-
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
17 changed files
with
195 additions
and
104 deletions.
There are no files selected for viewing
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,12 @@ | ||
( | ||
vec { | ||
record { variant { icp = 10_000_000 : nat }; opt (10 : nat8) }; | ||
record { variant { icp = 10_000_000 : nat }; opt (10 : nat8) }; | ||
record { variant { ckBtc = 1_500 : nat }; opt (10 : nat8) }; | ||
record { variant { ckBtc = 1_500 : nat }; opt (10 : nat8) }; | ||
record { variant { merch = "Pen" }; opt (18 : nat8) }; | ||
record { variant { merch = "Pen" }; opt (16 : nat8) }; | ||
record { variant { merch = "Pen" }; opt (16 : nat8) }; | ||
record { variant { special = "jackpot" }; opt (10 : nat8) }; | ||
}, | ||
) |
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,8 @@ | ||
( | ||
vec { | ||
principal "e3b3e-2qnk3-4g7uc-376eu-n3gim-gux6z-nshf6-xmrfg-yqihp-zeyol-bae"; | ||
principal "3zdpk-xwqme-jvghw-4zm7x-kfacg-mbkfd-7gpy7-q3m57-xkzba-z3p7u-bae"; | ||
principal "tk7wl-3gkcq-4swix-bsajd-o4tfd-acxlk-22npa-6dc77-f2f23-iacqw-jae"; | ||
principal "bcuet-2cf2x-ye6r4-2jipj-euxif-eduqz-nfpid-cy2ej-3t6zq-kivmc-tqe"; | ||
}, | ||
) |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
download_candid() { | ||
local canister_name="$1" | ||
|
||
# Check if dfx.json exists | ||
if [ ! -f "dfx.json" ]; then | ||
echo "Error: dfx.json not found" | ||
return 1 | ||
fi | ||
|
||
# Extract the URL and the name using jq | ||
local url=$(jq -r ".canisters.\"$canister_name\".candid" dfx.json) | ||
local name=$(jq -r ".canisters.\"$canister_name\".remote.id.ic" dfx.json) | ||
|
||
# Check if the URL and name are not null | ||
if [ "$url" == "null" ] || [ "$name" == "null" ]; then | ||
echo "Error: Unable to extract URL or name from dfx.json for canister $canister_name" | ||
return 1 | ||
fi | ||
|
||
# Download the file from the URL | ||
local output_file=".dfx/ic/canisters/idl/$name.did" | ||
curl -o "$output_file" "$url" | ||
|
||
# Check if the download was successful | ||
if [ $? -ne 0 ]; then | ||
echo "Error: Failed to download $url" | ||
return 1 | ||
fi | ||
|
||
echo "Downloaded $url to $output_file" | ||
return 0 | ||
} | ||
|
||
mkdir -p .dfx/ic/canisters/idl | ||
# Call the function with the arguments arg1, arg2, and arg3 | ||
for arg in "icp_ledger" "ckbtc_ledger" "cketh_ledger" "ckusdc_ledger"; do | ||
download_candid "$arg" | ||
done |
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
Oops, something went wrong.