@junobuild/functions 0.8.3 → 0.8.4-next-2026-04-17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/canisters/ckbtc/index.js +1 -1
- package/canisters/cketh/index.js +1 -1
- package/canisters/cmc/cmc.canister.d.ts +6 -6
- package/canisters/cmc/index.d.ts +1 -0
- package/canisters/cmc/index.js +1 -1
- package/canisters/cmc/index.js.map +4 -4
- package/canisters/cmc/schema.d.ts +92 -0
- package/canisters/declarations/_idl.d.ts +2 -1
- package/canisters/declarations/_types.d.ts +2 -1
- package/canisters/declarations/ckbtc/bitcoin.did.d.ts +8 -0
- package/canisters/declarations/ckbtc/bitcoin.did.idl.d.ts +2 -0
- package/canisters/declarations/ckbtc/minter.did.d.ts +190 -0
- package/canisters/declarations/ckbtc/minter.did.idl.d.ts +9 -0
- package/canisters/declarations/cketh/minter.did.d.ts +140 -0
- package/canisters/declarations/cketh/minter.did.idl.d.ts +8 -0
- package/canisters/declarations/cycles-ledger/cycles-ledger.did.d.ts +413 -0
- package/canisters/declarations/cycles-ledger/cycles-ledger.did.idl.d.ts +82 -0
- package/canisters/declarations/ic-management/ic-management.did.d.ts +18 -4
- package/canisters/declarations/ledger-icp/index.did.d.ts +20 -1
- package/canisters/declarations/ledger-icp/index.did.idl.d.ts +5 -1
- package/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +1 -0
- package/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +1 -0
- package/canisters/declarations/nns/governance.did.d.ts +100 -0
- package/canisters/declarations/nns/governance.did.idl.d.ts +11 -0
- package/canisters/declarations/nns/governance_test.did.d.ts +100 -0
- package/canisters/declarations/nns/governance_test.did.idl.d.ts +11 -0
- package/canisters/declarations/nns/sns_wasm.did.d.ts +4 -0
- package/canisters/declarations/nns/sns_wasm.did.idl.d.ts +1 -0
- package/canisters/declarations/sns/governance.did.d.ts +4 -0
- package/canisters/declarations/sns/governance.did.idl.d.ts +1 -0
- package/canisters/declarations/sns/governance_test.did.d.ts +4 -0
- package/canisters/declarations/sns/governance_test.did.idl.d.ts +1 -0
- package/canisters/ic-management/index.js +1 -1
- package/canisters/index.d.ts +1 -1
- package/canisters/index.js +1 -1
- package/canisters/ledger/cycles/index.d.ts +1 -0
- package/canisters/ledger/cycles/index.js +2 -0
- package/canisters/ledger/cycles/index.js.map +7 -0
- package/canisters/ledger/icp/index.d.ts +1 -0
- package/canisters/ledger/icp/index.js +1 -1
- package/canisters/ledger/icp/index.js.map +4 -4
- package/canisters/ledger/icp/ledger.canister.d.ts +6 -6
- package/canisters/ledger/icp/schema.d.ts +152 -0
- package/canisters/ledger/icrc/index.d.ts +1 -1
- package/canisters/ledger/icrc/index.js +1 -1
- package/canisters/ledger/icrc/index.js.map +4 -4
- package/canisters/ledger/icrc/ledger.canister.d.ts +13 -14
- package/canisters/ledger/icrc/schema.d.ts +351 -0
- package/canisters/nns/index.js +1 -1
- package/canisters/sns/index.js +1 -1
- package/chunk-I3WMKZTG.js +2 -0
- package/chunk-I3WMKZTG.js.map +7 -0
- package/{chunk-X3EF7OU6.js → chunk-JI3RCRR6.js} +1 -1
- package/{chunk-X3EF7OU6.js.map → chunk-JI3RCRR6.js.map} +1 -1
- package/package.json +10 -6
- package/src/canisters/declarations/ckbtc/bitcoin.did.d.ts +8 -0
- package/src/canisters/declarations/ckbtc/bitcoin.did.idl.js +16 -0
- package/src/canisters/declarations/ckbtc/minter.did.d.ts +190 -0
- package/src/canisters/declarations/ckbtc/minter.did.idl.js +118 -0
- package/src/canisters/declarations/cketh/minter.did.d.ts +140 -0
- package/src/canisters/declarations/cketh/minter.did.idl.js +78 -0
- package/src/canisters/declarations/cycles-ledger/cycles-ledger.did.d.ts +413 -0
- package/src/canisters/declarations/cycles-ledger/cycles-ledger.did.idl.js +806 -0
- package/src/canisters/declarations/ic-management/ic-management.did.d.ts +18 -4
- package/src/canisters/declarations/ic-management/ic-management.did.idl.js +32 -8
- package/src/canisters/declarations/ledger-icp/index.did.d.ts +20 -1
- package/src/canisters/declarations/ledger-icp/index.did.idl.js +32 -5
- package/src/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +1 -0
- package/src/canisters/declarations/ledger-icrc/icrc_index.did.idl.js +2 -0
- package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +1 -0
- package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.js +2 -0
- package/src/canisters/declarations/nns/governance.did.d.ts +100 -0
- package/src/canisters/declarations/nns/governance.did.idl.js +132 -0
- package/src/canisters/declarations/nns/governance_test.did.d.ts +100 -0
- package/src/canisters/declarations/nns/governance_test.did.idl.js +132 -0
- package/src/canisters/declarations/nns/sns_wasm.did.d.ts +4 -0
- package/src/canisters/declarations/nns/sns_wasm.did.idl.js +8 -0
- package/src/canisters/declarations/sns/governance.did.d.ts +4 -0
- package/src/canisters/declarations/sns/governance.did.idl.js +12 -0
- package/src/canisters/declarations/sns/governance_test.did.d.ts +4 -0
- package/src/canisters/declarations/sns/governance_test.did.idl.js +12 -0
- package/canisters/ledger/icrc/schemas.d.ts +0 -11
- package/chunk-I4MVAQHI.js +0 -2
- package/chunk-I4MVAQHI.js.map +0 -7
- /package/canisters/{schemas.d.ts → schema.d.ts} +0 -0
package/canisters/ckbtc/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i,b as C}from"../../chunk-
|
|
1
|
+
import{a as i,b as C}from"../../chunk-I3WMKZTG.js";import"../../chunk-4C666HHU.js";export{i as CkBTCBitcoinIdl,C as CkBTCMinterIdl};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/canisters/cketh/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as r,d as t}from"../../chunk-
|
|
1
|
+
import{c as r,d as t}from"../../chunk-I3WMKZTG.js";import"../../chunk-4C666HHU.js";export{r as CkETHMinterIdl,t as CkETHOrchestratorIdl};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Canister } from '../_canister';
|
|
2
|
-
import { type
|
|
3
|
-
import { type
|
|
2
|
+
import { type CanisterOptions } from '../schema';
|
|
3
|
+
import { type NotifyTopUpArg, type NotifyTopUpResult } from './schema';
|
|
4
4
|
/**
|
|
5
5
|
* Provides a simple interface to interact with the Cycle Minting Canister,
|
|
6
6
|
* when developing Juno Serverless Functions in TypeScript.
|
|
@@ -19,10 +19,10 @@ export declare class CMCCanister extends Canister {
|
|
|
19
19
|
* The CMC will then convert the ICP from the given ledger block into cycles and add
|
|
20
20
|
* them to the specified canister.
|
|
21
21
|
*
|
|
22
|
-
* @param {
|
|
23
|
-
* @returns {Promise<
|
|
22
|
+
* @param {NotifyTopUpArg} args - Arguments containing the ledger block index and the canister ID that should receive the cycles.
|
|
23
|
+
* @returns {Promise<NotifyTopUpResult>} The result of the CMC conversion and deposit.
|
|
24
24
|
*/
|
|
25
25
|
notifyTopUp: ({ args }: {
|
|
26
|
-
args:
|
|
27
|
-
}) => Promise<
|
|
26
|
+
args: NotifyTopUpArg;
|
|
27
|
+
}) => Promise<NotifyTopUpResult>;
|
|
28
28
|
}
|
package/canisters/cmc/index.d.ts
CHANGED
package/canisters/cmc/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"../../chunk-BXZ5PSUW.js";import{a as c}from"../../chunk-ZBCLFWQJ.js";import{g as p}from"../../chunk-YHNBR22R.js";import"../../chunk-JU5CZHLY.js";import{a as n}from"../../chunk-JI3RCRR6.js";import{e as o}from"../../chunk-I3WMKZTG.js";import"../../chunk-4C666HHU.js";import{schemaFromIdl as y,schemaToIdl as b}from"@junobuild/schema/utils";import{j as i}from"@junobuild/schema";import*as t from"zod";var e=i.strictObject({block_index:i.bigint(),canister_id:i.principal()}),g=t.union([t.strictObject({Refunded:t.strictObject({block_index:t.bigint().optional(),reason:t.string()})}),t.strictObject({InvalidTransaction:t.string()}),t.strictObject({Other:t.strictObject({error_message:t.string(),error_code:t.bigint()})}),t.strictObject({Processing:t.null()}),t.strictObject({TransactionTooOld:t.bigint()})]),m=t.union([t.strictObject({Ok:t.bigint()}),t.strictObject({Err:g})]);var s=class extends c{constructor(r={}){n.parse(r),super({canisterId:r?.canisterId??a})}notifyTopUp=async({args:r})=>{let l=e.parse(r),f=b({schema:e,value:l}),d=await p({canisterId:this.canisterId,method:"notify_top_up",args:[[o.NotifyTopUpArg,f]],result:o.NotifyTopUpResult});return y({schema:m,value:d})}};export{s as CMCCanister,o as CmcIdl,g as NotifyErrorSchema,e as NotifyTopUpArgSchema,m as NotifyTopUpResultSchema};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/canisters/cmc/cmc.canister.ts"],
|
|
4
|
-
"sourcesContent": ["import {call} from '../../ic-cdk/call.ic-cdk';\nimport {Canister} from '../_canister';\nimport {CMC_ID} from '../_constants';\nimport {
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["CMCCanister", "Canister", "options", "CanisterOptionsSchema", "CMC_ID", "args", "call", "cmc_did_idl_exports"]
|
|
3
|
+
"sources": ["../../src/canisters/cmc/cmc.canister.ts", "../../src/canisters/cmc/schema.ts"],
|
|
4
|
+
"sourcesContent": ["import {schemaFromIdl, schemaToIdl} from '@junobuild/schema/utils';\nimport {call} from '../../ic-cdk/call.ic-cdk';\nimport {Canister} from '../_canister';\nimport {CMC_ID} from '../_constants';\nimport {CmcIdl} from '../declarations';\nimport {type CanisterOptions, CanisterOptionsSchema} from '../schema';\nimport {\n type NotifyTopUpArg,\n type NotifyTopUpResult,\n NotifyTopUpArgSchema,\n NotifyTopUpResultSchema\n} from './schema';\n\n/**\n * Provides a simple interface to interact with the Cycle Minting Canister,\n * when developing Juno Serverless Functions in TypeScript.\n *\n * @param {CanisterOptions} [options] - Optional custom canister ID.\n */\nexport class CMCCanister extends Canister {\n constructor(options: CanisterOptions = {}) {\n CanisterOptionsSchema.parse(options);\n\n super({canisterId: options?.canisterId ?? CMC_ID});\n }\n\n /**\n * Notifies the Cycle Minting Canister (CMC) that a top-up transfer has been completed.\n *\n * After sending ICP to the CMC top-up account for a canister, the transfer is recorded\n * on the ledger. The CMC does not automatically convert that ICP into cycles \u2014 you\n * must call this function to let the CMC know which transaction to process.\n *\n * The CMC will then convert the ICP from the given ledger block into cycles and add\n * them to the specified canister.\n *\n * @param {NotifyTopUpArg} args - Arguments containing the ledger block index and the canister ID that should receive the cycles.\n * @returns {Promise<NotifyTopUpResult>} The result of the CMC conversion and deposit.\n */\n notifyTopUp = async ({args}: {args: NotifyTopUpArg}): Promise<NotifyTopUpResult> => {\n const parsed = NotifyTopUpArgSchema.parse(args);\n\n const idlArgs = schemaToIdl({schema: NotifyTopUpArgSchema, value: parsed});\n\n const idlResult = await call<NotifyTopUpResult>({\n canisterId: this.canisterId,\n method: 'notify_top_up',\n args: [[CmcIdl.NotifyTopUpArg, idlArgs]],\n result: CmcIdl.NotifyTopUpResult\n });\n\n return schemaFromIdl({schema: NotifyTopUpResultSchema, value: idlResult}) as NotifyTopUpResult;\n };\n}\n", "import type {Principal} from '@icp-sdk/core/principal';\nimport {j} from '@junobuild/schema';\nimport * as z from 'zod';\n\nexport const NotifyTopUpArgSchema = j.strictObject({\n block_index: j.bigint(),\n canister_id: j.principal()\n});\n\nexport const NotifyErrorSchema = z.union([\n z.strictObject({\n Refunded: z.strictObject({\n block_index: z.bigint().optional(),\n reason: z.string()\n })\n }),\n z.strictObject({InvalidTransaction: z.string()}),\n z.strictObject({Other: z.strictObject({error_message: z.string(), error_code: z.bigint()})}),\n z.strictObject({Processing: z.null()}),\n z.strictObject({TransactionTooOld: z.bigint()})\n]);\n\nexport const NotifyTopUpResultSchema = z.union([\n z.strictObject({Ok: z.bigint()}),\n z.strictObject({Err: NotifyErrorSchema})\n]);\n\n/**\n * Arguments for the CMC `notify_top_up` call.\n */\nexport interface NotifyTopUpArg {\n /** Index of the block on the ICP ledger that contains the payment. */\n block_index: bigint;\n /** The canister to top up. */\n canister_id: Principal;\n}\n\n/**\n * Errors that can occur during a CMC notify call.\n */\nexport type NotifyError =\n /** The payment was returned to the caller. */\n | {Refunded: {block_index?: bigint; reason: string}}\n /** The transaction does not satisfy the CMC payment protocol. */\n | {InvalidTransaction: string}\n /** Other error. */\n | {Other: {error_message: string; error_code: bigint}}\n /** The same payment is already being processed by a concurrent request. */\n | {Processing: null}\n /** The payment was too old to be processed. */\n | {TransactionTooOld: bigint};\n\n/**\n * The result of a CMC `notify_top_up` call.\n * Returns the amount of cycles sent to the specified canister on success.\n */\nexport type NotifyTopUpResult = {Ok: bigint} | {Err: NotifyError};\n"],
|
|
5
|
+
"mappings": "uRAAA,OAAQ,iBAAAA,EAAe,eAAAC,MAAkB,0BCCzC,OAAQ,KAAAC,MAAQ,oBAChB,UAAYC,MAAO,MAEZ,IAAMC,EAAuBF,EAAE,aAAa,CACjD,YAAaA,EAAE,OAAO,EACtB,YAAaA,EAAE,UAAU,CAC3B,CAAC,EAEYG,EAAsB,QAAM,CACrC,eAAa,CACb,SAAY,eAAa,CACvB,YAAe,SAAO,EAAE,SAAS,EACjC,OAAU,SAAO,CACnB,CAAC,CACH,CAAC,EACC,eAAa,CAAC,mBAAsB,SAAO,CAAC,CAAC,EAC7C,eAAa,CAAC,MAAS,eAAa,CAAC,cAAiB,SAAO,EAAG,WAAc,SAAO,CAAC,CAAC,CAAC,CAAC,EACzF,eAAa,CAAC,WAAc,OAAK,CAAC,CAAC,EACnC,eAAa,CAAC,kBAAqB,SAAO,CAAC,CAAC,CAChD,CAAC,EAEYC,EAA4B,QAAM,CAC3C,eAAa,CAAC,GAAM,SAAO,CAAC,CAAC,EAC7B,eAAa,CAAC,IAAKD,CAAiB,CAAC,CACzC,CAAC,EDNM,IAAME,EAAN,cAA0BC,CAAS,CACxC,YAAYC,EAA2B,CAAC,EAAG,CACzCC,EAAsB,MAAMD,CAAO,EAEnC,MAAM,CAAC,WAAYA,GAAS,YAAcE,CAAM,CAAC,CACnD,CAeA,YAAc,MAAO,CAAC,KAAAC,CAAI,IAA0D,CAClF,IAAMC,EAASC,EAAqB,MAAMF,CAAI,EAExCG,EAAUC,EAAY,CAAC,OAAQF,EAAsB,MAAOD,CAAM,CAAC,EAEnEI,EAAY,MAAMC,EAAwB,CAC9C,WAAY,KAAK,WACjB,OAAQ,gBACR,KAAM,CAAC,CAACC,EAAO,eAAgBJ,CAAO,CAAC,EACvC,OAAQI,EAAO,iBACjB,CAAC,EAED,OAAOC,EAAc,CAAC,OAAQC,EAAyB,MAAOJ,CAAS,CAAC,CAC1E,CACF",
|
|
6
|
+
"names": ["schemaFromIdl", "schemaToIdl", "j", "z", "NotifyTopUpArgSchema", "NotifyErrorSchema", "NotifyTopUpResultSchema", "CMCCanister", "Canister", "options", "CanisterOptionsSchema", "CMC_ID", "args", "parsed", "NotifyTopUpArgSchema", "idlArgs", "schemaToIdl", "idlResult", "call", "cmc_did_idl_exports", "schemaFromIdl", "NotifyTopUpResultSchema"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { Principal } from '@icp-sdk/core/principal';
|
|
2
|
+
import * as z from 'zod';
|
|
3
|
+
export declare const NotifyTopUpArgSchema: z.ZodObject<{
|
|
4
|
+
block_index: z.ZodBigInt;
|
|
5
|
+
canister_id: z.ZodPipe<z.ZodCustom<Principal, Principal>, z.ZodTransform<Principal, Principal>>;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
export declare const NotifyErrorSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
8
|
+
Refunded: z.ZodObject<{
|
|
9
|
+
block_index: z.ZodOptional<z.ZodBigInt>;
|
|
10
|
+
reason: z.ZodString;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
13
|
+
InvalidTransaction: z.ZodString;
|
|
14
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
15
|
+
Other: z.ZodObject<{
|
|
16
|
+
error_message: z.ZodString;
|
|
17
|
+
error_code: z.ZodBigInt;
|
|
18
|
+
}, z.core.$strict>;
|
|
19
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
20
|
+
Processing: z.ZodNull;
|
|
21
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
22
|
+
TransactionTooOld: z.ZodBigInt;
|
|
23
|
+
}, z.core.$strict>]>;
|
|
24
|
+
export declare const NotifyTopUpResultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
25
|
+
Ok: z.ZodBigInt;
|
|
26
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
27
|
+
Err: z.ZodUnion<readonly [z.ZodObject<{
|
|
28
|
+
Refunded: z.ZodObject<{
|
|
29
|
+
block_index: z.ZodOptional<z.ZodBigInt>;
|
|
30
|
+
reason: z.ZodString;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
33
|
+
InvalidTransaction: z.ZodString;
|
|
34
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
35
|
+
Other: z.ZodObject<{
|
|
36
|
+
error_message: z.ZodString;
|
|
37
|
+
error_code: z.ZodBigInt;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
40
|
+
Processing: z.ZodNull;
|
|
41
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
42
|
+
TransactionTooOld: z.ZodBigInt;
|
|
43
|
+
}, z.core.$strict>]>;
|
|
44
|
+
}, z.core.$strict>]>;
|
|
45
|
+
/**
|
|
46
|
+
* Arguments for the CMC `notify_top_up` call.
|
|
47
|
+
*/
|
|
48
|
+
export interface NotifyTopUpArg {
|
|
49
|
+
/** Index of the block on the ICP ledger that contains the payment. */
|
|
50
|
+
block_index: bigint;
|
|
51
|
+
/** The canister to top up. */
|
|
52
|
+
canister_id: Principal;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Errors that can occur during a CMC notify call.
|
|
56
|
+
*/
|
|
57
|
+
export type NotifyError =
|
|
58
|
+
/** The payment was returned to the caller. */
|
|
59
|
+
{
|
|
60
|
+
Refunded: {
|
|
61
|
+
block_index?: bigint;
|
|
62
|
+
reason: string;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/** The transaction does not satisfy the CMC payment protocol. */
|
|
66
|
+
| {
|
|
67
|
+
InvalidTransaction: string;
|
|
68
|
+
}
|
|
69
|
+
/** Other error. */
|
|
70
|
+
| {
|
|
71
|
+
Other: {
|
|
72
|
+
error_message: string;
|
|
73
|
+
error_code: bigint;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/** The same payment is already being processed by a concurrent request. */
|
|
77
|
+
| {
|
|
78
|
+
Processing: null;
|
|
79
|
+
}
|
|
80
|
+
/** The payment was too old to be processed. */
|
|
81
|
+
| {
|
|
82
|
+
TransactionTooOld: bigint;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* The result of a CMC `notify_top_up` call.
|
|
86
|
+
* Returns the amount of cycles sent to the specified canister on success.
|
|
87
|
+
*/
|
|
88
|
+
export type NotifyTopUpResult = {
|
|
89
|
+
Ok: bigint;
|
|
90
|
+
} | {
|
|
91
|
+
Err: NotifyError;
|
|
92
|
+
};
|
|
@@ -3,6 +3,7 @@ import * as CkBTCMinterIdl from './ckbtc/minter.did.idl';
|
|
|
3
3
|
import * as CkETHMinterIdl from './cketh/minter.did.idl';
|
|
4
4
|
import * as CkETHOrchestratorIdl from './cketh/orchestrator.did.idl';
|
|
5
5
|
import * as CmcIdl from './cmc/cmc.did.idl';
|
|
6
|
+
import * as CyclesLedgerIdl from './cycles-ledger/cycles-ledger.did.idl';
|
|
6
7
|
import * as IcManagementIdl from './ic-management/ic-management.did.idl';
|
|
7
8
|
import * as IcpIndexIdl from './ledger-icp/index.did.idl';
|
|
8
9
|
import * as IcpLedgerIdl from './ledger-icp/ledger.did.idl';
|
|
@@ -13,4 +14,4 @@ import * as NnsSnsWasmIdl from './nns/sns_wasm.did.idl';
|
|
|
13
14
|
import * as SnsGovernanceIdl from './sns/governance.did.idl';
|
|
14
15
|
import * as SnsRootIdl from './sns/root.did.idl';
|
|
15
16
|
import * as SnsSwapIdl from './sns/swap.did.idl';
|
|
16
|
-
export { CkBTCBitcoinIdl, CkBTCMinterIdl, CkETHMinterIdl, CkETHOrchestratorIdl, CmcIdl, IcManagementIdl, IcpIndexIdl, IcpLedgerIdl, IcrcIndexIdl, IcrcLedgerIdl, NnsGovernanceIdl, NnsSnsWasmIdl, SnsGovernanceIdl, SnsRootIdl, SnsSwapIdl };
|
|
17
|
+
export { CkBTCBitcoinIdl, CkBTCMinterIdl, CkETHMinterIdl, CkETHOrchestratorIdl, CmcIdl, CyclesLedgerIdl, IcManagementIdl, IcpIndexIdl, IcpLedgerIdl, IcrcIndexIdl, IcrcLedgerIdl, NnsGovernanceIdl, NnsSnsWasmIdl, SnsGovernanceIdl, SnsRootIdl, SnsSwapIdl };
|
|
@@ -3,6 +3,7 @@ import type * as CkBTCMinterDid from './ckbtc/minter.did';
|
|
|
3
3
|
import type * as CkETHMinterDid from './cketh/minter.did';
|
|
4
4
|
import type * as CkETHOrchestratorDid from './cketh/orchestrator.did';
|
|
5
5
|
import type * as CmcDid from './cmc/cmc.did';
|
|
6
|
+
import type * as CyclesLedgerDid from './cycles-ledger/cycles-ledger.did';
|
|
6
7
|
import type * as IcManagementDid from './ic-management/ic-management.did';
|
|
7
8
|
import type * as IcpIndexDid from './ledger-icp/index.did';
|
|
8
9
|
import type * as IcpLedgerDid from './ledger-icp/ledger.did';
|
|
@@ -13,4 +14,4 @@ import type * as NnsSnsWasmDid from './nns/sns_wasm.did';
|
|
|
13
14
|
import type * as SnsGovernanceDid from './sns/governance.did';
|
|
14
15
|
import type * as SnsRootDid from './sns/root.did';
|
|
15
16
|
import type * as SnsSwapDid from './sns/swap.did';
|
|
16
|
-
export type { CkBTCBitcoinDid, CkBTCMinterDid, CkETHMinterDid, CkETHOrchestratorDid, CmcDid, IcManagementDid, IcpIndexDid, IcpLedgerDid, IcrcIndexDid, IcrcLedgerDid, NnsGovernanceDid, NnsSnsWasmDid, SnsGovernanceDid, SnsRootDid, SnsSwapDid };
|
|
17
|
+
export type { CkBTCBitcoinDid, CkBTCMinterDid, CkETHMinterDid, CkETHOrchestratorDid, CmcDid, CyclesLedgerDid, IcManagementDid, IcpIndexDid, IcpLedgerDid, IcrcIndexDid, IcrcLedgerDid, NnsGovernanceDid, NnsSnsWasmDid, SnsGovernanceDid, SnsRootDid, SnsSwapDid };
|
|
@@ -14,6 +14,13 @@ export type address = string;
|
|
|
14
14
|
export type block_hash = Uint8Array;
|
|
15
15
|
export type block_header = Uint8Array;
|
|
16
16
|
export type block_height = number;
|
|
17
|
+
export interface blockchain_info {
|
|
18
|
+
'height' : block_height,
|
|
19
|
+
'block_hash' : block_hash,
|
|
20
|
+
'difficulty' : bigint,
|
|
21
|
+
'timestamp' : number,
|
|
22
|
+
'utxos_length' : bigint,
|
|
23
|
+
}
|
|
17
24
|
export type canister_arg = { 'init' : init_config } |
|
|
18
25
|
{ 'upgrade' : [] | [set_config_request] };
|
|
19
26
|
export interface config {
|
|
@@ -127,6 +134,7 @@ export interface _SERVICE {
|
|
|
127
134
|
[send_transaction_request],
|
|
128
135
|
undefined
|
|
129
136
|
>,
|
|
137
|
+
'get_blockchain_info' : ActorMethod<[], blockchain_info>,
|
|
130
138
|
'get_config' : ActorMethod<[], config>,
|
|
131
139
|
'set_config' : ActorMethod<[set_config_request], undefined>,
|
|
132
140
|
}
|
|
@@ -19,6 +19,7 @@ export const outpoint: IDL.RecordClass;
|
|
|
19
19
|
export const utxo: IDL.RecordClass;
|
|
20
20
|
export const get_utxos_response: IDL.RecordClass;
|
|
21
21
|
export const send_transaction_request: IDL.RecordClass;
|
|
22
|
+
export const blockchain_info: IDL.RecordClass;
|
|
22
23
|
export const config: IDL.RecordClass;
|
|
23
24
|
export const idlService: IDL.ServiceClass<string, {
|
|
24
25
|
bitcoin_get_balance: IDL.FuncClass<[IDL.RecordClass], [IDL.FixedNatClass]>;
|
|
@@ -28,6 +29,7 @@ export const idlService: IDL.ServiceClass<string, {
|
|
|
28
29
|
bitcoin_get_utxos: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
29
30
|
bitcoin_get_utxos_query: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
30
31
|
bitcoin_send_transaction: IDL.FuncClass<[IDL.RecordClass], []>;
|
|
32
|
+
get_blockchain_info: IDL.FuncClass<[], [IDL.RecordClass]>;
|
|
31
33
|
get_config: IDL.FuncClass<[], [IDL.RecordClass]>;
|
|
32
34
|
set_config: IDL.FuncClass<[IDL.RecordClass], []>;
|
|
33
35
|
}>;
|
|
@@ -40,6 +40,40 @@ export type BtcNetwork = {
|
|
|
40
40
|
*/
|
|
41
41
|
'Testnet' : null
|
|
42
42
|
};
|
|
43
|
+
export type BurnMemo = {
|
|
44
|
+
/**
|
|
45
|
+
* The minter consolidated UTXOs.
|
|
46
|
+
*/
|
|
47
|
+
'Consolidate' : {
|
|
48
|
+
/**
|
|
49
|
+
* The total value of the consolidated UTXOs.
|
|
50
|
+
*/
|
|
51
|
+
'value' : bigint,
|
|
52
|
+
/**
|
|
53
|
+
* The number of input UTXOs that were consolidated.
|
|
54
|
+
*/
|
|
55
|
+
'inputs' : bigint,
|
|
56
|
+
}
|
|
57
|
+
} |
|
|
58
|
+
{
|
|
59
|
+
/**
|
|
60
|
+
* The minter processed a retrieve_btc request.
|
|
61
|
+
*/
|
|
62
|
+
'Convert' : {
|
|
63
|
+
/**
|
|
64
|
+
* The status of the Bitcoin check.
|
|
65
|
+
*/
|
|
66
|
+
'status' : [] | [Status],
|
|
67
|
+
/**
|
|
68
|
+
* The destination of the retrieve BTC request.
|
|
69
|
+
*/
|
|
70
|
+
'address' : [] | [string],
|
|
71
|
+
/**
|
|
72
|
+
* The check fee for the burn.
|
|
73
|
+
*/
|
|
74
|
+
'kyt_fee' : [] | [bigint],
|
|
75
|
+
}
|
|
76
|
+
};
|
|
43
77
|
export interface CanisterStatusResponse {
|
|
44
78
|
'memory_metrics' : MemoryMetrics,
|
|
45
79
|
'status' : CanisterStatusType,
|
|
@@ -56,6 +90,48 @@ export interface CanisterStatusResponse {
|
|
|
56
90
|
export type CanisterStatusType = { 'stopped' : null } |
|
|
57
91
|
{ 'stopping' : null } |
|
|
58
92
|
{ 'running' : null };
|
|
93
|
+
export interface DecodeLedgerMemoArgs {
|
|
94
|
+
/**
|
|
95
|
+
* The encoded memo type
|
|
96
|
+
*/
|
|
97
|
+
'memo_type' : MemoType,
|
|
98
|
+
/**
|
|
99
|
+
* The encoded memo from a minter transaction on the ledger
|
|
100
|
+
*/
|
|
101
|
+
'encoded_memo' : Uint8Array,
|
|
102
|
+
}
|
|
103
|
+
export type DecodeLedgerMemoError = {
|
|
104
|
+
/**
|
|
105
|
+
* The provided memo could not be decoded.
|
|
106
|
+
*/
|
|
107
|
+
'InvalidMemo' : string
|
|
108
|
+
};
|
|
109
|
+
export type DecodeLedgerMemoResult = {
|
|
110
|
+
/**
|
|
111
|
+
* The decoded memo, if the minter was able to decode it. This field is `opt`, so that other memo types can be
|
|
112
|
+
* added in the future.
|
|
113
|
+
*/
|
|
114
|
+
'Ok' : [] | [DecodedMemo]
|
|
115
|
+
} |
|
|
116
|
+
{
|
|
117
|
+
/**
|
|
118
|
+
* An error in case the minter was not able to decode the provided memo. This field is `opt`, so that other error
|
|
119
|
+
* types can be added in the future.
|
|
120
|
+
*/
|
|
121
|
+
'Err' : [] | [DecodeLedgerMemoError]
|
|
122
|
+
};
|
|
123
|
+
export type DecodedMemo = {
|
|
124
|
+
/**
|
|
125
|
+
* The decoded BurnMemo - `opt` since other variants of `BurnMemo` could be added in the future.
|
|
126
|
+
*/
|
|
127
|
+
'Burn' : [] | [BurnMemo]
|
|
128
|
+
} |
|
|
129
|
+
{
|
|
130
|
+
/**
|
|
131
|
+
* The decoded MintMemo - `opt` since other variants of `MintMemo` could be added in the future.
|
|
132
|
+
*/
|
|
133
|
+
'Mint' : [] | [MintMemo]
|
|
134
|
+
};
|
|
59
135
|
export interface DefiniteCanisterSettings {
|
|
60
136
|
'freezing_threshold' : bigint,
|
|
61
137
|
'wasm_memory_threshold' : bigint,
|
|
@@ -88,6 +164,7 @@ export type EventType = {
|
|
|
88
164
|
'fee' : [] | [bigint],
|
|
89
165
|
'change_output' : [] | [{ 'value' : bigint, 'vout' : number }],
|
|
90
166
|
'txid' : Uint8Array,
|
|
167
|
+
'signed_tx' : [] | [Uint8Array],
|
|
91
168
|
'withdrawal_fee' : [] | [WithdrawalFee],
|
|
92
169
|
'utxos' : Array<Utxo>,
|
|
93
170
|
'requests' : BigUint64Array,
|
|
@@ -164,6 +241,14 @@ export type EventType = {
|
|
|
164
241
|
{ 'checked_utxo_v2' : { 'utxo' : Utxo, 'account' : Account } } |
|
|
165
242
|
{ 'ignored_utxo' : { 'utxo' : Utxo } } |
|
|
166
243
|
{ 'checked_utxo_mint_unknown' : { 'utxo' : Utxo, 'account' : Account } } |
|
|
244
|
+
{
|
|
245
|
+
'created_consolidate_utxos_request' : {
|
|
246
|
+
'received_at' : bigint,
|
|
247
|
+
'block_index' : bigint,
|
|
248
|
+
'address' : BitcoinAddress,
|
|
249
|
+
'amount' : bigint,
|
|
250
|
+
}
|
|
251
|
+
} |
|
|
167
252
|
{
|
|
168
253
|
'reimbursed_failed_deposit' : {
|
|
169
254
|
'burn_block_index' : bigint,
|
|
@@ -201,6 +286,11 @@ export interface InitArgs {
|
|
|
201
286
|
* The minimal amount of ckBTC that can be converted to BTC.
|
|
202
287
|
*/
|
|
203
288
|
'retrieve_btc_min_amount' : bigint,
|
|
289
|
+
/**
|
|
290
|
+
* The minimal amount of BTC that can be converted to ckBTC.
|
|
291
|
+
* UTXOs with lower values will be ignored.
|
|
292
|
+
*/
|
|
293
|
+
'deposit_btc_min_amount' : [] | [bigint],
|
|
204
294
|
/**
|
|
205
295
|
* The principal of the ledger that handles ckBTC transfers.
|
|
206
296
|
* The default account of the ckBTC minter must be configured as
|
|
@@ -220,6 +310,14 @@ export interface InitArgs {
|
|
|
220
310
|
* / The fee paid per Bitcoin check.
|
|
221
311
|
*/
|
|
222
312
|
'check_fee' : [] | [bigint],
|
|
313
|
+
/**
|
|
314
|
+
* / The maximum number of input UTXOs allowed in a transaction.
|
|
315
|
+
*/
|
|
316
|
+
'max_num_inputs_in_transaction' : [] | [bigint],
|
|
317
|
+
/**
|
|
318
|
+
* / The minimum number of available UTXOs to trigger a consolidation.
|
|
319
|
+
*/
|
|
320
|
+
'utxo_consolidation_threshold' : [] | [bigint],
|
|
223
321
|
/**
|
|
224
322
|
* / The canister id of the Bitcoin checker canister.
|
|
225
323
|
*/
|
|
@@ -240,6 +338,8 @@ export type InvalidTransactionError = {
|
|
|
240
338
|
export type LogVisibility = { 'controllers' : null } |
|
|
241
339
|
{ 'public' : null } |
|
|
242
340
|
{ 'allowed_viewers' : Array<Principal> };
|
|
341
|
+
export type MemoType = { 'Burn' : null } |
|
|
342
|
+
{ 'Mint' : null };
|
|
243
343
|
export interface MemoryMetrics {
|
|
244
344
|
'wasm_binary_size' : bigint,
|
|
245
345
|
'wasm_chunk_store_size' : bigint,
|
|
@@ -250,6 +350,57 @@ export interface MemoryMetrics {
|
|
|
250
350
|
'global_memory_size' : bigint,
|
|
251
351
|
'custom_sections_size' : bigint,
|
|
252
352
|
}
|
|
353
|
+
export type MintMemo = {
|
|
354
|
+
/**
|
|
355
|
+
* [deprecated] The minter minted accumulated check fees to the KYT provider.
|
|
356
|
+
*/
|
|
357
|
+
'Kyt' : null
|
|
358
|
+
} |
|
|
359
|
+
{
|
|
360
|
+
'ReimburseWithdrawal' : {
|
|
361
|
+
/**
|
|
362
|
+
* The id corresponding to the withdrawal request,
|
|
363
|
+
* which corresponds to the ledger burn index.
|
|
364
|
+
*/
|
|
365
|
+
'withdrawal_id' : bigint,
|
|
366
|
+
}
|
|
367
|
+
} |
|
|
368
|
+
{
|
|
369
|
+
/**
|
|
370
|
+
* [deprecated] The minter failed to check retrieve btc destination address
|
|
371
|
+
* or the destination address is tainted.
|
|
372
|
+
*/
|
|
373
|
+
'KytFail' : {
|
|
374
|
+
/**
|
|
375
|
+
* The status of the Bitcoin check.
|
|
376
|
+
*/
|
|
377
|
+
'status' : [] | [Status],
|
|
378
|
+
'associated_burn_index' : [] | [bigint],
|
|
379
|
+
/**
|
|
380
|
+
* The Bitcoin check fee.
|
|
381
|
+
*/
|
|
382
|
+
'kyt_fee' : [] | [bigint],
|
|
383
|
+
}
|
|
384
|
+
} |
|
|
385
|
+
{
|
|
386
|
+
/**
|
|
387
|
+
* The minter converted a single UTXO to ckBTC.
|
|
388
|
+
*/
|
|
389
|
+
'Convert' : {
|
|
390
|
+
/**
|
|
391
|
+
* The transaction ID of the accepted UTXO.
|
|
392
|
+
*/
|
|
393
|
+
'txid' : [] | [Uint8Array],
|
|
394
|
+
/**
|
|
395
|
+
* UTXO's output index within the BTC transaction.
|
|
396
|
+
*/
|
|
397
|
+
'vout' : [] | [number],
|
|
398
|
+
/**
|
|
399
|
+
* The Bitcoin check fee.
|
|
400
|
+
*/
|
|
401
|
+
'kyt_fee' : [] | [bigint],
|
|
402
|
+
}
|
|
403
|
+
};
|
|
253
404
|
export type MinterArg = { 'Upgrade' : [] | [UpgradeArgs] } |
|
|
254
405
|
{ 'Init' : InitArgs };
|
|
255
406
|
export interface MinterInfo {
|
|
@@ -258,6 +409,11 @@ export interface MinterInfo {
|
|
|
258
409
|
* initialization or upgrades, but may vary according to current network fees.
|
|
259
410
|
*/
|
|
260
411
|
'retrieve_btc_min_amount' : bigint,
|
|
412
|
+
/**
|
|
413
|
+
* Minimal amount of BTC that can be deposited to be converted into ckBTC.
|
|
414
|
+
* UTXOs with lower values will be ignored.
|
|
415
|
+
*/
|
|
416
|
+
'deposit_btc_min_amount' : [] | [bigint],
|
|
261
417
|
'min_confirmations' : number,
|
|
262
418
|
/**
|
|
263
419
|
* The same as `check_fee`, but the old name is kept here to be backward compatible.
|
|
@@ -546,6 +702,19 @@ export type RetrieveBtcWithApprovalError = {
|
|
|
546
702
|
*/
|
|
547
703
|
'InsufficientFunds' : { 'balance' : bigint }
|
|
548
704
|
};
|
|
705
|
+
export type Status = { 'CallFailed' : null } |
|
|
706
|
+
{
|
|
707
|
+
/**
|
|
708
|
+
* The minter rejected a retrieve_btc due to a failed Bitcoin check.
|
|
709
|
+
*/
|
|
710
|
+
'Rejected' : null
|
|
711
|
+
} |
|
|
712
|
+
{
|
|
713
|
+
/**
|
|
714
|
+
* The minter accepted a retrieve_btc request.
|
|
715
|
+
*/
|
|
716
|
+
'Accepted' : null
|
|
717
|
+
};
|
|
549
718
|
export type SuspendedReason = {
|
|
550
719
|
/**
|
|
551
720
|
* The minter ignored this UTXO because UTXO's value is too small to pay
|
|
@@ -618,6 +787,11 @@ export interface UpgradeArgs {
|
|
|
618
787
|
* The minimal amount of ckBTC that the minter converts to BTC.
|
|
619
788
|
*/
|
|
620
789
|
'retrieve_btc_min_amount' : [] | [bigint],
|
|
790
|
+
/**
|
|
791
|
+
* The minimal amount of BTC that can be converted to ckBTC.
|
|
792
|
+
* UTXOs with lower values will be ignored.
|
|
793
|
+
*/
|
|
794
|
+
'deposit_btc_min_amount' : [] | [bigint],
|
|
621
795
|
/**
|
|
622
796
|
* / Maximum time in nanoseconds that a transaction should spend in the queue
|
|
623
797
|
* / before being sent.
|
|
@@ -627,6 +801,14 @@ export interface UpgradeArgs {
|
|
|
627
801
|
* / The fee per Bitcoin check.
|
|
628
802
|
*/
|
|
629
803
|
'check_fee' : [] | [bigint],
|
|
804
|
+
/**
|
|
805
|
+
* / The maximum number of input UTXOs allowed in a transaction.
|
|
806
|
+
*/
|
|
807
|
+
'max_num_inputs_in_transaction' : [] | [bigint],
|
|
808
|
+
/**
|
|
809
|
+
* / The minimum number of available UTXOs to trigger a consolidation.
|
|
810
|
+
*/
|
|
811
|
+
'utxo_consolidation_threshold' : [] | [bigint],
|
|
630
812
|
/**
|
|
631
813
|
* / The principal of the Bitcoin checker canister.
|
|
632
814
|
*/
|
|
@@ -686,6 +868,14 @@ export type WithdrawalReimbursementReason = {
|
|
|
686
868
|
};
|
|
687
869
|
export interface environment_variable { 'value' : string, 'name' : string }
|
|
688
870
|
export interface _SERVICE {
|
|
871
|
+
/**
|
|
872
|
+
* Section "Transaction Information" {{{
|
|
873
|
+
* Returns information related to minter transactions.
|
|
874
|
+
*/
|
|
875
|
+
'decode_ledger_memo' : ActorMethod<
|
|
876
|
+
[DecodeLedgerMemoArgs],
|
|
877
|
+
DecodeLedgerMemoResult
|
|
878
|
+
>,
|
|
689
879
|
/**
|
|
690
880
|
* / Returns an estimate of the user's fee (in Satoshi) for a
|
|
691
881
|
* / retrieve_btc request based on the current status of the Bitcoin network.
|
|
@@ -3,6 +3,14 @@ export const UpgradeArgs: IDL.RecordClass;
|
|
|
3
3
|
export const BtcNetwork: IDL.VariantClass;
|
|
4
4
|
export const InitArgs: IDL.RecordClass;
|
|
5
5
|
export const MinterArg: IDL.VariantClass;
|
|
6
|
+
export const MemoType: IDL.VariantClass;
|
|
7
|
+
export const DecodeLedgerMemoArgs: IDL.RecordClass;
|
|
8
|
+
export const Status: IDL.VariantClass;
|
|
9
|
+
export const BurnMemo: IDL.VariantClass;
|
|
10
|
+
export const MintMemo: IDL.VariantClass;
|
|
11
|
+
export const DecodedMemo: IDL.VariantClass;
|
|
12
|
+
export const DecodeLedgerMemoError: IDL.VariantClass;
|
|
13
|
+
export const DecodeLedgerMemoResult: IDL.VariantClass;
|
|
6
14
|
export const MemoryMetrics: IDL.RecordClass;
|
|
7
15
|
export const CanisterStatusType: IDL.VariantClass;
|
|
8
16
|
export const environment_variable: IDL.RecordClass;
|
|
@@ -37,6 +45,7 @@ export const SuspendedUtxo: IDL.RecordClass;
|
|
|
37
45
|
export const PendingUtxo: IDL.RecordClass;
|
|
38
46
|
export const UpdateBalanceError: IDL.VariantClass;
|
|
39
47
|
export const idlService: IDL.ServiceClass<string, {
|
|
48
|
+
decode_ledger_memo: IDL.FuncClass<[IDL.RecordClass], [IDL.VariantClass]>;
|
|
40
49
|
estimate_withdrawal_fee: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
|
|
41
50
|
get_btc_address: IDL.FuncClass<[IDL.RecordClass], [IDL.TextClass]>;
|
|
42
51
|
get_canister_status: IDL.FuncClass<[], [IDL.RecordClass]>;
|