From f01c7501cc33b430b57d25c3cb84cbbc6c205017 Mon Sep 17 00:00:00 2001 From: Jordan Last Date: Fri, 29 Sep 2023 22:15:44 -0500 Subject: [PATCH] fix up variant and func types, fix icrc --- .github/workflows/test.yml | 1 + canisters/icrc/icrc_1.ts | 30 +- canisters/icrc/icrc_2.ts | 36 +- canisters/icrc/index.ts | 96 +- canisters/ledger/index.ts | 18 +- examples/icrc/README.md | 4 +- examples/icrc/canisters/proxy/index.did | 104 +- examples/icrc/canisters/proxy/index.ts | 207 ++- examples/icrc/dfx.json | 3 +- examples/icrc/package-lock.json | 1279 +++++++++++++++++ examples/icrc/params.did | 2 +- examples/icrc/test/pretest.ts | 40 + examples/icrc/test/test.ts | 11 + examples/icrc/test/tests.ts | 221 +++ .../src/ledger_canister/index.did | 102 +- src/lib_functional/candid/reference/func.ts | 6 +- .../candid/reference/variant.ts | 10 +- 17 files changed, 1830 insertions(+), 340 deletions(-) create mode 100644 examples/icrc/package-lock.json create mode 100644 examples/icrc/test/pretest.ts create mode 100644 examples/icrc/test/test.ts create mode 100644 examples/icrc/test/tests.ts diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fbca8bc3e3..6e5fe6aec7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -83,6 +83,7 @@ jobs: "examples/guard_functions", "examples/heartbeat", "examples/ic_api", + "examples/icrc", "examples/imports", "examples/init", "examples/inspect_message", diff --git a/canisters/icrc/icrc_1.ts b/canisters/icrc/icrc_1.ts index 62e339e8e8..924ac6d2c7 100644 --- a/canisters/icrc/icrc_1.ts +++ b/canisters/icrc/icrc_1.ts @@ -19,31 +19,31 @@ import { } from './errors'; // Number of nanoseconds since the UNIX epoch in UTC timezone. -export type ICRC1Timestamp = nat64; -export const ICRC1Timestamp = nat64; +export type Timestamp = nat64; +export const Timestamp = nat64; -export type ICRC1Subaccount = blob; -export const ICRC1Subaccount = blob; +export type Subaccount = blob; +export const Subaccount = blob; -export const ICRC1Account = Record({ +export const Account = Record({ owner: Principal, - subaccount: Opt(ICRC1Subaccount) + subaccount: Opt(Subaccount) }); -export const ICRC1TransferArgs = Record({ - from_subaccount: Opt(ICRC1Subaccount), - to: ICRC1Account, +export const TransferArgs = Record({ + from_subaccount: Opt(Subaccount), + to: Account, amount: nat, fee: Opt(nat), memo: Opt(blob), - created_at_time: Opt(ICRC1Timestamp) + created_at_time: Opt(Timestamp) }); const CreatedInFuture = Record({ - ledger_time: ICRC1Timestamp + ledger_time: Timestamp }); -export const ICRC1TransferError = Variant({ +export const TransferError = Variant({ BadFee, BadBurn, InsufficientFunds, @@ -54,12 +54,12 @@ export const ICRC1TransferError = Variant({ GenericError: GenericError }); -export const ICRC1TransferResult = Variant({ +export const TransferResult = Variant({ Ok: nat, - Err: ICRC1TransferError + Err: TransferError }); -export const ICRC1Value = Variant({ +export const Value = Variant({ Nat: nat, Int: int, Text: text, diff --git a/canisters/icrc/icrc_2.ts b/canisters/icrc/icrc_2.ts index 4d4aea4985..42777ed7d8 100644 --- a/canisters/icrc/icrc_2.ts +++ b/canisters/icrc/icrc_2.ts @@ -16,15 +16,11 @@ import { Duplicate, GenericError } from './errors'; +import { Account } from './icrc_1'; -export const ICRC2Account = Record({ - owner: Principal, - subaccount: Opt(blob) -}); - -export const ICRC2ApproveArgs = Record({ +export const ApproveArgs = Record({ from_subaccount: Opt(blob), - spender: ICRC2Account, + spender: Account, amount: nat, expected_allowance: Opt(nat), expires_at: Opt(nat64), @@ -49,7 +45,7 @@ export const InsufficientAllowance = Record({ allowance: nat }); -export const ICRC2ApproveError = Variant({ +export const ApproveError = Variant({ BadFee, InsufficientFunds, AllowanceChanged, @@ -61,16 +57,16 @@ export const ICRC2ApproveError = Variant({ GenericError: GenericError }); -export const ICRC2TransferFromArgs = Record({ - from: ICRC2Account, - to: ICRC2Account, +export const TransferFromArgs = Record({ + from: Account, + to: Account, amount: nat, fee: Opt(nat), memo: Opt(blob), created_at_time: Opt(nat64) }); -export const ICRC2TransferFromError = Variant({ +export const TransferFromError = Variant({ BadFee, BadBurn, InsufficientFunds, @@ -82,22 +78,22 @@ export const ICRC2TransferFromError = Variant({ GenericError }); -export const ICRC2AllowanceArgs = Record({ - account: ICRC2Account, - spender: ICRC2Account +export const AllowanceArgs = Record({ + account: Account, + spender: Account }); -export const ICRC2ApproveResult = Variant({ +export const ApproveResult = Variant({ Ok: nat, - Err: ICRC2ApproveError + Err: ApproveError }); -export const ICRC2TransferFromResult = Variant({ +export const TransferFromResult = Variant({ Ok: nat, - Err: ICRC2TransferFromError + Err: TransferFromError }); -export const ICRC2AllowanceResults = Record({ +export const AllowanceResult = Record({ allowance: nat, expires_at: Opt(nat64) }); diff --git a/canisters/icrc/index.ts b/canisters/icrc/index.ts index bb5bf65f71..9af9851f7b 100644 --- a/canisters/icrc/index.ts +++ b/canisters/icrc/index.ts @@ -1,81 +1,45 @@ import { + Canister, nat, nat8, Opt, Record, - Service, query, update, text, Tuple, - Vec, - candid -} from '../../src/lib_new'; + Vec +} from '../../src/lib_functional'; +import { Account, TransferArgs, TransferResult, Value } from './icrc_1'; import { - ICRC1Account, - ICRC1TransferArgs, - ICRC1TransferResult, - ICRC1Value -} from './icrc_1'; -import { - ICRC2AllowanceArgs, - ICRC2AllowanceResults, - ICRC2ApproveArgs, - ICRC2ApproveResult, - ICRC2TransferFromArgs, - ICRC2TransferFromResult + AllowanceArgs, + AllowanceResult, + ApproveArgs, + ApproveResult, + TransferFromArgs, + TransferFromResult } from './icrc_2'; -export class ICRC1SupportedStandard extends Record { - @candid(text) - name: text; - - @candid(text) - url: text; -} - -export class ICRC extends Service { - @query([], Vec(Tuple(text, ICRC1Value))) - icrc1_metadata: () => [text, ICRC1Value][]; - - @query([], text) - icrc1_name: () => text; - - @query([], text) - icrc1_symbol: () => text; - - @query([], nat8) - icrc1_decimals: () => nat8; - - @query([], nat) - icrc1_fee: () => nat; - - @query([], nat) - icrc1_total_supply: () => nat; - - @query([], Opt(ICRC1Account)) - icrc1_minting_account: () => Opt; - - @query([ICRC1Account], nat) - icrc1_balance_of: (account: ICRC1Account) => nat; - - @update([ICRC1TransferArgs], ICRC1TransferResult) - icrc1_transfer: (transferArgs: ICRC1TransferArgs) => ICRC1TransferResult; - - @query([], Vec(ICRC1SupportedStandard)) - icrc1_supported_standards: () => Vec; - - @update([ICRC2ApproveArgs], ICRC2ApproveResult) - icrc2_approve: (args: ICRC2ApproveArgs) => ICRC2ApproveResult; - - @update([ICRC2TransferFromArgs], ICRC2TransferFromResult) - icrc2_transfer_from: ( - args: ICRC2TransferFromArgs - ) => ICRC2TransferFromResult; - - @query([ICRC2AllowanceArgs], ICRC2AllowanceResults) - icrc2_allowance: (args: ICRC2AllowanceArgs) => ICRC2AllowanceResults; -} +export const SupportedStandard = Record({ + name: text, + url: text +}); + +export const ICRC = Canister({ + icrc1_metadata: query([], Vec(Tuple(text, Value))), + icrc1_name: query([], text), + icrc1_symbol: query([], text), + icrc1_decimals: query([], nat8), + icrc1_fee: query([], nat), + icrc1_total_supply: query([], nat), + icrc1_minting_account: query([], Opt(Account)), + icrc1_balance_of: query([Account], nat), + icrc1_transfer: update([TransferArgs], TransferResult), + icrc1_supported_standards: query([], Vec(SupportedStandard)), + icrc2_approve: update([ApproveArgs], ApproveResult), + icrc2_transfer_from: update([TransferFromArgs], TransferFromResult), + icrc2_allowance: query([AllowanceArgs], AllowanceResult) +}); export * from './icrc_1'; export * from './icrc_2'; diff --git a/canisters/ledger/index.ts b/canisters/ledger/index.ts index ab8cd6a907..0b0c95b092 100644 --- a/canisters/ledger/index.ts +++ b/canisters/ledger/index.ts @@ -25,13 +25,7 @@ import { Principal, Func } from '../../src/lib_functional'; -import { - ICRC1Account, - ICRC1SupportedStandard, - ICRC1TransferArgs, - ICRC1TransferResult, - ICRC1Value -} from '../icrc'; +import * as icrc from '../icrc'; // Amount of tokens, measured in 10^-8 of a token. export const Tokens = Record({ @@ -316,16 +310,16 @@ export const Ledger = Canister({ decimals: query([], DecimalsResult), // Returns the existing archive canisters information. archives: query([], Archives), - icrc1_metadata: query([], Vec(Tuple(text, ICRC1Value))), + icrc1_metadata: query([], Vec(Tuple(text, icrc.Value))), icrc1_name: query([], text), icrc1_symbol: query([], text), icrc1_decimals: query([], nat8), icrc1_fee: query([], nat), icrc1_total_supply: query([], nat), - icrc1_minting_account: query([], Opt(ICRC1Account)), - icrc1_balance_of: query([ICRC1Account], nat), - icrc1_transfer: update([ICRC1TransferArgs], ICRC1TransferResult), - icrc1_supported_standards: query([], Vec(ICRC1SupportedStandard)) + icrc1_minting_account: query([], Opt(icrc.Account)), + icrc1_balance_of: query([icrc.Account], nat), + icrc1_transfer: update([icrc.TransferArgs], icrc.TransferResult), + icrc1_supported_standards: query([], Vec(icrc.SupportedStandard)) }); export { diff --git a/examples/icrc/README.md b/examples/icrc/README.md index 70691b48a5..546c021abf 100644 --- a/examples/icrc/README.md +++ b/examples/icrc/README.md @@ -17,5 +17,7 @@ cd canisters/ICRC-1/test # Change canisters/ICRC-1/test/suite/lib.rs test_burn assert_balance(&env, tmp_account, 0).await?; to assert_balance(&env, tmp_account, 10_000).await?; -cargo run -- -u http://127.0.0.1:8000 -c r7inp-6aaaa-aaaaa-aaabq-cai -s /home/lastmjs/.config/dfx/identity/test/identity.pem +# cargo run -- -u http://127.0.0.1:8000 -c r7inp-6aaaa-aaaaa-aaabq-cai -s /home/lastmjs/.config/dfx/identity/test/identity.pem + +cargo run --bin runner -- -u http://127.0.0.1:8000 -c r7inp-6aaaa-aaaaa-aaabq-cai -s /home/lastmjs/.config/dfx/identity/test_unencrypted/identity.pem ``` diff --git a/examples/icrc/canisters/proxy/index.did b/examples/icrc/canisters/proxy/index.did index 8858505442..c7442ff264 100644 --- a/examples/icrc/canisters/proxy/index.did +++ b/examples/icrc/canisters/proxy/index.did @@ -1,48 +1,56 @@ -type ICRCAccount = record { owner : principal; subaccount : opt vec nat8 }; -type ICRCTransferArgs = record { - to : ICRCAccount; - fee : opt nat; - memo : opt vec nat8; - from_subaccount : opt vec nat8; - created_at_time : opt nat64; - amount : nat; -}; -type ICRCTransferError = variant { - GenericError : _InlineICRCTransferErrorGenericError; - TemporarilyUnavailable; - BadBurn : _InlineICRCTransferErrorBadBurn; - Duplicate : _InlineICRCTransferErrorDuplicate; - BadFee : _InlineICRCTransferErrorBadFee; - CreatedInFuture : _InlineICRCTransferErrorCreatedInFuture; - TooOld; - InsufficientFunds : _InlineICRCTransferErrorInsufficientFunds; -}; -type ICRCValue = variant { Int : int; Nat : nat; Blob : vec nat8; Text : text }; -type ManualReply = variant { Ok : nat; Err : ICRCTransferError }; -type _InlineICRCTransferErrorBadBurn = record { min_burn_amount : nat }; -type _InlineICRCTransferErrorBadFee = record { expected_fee : nat }; -type _InlineICRCTransferErrorCreatedInFuture = record { ledger_time : nat64 }; -type _InlineICRCTransferErrorDuplicate = record { duplicate_of : nat }; -type _InlineICRCTransferErrorGenericError = record { - message : text; - error_code : nat; -}; -type _InlineICRCTransferErrorInsufficientFunds = record { balance : nat }; -type _InlineIcrc1SupportedStandardsReturnType = record { - url : text; - name : text; -}; -service : () -> { - icrc1_balance_of : (ICRCAccount) -> (nat) query; - icrc1_decimals : () -> (nat8) query; - icrc1_fee : () -> (nat) query; - icrc1_metadata : () -> (vec record { text; ICRCValue }) query; - icrc1_minting_account : () -> (opt ICRCAccount) query; - icrc1_name : () -> (text) query; - icrc1_supported_standards : () -> ( - vec _InlineIcrc1SupportedStandardsReturnType, - ) query; - icrc1_symbol : () -> (text) query; - icrc1_total_supply : () -> (nat) query; - icrc1_transfer : (ICRCTransferArgs) -> (ManualReply); -} \ No newline at end of file +type rec_41 = variant {Int:int; Nat:nat; Blob:vec nat8; Text:text}; +type rec_42 = record {owner:principal; subaccount:opt vec nat8}; +type rec_43 = record {owner:principal; subaccount:opt vec nat8}; +type rec_45 = record {owner:principal; subaccount:opt vec nat8}; +type rec_44 = record {to:rec_45; fee:opt nat; memo:opt vec nat8; from_subaccount:opt vec nat8; created_at_time:opt nat64; amount:nat}; +type rec_53 = record {message:text; error_code:nat}; +type rec_49 = record {min_burn_amount:nat}; +type rec_52 = record {duplicate_of:nat}; +type rec_48 = record {expected_fee:nat}; +type rec_51 = record {ledger_time:nat64}; +type rec_50 = record {balance:nat}; +type rec_47 = variant {GenericError:rec_53; TemporarilyUnavailable; BadBurn:rec_49; Duplicate:rec_52; BadFee:rec_48; CreatedInFuture:rec_51; TooOld; InsufficientFunds:rec_50}; +type rec_46 = variant {Ok:nat; Err:rec_47}; +type rec_54 = record {url:text; name:text}; +type rec_56 = record {owner:principal; subaccount:opt vec nat8}; +type rec_55 = record {fee:opt nat; memo:opt vec nat8; from_subaccount:opt vec nat8; created_at_time:opt nat64; amount:nat; expected_allowance:opt nat; expires_at:opt nat64; spender:rec_56}; +type rec_65 = record {message:text; error_code:nat}; +type rec_64 = record {duplicate_of:nat}; +type rec_59 = record {expected_fee:nat}; +type rec_61 = record {current_allowance:nat}; +type rec_63 = record {ledger_time:nat64}; +type rec_62 = record {ledger_time:nat64}; +type rec_60 = record {balance:nat}; +type rec_58 = variant {GenericError:rec_65; TemporarilyUnavailable; Duplicate:rec_64; BadFee:rec_59; AllowanceChanged:rec_61; CreatedInFuture:rec_63; TooOld; Expired:rec_62; InsufficientFunds:rec_60}; +type rec_57 = variant {Ok:nat; Err:rec_58}; +type rec_68 = record {owner:principal; subaccount:opt vec nat8}; +type rec_67 = record {owner:principal; subaccount:opt vec nat8}; +type rec_66 = record {to:rec_68; fee:opt nat; from:rec_67; memo:opt vec nat8; created_at_time:opt nat64; amount:nat}; +type rec_77 = record {message:text; error_code:nat}; +type rec_74 = record {allowance:nat}; +type rec_72 = record {min_burn_amount:nat}; +type rec_76 = record {duplicate_of:nat}; +type rec_71 = record {expected_fee:nat}; +type rec_75 = record {ledger_time:nat64}; +type rec_73 = record {balance:nat}; +type rec_70 = variant {GenericError:rec_77; TemporarilyUnavailable; InsufficientAllowance:rec_74; BadBurn:rec_72; Duplicate:rec_76; BadFee:rec_71; CreatedInFuture:rec_75; TooOld; InsufficientFunds:rec_73}; +type rec_69 = variant {Ok:nat; Err:rec_70}; +type rec_79 = record {owner:principal; subaccount:opt vec nat8}; +type rec_80 = record {owner:principal; subaccount:opt vec nat8}; +type rec_78 = record {account:rec_79; spender:rec_80}; +type rec_81 = record {allowance:nat; expires_at:opt nat64}; +service: () -> { + icrc1_metadata: () -> (vec record {text; rec_41}) query; + icrc1_name: () -> (text) query; + icrc1_decimals: () -> (nat8) query; + icrc1_symbol: () -> (text) query; + icrc1_fee: () -> (nat) query; + icrc1_total_supply: () -> (nat) query; + icrc1_minting_account: () -> (opt rec_42) query; + icrc1_balance_of: (rec_43) -> (nat) query; + icrc1_transfer: (rec_44) -> (rec_46); + icrc1_supported_standards: () -> (vec rec_54) query; + icrc2_approve: (rec_55) -> (rec_57); + icrc2_transfer_from: (rec_66) -> (rec_69); + icrc2_allowance: (rec_78) -> (rec_81); +} diff --git a/examples/icrc/canisters/proxy/index.ts b/examples/icrc/canisters/proxy/index.ts index b173c5c3f1..5342fa6237 100644 --- a/examples/icrc/canisters/proxy/index.ts +++ b/examples/icrc/canisters/proxy/index.ts @@ -1,135 +1,102 @@ import { + Canister, ic, - match, + init, nat, nat8, Opt, Principal, - $query, - Record, + query, text, Tuple, - $update, - Variant, + update, Vec } from 'azle'; import { - ICRC1Account, + Account, ICRC, - ICRC1TransferArgs, - ICRC1TransferError, - ICRC1Value + TransferArgs, + TransferResult, + Value, + SupportedStandard, + ApproveArgs, + ApproveResult, + TransferFromArgs, + TransferFromResult, + AllowanceArgs, + AllowanceResult } from 'azle/canisters/icrc'; -const icrc = new ICRC( - Principal.fromText( - process.env.ICRC_PRINCIPAL ?? - ic.trap('process.env.ICRC_PRINCIPAL is undefined') +let icrc: typeof ICRC; + +export default Canister({ + init: init([], () => { + icrc = ICRC( + Principal.fromText( + process.env.ICRC_PRINCIPAL ?? + ic.trap('process.env.ICRC_PRINCIPAL is undefined') + ) + ); + }), + icrc1_metadata: query([], Vec(Tuple(text, Value)), async () => { + return await ic.call(icrc.icrc1_metadata); + }), + icrc1_name: query([], text, async () => { + return await ic.call(icrc.icrc1_name); + }), + icrc1_decimals: query([], nat8, async () => { + return await ic.call(icrc.icrc1_decimals); + }), + icrc1_symbol: query([], text, async () => { + return await ic.call(icrc.icrc1_symbol); + }), + icrc1_fee: query([], nat, async () => { + return await ic.call(icrc.icrc1_fee); + }), + icrc1_total_supply: query([], nat, async () => { + return await ic.call(icrc.icrc1_total_supply); + }), + icrc1_minting_account: query([], Opt(Account), async () => { + return await ic.call(icrc.icrc1_minting_account); + }), + icrc1_balance_of: query([Account], nat, async (account) => { + return await ic.call(icrc.icrc1_balance_of, { + args: [account] + }); + }), + icrc1_transfer: update( + [TransferArgs], + TransferResult, + async (transferArgs) => { + return await ic.call(icrc.icrc1_transfer, { + args: [transferArgs] + }); + } + ), + icrc1_supported_standards: query([], Vec(SupportedStandard), async () => { + return await ic.call(icrc.icrc1_supported_standards); + }), + icrc2_approve: update([ApproveArgs], ApproveResult, async (approveArgs) => { + return await ic.call(icrc.icrc2_approve, { + args: [approveArgs] + }); + }), + icrc2_transfer_from: update( + [TransferFromArgs], + TransferFromResult, + async (transferFromArgs) => { + return await ic.call(icrc.icrc2_transfer_from, { + args: [transferFromArgs] + }); + } + ), + icrc2_allowance: update( + [AllowanceArgs], + AllowanceResult, + async (allowanceArgs) => { + return await ic.call(icrc.icrc2_allowance, { + args: [allowanceArgs] + }); + } ) -); - -$query; -export async function icrc1_metadata(): Promise< - Vec> -> { - const result = await icrc.icrc1_metadata().call(); - - return match(result, { - Ok: (ok) => ok, - Err: (err) => ic.trap(err) - }); -} - -$query; -export async function icrc1_name(): Promise { - const result = await icrc.icrc1_name().call(); - - return match(result, { - Ok: (ok) => ok, - Err: (err) => ic.trap(err) - }); -} - -$query; -export async function icrc1_symbol(): Promise { - const result = await icrc.icrc1_symbol().call(); - - return match(result, { - Ok: (ok) => ok, - Err: (err) => ic.trap(err) - }); -} - -$query; -export async function icrc1_decimals(): Promise { - const result = await icrc.icrc1_decimals().call(); - - return match(result, { - Ok: (ok) => ok, - Err: (err) => ic.trap(err) - }); -} - -$query; -export async function icrc1_fee(): Promise { - const result = await icrc.icrc1_fee().call(); - - return match(result, { - Ok: (ok) => ok, - Err: (err) => ic.trap(err) - }); -} - -$query; -export async function icrc1_total_supply(): Promise { - const result = await icrc.icrc1_total_supply().call(); - - return match(result, { - Ok: (ok) => ok, - Err: (err) => ic.trap(err) - }); -} - -$query; -export async function icrc1_minting_account(): Promise> { - const result = await icrc.icrc1_minting_account().call(); - - return match(result, { - Ok: (ok) => ok, - Err: (err) => ic.trap(err) - }); -} - -$query; -export async function icrc1_balance_of(account: ICRC1Account): Promise { - const result = await icrc.icrc1_balance_of(account).call(); - - return match(result, { - Ok: (ok) => ok, - Err: (err) => ic.trap(err) - }); -} - -$update; -export async function icrc1_transfer( - transferArgs: ICRC1TransferArgs -): Promise> { - const result = await icrc.icrc1_transfer(transferArgs).call(); - - return match(result, { - Ok: (ok) => ok, - Err: (err) => ic.trap(err) - }); -} - -$query; -export async function icrc1_supported_standards(): Promise< - Vec> -> { - const result = await icrc.icrc1_supported_standards().call(); - - return match(result, { - Ok: (ok) => ok, - Err: (err) => ic.trap(err) - }); -} +}); diff --git a/examples/icrc/dfx.json b/examples/icrc/dfx.json index 5afbaa85ed..3362b38976 100644 --- a/examples/icrc/dfx.json +++ b/examples/icrc/dfx.json @@ -5,7 +5,8 @@ "main": "canisters/proxy/index.ts", "build": "npx azle proxy", "candid": "canisters/proxy/index.did", - "wasm": ".azle/proxy/proxy.wasm.gz", + "wasm": ".azle/proxy/proxy.wasm", + "gzip": true, "declarations": { "output": "test/dfx_generated/proxy", "node_compatibility": true diff --git a/examples/icrc/package-lock.json b/examples/icrc/package-lock.json new file mode 100644 index 0000000000..6d7d4fffea --- /dev/null +++ b/examples/icrc/package-lock.json @@ -0,0 +1,1279 @@ +{ + "name": "icrc", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "azle": "0.16.2" + }, + "devDependencies": { + "@dfinity/agent": "0.14.1", + "ts-node": "10.7.0", + "typescript": "4.6.3" + } + }, + "node_modules/@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", + "engines": { + "node": ">= 12" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", + "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", + "dependencies": { + "@cspotcode/source-map-consumer": "0.8.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@dfinity/agent": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/@dfinity/agent/-/agent-0.14.1.tgz", + "integrity": "sha512-qLAQrhkxshcsxECnMSa1zY7mI8ua0vItrdA9JJI9WBRz4rDDXtrXyOYnh3u6pUPpdfF/i6bjx+NgrjYZucLe1Q==", + "dev": true, + "dependencies": { + "base64-arraybuffer": "^0.2.0", + "bignumber.js": "^9.0.0", + "borc": "^2.1.1", + "js-sha256": "0.9.0", + "simple-cbor": "^0.4.1", + "ts-node": "^10.8.2" + }, + "peerDependencies": { + "@dfinity/candid": "^0.14.1", + "@dfinity/principal": "^0.14.1" + } + }, + "node_modules/@dfinity/agent/node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@dfinity/agent/node_modules/ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/@dfinity/candid": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/@dfinity/candid/-/candid-0.14.1.tgz", + "integrity": "sha512-yRIRnVrJ4LjB0jFKUqZ2NeUzCCR6m8pm/n+0+IoVzY94ZkFATUkBSvdNxDZd1CCtNDNApi+YDe61DSQ51cDkrg==", + "dev": true, + "peer": true, + "dependencies": { + "ts-node": "^10.8.2" + } + }, + "node_modules/@dfinity/candid/node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@dfinity/candid/node_modules/ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "peer": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/@dfinity/principal": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/@dfinity/principal/-/principal-0.14.1.tgz", + "integrity": "sha512-a5TDU0iWLeuNjI+L1Ukx5nRhQHMCN2GRQkQg1Z0AzP3dX7FkBOiaLwMCLhCRUk/sK/SeR6/hCA0YKiwRqzjhqA==", + "dev": true, + "peer": true, + "dependencies": { + "js-sha256": "^0.9.0", + "ts-node": "^10.8.2" + } + }, + "node_modules/@dfinity/principal/node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@dfinity/principal/node_modules/ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "peer": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@swc/core": { + "version": "1.2.151", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.2.151.tgz", + "integrity": "sha512-oHgqKwK/Djv765zUHPiGqfMCaKIxXTgQyyCUBKLBQfAJwe/7FVobQ2fghBp4FsZA/NE1LZBmMPpRZNQwlGjeHw==", + "bin": { + "swcx": "run_swcx.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/swc" + }, + "optionalDependencies": { + "@swc/core-android-arm-eabi": "1.2.151", + "@swc/core-android-arm64": "1.2.151", + "@swc/core-darwin-arm64": "1.2.151", + "@swc/core-darwin-x64": "1.2.151", + "@swc/core-freebsd-x64": "1.2.151", + "@swc/core-linux-arm-gnueabihf": "1.2.151", + "@swc/core-linux-arm64-gnu": "1.2.151", + "@swc/core-linux-arm64-musl": "1.2.151", + "@swc/core-linux-x64-gnu": "1.2.151", + "@swc/core-linux-x64-musl": "1.2.151", + "@swc/core-win32-arm64-msvc": "1.2.151", + "@swc/core-win32-ia32-msvc": "1.2.151", + "@swc/core-win32-x64-msvc": "1.2.151" + } + }, + "node_modules/@swc/core-android-arm-eabi": { + "version": "1.2.151", + "resolved": "https://registry.npmjs.org/@swc/core-android-arm-eabi/-/core-android-arm-eabi-1.2.151.tgz", + "integrity": "sha512-Suk3IcHdha33K4hq9tfBCwkXJsENh7kjXCseLqL8Yvy8QobqkXjf1fcoJxX9BdCmPwsKmIw0ZgCBYR+Hl83M2w==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-android-arm64": { + "version": "1.2.151", + "resolved": "https://registry.npmjs.org/@swc/core-android-arm64/-/core-android-arm64-1.2.151.tgz", + "integrity": "sha512-HZVy69dVWT5RgrMJMRK5aiicPmhzkyCHAexApYAHYLgAIhsxL7uoAIPmuRKRkrKNJjrwsWL7H27bBH5bddRDvg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-darwin-arm64": { + "version": "1.2.151", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.2.151.tgz", + "integrity": "sha512-Ql7rXMu+IC76TemRtkt+opl5iSpX2ApAXVSfvf6afNVTrfTKLpDwiR3ySRRlG0FnNIv6TfOCJpHf655xp01S/g==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-darwin-x64": { + "version": "1.2.151", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.2.151.tgz", + "integrity": "sha512-N1OBIB7xatR5eybLo91ZhvMJMxT0zxRQURV/a9I8o5CyP4iLd1k8gmrYvBbtj08ohS8F9z7k/dFjxk/9ve5Drw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-freebsd-x64": { + "version": "1.2.151", + "resolved": "https://registry.npmjs.org/@swc/core-freebsd-x64/-/core-freebsd-x64-1.2.151.tgz", + "integrity": "sha512-WVIRiDzuz+/W7BMjVtg1Cmk1+zmDT18Qq+Ygr9J6aFQ1JQUkLEE1pvtkGD3JIEa6Jhz/VwM6AFHtY5o1CrZ21w==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-arm-gnueabihf": { + "version": "1.2.151", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.2.151.tgz", + "integrity": "sha512-pfBrIUwu3cR/M7DzDCUJAw9jFKXvJ/Ge8auFk07lRb+JcDnPm0XxLyrLqGvNQWdcHgXeXfmnS4fMQxdb9GUN1w==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-arm64-gnu": { + "version": "1.2.151", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.2.151.tgz", + "integrity": "sha512-M+BTkTdPY7gteM+0dYz9wrU/j9taL4ccqPEHkDEKP21lS24y99UtuKsvdBLzDm/6ShBVLFAkgIBPu5cEb7y6ig==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-arm64-musl": { + "version": "1.2.151", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.2.151.tgz", + "integrity": "sha512-7A+yTtSvPJVwO8X1cxUbD/PVCx8G9MKn83G9pH/r+9sQMBXqxyw6/NR0DG6nMMiyOmJkmYWgh5mO47BN7WC4dQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-x64-gnu": { + "version": "1.2.151", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.2.151.tgz", + "integrity": "sha512-ORlbN3wf1w0IQGjGToYYC/hV/Vwfcs88Ohfxc4X+IQaw/VxKG6/XT65c0btK640F2TVhvhH1MbYFJJlsycsW7g==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-x64-musl": { + "version": "1.2.151", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.2.151.tgz", + "integrity": "sha512-r6odKE3+9+ReVdnNTZnICt5tscyFFtP4GFcmPQzBSlVoD9LZX6O4WeOlFXn77rVK/+205n2ag/KkKgZH+vdPuQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-win32-arm64-msvc": { + "version": "1.2.151", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.2.151.tgz", + "integrity": "sha512-jnjJTNHpLhBaPwRgiKv1TdrMljL88ePqMCdVMantyd7yl4lP0D2e5/xR9ysR9S4EGcUnOyo9w8WUYhx/TioMZw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-win32-ia32-msvc": { + "version": "1.2.151", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.2.151.tgz", + "integrity": "sha512-hSCxAiyDDXKvdUExj4jSIhzWFePqoqak1qdNUjlhEhEinDG8T8PTRCLalyW6fqZDcLf6Tqde7H79AqbfhRlYGQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-win32-x64-msvc": { + "version": "1.2.151", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.2.151.tgz", + "integrity": "sha512-HOkqcJWCChps83Maj0M5kifPDuZ2sGPqpLM67poawspTFkBh0QJ9TMmxW1doQw+74cqsTpRi1ewr/KhsN18i5g==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==" + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==" + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==" + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==" + }, + "node_modules/@types/node": { + "version": "20.7.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.7.2.tgz", + "integrity": "sha512-RcdC3hOBOauLP+r/kRt27NrByYtDjsXyAuSbR87O6xpsvi763WI+5fbSIvYJrXnt9w4RuxhV6eAXfIs7aaf/FQ==", + "peer": true + }, + "node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==" + }, + "node_modules/azle": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/azle/-/azle-0.16.2.tgz", + "integrity": "sha512-YC8B2v8QKqzm2lrVVlCb1YmnqIkCpUQ6jondnk4RP92EAJG4GVaMv4a530m39iUOPzr3QazN4hGfdBt4xznFOg==", + "dependencies": { + "@dfinity/principal": "0.11.2", + "@swc/core": "1.2.151", + "azle-syn": "0.0.0", + "esbuild": "0.14.25", + "fs-extra": "10.0.1", + "js-sha256": "0.9.0", + "ts-node": "10.3.1", + "typescript": "4.4.4" + }, + "bin": { + "azle": "bin.js" + } + }, + "node_modules/azle-syn": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/azle-syn/-/azle-syn-0.0.0.tgz", + "integrity": "sha512-fWExJb5/hOEJOuBQ8hMMHRs9WryYeLLa9/ydqPWxbwjMEpE8RKdU1dTK6mdZtzNMhbeHdyne2pU1iVKiKmImGw==" + }, + "node_modules/azle/node_modules/@dfinity/principal": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/@dfinity/principal/-/principal-0.11.2.tgz", + "integrity": "sha512-vReWruqIl16yQeKOrCLDLDf2aTEJsXcKeW9qbwVfmV0kwLNE3B2Z6tbRjYbY7s+KwpysD5B1b48ZbIwI00BeyQ==" + }, + "node_modules/azle/node_modules/ts-node": { + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.3.1.tgz", + "integrity": "sha512-Yw3W2mYzhHfCHOICGNJqa0i+rbL0rAyg7ZIHxU+K4pgY8gd2Lh1j+XbHCusJMykbj6RZMJVOY0MlHVd+GOivcw==", + "dependencies": { + "@cspotcode/source-map-support": "0.7.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/azle/node_modules/typescript": { + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", + "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/base64-arraybuffer": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.2.0.tgz", + "integrity": "sha512-7emyCsu1/xiBXgQZrscw/8KPRT44I4Yq9Pe6EGs3aPRTsWuggML1/1DTuZUuIaJPIm1FTDUVXl4x/yW8s0kQDQ==", + "dev": true, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bignumber.js": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/borc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/borc/-/borc-2.1.2.tgz", + "integrity": "sha512-Sy9eoUi4OiKzq7VovMn246iTo17kzuyHJKomCfpWMlI6RpfN1gk95w7d7gH264nApVLg0HZfcpz62/g4VH1Y4w==", + "dev": true, + "dependencies": { + "bignumber.js": "^9.0.0", + "buffer": "^5.5.0", + "commander": "^2.15.0", + "ieee754": "^1.1.13", + "iso-url": "~0.4.7", + "json-text-sequence": "~0.1.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" + }, + "node_modules/delimit-stream": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/delimit-stream/-/delimit-stream-0.1.0.tgz", + "integrity": "sha512-a02fiQ7poS5CnjiJBAsjGLPp5EwVoGHNeu9sziBd9huppRfsAFIpv5zNLv0V1gbop53ilngAf5Kf331AwcoRBQ==", + "dev": true + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/esbuild": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.25.tgz", + "integrity": "sha512-4JHEIOMNFvK09ziiL+iVmldIhLbn49V4NAVo888tcGFKedEZY/Y8YapfStJ6zSE23tzYPKxqKwQBnQoIO0BI/Q==", + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "esbuild-android-64": "0.14.25", + "esbuild-android-arm64": "0.14.25", + "esbuild-darwin-64": "0.14.25", + "esbuild-darwin-arm64": "0.14.25", + "esbuild-freebsd-64": "0.14.25", + "esbuild-freebsd-arm64": "0.14.25", + "esbuild-linux-32": "0.14.25", + "esbuild-linux-64": "0.14.25", + "esbuild-linux-arm": "0.14.25", + "esbuild-linux-arm64": "0.14.25", + "esbuild-linux-mips64le": "0.14.25", + "esbuild-linux-ppc64le": "0.14.25", + "esbuild-linux-riscv64": "0.14.25", + "esbuild-linux-s390x": "0.14.25", + "esbuild-netbsd-64": "0.14.25", + "esbuild-openbsd-64": "0.14.25", + "esbuild-sunos-64": "0.14.25", + "esbuild-windows-32": "0.14.25", + "esbuild-windows-64": "0.14.25", + "esbuild-windows-arm64": "0.14.25" + } + }, + "node_modules/esbuild-android-64": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.25.tgz", + "integrity": "sha512-L5vCUk7TzFbBnoESNoXjU3x9+/+7TDIE/1mTfy/erAfvZAqC+S3sp/Qa9wkypFMcFvN9FzvESkTlpeQDolREtQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-android-arm64": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.25.tgz", + "integrity": "sha512-4jv5xPjM/qNm27T5j3ZEck0PvjgQtoMHnz4FzwF5zNP56PvY2CT0WStcAIl6jNlsuDdN63rk2HRBIsO6xFbcFw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-64": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.25.tgz", + "integrity": "sha512-TGp8tuudIxOyWd1+8aYPxQmC1ZQyvij/AfNBa35RubixD0zJ1vkKHVAzo0Zao1zcG6pNqiSyzfPto8vmg0s7oA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-arm64": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.25.tgz", + "integrity": "sha512-oTcDgdm0MDVEmw2DWu8BV68pYuImpFgvWREPErBZmNA4MYKGuBRaCiJqq6jZmBR1x+3y1DWCjez+5uLtuAm6mw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-64": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.25.tgz", + "integrity": "sha512-ueAqbnMZ8arnuLH8tHwTCQYeptnHOUV7vA6px6j4zjjQwDx7TdP7kACPf3TLZLdJQ3CAD1XCvQ2sPhX+8tacvQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-arm64": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.25.tgz", + "integrity": "sha512-+ZVWud2HKh+Ob6k/qiJWjBtUg4KmJGGmbvEXXW1SNKS7hW7HU+Zq2ZCcE1akFxOPkVB+EhOty/sSek30tkCYug==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-32": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.25.tgz", + "integrity": "sha512-3OP/lwV3kCzEz45tobH9nj+uE4ubhGsfx+tn0L26WAGtUbmmcRpqy7XRG/qK7h1mClZ+eguIANcQntYMdYklfw==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-64": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.25.tgz", + "integrity": "sha512-+aKHdHZmX9qwVlQmu5xYXh7GsBFf4TWrePgeJTalhXHOG7NNuUwoHmketGiZEoNsWyyqwH9rE5BC+iwcLY30Ug==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.25.tgz", + "integrity": "sha512-aTLcE2VBoLydL943REcAcgnDi3bHtmULSXWLbjtBdtykRatJVSxKMjK9YlBXUZC4/YcNQfH7AxwVeQr9fNxPhw==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm64": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.25.tgz", + "integrity": "sha512-UxfenPx/wSZx55gScCImPtXekvZQLI2GW3qe5dtlmU7luiqhp5GWPzGeQEbD3yN3xg/pHc671m5bma5Ns7lBHw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-mips64le": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.25.tgz", + "integrity": "sha512-wLWYyqVfYx9Ur6eU5RT92yJVsaBGi5RdkoWqRHOqcJ38Kn60QMlcghsKeWfe9jcYut8LangYZ98xO1LxIoSXrQ==", + "cpu": [ + "mips64el" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-ppc64le": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.25.tgz", + "integrity": "sha512-0dR6Csl6Zas3g4p9ULckEl8Mo8IInJh33VCJ3eaV1hj9+MHGdmDOakYMN8MZP9/5nl+NU/0ygpd14cWgy8uqRw==", + "cpu": [ + "ppc64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-riscv64": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.25.tgz", + "integrity": "sha512-J4d20HDmTrgvhR0bdkDhvvJGaikH3LzXQnNaseo8rcw9Yqby9A90gKUmWpfwqLVNRILvNnAmKLfBjCKU9ajg8w==", + "cpu": [ + "riscv64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-s390x": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.25.tgz", + "integrity": "sha512-YI2d5V6nTE73ZnhEKQD7MtsPs1EtUZJ3obS21oxQxGbbRw1G+PtJKjNyur+3t6nzHP9oTg6GHQ3S3hOLLmbDIQ==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-netbsd-64": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.25.tgz", + "integrity": "sha512-TKIVgNWLUOkr+Exrye70XTEE1lJjdQXdM4tAXRzfHE9iBA7LXWcNtVIuSnphTqpanPzTDFarF0yqq4kpbC6miA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-openbsd-64": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.25.tgz", + "integrity": "sha512-QgFJ37A15D7NIXBTYEqz29+uw3nNBOIyog+3kFidANn6kjw0GHZ0lEYQn+cwjyzu94WobR+fes7cTl/ZYlHb1A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-sunos-64": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.25.tgz", + "integrity": "sha512-rmWfjUItYIVlqr5EnTH1+GCxXiBOC42WBZ3w++qh7n2cS9Xo0lO5pGSG2N+huOU2fX5L+6YUuJ78/vOYvefeFw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-32": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.25.tgz", + "integrity": "sha512-HGAxVUofl3iUIz9W10Y9XKtD0bNsK9fBXv1D55N/ljNvkrAYcGB8YCm0v7DjlwtyS6ws3dkdQyXadbxkbzaKOA==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-64": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.25.tgz", + "integrity": "sha512-TirEohRkfWU9hXLgoDxzhMQD1g8I2mOqvdQF2RS9E/wbkORTAqJHyh7wqGRCQAwNzdNXdg3JAyhQ9/177AadWA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-arm64": { + "version": "0.14.25", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.25.tgz", + "integrity": "sha512-4ype9ERiI45rSh+R8qUoBtaj6kJvUOI7oVLhKqPEpcF4Pa5PpT3hm/mXAyotJHREkHpM87PAJcA442mLnbtlNA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/fs-extra": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz", + "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/iso-url": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/iso-url/-/iso-url-0.4.7.tgz", + "integrity": "sha512-27fFRDnPAMnHGLq36bWTpKET+eiXct3ENlCcdcMdk+mjXrb2kw3mhBUg1B7ewAC0kVzlOPhADzQgz1SE6Tglog==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/js-sha256": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", + "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==" + }, + "node_modules/json-text-sequence": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/json-text-sequence/-/json-text-sequence-0.1.1.tgz", + "integrity": "sha512-L3mEegEWHRekSHjc7+sc8eJhba9Clq1PZ8kMkzf8OxElhXc8O4TS5MwcVlj9aEbm5dr81N90WHC5nAz3UO971w==", + "dev": true, + "dependencies": { + "delimit-stream": "0.1.0" + } + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/simple-cbor": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/simple-cbor/-/simple-cbor-0.4.1.tgz", + "integrity": "sha512-rijcxtwx2b4Bje3sqeIqw5EeW7UlOIC4YfOdwqIKacpvRQ/D78bWg/4/0m5e0U91oKvlGh7LlJuZCu07ISCC7w==", + "dev": true + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/ts-node": { + "version": "10.7.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", + "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "0.7.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.0", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/typescript": { + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", + "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "engines": { + "node": ">=6" + } + } + } +} diff --git a/examples/icrc/params.did b/examples/icrc/params.did index 28a25e34d1..eeac9a0291 100644 --- a/examples/icrc/params.did +++ b/examples/icrc/params.did @@ -4,7 +4,7 @@ record { account = record { owner = principal "r7inp-6aaaa-aaaaa-aaabq-cai"; }; - amount = 20_000; + amount = 1_000_000; }; }; minting_account = record { diff --git a/examples/icrc/test/pretest.ts b/examples/icrc/test/pretest.ts new file mode 100644 index 0000000000..ab197b815b --- /dev/null +++ b/examples/icrc/test/pretest.ts @@ -0,0 +1,40 @@ +import { execSync } from 'child_process'; + +async function pretest(icrcPath: string) { + await new Promise((resolve) => setTimeout(resolve, 5000)); + + execSync(`dfx canister uninstall-code proxy || true`, { + stdio: 'inherit' + }); + + execSync(`dfx canister uninstall-code icrc || true`, { + stdio: 'inherit' + }); + + execSync( + `rm -rf ${icrcPath} && cd canisters && git clone https://github.com/dfinity/ICRC-1 && cd ICRC-1 && rm -rf .git`, + { + stdio: 'inherit' + } + ); + + execSync( + `dfx deploy --argument "($(cat params.did | tr -s '\n' ' '))" icrc --specified-id rrkah-fqaaa-aaaaa-aaaaq-cai`, + { + stdio: 'inherit' + } + ); + + execSync( + `ICRC_PRINCIPAL=rrkah-fqaaa-aaaaa-aaaaq-cai dfx deploy proxy --specified-id r7inp-6aaaa-aaaaa-aaabq-cai`, + { + stdio: 'inherit' + } + ); + + execSync(`dfx generate proxy`, { + stdio: 'inherit' + }); +} + +pretest('canisters/ICRC-1'); diff --git a/examples/icrc/test/test.ts b/examples/icrc/test/test.ts new file mode 100644 index 0000000000..539ec7e093 --- /dev/null +++ b/examples/icrc/test/test.ts @@ -0,0 +1,11 @@ +import { getCanisterId, runTests } from 'azle/test'; +import { createActor } from '../test/dfx_generated/proxy'; +import { getTests } from './tests'; + +const proxyCanister = createActor(getCanisterId('proxy'), { + agentOptions: { + host: 'http://127.0.0.1:8000' + } +}); + +runTests(getTests(proxyCanister)); diff --git a/examples/icrc/test/tests.ts b/examples/icrc/test/tests.ts new file mode 100644 index 0000000000..e5c293d38d --- /dev/null +++ b/examples/icrc/test/tests.ts @@ -0,0 +1,221 @@ +import { ActorSubclass } from '@dfinity/agent'; +import { Test } from 'azle/test'; +import { _SERVICE } from './dfx_generated/proxy/proxy.did'; +import { Principal } from '@dfinity/principal'; + +export function getTests(proxyCanister: ActorSubclass<_SERVICE>): Test[] { + return [ + { + name: 'icrc1_metadata', + test: async () => { + const result = await proxyCanister.icrc1_metadata(); + + const [firstDatumName, firstDatumValue] = result[0]; + const [secondDatumName, secondDatumValue] = result[1]; + const [thirdDatumName, thirdDatumValue] = result[2]; + const [fourthDatumName, fourthDatumValue] = result[3]; + + return { + Ok: + firstDatumName === 'icrc1:name' && + 'Text' in firstDatumValue && + firstDatumValue.Text === 'Azle' && + secondDatumName === 'icrc1:symbol' && + 'Text' in secondDatumValue && + secondDatumValue.Text === 'AZLE' && + thirdDatumName === 'icrc1:decimals' && + 'Nat' in thirdDatumValue && + thirdDatumValue.Nat === 8n && + fourthDatumName === 'icrc1:fee' && + 'Nat' in fourthDatumValue && + fourthDatumValue.Nat === 0n + }; + } + }, + { + name: 'icrc1_name', + test: async () => { + const result = await proxyCanister.icrc1_name(); + + return { + Ok: result === 'Azle' + }; + } + }, + { + name: 'icrc1_decimals', + test: async () => { + const result = await proxyCanister.icrc1_decimals(); + + return { + Ok: result === 8 + }; + } + }, + { + name: 'icrc1_symbol', + test: async () => { + const result = await proxyCanister.icrc1_symbol(); + + return { + Ok: result === 'AZLE' + }; + } + }, + { + name: 'icrc1_fee', + test: async () => { + const result = await proxyCanister.icrc1_fee(); + + return { + Ok: result === 0n + }; + } + }, + { + name: 'icrc1_total_supply', + test: async () => { + const result = await proxyCanister.icrc1_total_supply(); + + return { + Ok: result === 1_000_000n + }; + } + }, + { + name: 'icrc1_minting_account', + test: async () => { + const result = await proxyCanister.icrc1_minting_account(); + + return { + Ok: result[0]?.owner.toText() === '2vxsx-fae' + }; + } + }, + { + name: 'icrc1_balance_of', + test: async () => { + const result = await proxyCanister.icrc1_balance_of({ + owner: Principal.fromText('r7inp-6aaaa-aaaaa-aaabq-cai'), + subaccount: [] + }); + + return { + Ok: result === 1_000_000n + }; + } + }, + { + name: 'icrc1_transfer', + test: async () => { + const result = await proxyCanister.icrc1_transfer({ + from_subaccount: [], + to: { + owner: Principal.fromText( + 'rrkah-fqaaa-aaaaa-aaaaq-cai' + ), + subaccount: [] + }, + amount: 1n, + fee: [], + memo: [], + created_at_time: [] + }); + + return { + Ok: 'Ok' in result && result.Ok === 1n + }; + } + }, + { + name: 'icrc1_supported_standards', + test: async () => { + const result = await proxyCanister.icrc1_supported_standards(); + + return { + Ok: + result[0].url === + 'https://github.com/dfinity/ICRC-1/tree/main/standards/ICRC-1' && + result[0].name === 'ICRC-1' && + result[1].url === + 'https://github.com/dfinity/ICRC-1/tree/main/standards/ICRC-2' && + result[1].name === 'ICRC-2' + }; + } + }, + { + name: 'icrc2_approve', + test: async () => { + const result = await proxyCanister.icrc2_approve({ + from_subaccount: [], + spender: { + owner: Principal.fromText( + 'rrkah-fqaaa-aaaaa-aaaaq-cai' + ), + subaccount: [] + }, + amount: 1n, + expected_allowance: [], + expires_at: [], + fee: [], + memo: [], + created_at_time: [] + }); + + return { + Ok: 'Ok' in result && result.Ok === 2n + }; + } + }, + { + name: 'icrc2_transfer_from', + test: async () => { + const result = await proxyCanister.icrc2_transfer_from({ + from: { + owner: Principal.fromText( + 'r7inp-6aaaa-aaaaa-aaabq-cai' + ), + subaccount: [] + }, + to: { + owner: Principal.fromText( + 'rrkah-fqaaa-aaaaa-aaaaq-cai' + ), + subaccount: [] + }, + amount: 1n, + fee: [], + memo: [], + created_at_time: [] + }); + + return { + Ok: 'Ok' in result && result.Ok === 3n + }; + } + }, + { + name: 'icrc2_allowance', + test: async () => { + const result = await proxyCanister.icrc2_allowance({ + account: { + owner: Principal.fromText( + 'r7inp-6aaaa-aaaaa-aaabq-cai' + ), + subaccount: [] + }, + spender: { + owner: Principal.fromText( + 'rrkah-fqaaa-aaaaa-aaaaq-cai' + ), + subaccount: [] + } + }); + + return { + Ok: result.allowance === 1n + }; + } + } + ]; +} diff --git a/examples/ledger_canister/src/ledger_canister/index.did b/examples/ledger_canister/src/ledger_canister/index.did index 25085886e2..fa9bf09b34 100644 --- a/examples/ledger_canister/src/ledger_canister/index.did +++ b/examples/ledger_canister/src/ledger_canister/index.did @@ -1,57 +1,57 @@ -type rec_75 = record {allowed_window_nanos:nat64}; -type rec_72 = record {e8s:nat64}; -type rec_71 = record {expected_fee:rec_72}; -type rec_76 = record {duplicate_of:nat64}; -type rec_74 = record {e8s:nat64}; -type rec_73 = record {balance:rec_74}; -type rec_70 = variant {TxTooOld:rec_75; BadFee:rec_71; TxDuplicate:rec_76; TxCreatedInFuture; InsufficientFunds:rec_73}; -type rec_69 = variant {Ok:nat64; Err:rec_70}; -type rec_77 = record {e8s:nat64}; -type rec_79 = record {e8s:nat64}; -type rec_78 = record {transfer_fee:rec_79}; -type rec_80 = record {start:nat64; length:nat64}; -type rec_88 = record {e8s:nat64}; -type rec_87 = record {from:vec nat8; amount:rec_88}; -type rec_86 = record {e8s:nat64}; -type rec_85 = record {to:vec nat8; amount:rec_86}; -type rec_91 = record {e8s:nat64}; -type rec_90 = record {e8s:nat64}; -type rec_89 = record {to:vec nat8; fee:rec_91; from:vec nat8; amount:rec_90}; -type rec_84 = variant {Burn:rec_87; Mint:rec_85; Transfer:rec_89}; -type rec_92 = record {timestamp_nanos:nat64}; -type rec_83 = record {memo:nat64; operation:opt rec_84; created_at_time:rec_92}; -type rec_93 = record {timestamp_nanos:nat64}; -type rec_82 = record {transaction:rec_83; timestamp:rec_93; parent_hash:opt vec nat8}; -type rec_95 = record {start:nat64; length:nat64}; -type rec_104 = record {e8s:nat64}; -type rec_103 = record {from:vec nat8; amount:rec_104}; -type rec_102 = record {e8s:nat64}; -type rec_101 = record {to:vec nat8; amount:rec_102}; -type rec_107 = record {e8s:nat64}; -type rec_106 = record {e8s:nat64}; -type rec_105 = record {to:vec nat8; fee:rec_107; from:vec nat8; amount:rec_106}; -type rec_100 = variant {Burn:rec_103; Mint:rec_101; Transfer:rec_105}; -type rec_108 = record {timestamp_nanos:nat64}; -type rec_99 = record {memo:nat64; operation:opt rec_100; created_at_time:rec_108}; -type rec_109 = record {timestamp_nanos:nat64}; -type rec_98 = record {transaction:rec_99; timestamp:rec_109; parent_hash:opt vec nat8}; -type rec_97 = record {blocks:vec rec_98}; -type rec_111 = record {requested_index:nat64; first_valid_index:nat64}; -type rec_112 = record {error_message:text; error_code:nat64}; -type rec_110 = variant {BadFirstBlockIndex:rec_111; Other:rec_112}; -type rec_96 = variant {Ok:rec_97; Err:rec_110}; -type rec_94 = record {callback:func (rec_95) -> (rec_96) query; start:nat64; length:nat64}; -type rec_81 = record {certificate:opt vec nat8; blocks:vec rec_82; chain_length:nat64; first_block_index:nat64; archived_blocks:vec rec_94}; -type rec_114 = record {canister_id:principal}; -type rec_113 = record {archives:vec rec_114}; +type rec_116 = record {allowed_window_nanos:nat64}; +type rec_113 = record {e8s:nat64}; +type rec_112 = record {expected_fee:rec_113}; +type rec_117 = record {duplicate_of:nat64}; +type rec_115 = record {e8s:nat64}; +type rec_114 = record {balance:rec_115}; +type rec_111 = variant {TxTooOld:rec_116; BadFee:rec_112; TxDuplicate:rec_117; TxCreatedInFuture; InsufficientFunds:rec_114}; +type rec_110 = variant {Ok:nat64; Err:rec_111}; +type rec_118 = record {e8s:nat64}; +type rec_120 = record {e8s:nat64}; +type rec_119 = record {transfer_fee:rec_120}; +type rec_121 = record {start:nat64; length:nat64}; +type rec_129 = record {e8s:nat64}; +type rec_128 = record {from:vec nat8; amount:rec_129}; +type rec_127 = record {e8s:nat64}; +type rec_126 = record {to:vec nat8; amount:rec_127}; +type rec_132 = record {e8s:nat64}; +type rec_131 = record {e8s:nat64}; +type rec_130 = record {to:vec nat8; fee:rec_132; from:vec nat8; amount:rec_131}; +type rec_125 = variant {Burn:rec_128; Mint:rec_126; Transfer:rec_130}; +type rec_133 = record {timestamp_nanos:nat64}; +type rec_124 = record {memo:nat64; operation:opt rec_125; created_at_time:rec_133}; +type rec_134 = record {timestamp_nanos:nat64}; +type rec_123 = record {transaction:rec_124; timestamp:rec_134; parent_hash:opt vec nat8}; +type rec_136 = record {start:nat64; length:nat64}; +type rec_145 = record {e8s:nat64}; +type rec_144 = record {from:vec nat8; amount:rec_145}; +type rec_143 = record {e8s:nat64}; +type rec_142 = record {to:vec nat8; amount:rec_143}; +type rec_148 = record {e8s:nat64}; +type rec_147 = record {e8s:nat64}; +type rec_146 = record {to:vec nat8; fee:rec_148; from:vec nat8; amount:rec_147}; +type rec_141 = variant {Burn:rec_144; Mint:rec_142; Transfer:rec_146}; +type rec_149 = record {timestamp_nanos:nat64}; +type rec_140 = record {memo:nat64; operation:opt rec_141; created_at_time:rec_149}; +type rec_150 = record {timestamp_nanos:nat64}; +type rec_139 = record {transaction:rec_140; timestamp:rec_150; parent_hash:opt vec nat8}; +type rec_138 = record {blocks:vec rec_139}; +type rec_152 = record {requested_index:nat64; first_valid_index:nat64}; +type rec_153 = record {error_message:text; error_code:nat64}; +type rec_151 = variant {BadFirstBlockIndex:rec_152; Other:rec_153}; +type rec_137 = variant {Ok:rec_138; Err:rec_151}; +type rec_135 = record {callback:func (rec_136) -> (rec_137) query; start:nat64; length:nat64}; +type rec_122 = record {certificate:opt vec nat8; blocks:vec rec_123; chain_length:nat64; first_block_index:nat64; archived_blocks:vec rec_135}; +type rec_155 = record {canister_id:principal}; +type rec_154 = record {archives:vec rec_155}; service: () -> { - executeTransfer: (text, nat64, nat64, opt nat64) -> (rec_69); - getAccountBalance: (text) -> (rec_77); - getTransferFee: () -> (rec_78); - getBlocks: (rec_80) -> (rec_81); + executeTransfer: (text, nat64, nat64, opt nat64) -> (rec_110); + getAccountBalance: (text) -> (rec_118); + getTransferFee: () -> (rec_119); + getBlocks: (rec_121) -> (rec_122); getSymbol: () -> (text); getName: () -> (text); getDecimals: () -> (nat32); - getArchives: () -> (rec_113); + getArchives: () -> (rec_154); getAddressFromPrincipal: (principal) -> (text) query; } diff --git a/src/lib_functional/candid/reference/func.ts b/src/lib_functional/candid/reference/func.ts index 17a7468dc1..b798e4e6e8 100644 --- a/src/lib_functional/candid/reference/func.ts +++ b/src/lib_functional/candid/reference/func.ts @@ -1,4 +1,4 @@ -import { TypeMapping } from '..'; +import { CandidType } from '..'; import { IDL } from '@dfinity/candid'; import { processMap, @@ -17,8 +17,8 @@ const modeToCandid = { }; export function Func( - paramsIdls: any[], - returnIdl: any, + paramsIdls: CandidType[], + returnIdl: CandidType, mode: Mode ): [Principal, string] & { _azleCandidType?: '_azleCandidType' } { // TODO can't Func be recursive? diff --git a/src/lib_functional/candid/reference/variant.ts b/src/lib_functional/candid/reference/variant.ts index bde604c04f..60e8afddcb 100644 --- a/src/lib_functional/candid/reference/variant.ts +++ b/src/lib_functional/candid/reference/variant.ts @@ -1,10 +1,16 @@ -import { TypeMapping } from '..'; +import { CandidType, TypeMapping } from '..'; import { IDL } from '@dfinity/candid'; import { processMap } from '../../../lib_new/utils'; import { v4 } from 'uuid'; import { Null } from '../../../lib_new/primitives'; -export function Variant(obj: T): RequireExactlyOne<{ +export function Variant< + T extends { + [K in keyof T]: CandidType; + } +>( + obj: T +): RequireExactlyOne<{ [K in keyof T]: TypeMapping; }> & { _azleCandidType?: '_azleCandidType' } { const name = v4();