@junobuild/functions 0.4.1 → 0.5.0

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.
Files changed (137) hide show
  1. package/canisters/_canister.d.ts +17 -0
  2. package/canisters/_constants.d.ts +3 -0
  3. package/canisters/ckbtc/index.d.ts +1 -0
  4. package/canisters/ckbtc/index.js +2 -0
  5. package/canisters/cketh/index.d.ts +1 -0
  6. package/canisters/cketh/index.js +2 -0
  7. package/canisters/cketh/index.js.map +7 -0
  8. package/canisters/cmc/cmc.canister.d.ts +28 -0
  9. package/canisters/cmc/index.d.ts +2 -0
  10. package/canisters/cmc/index.js +2 -0
  11. package/canisters/cmc/index.js.map +7 -0
  12. package/canisters/declarations/_idl.d.ts +16 -0
  13. package/canisters/declarations/_types.d.ts +16 -0
  14. package/canisters/declarations/ckbtc/bitcoin.did.d.ts +134 -0
  15. package/canisters/declarations/ckbtc/bitcoin.did.idl.d.ts +40 -0
  16. package/canisters/declarations/ckbtc/minter.did.d.ts +831 -0
  17. package/canisters/declarations/ckbtc/minter.did.idl.d.ts +61 -0
  18. package/canisters/declarations/cketh/minter.did.d.ts +893 -0
  19. package/canisters/declarations/cketh/minter.did.idl.d.ts +58 -0
  20. package/canisters/declarations/cketh/orchestrator.did.d.ts +302 -0
  21. package/canisters/declarations/cketh/orchestrator.did.idl.d.ts +34 -0
  22. package/canisters/declarations/cmc/cmc.did.d.ts +344 -0
  23. package/canisters/declarations/cmc/cmc.did.idl.d.ts +53 -0
  24. package/canisters/declarations/ic-management/ic-management.did.d.ts +583 -0
  25. package/canisters/declarations/ic-management/ic-management.did.idl.d.ts +147 -0
  26. package/canisters/declarations/index.d.ts +2 -0
  27. package/canisters/declarations/ledger-icp/index.did.d.ts +119 -0
  28. package/canisters/declarations/ledger-icp/index.did.idl.d.ts +35 -0
  29. package/canisters/declarations/ledger-icp/ledger.did.d.ts +606 -0
  30. package/canisters/declarations/ledger-icp/ledger.did.idl.d.ts +106 -0
  31. package/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +148 -0
  32. package/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.d.ts +44 -0
  33. package/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +102 -0
  34. package/canisters/declarations/ledger-icrc/icrc_index.did.idl.d.ts +28 -0
  35. package/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +579 -0
  36. package/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.d.ts +100 -0
  37. package/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.d.ts +81 -0
  38. package/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.idl.d.ts +39 -0
  39. package/canisters/declarations/nns/genesis_token.did.d.ts +49 -0
  40. package/canisters/declarations/nns/genesis_token.did.idl.d.ts +24 -0
  41. package/canisters/declarations/nns/governance.did.d.ts +1254 -0
  42. package/canisters/declarations/nns/governance.did.idl.d.ts +217 -0
  43. package/canisters/declarations/nns/governance_test.did.d.ts +1258 -0
  44. package/canisters/declarations/nns/governance_test.did.idl.d.ts +218 -0
  45. package/canisters/declarations/nns/sns_wasm.did.d.ts +286 -0
  46. package/canisters/declarations/nns/sns_wasm.did.idl.d.ts +80 -0
  47. package/canisters/declarations/sns/sns_governance.did.d.ts +834 -0
  48. package/canisters/declarations/sns/sns_governance.did.idl.d.ts +189 -0
  49. package/canisters/declarations/sns/sns_governance_test.did.d.ts +861 -0
  50. package/canisters/declarations/sns/sns_governance_test.did.idl.d.ts +199 -0
  51. package/canisters/declarations/sns/sns_root.did.d.ts +204 -0
  52. package/canisters/declarations/sns/sns_root.did.idl.d.ts +53 -0
  53. package/canisters/declarations/sns/sns_swap.did.d.ts +411 -0
  54. package/canisters/declarations/sns/sns_swap.did.idl.d.ts +108 -0
  55. package/canisters/ic-management/index.d.ts +1 -0
  56. package/canisters/ic-management/index.js +2 -0
  57. package/canisters/ic-management/index.js.map +7 -0
  58. package/canisters/index.d.ts +1 -0
  59. package/canisters/index.js +2 -0
  60. package/canisters/index.js.map +7 -0
  61. package/canisters/ledger/icp/index.d.ts +2 -0
  62. package/canisters/ledger/icp/index.js +2 -0
  63. package/canisters/ledger/icp/index.js.map +7 -0
  64. package/canisters/ledger/icp/ledger.canister.d.ts +24 -0
  65. package/canisters/ledger/icrc/index.d.ts +3 -0
  66. package/canisters/ledger/icrc/index.js +2 -0
  67. package/canisters/ledger/icrc/index.js.map +7 -0
  68. package/canisters/ledger/icrc/ledger.canister.d.ts +45 -0
  69. package/canisters/ledger/icrc/schemas.d.ts +11 -0
  70. package/canisters/nns/index.d.ts +1 -0
  71. package/canisters/nns/index.js +2 -0
  72. package/canisters/nns/index.js.map +7 -0
  73. package/canisters/schemas.d.ts +11 -0
  74. package/canisters/sns/index.d.ts +1 -0
  75. package/canisters/sns/index.js +2 -0
  76. package/canisters/sns/index.js.map +7 -0
  77. package/chunk-4C666HHU.js +2 -0
  78. package/chunk-4C666HHU.js.map +7 -0
  79. package/chunk-5NZMOUKF.js +2 -0
  80. package/chunk-5NZMOUKF.js.map +7 -0
  81. package/chunk-BXZ5PSUW.js +2 -0
  82. package/chunk-BXZ5PSUW.js.map +7 -0
  83. package/chunk-EMQQE34V.js +2 -0
  84. package/chunk-EMQQE34V.js.map +7 -0
  85. package/chunk-HANEPD6T.js +2 -0
  86. package/chunk-HANEPD6T.js.map +7 -0
  87. package/chunk-TZVF5LQY.js +2 -0
  88. package/chunk-TZVF5LQY.js.map +7 -0
  89. package/ic-cdk.js +1 -1
  90. package/ic-cdk.js.map +4 -4
  91. package/index.js +1 -1
  92. package/index.js.map +1 -1
  93. package/package.json +39 -2
  94. package/sdk.js +1 -1
  95. package/sdk.js.map +1 -1
  96. package/src/canisters/declarations/ckbtc/bitcoin.did.d.ts +134 -0
  97. package/src/canisters/declarations/ckbtc/bitcoin.did.idl.js +302 -0
  98. package/src/canisters/declarations/ckbtc/minter.did.d.ts +831 -0
  99. package/src/canisters/declarations/ckbtc/minter.did.idl.js +893 -0
  100. package/src/canisters/declarations/cketh/minter.did.d.ts +893 -0
  101. package/src/canisters/declarations/cketh/minter.did.idl.js +878 -0
  102. package/src/canisters/declarations/cketh/orchestrator.did.d.ts +302 -0
  103. package/src/canisters/declarations/cketh/orchestrator.did.idl.js +343 -0
  104. package/src/canisters/declarations/cmc/cmc.did.d.ts +344 -0
  105. package/src/canisters/declarations/cmc/cmc.did.idl.js +338 -0
  106. package/src/canisters/declarations/ic-management/ic-management.did.d.ts +583 -0
  107. package/src/canisters/declarations/ic-management/ic-management.did.idl.js +1150 -0
  108. package/src/canisters/declarations/ledger-icp/index.did.d.ts +119 -0
  109. package/src/canisters/declarations/ledger-icp/index.did.idl.js +225 -0
  110. package/src/canisters/declarations/ledger-icp/ledger.did.d.ts +606 -0
  111. package/src/canisters/declarations/ledger-icp/ledger.did.idl.js +813 -0
  112. package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +148 -0
  113. package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.js +274 -0
  114. package/src/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +102 -0
  115. package/src/canisters/declarations/ledger-icrc/icrc_index.did.idl.js +171 -0
  116. package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +579 -0
  117. package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.js +923 -0
  118. package/src/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.d.ts +81 -0
  119. package/src/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.idl.js +163 -0
  120. package/src/canisters/declarations/nns/genesis_token.did.d.ts +49 -0
  121. package/src/canisters/declarations/nns/genesis_token.did.idl.js +84 -0
  122. package/src/canisters/declarations/nns/governance.did.d.ts +1254 -0
  123. package/src/canisters/declarations/nns/governance.did.idl.js +2756 -0
  124. package/src/canisters/declarations/nns/governance_test.did.d.ts +1258 -0
  125. package/src/canisters/declarations/nns/governance_test.did.idl.js +2758 -0
  126. package/src/canisters/declarations/nns/sns_wasm.did.d.ts +286 -0
  127. package/src/canisters/declarations/nns/sns_wasm.did.idl.js +589 -0
  128. package/src/canisters/declarations/sns/sns_governance.did.d.ts +834 -0
  129. package/src/canisters/declarations/sns/sns_governance.did.idl.js +2235 -0
  130. package/src/canisters/declarations/sns/sns_governance_test.did.d.ts +861 -0
  131. package/src/canisters/declarations/sns/sns_governance_test.did.idl.js +2283 -0
  132. package/src/canisters/declarations/sns/sns_root.did.d.ts +204 -0
  133. package/src/canisters/declarations/sns/sns_root.did.idl.js +433 -0
  134. package/src/canisters/declarations/sns/sns_swap.did.d.ts +411 -0
  135. package/src/canisters/declarations/sns/sns_swap.did.idl.js +858 -0
  136. package/global.d.js +0 -1
  137. /package/{global.d.js.map → canisters/ckbtc/index.js.map} +0 -0
@@ -0,0 +1,17 @@
1
+ import type { Principal } from '@icp-sdk/core/principal';
2
+ import * as z from 'zod';
3
+ /**
4
+ * @see CanisterParameters
5
+ */
6
+ export declare const CanisterParametersSchema: z.ZodObject<{
7
+ canisterId: z.ZodCustom<Principal, Principal>;
8
+ }, z.core.$strict>;
9
+ /**
10
+ * The parameters that define a canister.
11
+ */
12
+ export type CanisterParameters = z.infer<typeof CanisterParametersSchema>;
13
+ export declare abstract class Canister {
14
+ #private;
15
+ protected constructor({ canisterId }: CanisterParameters);
16
+ get canisterId(): Principal;
17
+ }
@@ -0,0 +1,3 @@
1
+ import { Principal } from '@icp-sdk/core/principal';
2
+ export declare const CMC_ID: Principal;
3
+ export declare const ICP_LEDGER_ID: Principal;
@@ -0,0 +1 @@
1
+ export { CkBTCBitcoinIdl, CkBTCMinterIdl, type CkBTCBitcoinDid, type CkBTCMinterDid } from '../declarations';
@@ -0,0 +1,2 @@
1
+ import{a as i,b as C}from"../../chunk-HANEPD6T.js";import"../../chunk-4C666HHU.js";export{i as CkBTCBitcoinIdl,C as CkBTCMinterIdl};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ export { CkETHMinterIdl, CkETHOrchestratorIdl, type CkETHMinterDid, type CkETHOrchestratorDid } from '../declarations';
@@ -0,0 +1,2 @@
1
+ import{c as r,d as t}from"../../chunk-HANEPD6T.js";import"../../chunk-4C666HHU.js";export{r as CkETHMinterIdl,t as CkETHOrchestratorIdl};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ import { Canister } from '../_canister';
2
+ import { type CmcDid } from '../declarations';
3
+ import { type CanisterOptions } from '../schemas';
4
+ /**
5
+ * Provides a simple interface to interact with the Cycle Minting Canister,
6
+ * when developing Juno Serverless Functions in TypeScript.
7
+ *
8
+ * @param {CanisterOptions} [options] - Optional custom canister ID.
9
+ */
10
+ export declare class CMCCanister extends Canister {
11
+ constructor(options?: CanisterOptions);
12
+ /**
13
+ * Notifies the Cycle Minting Canister (CMC) that a top-up transfer has been completed.
14
+ *
15
+ * After sending ICP to the CMC top-up account for a canister, the transfer is recorded
16
+ * on the ledger. The CMC does not automatically convert that ICP into cycles — you
17
+ * must call this function to let the CMC know which transaction to process.
18
+ *
19
+ * The CMC will then convert the ICP from the given ledger block into cycles and add
20
+ * them to the specified canister.
21
+ *
22
+ * @param {CmcDid.NotifyTopUpArg} args - Arguments containing the ledger block index and the canister ID that should receive the cycles.
23
+ * @returns {Promise<CmcDid.NotifyTopUpResult>} The result of the CMC conversion and deposit.
24
+ */
25
+ notifyTopUp: ({ args }: {
26
+ args: CmcDid.NotifyTopUpArg;
27
+ }) => Promise<CmcDid.NotifyTopUpResult>;
28
+ }
@@ -0,0 +1,2 @@
1
+ export { CmcIdl, type CmcDid } from '../declarations';
2
+ export { CMCCanister } from './cmc.canister';
@@ -0,0 +1,2 @@
1
+ import{a as s}from"../../chunk-BXZ5PSUW.js";import{a as e}from"../../chunk-5NZMOUKF.js";import{g as i}from"../../chunk-EMQQE34V.js";import{a as p}from"../../chunk-TZVF5LQY.js";import"../../chunk-7B6WU32N.js";import{e as o}from"../../chunk-HANEPD6T.js";import"../../chunk-4C666HHU.js";var r=class extends e{constructor(t={}){p.parse(t),super({canisterId:t?.canisterId??s})}notifyTopUp=async({args:t})=>await i({canisterId:this.canisterId,method:"notify_top_up",args:[[o.NotifyTopUpArg,t]],result:o.NotifyTopUpResult})};export{r as CMCCanister,o as CmcIdl};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
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 {type CmcDid, CmcIdl} from '../declarations';\nimport {type CanisterOptions, CanisterOptionsSchema} from '../schemas';\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 {CmcDid.NotifyTopUpArg} args - Arguments containing the ledger block index and the canister ID that should receive the cycles.\n * @returns {Promise<CmcDid.NotifyTopUpResult>} The result of the CMC conversion and deposit.\n */\n notifyTopUp = async ({args}: {args: CmcDid.NotifyTopUpArg}): Promise<CmcDid.NotifyTopUpResult> =>\n await call<CmcDid.NotifyTopUpResult>({\n canisterId: this.canisterId,\n method: 'notify_top_up',\n args: [[CmcIdl.NotifyTopUpArg, args]],\n result: CmcIdl.NotifyTopUpResult\n });\n}\n"],
5
+ "mappings": "4RAYO,IAAMA,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,IACxB,MAAMC,EAA+B,CACnC,WAAY,KAAK,WACjB,OAAQ,gBACR,KAAM,CAAC,CAACC,EAAO,eAAgBF,CAAI,CAAC,EACpC,OAAQE,EAAO,iBACjB,CAAC,CACL",
6
+ "names": ["CMCCanister", "Canister", "options", "CanisterOptionsSchema", "CMC_ID", "args", "call", "cmc_did_idl_exports"]
7
+ }
@@ -0,0 +1,16 @@
1
+ import * as CkBTCBitcoinIdl from './ckbtc/bitcoin.did.idl';
2
+ import * as CkBTCMinterIdl from './ckbtc/minter.did.idl';
3
+ import * as CkETHMinterIdl from './cketh/minter.did.idl';
4
+ import * as CkETHOrchestratorIdl from './cketh/orchestrator.did.idl';
5
+ import * as CmcIdl from './cmc/cmc.did.idl';
6
+ import * as IcManagementIdl from './ic-management/ic-management.did.idl';
7
+ import * as IcpIndexIdl from './ledger-icp/index.did.idl';
8
+ import * as IcpLedgerIdl from './ledger-icp/ledger.did.idl';
9
+ import * as IcrcIndexNgIdl from './ledger-icrc/icrc_index-ng.did.idl';
10
+ import * as IcrcLedgerIdl from './ledger-icrc/icrc_ledger.did.idl';
11
+ import * as NnsGovernanceIdl from './nns/governance.did.idl';
12
+ import * as NnsSnsWasmIdl from './nns/sns_wasm.did.idl';
13
+ import * as SnsGovernanceIdl from './sns/sns_governance.did.idl';
14
+ import * as SnsRootIdl from './sns/sns_root.did.idl';
15
+ import * as SnsSwapIdl from './sns/sns_swap.did.idl';
16
+ export { CkBTCBitcoinIdl, CkBTCMinterIdl, CkETHMinterIdl, CkETHOrchestratorIdl, CmcIdl, IcManagementIdl, IcpIndexIdl, IcpLedgerIdl, IcrcIndexNgIdl, IcrcLedgerIdl, NnsGovernanceIdl, NnsSnsWasmIdl, SnsGovernanceIdl, SnsRootIdl, SnsSwapIdl };
@@ -0,0 +1,16 @@
1
+ import type * as CkBTCBitcoinDid from './ckbtc/bitcoin.did';
2
+ import type * as CkBTCMinterDid from './ckbtc/minter.did';
3
+ import type * as CkETHMinterDid from './cketh/minter.did';
4
+ import type * as CkETHOrchestratorDid from './cketh/orchestrator.did';
5
+ import type * as CmcDid from './cmc/cmc.did';
6
+ import type * as IcManagementDid from './ic-management/ic-management.did';
7
+ import type * as IcpIndexDid from './ledger-icp/index.did';
8
+ import type * as IcpLedgerDid from './ledger-icp/ledger.did';
9
+ import type * as IcrcIndexNgDid from './ledger-icrc/icrc_index-ng.did';
10
+ import type * as IcrcLedgerDid from './ledger-icrc/icrc_ledger.did';
11
+ import type * as NnsGovernanceDid from './nns/governance.did';
12
+ import type * as NnsSnsWasmDid from './nns/sns_wasm.did';
13
+ import type * as SnsGovernanceDid from './sns/sns_governance.did';
14
+ import type * as SnsRootDid from './sns/sns_root.did';
15
+ import type * as SnsSwapDid from './sns/sns_swap.did';
16
+ export type { CkBTCBitcoinDid, CkBTCMinterDid, CkETHMinterDid, CkETHOrchestratorDid, CmcDid, IcManagementDid, IcpIndexDid, IcpLedgerDid, IcrcIndexNgDid, IcrcLedgerDid, NnsGovernanceDid, NnsSnsWasmDid, SnsGovernanceDid, SnsRootDid, SnsSwapDid };
@@ -0,0 +1,134 @@
1
+ /* eslint-disable */
2
+
3
+ // @ts-nocheck
4
+
5
+ // This file was automatically generated by @icp-sdk/bindgen@0.2.0.
6
+ // You should NOT make any changes in this file as it will be overwritten.
7
+ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
8
+
9
+ import type { ActorMethod } from '@icp-sdk/core/agent';
10
+ import type { IDL } from '@icp-sdk/core/candid';
11
+ import type { Principal } from '@icp-sdk/core/principal';
12
+
13
+ export type address = string;
14
+ export type block_hash = Uint8Array;
15
+ export type block_header = Uint8Array;
16
+ export type block_height = number;
17
+ export interface config {
18
+ 'api_access' : flag,
19
+ 'lazily_evaluate_fee_percentiles' : flag,
20
+ 'blocks_source' : Principal,
21
+ 'fees' : fees,
22
+ 'watchdog_canister' : [] | [Principal],
23
+ 'network' : network,
24
+ 'stability_threshold' : bigint,
25
+ 'syncing' : flag,
26
+ 'burn_cycles' : flag,
27
+ 'disable_api_if_not_fully_synced' : flag,
28
+ }
29
+ export interface fees {
30
+ 'get_current_fee_percentiles' : bigint,
31
+ 'get_utxos_maximum' : bigint,
32
+ 'get_block_headers_cycles_per_ten_instructions' : bigint,
33
+ 'get_current_fee_percentiles_maximum' : bigint,
34
+ 'send_transaction_per_byte' : bigint,
35
+ 'get_balance' : bigint,
36
+ 'get_utxos_cycles_per_ten_instructions' : bigint,
37
+ 'get_block_headers_base' : bigint,
38
+ 'get_utxos_base' : bigint,
39
+ 'get_balance_maximum' : bigint,
40
+ 'send_transaction_base' : bigint,
41
+ 'get_block_headers_maximum' : bigint,
42
+ }
43
+ export type flag = { 'disabled' : null } |
44
+ { 'enabled' : null };
45
+ export interface get_balance_request {
46
+ 'network' : network,
47
+ 'address' : address,
48
+ 'min_confirmations' : [] | [number],
49
+ }
50
+ export interface get_block_headers_request {
51
+ 'start_height' : block_height,
52
+ 'end_height' : [] | [block_height],
53
+ 'network' : network,
54
+ }
55
+ export interface get_block_headers_response {
56
+ 'tip_height' : block_height,
57
+ 'block_headers' : Array<block_header>,
58
+ }
59
+ export interface get_current_fee_percentiles_request { 'network' : network }
60
+ export interface get_utxos_request {
61
+ 'network' : network,
62
+ 'filter' : [] | [{ 'page' : Uint8Array } | { 'min_confirmations' : number }],
63
+ 'address' : address,
64
+ }
65
+ export interface get_utxos_response {
66
+ 'next_page' : [] | [Uint8Array],
67
+ 'tip_height' : block_height,
68
+ 'tip_block_hash' : block_hash,
69
+ 'utxos' : Array<utxo>,
70
+ }
71
+ export interface init_config {
72
+ 'api_access' : [] | [flag],
73
+ 'lazily_evaluate_fee_percentiles' : [] | [flag],
74
+ 'blocks_source' : [] | [Principal],
75
+ 'fees' : [] | [fees],
76
+ 'watchdog_canister' : [] | [[] | [Principal]],
77
+ 'network' : [] | [network],
78
+ 'stability_threshold' : [] | [bigint],
79
+ 'syncing' : [] | [flag],
80
+ 'burn_cycles' : [] | [flag],
81
+ 'disable_api_if_not_fully_synced' : [] | [flag],
82
+ }
83
+ export type millisatoshi_per_byte = bigint;
84
+ export type network = { 'mainnet' : null } |
85
+ { 'regtest' : null } |
86
+ { 'testnet' : null };
87
+ export interface outpoint { 'txid' : Uint8Array, 'vout' : number }
88
+ export type satoshi = bigint;
89
+ export interface send_transaction_request {
90
+ 'transaction' : Uint8Array,
91
+ 'network' : network,
92
+ }
93
+ export interface set_config_request {
94
+ 'api_access' : [] | [flag],
95
+ 'lazily_evaluate_fee_percentiles' : [] | [flag],
96
+ 'fees' : [] | [fees],
97
+ 'watchdog_canister' : [] | [[] | [Principal]],
98
+ 'stability_threshold' : [] | [bigint],
99
+ 'syncing' : [] | [flag],
100
+ 'burn_cycles' : [] | [flag],
101
+ 'disable_api_if_not_fully_synced' : [] | [flag],
102
+ }
103
+ export interface utxo {
104
+ 'height' : block_height,
105
+ 'value' : satoshi,
106
+ 'outpoint' : outpoint,
107
+ }
108
+ export interface _SERVICE {
109
+ 'bitcoin_get_balance' : ActorMethod<[get_balance_request], satoshi>,
110
+ 'bitcoin_get_balance_query' : ActorMethod<[get_balance_request], satoshi>,
111
+ 'bitcoin_get_block_headers' : ActorMethod<
112
+ [get_block_headers_request],
113
+ get_block_headers_response
114
+ >,
115
+ 'bitcoin_get_current_fee_percentiles' : ActorMethod<
116
+ [get_current_fee_percentiles_request],
117
+ BigUint64Array
118
+ >,
119
+ 'bitcoin_get_utxos' : ActorMethod<[get_utxos_request], get_utxos_response>,
120
+ 'bitcoin_get_utxos_query' : ActorMethod<
121
+ [get_utxos_request],
122
+ get_utxos_response
123
+ >,
124
+ 'bitcoin_send_transaction' : ActorMethod<
125
+ [send_transaction_request],
126
+ undefined
127
+ >,
128
+ 'get_config' : ActorMethod<[], config>,
129
+ 'set_config' : ActorMethod<[set_config_request], undefined>,
130
+ }
131
+ export declare const idlService: IDL.ServiceClass;
132
+ export declare const idlInitArgs: IDL.Type[];
133
+ export declare const idlFactory: IDL.InterfaceFactory;
134
+ export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
@@ -0,0 +1,40 @@
1
+ export const flag: IDL.VariantClass;
2
+ export const fees: IDL.RecordClass;
3
+ export const network: IDL.VariantClass;
4
+ export const init_config: IDL.RecordClass;
5
+ export const address: IDL.TextClass;
6
+ export const get_balance_request: IDL.RecordClass;
7
+ export const satoshi: IDL.FixedNatClass;
8
+ export const block_height: IDL.FixedNatClass;
9
+ export const get_block_headers_request: IDL.RecordClass;
10
+ export const block_header: IDL.VecClass<number | bigint>;
11
+ export const get_block_headers_response: IDL.RecordClass;
12
+ export const get_current_fee_percentiles_request: IDL.RecordClass;
13
+ export const millisatoshi_per_byte: IDL.FixedNatClass;
14
+ export const get_utxos_request: IDL.RecordClass;
15
+ export const block_hash: IDL.VecClass<number | bigint>;
16
+ export const outpoint: IDL.RecordClass;
17
+ export const utxo: IDL.RecordClass;
18
+ export const get_utxos_response: IDL.RecordClass;
19
+ export const send_transaction_request: IDL.RecordClass;
20
+ export const config: IDL.RecordClass;
21
+ export const set_config_request: IDL.RecordClass;
22
+ export const idlService: IDL.ServiceClass<string, {
23
+ bitcoin_get_balance: IDL.FuncClass<[IDL.RecordClass], [IDL.FixedNatClass]>;
24
+ bitcoin_get_balance_query: IDL.FuncClass<[IDL.RecordClass], [IDL.FixedNatClass]>;
25
+ bitcoin_get_block_headers: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
26
+ bitcoin_get_current_fee_percentiles: IDL.FuncClass<[IDL.RecordClass], [IDL.VecClass<number | bigint>]>;
27
+ bitcoin_get_utxos: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
28
+ bitcoin_get_utxos_query: IDL.FuncClass<[IDL.RecordClass], [IDL.RecordClass]>;
29
+ bitcoin_send_transaction: IDL.FuncClass<[IDL.RecordClass], []>;
30
+ get_config: IDL.FuncClass<[], [IDL.RecordClass]>;
31
+ set_config: IDL.FuncClass<[IDL.RecordClass], []>;
32
+ }>;
33
+ export const idlInitArgs: IDL.RecordClass[];
34
+ export function idlFactory({ IDL }: {
35
+ IDL: any;
36
+ }): any;
37
+ export function init({ IDL }: {
38
+ IDL: any;
39
+ }): any[];
40
+ import { IDL } from '@icp-sdk/core/candid';