Skip to content

Commit e84b7d8

Browse files
committed
chore: update ic_panda_frontend
1 parent 5b5415d commit e84b7d8

File tree

30 files changed

+393
-142
lines changed

30 files changed

+393
-142
lines changed

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ opt-level = 's'
2525

2626
[workspace.package]
2727
edition = "2021"
28-
version = "2.9.0"
28+
version = "2.9.1"
2929
repository = "https://github.com/ldclabs/ic-panda"
3030
keywords = ["canister", "icp", "panda"]
3131
categories = ["web-programming"]

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# ICPanda DAO
2-
🐼 A decentralized Panda meme platform featuring E2E encrypted messaging, lucky draws, airdrops.
2+
🐼 A technical panda fully running on the Internet Computer blockchain, building chain-native infrastructures and practical Web3 apps.
3+
4+
About us: https://dmsg.net/panda
35

46
## dMsg (ICPanda Message)
57

proposals/proposal-280.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
# Load the environment variables
4+
source "$(pwd)"/proposals/env.sh
5+
6+
# build and get batch_id, evidence:
7+
# dfx deploy ic_panda_frontend --ic --by-proposal
8+
9+
export BLOB="$(didc encode --format blob '(record {batch_id=66:nat; evidence=blob "\b9\3d\73\be\22\aa\fe\c7\3b\59\f3\4e\8d\d6\3c\36\c9\7d\a1\d5\51\da\07\a5\ab\c3\c3\01\1e\64\ec\2f"})')"
10+
11+
quill sns make-proposal --canister-ids-file ./sns_canister_ids.json --pem-file $PROPOSAL_PEM_FILE $PROPOSAL_NEURON_ID --proposal "(
12+
record {
13+
title = \"Execute commit_proposed_batch() to release ic_panda_frontend v2.9.0\";
14+
url = \"https://panda.fans/\";
15+
summary = \"This proposal executes commit_proposed_batch() on c63a7-6yaaa-aaaap-ab3gq-cai to release ic_panda_frontend v2.9.0.\n\n1. chore: update landing page.\";
16+
action = opt variant {
17+
ExecuteGenericNervousSystemFunction = record {
18+
function_id = 1000 : nat64;
19+
payload = ${BLOB};
20+
}
21+
};
22+
}
23+
)" > proposal-message.json
24+
25+
# quill send proposal-message.json

src/ic_message_frontend/src/routes/(app)/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,13 +508,13 @@
508508
>
509509
</p>
510510
<p class="mt-2 text-center text-sm capitalize antialiased">
511-
A decentralized Panda meme brand fully running on the <a
511+
A technical panda fully running on the <a
512512
class="underline underline-offset-4"
513513
href="https://dashboard.internetcomputer.org/sns/d7wvo-iiaaa-aaaaq-aacsq-cai"
514514
target="_blank"
515515
>
516516
Internet Computer
517-
</a> blockchain.
517+
</a> blockchain, building chain-native infras and practical Web3 apps.
518518
</p>
519519
</div>
520520
</footer>

src/ic_message_frontend/src/routes/(app)/[username]/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@
6868
>
6969
</p>
7070
<p class="mt-2 text-center text-sm capitalize antialiased">
71-
A decentralized Panda meme brand fully running on the <a
71+
A technical panda fully running on the <a
7272
class="underline underline-offset-4"
7373
href="https://dashboard.internetcomputer.org/sns/d7wvo-iiaaa-aaaaq-aacsq-cai"
7474
target="_blank"
7575
>
7676
Internet Computer
77-
</a> blockchain.
77+
</a> blockchain, building chain-native infras and practical Web3 apps.
7878
</p>
7979
</div>
8080
</footer>

src/ic_panda_frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,5 @@
8080
"test": "vitest run"
8181
},
8282
"type": "module",
83-
"version": "2.8.0"
83+
"version": "2.9.0"
8484
}

src/ic_panda_frontend/src/app.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
<title>ICPanda DAO</title>
1111
<link href="https://panda.fans" rel="canonical" />
12-
<meta content="ICPanda DAO" property="og:title" />
13-
<meta content="A decentralized Panda meme platform featuring E2E encrypted messaging, lucky draws, airdrops."
12+
<meta content="ICPanda" property="og:title" />
13+
<meta
14+
content="A technical panda fully running on the Internet Computer blockchain, building chain-native infras and practical Web3 apps."
1415
name="description" property="og:description" />
1516
<meta content="website" property="og:type" />
1617
<meta content="https://panda.fans" property="og:url" />
@@ -26,7 +27,7 @@
2627
<!-- iOS meta tags & icons -->
2728
<meta name="mobile-web-app-capable" content="yes" />
2829
<meta name="mobile-web-app-status-bar-style" content="#5bbad5" />
29-
<meta name="mobile-web-app-title" content="ICPanda DAO" />
30+
<meta name="mobile-web-app-title" content="ICPanda" />
3031
<link rel="apple-touch-icon" href="/_assets/favicons/apple-touch-icon.png" />
3132
<link rel="mask-icon" href="/_assets/favicons/safari-pinned-tab.svg" color="#5bbad5" />
3233

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
import { Actor, HttpAgent } from "@dfinity/agent";
1+
import { Actor, HttpAgent } from "@dfinity/agent"
22

33
// Imports and re-exports candid interface
4-
import { idlFactory } from "./ck-doge-canister.did.js";
5-
export { idlFactory } from "./ck-doge-canister.did.js";
4+
import { idlFactory } from "./ck-doge-canister.did.js"
5+
export { idlFactory } from "./ck-doge-canister.did.js"
66

77
/* CANISTER_ID is replaced by webpack based on node environment
88
* Note: canister environment variable will be standardized as
99
* process.env.CANISTER_ID_<CANISTER_NAME_UPPERCASE>
1010
* beginning in dfx 0.15.0
1111
*/
1212
export const canisterId =
13-
process.env.CANISTER_ID_CK_DOGE_CANISTER;
13+
process.env.CANISTER_ID_CK_DOGE_CANISTER
1414

1515
export const createActor = (canisterId, options = {}) => {
16-
const agent = options.agent || new HttpAgent({ ...options.agentOptions });
16+
const agent = options.agent || new HttpAgent({ ...options.agentOptions })
1717

1818
if (options.agent && options.agentOptions) {
1919
console.warn(
2020
"Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent."
21-
);
21+
)
2222
}
2323

2424
// Fetch root key for certificate validation during development
2525
if (process.env.DFX_NETWORK !== "ic") {
26-
agent.fetchRootKey().catch((err) => {
26+
dynAgent.fetchRootKey().catch((err) => {
2727
console.warn(
2828
"Unable to fetch root key. Check to ensure that your local replica is running"
29-
);
30-
console.error(err);
31-
});
29+
)
30+
console.error(err)
31+
})
3232
}
3333

3434
// Creates an actor with using the candid interface and the HttpAgent
3535
return Actor.createActor(idlFactory, {
3636
agent,
3737
canisterId,
3838
...options.actorOptions,
39-
});
40-
};
39+
})
40+
}
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
import { Actor, HttpAgent } from "@dfinity/agent";
1+
import { Actor, HttpAgent } from "@dfinity/agent"
22

33
// Imports and re-exports candid interface
4-
import { idlFactory } from "./ck-doge-minter.did.js";
5-
export { idlFactory } from "./ck-doge-minter.did.js";
4+
import { idlFactory } from "./ck-doge-minter.did.js"
5+
export { idlFactory } from "./ck-doge-minter.did.js"
66

77
/* CANISTER_ID is replaced by webpack based on node environment
88
* Note: canister environment variable will be standardized as
99
* process.env.CANISTER_ID_<CANISTER_NAME_UPPERCASE>
1010
* beginning in dfx 0.15.0
1111
*/
1212
export const canisterId =
13-
process.env.CANISTER_ID_CK_DOGE_MINTER;
13+
process.env.CANISTER_ID_CK_DOGE_MINTER
1414

1515
export const createActor = (canisterId, options = {}) => {
16-
const agent = options.agent || new HttpAgent({ ...options.agentOptions });
16+
const agent = options.agent || new HttpAgent({ ...options.agentOptions })
1717

1818
if (options.agent && options.agentOptions) {
1919
console.warn(
2020
"Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent."
21-
);
21+
)
2222
}
2323

2424
// Fetch root key for certificate validation during development
2525
if (process.env.DFX_NETWORK !== "ic") {
26-
agent.fetchRootKey().catch((err) => {
26+
dynAgent.fetchRootKey().catch((err) => {
2727
console.warn(
2828
"Unable to fetch root key. Check to ensure that your local replica is running"
29-
);
30-
console.error(err);
31-
});
29+
)
30+
console.error(err)
31+
})
3232
}
3333

3434
// Creates an actor with using the candid interface and the HttpAgent
3535
return Actor.createActor(idlFactory, {
3636
agent,
3737
canisterId,
3838
...options.actorOptions,
39-
});
40-
};
39+
})
40+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
type PublicTokenOverview =
2+
record {
3+
address: text;
4+
feesUSD: float64;
5+
id: nat;
6+
name: text;
7+
priceUSD: float64;
8+
priceUSDChange: float64;
9+
standard: text;
10+
symbol: text;
11+
totalVolumeUSD: float64;
12+
txCount: int;
13+
volumeUSD: float64;
14+
volumeUSD1d: float64;
15+
volumeUSD7d: float64;
16+
};
17+
18+
service : { getToken: (text) -> (PublicTokenOverview) query; }
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import type { ActorMethod } from '@dfinity/agent'
2+
import type { IDL } from '@dfinity/candid'
3+
4+
export interface PublicTokenOverview {
5+
address: string
6+
feesUSD: number
7+
id: number
8+
name: string
9+
priceUSD: number
10+
priceUSDChange: number
11+
standard: string
12+
symbol: string
13+
totalVolumeUSD: number
14+
txCount: number
15+
volumeUSD: number
16+
volumeUSD1d: number
17+
volumeUSD7d: number
18+
}
19+
20+
export interface _SERVICE {
21+
'getToken': ActorMethod<[string], PublicTokenOverview>
22+
}
23+
export declare const idlFactory: IDL.InterfaceFactory
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
export const idlFactory = ({ IDL }) => {
2+
const UpgradeArgs = IDL.Record({
3+
'preparers': IDL.Opt(IDL.Vec(IDL.Principal)),
4+
'committers': IDL.Opt(IDL.Vec(IDL.Principal)),
5+
})
6+
const InitArgs = IDL.Record({
7+
'preparers': IDL.Vec(IDL.Principal),
8+
'committers': IDL.Vec(IDL.Principal),
9+
})
10+
const MinterArgs = IDL.Variant({
11+
'Upgrade': UpgradeArgs,
12+
'Init': InitArgs,
13+
})
14+
const LinkLog = IDL.Record({
15+
'rewards': IDL.Nat64,
16+
'linker': IDL.Tuple(IDL.Principal, IDL.Principal),
17+
'minted_at': IDL.Nat64,
18+
})
19+
const PublicTokenOverview = IDL.Record({
20+
'address': IDL.Text,
21+
'feesUSD': IDL.Float64,
22+
'id': IDL.Nat,
23+
'name': IDL.Text,
24+
'priceUSD': IDL.Float64,
25+
'priceUSDChange': IDL.Float64,
26+
'standard': IDL.Text,
27+
'symbol': IDL.Text,
28+
'totalVolumeUSD': IDL.Float64,
29+
'txCount': IDL.Int,
30+
'volumeUSD': IDL.Float64,
31+
'volumeUSD1d': IDL.Float64,
32+
'volumeUSD7d': IDL.Float64,
33+
})
34+
return IDL.Service({
35+
'getToken': IDL.Func([IDL.Text], [PublicTokenOverview], ['query']),
36+
})
37+
}
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
1-
import { agent } from '$lib/stores/auth'
1+
import { AuthAgent, dynAgent } from '$lib/utils/auth'
22
import { Actor, type ActorMethod, type ActorSubclass } from '@dfinity/agent'
33
import type { IDL } from '@dfinity/candid'
44
import type { Principal } from '@dfinity/principal'
55

66
export function createActor<T = Record<string, ActorMethod>>({
77
canisterId,
8-
idlFactory
8+
idlFactory,
9+
agent
910
}: {
1011
canisterId: string | Principal
1112
idlFactory: IDL.InterfaceFactory
13+
agent?: AuthAgent
1214
}): ActorSubclass<T> {
1315
// Creates an actor with using the candid interface and the HttpAgent
16+
agent = agent || dynAgent
1417
return Actor.createActor(idlFactory, {
18+
// queryTransform or callTransform
19+
// callTransform: (methodName: string, args: unknown[], callConfig: any) => {
20+
// console.log('callTransform', methodName, args, callConfig)
21+
// console.log('caller', agent?.id.getPrincipal().toText())
22+
// },
1523
agent,
1624
canisterId
17-
// queryTransform: (methodName: string, args: unknown[], callConfig: any) => {
18-
// console.log('queryTransform', methodName, args, callConfig)
19-
// }
2025
})
2126
}

0 commit comments

Comments
 (0)