-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
393 additions
and
142 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Load the environment variables | ||
source "$(pwd)"/proposals/env.sh | ||
|
||
# build and get batch_id, evidence: | ||
# dfx deploy ic_panda_frontend --ic --by-proposal | ||
|
||
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"})')" | ||
|
||
quill sns make-proposal --canister-ids-file ./sns_canister_ids.json --pem-file $PROPOSAL_PEM_FILE $PROPOSAL_NEURON_ID --proposal "( | ||
record { | ||
title = \"Execute commit_proposed_batch() to release ic_panda_frontend v2.9.0\"; | ||
url = \"https://panda.fans/\"; | ||
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.\"; | ||
action = opt variant { | ||
ExecuteGenericNervousSystemFunction = record { | ||
function_id = 1000 : nat64; | ||
payload = ${BLOB}; | ||
} | ||
}; | ||
} | ||
)" > proposal-message.json | ||
|
||
# quill send proposal-message.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,5 +80,5 @@ | |
"test": "vitest run" | ||
}, | ||
"type": "module", | ||
"version": "2.8.0" | ||
"version": "2.9.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 12 additions & 12 deletions
24
src/ic_panda_frontend/src/declarations/ck-doge-canister/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
import { Actor, HttpAgent } from "@dfinity/agent"; | ||
import { Actor, HttpAgent } from "@dfinity/agent" | ||
|
||
// Imports and re-exports candid interface | ||
import { idlFactory } from "./ck-doge-canister.did.js"; | ||
export { idlFactory } from "./ck-doge-canister.did.js"; | ||
import { idlFactory } from "./ck-doge-canister.did.js" | ||
export { idlFactory } from "./ck-doge-canister.did.js" | ||
|
||
/* CANISTER_ID is replaced by webpack based on node environment | ||
* Note: canister environment variable will be standardized as | ||
* process.env.CANISTER_ID_<CANISTER_NAME_UPPERCASE> | ||
* beginning in dfx 0.15.0 | ||
*/ | ||
export const canisterId = | ||
process.env.CANISTER_ID_CK_DOGE_CANISTER; | ||
process.env.CANISTER_ID_CK_DOGE_CANISTER | ||
|
||
export const createActor = (canisterId, options = {}) => { | ||
const agent = options.agent || new HttpAgent({ ...options.agentOptions }); | ||
const agent = options.agent || new HttpAgent({ ...options.agentOptions }) | ||
|
||
if (options.agent && options.agentOptions) { | ||
console.warn( | ||
"Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent." | ||
); | ||
) | ||
} | ||
|
||
// Fetch root key for certificate validation during development | ||
if (process.env.DFX_NETWORK !== "ic") { | ||
agent.fetchRootKey().catch((err) => { | ||
dynAgent.fetchRootKey().catch((err) => { | ||
console.warn( | ||
"Unable to fetch root key. Check to ensure that your local replica is running" | ||
); | ||
console.error(err); | ||
}); | ||
) | ||
console.error(err) | ||
}) | ||
} | ||
|
||
// Creates an actor with using the candid interface and the HttpAgent | ||
return Actor.createActor(idlFactory, { | ||
agent, | ||
canisterId, | ||
...options.actorOptions, | ||
}); | ||
}; | ||
}) | ||
} |
24 changes: 12 additions & 12 deletions
24
src/ic_panda_frontend/src/declarations/ck-doge-minter/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
import { Actor, HttpAgent } from "@dfinity/agent"; | ||
import { Actor, HttpAgent } from "@dfinity/agent" | ||
|
||
// Imports and re-exports candid interface | ||
import { idlFactory } from "./ck-doge-minter.did.js"; | ||
export { idlFactory } from "./ck-doge-minter.did.js"; | ||
import { idlFactory } from "./ck-doge-minter.did.js" | ||
export { idlFactory } from "./ck-doge-minter.did.js" | ||
|
||
/* CANISTER_ID is replaced by webpack based on node environment | ||
* Note: canister environment variable will be standardized as | ||
* process.env.CANISTER_ID_<CANISTER_NAME_UPPERCASE> | ||
* beginning in dfx 0.15.0 | ||
*/ | ||
export const canisterId = | ||
process.env.CANISTER_ID_CK_DOGE_MINTER; | ||
process.env.CANISTER_ID_CK_DOGE_MINTER | ||
|
||
export const createActor = (canisterId, options = {}) => { | ||
const agent = options.agent || new HttpAgent({ ...options.agentOptions }); | ||
const agent = options.agent || new HttpAgent({ ...options.agentOptions }) | ||
|
||
if (options.agent && options.agentOptions) { | ||
console.warn( | ||
"Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent." | ||
); | ||
) | ||
} | ||
|
||
// Fetch root key for certificate validation during development | ||
if (process.env.DFX_NETWORK !== "ic") { | ||
agent.fetchRootKey().catch((err) => { | ||
dynAgent.fetchRootKey().catch((err) => { | ||
console.warn( | ||
"Unable to fetch root key. Check to ensure that your local replica is running" | ||
); | ||
console.error(err); | ||
}); | ||
) | ||
console.error(err) | ||
}) | ||
} | ||
|
||
// Creates an actor with using the candid interface and the HttpAgent | ||
return Actor.createActor(idlFactory, { | ||
agent, | ||
canisterId, | ||
...options.actorOptions, | ||
}); | ||
}; | ||
}) | ||
} |
18 changes: 18 additions & 0 deletions
18
src/ic_panda_frontend/src/declarations/icpswap_tokens/icpswap_tokens.did
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
type PublicTokenOverview = | ||
record { | ||
address: text; | ||
feesUSD: float64; | ||
id: nat; | ||
name: text; | ||
priceUSD: float64; | ||
priceUSDChange: float64; | ||
standard: text; | ||
symbol: text; | ||
totalVolumeUSD: float64; | ||
txCount: int; | ||
volumeUSD: float64; | ||
volumeUSD1d: float64; | ||
volumeUSD7d: float64; | ||
}; | ||
|
||
service : { getToken: (text) -> (PublicTokenOverview) query; } |
23 changes: 23 additions & 0 deletions
23
src/ic_panda_frontend/src/declarations/icpswap_tokens/icpswap_tokens.did.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import type { ActorMethod } from '@dfinity/agent' | ||
import type { IDL } from '@dfinity/candid' | ||
|
||
export interface PublicTokenOverview { | ||
address: string | ||
feesUSD: number | ||
id: number | ||
name: string | ||
priceUSD: number | ||
priceUSDChange: number | ||
standard: string | ||
symbol: string | ||
totalVolumeUSD: number | ||
txCount: number | ||
volumeUSD: number | ||
volumeUSD1d: number | ||
volumeUSD7d: number | ||
} | ||
|
||
export interface _SERVICE { | ||
'getToken': ActorMethod<[string], PublicTokenOverview> | ||
} | ||
export declare const idlFactory: IDL.InterfaceFactory |
37 changes: 37 additions & 0 deletions
37
src/ic_panda_frontend/src/declarations/icpswap_tokens/icpswap_tokens.did.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
export const idlFactory = ({ IDL }) => { | ||
const UpgradeArgs = IDL.Record({ | ||
'preparers': IDL.Opt(IDL.Vec(IDL.Principal)), | ||
'committers': IDL.Opt(IDL.Vec(IDL.Principal)), | ||
}) | ||
const InitArgs = IDL.Record({ | ||
'preparers': IDL.Vec(IDL.Principal), | ||
'committers': IDL.Vec(IDL.Principal), | ||
}) | ||
const MinterArgs = IDL.Variant({ | ||
'Upgrade': UpgradeArgs, | ||
'Init': InitArgs, | ||
}) | ||
const LinkLog = IDL.Record({ | ||
'rewards': IDL.Nat64, | ||
'linker': IDL.Tuple(IDL.Principal, IDL.Principal), | ||
'minted_at': IDL.Nat64, | ||
}) | ||
const PublicTokenOverview = IDL.Record({ | ||
'address': IDL.Text, | ||
'feesUSD': IDL.Float64, | ||
'id': IDL.Nat, | ||
'name': IDL.Text, | ||
'priceUSD': IDL.Float64, | ||
'priceUSDChange': IDL.Float64, | ||
'standard': IDL.Text, | ||
'symbol': IDL.Text, | ||
'totalVolumeUSD': IDL.Float64, | ||
'txCount': IDL.Int, | ||
'volumeUSD': IDL.Float64, | ||
'volumeUSD1d': IDL.Float64, | ||
'volumeUSD7d': IDL.Float64, | ||
}) | ||
return IDL.Service({ | ||
'getToken': IDL.Func([IDL.Text], [PublicTokenOverview], ['query']), | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
import { agent } from '$lib/stores/auth' | ||
import { AuthAgent, dynAgent } from '$lib/utils/auth' | ||
import { Actor, type ActorMethod, type ActorSubclass } from '@dfinity/agent' | ||
import type { IDL } from '@dfinity/candid' | ||
import type { Principal } from '@dfinity/principal' | ||
|
||
export function createActor<T = Record<string, ActorMethod>>({ | ||
canisterId, | ||
idlFactory | ||
idlFactory, | ||
agent | ||
}: { | ||
canisterId: string | Principal | ||
idlFactory: IDL.InterfaceFactory | ||
agent?: AuthAgent | ||
}): ActorSubclass<T> { | ||
// Creates an actor with using the candid interface and the HttpAgent | ||
agent = agent || dynAgent | ||
return Actor.createActor(idlFactory, { | ||
// queryTransform or callTransform | ||
// callTransform: (methodName: string, args: unknown[], callConfig: any) => { | ||
// console.log('callTransform', methodName, args, callConfig) | ||
// console.log('caller', agent?.id.getPrincipal().toText()) | ||
// }, | ||
agent, | ||
canisterId | ||
// queryTransform: (methodName: string, args: unknown[], callConfig: any) => { | ||
// console.log('queryTransform', methodName, args, callConfig) | ||
// } | ||
}) | ||
} |
Oops, something went wrong.