@dfinity/ckbtc 2.4.1 → 2.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.
- package/dist/candid/bitcoin.certified.idl.js +7 -0
- package/dist/candid/bitcoin.d.ts +4 -0
- package/dist/candid/bitcoin.did +5 -1
- package/dist/candid/bitcoin.idl.js +7 -0
- package/dist/candid/minter.did +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/index.cjs.js.map +3 -3
- package/dist/esm/bitcoin.canister.js +1 -1
- package/dist/esm/chunk-NEYHWXBO.js +2 -0
- package/dist/esm/chunk-NEYHWXBO.js.map +7 -0
- package/dist/esm/index.js +1 -1
- package/package.json +5 -5
- package/dist/esm/chunk-KL2UT2R6.js +0 -2
- package/dist/esm/chunk-KL2UT2R6.js.map +0 -7
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as a}from"./chunk-
|
|
1
|
+
import{b as a}from"./chunk-NEYHWXBO.js";import"./chunk-IS3C7V4B.js";export{a as BitcoinCanister};
|
|
2
2
|
//# sourceMappingURL=bitcoin.canister.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Canister as q,createServices as F}from"@dfinity/utils";var x=({IDL:t})=>{let e=t.Variant({disabled:t.Null,enabled:t.Null}),s=t.Record({get_current_fee_percentiles:t.Nat,get_utxos_maximum:t.Nat,get_block_headers_cycles_per_ten_instructions:t.Nat,get_current_fee_percentiles_maximum:t.Nat,send_transaction_per_byte:t.Nat,get_balance:t.Nat,get_utxos_cycles_per_ten_instructions:t.Nat,get_block_headers_base:t.Nat,get_utxos_base:t.Nat,get_balance_maximum:t.Nat,send_transaction_base:t.Nat,get_block_headers_maximum:t.Nat}),n=t.Variant({mainnet:t.Null,regtest:t.Null,testnet:t.Null}),o=t.Record({api_access:t.Opt(e),lazily_evaluate_fee_percentiles:t.Opt(e),blocks_source:t.Opt(t.Principal),fees:t.Opt(s),watchdog_canister:t.Opt(t.Opt(t.Principal)),network:t.Opt(n),stability_threshold:t.Opt(t.Nat),syncing:t.Opt(e),burn_cycles:t.Opt(e),disable_api_if_not_fully_synced:t.Opt(e)}),a=t.Text,i=t.Record({network:n,address:a,min_confirmations:t.Opt(t.Nat32)}),_=t.Nat64,c=t.Nat32,p=t.Record({start_height:c,end_height:t.Opt(c),network:n}),u=t.Vec(t.Nat8),d=t.Record({tip_height:c,block_headers:t.Vec(u)}),g=t.Record({network:n}),b=t.Nat64,r=t.Record({network:n,filter:t.Opt(t.Variant({page:t.Vec(t.Nat8),min_confirmations:t.Nat32})),address:a}),N=t.Vec(t.Nat8),m=t.Record({txid:t.Vec(t.Nat8),vout:t.Nat32}),f=t.Record({height:c,value:_,outpoint:m}),l=t.Record({next_page:t.Opt(t.Vec(t.Nat8)),tip_height:c,tip_block_hash:N,utxos:t.Vec(f)}),y=t.Record({transaction:t.Vec(t.Nat8),network:n}),h=t.Record({api_access:e,lazily_evaluate_fee_percentiles:e,blocks_source:t.Principal,fees:s,watchdog_canister:t.Opt(t.Principal),network:n,stability_threshold:t.Nat,syncing:e,burn_cycles:e,disable_api_if_not_fully_synced:e}),O=t.Record({api_access:t.Opt(e),lazily_evaluate_fee_percentiles:t.Opt(e),fees:t.Opt(s),watchdog_canister:t.Opt(t.Opt(t.Principal)),stability_threshold:t.Opt(t.Nat),syncing:t.Opt(e),burn_cycles:t.Opt(e),disable_api_if_not_fully_synced:t.Opt(e)});return t.Service({bitcoin_get_balance:t.Func([i],[_],[]),bitcoin_get_balance_query:t.Func([i],[_],[]),bitcoin_get_block_headers:t.Func([p],[d],[]),bitcoin_get_current_fee_percentiles:t.Func([g],[t.Vec(b)],[]),bitcoin_get_utxos:t.Func([r],[l],[]),bitcoin_get_utxos_query:t.Func([r],[l],[]),bitcoin_send_transaction:t.Func([y],[],[]),get_config:t.Func([],[h],[]),set_config:t.Func([O],[],[])})};var k=({IDL:t})=>{let e=t.Variant({disabled:t.Null,enabled:t.Null}),s=t.Record({get_current_fee_percentiles:t.Nat,get_utxos_maximum:t.Nat,get_block_headers_cycles_per_ten_instructions:t.Nat,get_current_fee_percentiles_maximum:t.Nat,send_transaction_per_byte:t.Nat,get_balance:t.Nat,get_utxos_cycles_per_ten_instructions:t.Nat,get_block_headers_base:t.Nat,get_utxos_base:t.Nat,get_balance_maximum:t.Nat,send_transaction_base:t.Nat,get_block_headers_maximum:t.Nat}),n=t.Variant({mainnet:t.Null,regtest:t.Null,testnet:t.Null}),o=t.Record({api_access:t.Opt(e),lazily_evaluate_fee_percentiles:t.Opt(e),blocks_source:t.Opt(t.Principal),fees:t.Opt(s),watchdog_canister:t.Opt(t.Opt(t.Principal)),network:t.Opt(n),stability_threshold:t.Opt(t.Nat),syncing:t.Opt(e),burn_cycles:t.Opt(e),disable_api_if_not_fully_synced:t.Opt(e)}),a=t.Text,i=t.Record({network:n,address:a,min_confirmations:t.Opt(t.Nat32)}),_=t.Nat64,c=t.Nat32,p=t.Record({start_height:c,end_height:t.Opt(c),network:n}),u=t.Vec(t.Nat8),d=t.Record({tip_height:c,block_headers:t.Vec(u)}),g=t.Record({network:n}),b=t.Nat64,r=t.Record({network:n,filter:t.Opt(t.Variant({page:t.Vec(t.Nat8),min_confirmations:t.Nat32})),address:a}),N=t.Vec(t.Nat8),m=t.Record({txid:t.Vec(t.Nat8),vout:t.Nat32}),f=t.Record({height:c,value:_,outpoint:m}),l=t.Record({next_page:t.Opt(t.Vec(t.Nat8)),tip_height:c,tip_block_hash:N,utxos:t.Vec(f)}),y=t.Record({transaction:t.Vec(t.Nat8),network:n}),h=t.Record({api_access:e,lazily_evaluate_fee_percentiles:e,blocks_source:t.Principal,fees:s,watchdog_canister:t.Opt(t.Principal),network:n,stability_threshold:t.Nat,syncing:e,burn_cycles:e,disable_api_if_not_fully_synced:e}),O=t.Record({api_access:t.Opt(e),lazily_evaluate_fee_percentiles:t.Opt(e),fees:t.Opt(s),watchdog_canister:t.Opt(t.Opt(t.Principal)),stability_threshold:t.Opt(t.Nat),syncing:t.Opt(e),burn_cycles:t.Opt(e),disable_api_if_not_fully_synced:t.Opt(e)});return t.Service({bitcoin_get_balance:t.Func([i],[_],[]),bitcoin_get_balance_query:t.Func([i],[_],["query"]),bitcoin_get_block_headers:t.Func([p],[d],[]),bitcoin_get_current_fee_percentiles:t.Func([g],[t.Vec(b)],[]),bitcoin_get_utxos:t.Func([r],[l],[]),bitcoin_get_utxos_query:t.Func([r],[l],["query"]),bitcoin_send_transaction:t.Func([y],[],[]),get_config:t.Func([],[h],["query"]),set_config:t.Func([O],[],[])})};import{toNullable as V}from"@dfinity/utils";var w=({network:t,filter:e,...s})=>({filter:V(e),network:t==="testnet"?{testnet:null}:{mainnet:null},...s});var R=class t extends q{constructor(){super(...arguments);this.getUtxos=({certified:s=!0,...n})=>{let{bitcoin_get_utxos:o,bitcoin_get_utxos_query:a}=this.caller({certified:s});return(s?o:a)(w(n))}}static create(s){let{service:n,certifiedService:o,canisterId:a}=F({options:s,idlFactory:k,certifiedIdlFactory:x});return new t(a,n,o)}};export{w as a,R as b};
|
|
2
|
+
//# sourceMappingURL=chunk-NEYHWXBO.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/bitcoin.canister.ts", "../../candid/bitcoin.certified.idl.js", "../../candid/bitcoin.idl.js", "../../src/types/bitcoin.params.ts"],
|
|
4
|
+
"sourcesContent": ["import { Canister, createServices } from \"@dfinity/utils\";\nimport type {\n _SERVICE as BitcoinService,\n get_utxos_response,\n} from \"../candid/bitcoin\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/bitcoin.certified.idl\";\nimport { idlFactory } from \"../candid/bitcoin.idl\";\nimport { toGetUtxosParams, type GetUtxosParams } from \"./types/bitcoin.params\";\nimport type { CkBTCCanisterOptions } from \"./types/canister.options\";\n\nexport class BitcoinCanister extends Canister<BitcoinService> {\n static create(options: CkBTCCanisterOptions<BitcoinService>) {\n const { service, certifiedService, canisterId } =\n createServices<BitcoinService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new BitcoinCanister(canisterId, service, certifiedService);\n }\n\n /**\n * Given a `get_utxos_request`, which must specify a Bitcoin address and a Bitcoin network (`mainnet` or `testnet`), the function returns all unspent transaction outputs (UTXOs) associated with the provided address in the specified Bitcoin network based on the current view of the Bitcoin blockchain available to the Bitcoin component.\n *\n * @link https://internetcomputer.org/docs/current/references/ic-interface-spec#ic-bitcoin_get_utxos\n *\n * @param {Object} params\n * @param {BitcoinNetwork} params.network Tesnet or mainnet.\n * @param {Object} params.filter The optional filter parameter can be used to restrict the set of returned UTXOs, either providing a minimum number of confirmations or a page reference when pagination is used for addresses with many UTXOs.\n * @param {string} params.address A Bitcoin address.\n * @param {boolean} params.certified query or update call\n * @returns {Promise<bitcoin_get_utxos_result>} The UTXOs are returned sorted by block height in descending order.\n */\n getUtxos = ({\n certified = true,\n ...params\n }: GetUtxosParams): Promise<get_utxos_response> => {\n const { bitcoin_get_utxos, bitcoin_get_utxos_query } = this.caller({\n certified,\n });\n const fn = certified ? bitcoin_get_utxos : bitcoin_get_utxos_query;\n return fn(toGetUtxosParams(params));\n };\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ckbtc/candid/bitcoin.did */\nexport const idlFactory = ({ IDL }) => {\n const flag = IDL.Variant({ 'disabled' : IDL.Null, 'enabled' : IDL.Null });\n const fees = IDL.Record({\n 'get_current_fee_percentiles' : IDL.Nat,\n 'get_utxos_maximum' : IDL.Nat,\n 'get_block_headers_cycles_per_ten_instructions' : IDL.Nat,\n 'get_current_fee_percentiles_maximum' : IDL.Nat,\n 'send_transaction_per_byte' : IDL.Nat,\n 'get_balance' : IDL.Nat,\n 'get_utxos_cycles_per_ten_instructions' : IDL.Nat,\n 'get_block_headers_base' : IDL.Nat,\n 'get_utxos_base' : IDL.Nat,\n 'get_balance_maximum' : IDL.Nat,\n 'send_transaction_base' : IDL.Nat,\n 'get_block_headers_maximum' : IDL.Nat,\n });\n const network = IDL.Variant({\n 'mainnet' : IDL.Null,\n 'regtest' : IDL.Null,\n 'testnet' : IDL.Null,\n });\n const init_config = IDL.Record({\n 'api_access' : IDL.Opt(flag),\n 'lazily_evaluate_fee_percentiles' : IDL.Opt(flag),\n 'blocks_source' : IDL.Opt(IDL.Principal),\n 'fees' : IDL.Opt(fees),\n 'watchdog_canister' : IDL.Opt(IDL.Opt(IDL.Principal)),\n 'network' : IDL.Opt(network),\n 'stability_threshold' : IDL.Opt(IDL.Nat),\n 'syncing' : IDL.Opt(flag),\n 'burn_cycles' : IDL.Opt(flag),\n 'disable_api_if_not_fully_synced' : IDL.Opt(flag),\n });\n const address = IDL.Text;\n const get_balance_request = IDL.Record({\n 'network' : network,\n 'address' : address,\n 'min_confirmations' : IDL.Opt(IDL.Nat32),\n });\n const satoshi = IDL.Nat64;\n const block_height = IDL.Nat32;\n const get_block_headers_request = IDL.Record({\n 'start_height' : block_height,\n 'end_height' : IDL.Opt(block_height),\n 'network' : network,\n });\n const block_header = IDL.Vec(IDL.Nat8);\n const get_block_headers_response = IDL.Record({\n 'tip_height' : block_height,\n 'block_headers' : IDL.Vec(block_header),\n });\n const get_current_fee_percentiles_request = IDL.Record({\n 'network' : network,\n });\n const millisatoshi_per_byte = IDL.Nat64;\n const get_utxos_request = IDL.Record({\n 'network' : network,\n 'filter' : IDL.Opt(\n IDL.Variant({\n 'page' : IDL.Vec(IDL.Nat8),\n 'min_confirmations' : IDL.Nat32,\n })\n ),\n 'address' : address,\n });\n const block_hash = IDL.Vec(IDL.Nat8);\n const outpoint = IDL.Record({\n 'txid' : IDL.Vec(IDL.Nat8),\n 'vout' : IDL.Nat32,\n });\n const utxo = IDL.Record({\n 'height' : block_height,\n 'value' : satoshi,\n 'outpoint' : outpoint,\n });\n const get_utxos_response = IDL.Record({\n 'next_page' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'tip_height' : block_height,\n 'tip_block_hash' : block_hash,\n 'utxos' : IDL.Vec(utxo),\n });\n const send_transaction_request = IDL.Record({\n 'transaction' : IDL.Vec(IDL.Nat8),\n 'network' : network,\n });\n const config = IDL.Record({\n 'api_access' : flag,\n 'lazily_evaluate_fee_percentiles' : flag,\n 'blocks_source' : IDL.Principal,\n 'fees' : fees,\n 'watchdog_canister' : IDL.Opt(IDL.Principal),\n 'network' : network,\n 'stability_threshold' : IDL.Nat,\n 'syncing' : flag,\n 'burn_cycles' : flag,\n 'disable_api_if_not_fully_synced' : flag,\n });\n const set_config_request = IDL.Record({\n 'api_access' : IDL.Opt(flag),\n 'lazily_evaluate_fee_percentiles' : IDL.Opt(flag),\n 'fees' : IDL.Opt(fees),\n 'watchdog_canister' : IDL.Opt(IDL.Opt(IDL.Principal)),\n 'stability_threshold' : IDL.Opt(IDL.Nat),\n 'syncing' : IDL.Opt(flag),\n 'burn_cycles' : IDL.Opt(flag),\n 'disable_api_if_not_fully_synced' : IDL.Opt(flag),\n });\n return IDL.Service({\n 'bitcoin_get_balance' : IDL.Func([get_balance_request], [satoshi], []),\n 'bitcoin_get_balance_query' : IDL.Func(\n [get_balance_request],\n [satoshi],\n [],\n ),\n 'bitcoin_get_block_headers' : IDL.Func(\n [get_block_headers_request],\n [get_block_headers_response],\n [],\n ),\n 'bitcoin_get_current_fee_percentiles' : IDL.Func(\n [get_current_fee_percentiles_request],\n [IDL.Vec(millisatoshi_per_byte)],\n [],\n ),\n 'bitcoin_get_utxos' : IDL.Func(\n [get_utxos_request],\n [get_utxos_response],\n [],\n ),\n 'bitcoin_get_utxos_query' : IDL.Func(\n [get_utxos_request],\n [get_utxos_response],\n [],\n ),\n 'bitcoin_send_transaction' : IDL.Func([send_transaction_request], [], []),\n 'get_config' : IDL.Func([], [config], []),\n 'set_config' : IDL.Func([set_config_request], [], []),\n });\n};\nexport const init = ({ IDL }) => {\n const flag = IDL.Variant({ 'disabled' : IDL.Null, 'enabled' : IDL.Null });\n const fees = IDL.Record({\n 'get_current_fee_percentiles' : IDL.Nat,\n 'get_utxos_maximum' : IDL.Nat,\n 'get_block_headers_cycles_per_ten_instructions' : IDL.Nat,\n 'get_current_fee_percentiles_maximum' : IDL.Nat,\n 'send_transaction_per_byte' : IDL.Nat,\n 'get_balance' : IDL.Nat,\n 'get_utxos_cycles_per_ten_instructions' : IDL.Nat,\n 'get_block_headers_base' : IDL.Nat,\n 'get_utxos_base' : IDL.Nat,\n 'get_balance_maximum' : IDL.Nat,\n 'send_transaction_base' : IDL.Nat,\n 'get_block_headers_maximum' : IDL.Nat,\n });\n const network = IDL.Variant({\n 'mainnet' : IDL.Null,\n 'regtest' : IDL.Null,\n 'testnet' : IDL.Null,\n });\n const init_config = IDL.Record({\n 'api_access' : IDL.Opt(flag),\n 'lazily_evaluate_fee_percentiles' : IDL.Opt(flag),\n 'blocks_source' : IDL.Opt(IDL.Principal),\n 'fees' : IDL.Opt(fees),\n 'watchdog_canister' : IDL.Opt(IDL.Opt(IDL.Principal)),\n 'network' : IDL.Opt(network),\n 'stability_threshold' : IDL.Opt(IDL.Nat),\n 'syncing' : IDL.Opt(flag),\n 'burn_cycles' : IDL.Opt(flag),\n 'disable_api_if_not_fully_synced' : IDL.Opt(flag),\n });\n return [init_config];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ckbtc/candid/bitcoin.did */\nexport const idlFactory = ({ IDL }) => {\n const flag = IDL.Variant({ 'disabled' : IDL.Null, 'enabled' : IDL.Null });\n const fees = IDL.Record({\n 'get_current_fee_percentiles' : IDL.Nat,\n 'get_utxos_maximum' : IDL.Nat,\n 'get_block_headers_cycles_per_ten_instructions' : IDL.Nat,\n 'get_current_fee_percentiles_maximum' : IDL.Nat,\n 'send_transaction_per_byte' : IDL.Nat,\n 'get_balance' : IDL.Nat,\n 'get_utxos_cycles_per_ten_instructions' : IDL.Nat,\n 'get_block_headers_base' : IDL.Nat,\n 'get_utxos_base' : IDL.Nat,\n 'get_balance_maximum' : IDL.Nat,\n 'send_transaction_base' : IDL.Nat,\n 'get_block_headers_maximum' : IDL.Nat,\n });\n const network = IDL.Variant({\n 'mainnet' : IDL.Null,\n 'regtest' : IDL.Null,\n 'testnet' : IDL.Null,\n });\n const init_config = IDL.Record({\n 'api_access' : IDL.Opt(flag),\n 'lazily_evaluate_fee_percentiles' : IDL.Opt(flag),\n 'blocks_source' : IDL.Opt(IDL.Principal),\n 'fees' : IDL.Opt(fees),\n 'watchdog_canister' : IDL.Opt(IDL.Opt(IDL.Principal)),\n 'network' : IDL.Opt(network),\n 'stability_threshold' : IDL.Opt(IDL.Nat),\n 'syncing' : IDL.Opt(flag),\n 'burn_cycles' : IDL.Opt(flag),\n 'disable_api_if_not_fully_synced' : IDL.Opt(flag),\n });\n const address = IDL.Text;\n const get_balance_request = IDL.Record({\n 'network' : network,\n 'address' : address,\n 'min_confirmations' : IDL.Opt(IDL.Nat32),\n });\n const satoshi = IDL.Nat64;\n const block_height = IDL.Nat32;\n const get_block_headers_request = IDL.Record({\n 'start_height' : block_height,\n 'end_height' : IDL.Opt(block_height),\n 'network' : network,\n });\n const block_header = IDL.Vec(IDL.Nat8);\n const get_block_headers_response = IDL.Record({\n 'tip_height' : block_height,\n 'block_headers' : IDL.Vec(block_header),\n });\n const get_current_fee_percentiles_request = IDL.Record({\n 'network' : network,\n });\n const millisatoshi_per_byte = IDL.Nat64;\n const get_utxos_request = IDL.Record({\n 'network' : network,\n 'filter' : IDL.Opt(\n IDL.Variant({\n 'page' : IDL.Vec(IDL.Nat8),\n 'min_confirmations' : IDL.Nat32,\n })\n ),\n 'address' : address,\n });\n const block_hash = IDL.Vec(IDL.Nat8);\n const outpoint = IDL.Record({\n 'txid' : IDL.Vec(IDL.Nat8),\n 'vout' : IDL.Nat32,\n });\n const utxo = IDL.Record({\n 'height' : block_height,\n 'value' : satoshi,\n 'outpoint' : outpoint,\n });\n const get_utxos_response = IDL.Record({\n 'next_page' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'tip_height' : block_height,\n 'tip_block_hash' : block_hash,\n 'utxos' : IDL.Vec(utxo),\n });\n const send_transaction_request = IDL.Record({\n 'transaction' : IDL.Vec(IDL.Nat8),\n 'network' : network,\n });\n const config = IDL.Record({\n 'api_access' : flag,\n 'lazily_evaluate_fee_percentiles' : flag,\n 'blocks_source' : IDL.Principal,\n 'fees' : fees,\n 'watchdog_canister' : IDL.Opt(IDL.Principal),\n 'network' : network,\n 'stability_threshold' : IDL.Nat,\n 'syncing' : flag,\n 'burn_cycles' : flag,\n 'disable_api_if_not_fully_synced' : flag,\n });\n const set_config_request = IDL.Record({\n 'api_access' : IDL.Opt(flag),\n 'lazily_evaluate_fee_percentiles' : IDL.Opt(flag),\n 'fees' : IDL.Opt(fees),\n 'watchdog_canister' : IDL.Opt(IDL.Opt(IDL.Principal)),\n 'stability_threshold' : IDL.Opt(IDL.Nat),\n 'syncing' : IDL.Opt(flag),\n 'burn_cycles' : IDL.Opt(flag),\n 'disable_api_if_not_fully_synced' : IDL.Opt(flag),\n });\n return IDL.Service({\n 'bitcoin_get_balance' : IDL.Func([get_balance_request], [satoshi], []),\n 'bitcoin_get_balance_query' : IDL.Func(\n [get_balance_request],\n [satoshi],\n ['query'],\n ),\n 'bitcoin_get_block_headers' : IDL.Func(\n [get_block_headers_request],\n [get_block_headers_response],\n [],\n ),\n 'bitcoin_get_current_fee_percentiles' : IDL.Func(\n [get_current_fee_percentiles_request],\n [IDL.Vec(millisatoshi_per_byte)],\n [],\n ),\n 'bitcoin_get_utxos' : IDL.Func(\n [get_utxos_request],\n [get_utxos_response],\n [],\n ),\n 'bitcoin_get_utxos_query' : IDL.Func(\n [get_utxos_request],\n [get_utxos_response],\n ['query'],\n ),\n 'bitcoin_send_transaction' : IDL.Func([send_transaction_request], [], []),\n 'get_config' : IDL.Func([], [config], ['query']),\n 'set_config' : IDL.Func([set_config_request], [], []),\n });\n};\nexport const init = ({ IDL }) => {\n const flag = IDL.Variant({ 'disabled' : IDL.Null, 'enabled' : IDL.Null });\n const fees = IDL.Record({\n 'get_current_fee_percentiles' : IDL.Nat,\n 'get_utxos_maximum' : IDL.Nat,\n 'get_block_headers_cycles_per_ten_instructions' : IDL.Nat,\n 'get_current_fee_percentiles_maximum' : IDL.Nat,\n 'send_transaction_per_byte' : IDL.Nat,\n 'get_balance' : IDL.Nat,\n 'get_utxos_cycles_per_ten_instructions' : IDL.Nat,\n 'get_block_headers_base' : IDL.Nat,\n 'get_utxos_base' : IDL.Nat,\n 'get_balance_maximum' : IDL.Nat,\n 'send_transaction_base' : IDL.Nat,\n 'get_block_headers_maximum' : IDL.Nat,\n });\n const network = IDL.Variant({\n 'mainnet' : IDL.Null,\n 'regtest' : IDL.Null,\n 'testnet' : IDL.Null,\n });\n const init_config = IDL.Record({\n 'api_access' : IDL.Opt(flag),\n 'lazily_evaluate_fee_percentiles' : IDL.Opt(flag),\n 'blocks_source' : IDL.Opt(IDL.Principal),\n 'fees' : IDL.Opt(fees),\n 'watchdog_canister' : IDL.Opt(IDL.Opt(IDL.Principal)),\n 'network' : IDL.Opt(network),\n 'stability_threshold' : IDL.Opt(IDL.Nat),\n 'syncing' : IDL.Opt(flag),\n 'burn_cycles' : IDL.Opt(flag),\n 'disable_api_if_not_fully_synced' : IDL.Opt(flag),\n });\n return [init_config];\n};\n", "import { toNullable, type QueryParams } from \"@dfinity/utils\";\nimport type { get_utxos_request } from \"../../candid/bitcoin\";\n\nexport type BitcoinNetwork = \"testnet\" | \"mainnet\";\n\nexport type GetUtxosParams = Omit<get_utxos_request, \"network\" | \"filter\"> & {\n network: BitcoinNetwork;\n filter?: { page: Uint8Array | number[] } | { min_confirmations: number };\n} & QueryParams;\n\nexport const toGetUtxosParams = ({\n network,\n filter,\n ...rest\n}: GetUtxosParams): get_utxos_request => ({\n filter: toNullable(filter),\n network: network === \"testnet\" ? { testnet: null } : { mainnet: null },\n ...rest,\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,YAAAA,EAAU,kBAAAC,MAAsB,iBCClC,IAAMC,EAAa,CAAC,CAAE,IAAAC,CA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B,CAClE,CAwBF",
|
|
6
|
+
"names": ["Canister", "createServices", "idlFactory", "IDL", "flag", "fees", "network", "init_config", "address", "get_balance_request", "satoshi", "block_height", "get_block_headers_request", "block_header", "get_block_headers_response", "get_current_fee_percentiles_request", "millisatoshi_per_byte", "get_utxos_request", "block_hash", "outpoint", "utxo", "get_utxos_response", "send_transaction_request", "config", "set_config_request", "idlFactory", "IDL", "flag", "fees", "network", "init_config", "address", "get_balance_request", "satoshi", "block_height", "get_block_headers_request", "block_header", "get_block_headers_response", "get_current_fee_percentiles_request", "millisatoshi_per_byte", "get_utxos_request", "block_hash", "outpoint", "utxo", "get_utxos_response", "send_transaction_request", "config", "set_config_request", "toNullable", "toGetUtxosParams", "network", "filter", "rest", "BitcoinCanister", "_BitcoinCanister", "Canister", "certified", "params", "bitcoin_get_utxos", "bitcoin_get_utxos_query", "toGetUtxosParams", "options", "service", "certifiedService", "canisterId", "createServices", "idlFactory"]
|
|
7
|
+
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Ft,b as dt}from"./chunk-KL2UT2R6.js";import{a as jt,b as Dt,c as Wt,d as St,e as Vt,f as $t,g as qt,h as Gt,i as zt,j as Xt,k as Kt,l as Jt,m as Qt,n as bt}from"./chunk-D2A54F3A.js";import{a as y,b as G}from"./chunk-IS3C7V4B.js";var O=y((ue,Z)=>{"use strict";var At="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";Z.exports=At});var et=y((pe,tt)=>{"use strict";var _t=O(),Et=e=>{if(!e||typeof e!="string")throw new Error(`Expected base58 string but got \u201C${e}\u201D`);if(e.match(/[IOl0]/gmu))throw new Error(`Invalid base58 character \u201C${e.match(/[IOl0]/gmu)}\u201D`);let t=e.match(/^1+/gmu),o=t?t[0].length:0,r=(e.length-o)*(Math.log(58)/Math.log(256))+1>>>0;return new Uint8Array([...new Uint8Array(o),...e.match(/.{1}/gmu).map(s=>_t.indexOf(s)).reduce((s,c)=>(s=s.map(n=>{let i=n*58+c;return c=i>>8,i}),s),new Uint8Array(r)).reverse().filter((s=>c=>s=s||c)(!1))])};tt.exports=Et});var ot=y((xe,nt)=>{"use strict";var rt=O(),Ct=()=>{let e=Array(256).fill(-1);for(let t=0;t<rt.length;++t)e[rt.charCodeAt(t)]=t;return e};nt.exports=Ct});var it=y((le,ct)=>{"use strict";var st=O(),kt=ot(),Ut=kt(),Bt=e=>{let t=[];for(let o of e){let r=o;for(let s=0;s<t.length;++s){let c=(Ut[t[s]]<<8)+r;t[s]=st.charCodeAt(c%58),r=c/58|0}for(;r;)t.push(st.charCodeAt(r%58)),r=r/58|0}for(let o of e){if(o)break;t.push(49)}return t.reverse(),String.fromCharCode(...t)};ct.exports=Bt});var ft=y($=>{"use strict";$.base58_to_binary=et();$.binary_to_base58=it()});var pt=y(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.bech32m=E.bech32=void 0;var F="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ht={};for(let e=0;e<F.length;e++){let t=F.charAt(e);ht[t]=e}function _(e){let t=e>>25;return(e&33554431)<<5^-(t>>0&1)&996825010^-(t>>1&1)&642813549^-(t>>2&1)&513874426^-(t>>3&1)&1027748829^-(t>>4&1)&705979059}function at(e){let t=1;for(let o=0;o<e.length;++o){let r=e.charCodeAt(o);if(r<33||r>126)return"Invalid prefix ("+e+")";t=_(t)^r>>5}t=_(t);for(let o=0;o<e.length;++o){let r=e.charCodeAt(o);t=_(t)^r&31}return t}function q(e,t,o,r){let s=0,c=0,n=(1<<o)-1,i=[];for(let a=0;a<e.length;++a)for(s=s<<t|e[a],c+=t;c>=o;)c-=o,i.push(s>>c&n);if(r)c>0&&i.push(s<<o-c&n);else{if(c>=t)return"Excess padding";if(s<<o-c&n)return"Non-zero padding"}return i}function Lt(e){return q(e,8,5,!0)}function Pt(e){let t=q(e,5,8,!1);if(Array.isArray(t))return t}function Tt(e){let t=q(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}function ut(e){let t;e==="bech32"?t=1:t=734539939;function o(n,i,a){if(a=a||90,n.length+7+i.length>a)throw new TypeError("Exceeds length limit");n=n.toLowerCase();let u=at(n);if(typeof u=="string")throw new Error(u);let h=n+"1";for(let f=0;f<i.length;++f){let p=i[f];if(p>>5)throw new Error("Non 5-bit word");u=_(u)^p,h+=F.charAt(p)}for(let f=0;f<6;++f)u=_(u);u^=t;for(let f=0;f<6;++f){let p=u>>(5-f)*5&31;h+=F.charAt(p)}return h}function r(n,i){if(i=i||90,n.length<8)return n+" too short";if(n.length>i)return"Exceeds length limit";let a=n.toLowerCase(),u=n.toUpperCase();if(n!==a&&n!==u)return"Mixed-case string "+n;n=a;let h=n.lastIndexOf("1");if(h===-1)return"No separator character for "+n;if(h===0)return"Missing prefix for "+n;let f=n.slice(0,h),p=n.slice(h+1);if(p.length<6)return"Data too short";let x=at(f);if(typeof x=="string")return x;let w=[];for(let l=0;l<p.length;++l){let L=p.charAt(l),C=ht[L];if(C===void 0)return"Unknown character "+L;x=_(x)^C,!(l+6>=p.length)&&w.push(C)}return x!==t?"Invalid checksum for "+n:{prefix:f,words:w}}function s(n,i){let a=r(n,i);if(typeof a=="object")return a}function c(n,i){let a=r(n,i);if(typeof a=="object")return a;throw new Error(a)}return{decodeUnsafe:s,decode:c,encode:o,toWords:Lt,fromWordsUnsafe:Pt,fromWords:Tt}}E.bech32=ut("bech32");E.bech32m=ut("bech32m")});var z=(r=>(r[r.Mainnet=0]="Mainnet",r[r.Regtest=1]="Regtest",r[r.Testnet=2]="Testnet",r))(z||{}),X=(c=>(c[c.P2wpkhV0=0]="P2wpkhV0",c[c.P2pkh=1]="P2pkh",c[c.P2sh=2]="P2sh",c[c.P2wsh=3]="P2wsh",c[c.P2tr=4]="P2tr",c))(X||{});var b=class extends Error{},k=class extends b{},P=class extends b{},U=class extends b{},T=class extends b{},v=class extends b{},I=class extends b{},A=class extends b{},N=class extends b{};import{isNullish as xt}from"@dfinity/utils";function wt(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function j(e,...t){if(!wt(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function D(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function K(e,t){j(e);let o=t.outputLen;if(e.length<o)throw new Error(`digestInto() expects output buffer of length at least ${o}`)}var H=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),d=(e,t)=>e<<32-t|e>>>t;var re=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function gt(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function W(e){return typeof e=="string"&&(e=gt(e)),j(e),e}var R=class{clone(){return this._cloneInto()}},ne={}.toString;function J(e){let t=r=>e().update(W(r)).digest(),o=e();return t.outputLen=o.outputLen,t.blockLen=o.blockLen,t.create=()=>e(),t}function mt(e,t,o,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,o,r);let s=BigInt(32),c=BigInt(4294967295),n=Number(o>>s&c),i=Number(o&c),a=r?4:0,u=r?0:4;e.setUint32(t+a,n,r),e.setUint32(t+u,i,r)}var Q=(e,t,o)=>e&t^~e&o,Y=(e,t,o)=>e&t^e&o^t&o,M=class extends R{constructor(t,o,r,s){super(),this.blockLen=t,this.outputLen=o,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=H(this.buffer)}update(t){D(this);let{view:o,buffer:r,blockLen:s}=this;t=W(t);let c=t.length;for(let n=0;n<c;){let i=Math.min(s-this.pos,c-n);if(i===s){let a=H(t);for(;s<=c-n;n+=s)this.process(a,n);continue}r.set(t.subarray(n,n+i),this.pos),this.pos+=i,n+=i,this.pos===s&&(this.process(o,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){D(this),K(t,this),this.finished=!0;let{buffer:o,view:r,blockLen:s,isLE:c}=this,{pos:n}=this;o[n++]=128,this.buffer.subarray(n).fill(0),this.padOffset>s-n&&(this.process(r,0),n=0);for(let f=n;f<s;f++)o[f]=0;mt(r,s-8,BigInt(this.length*8),c),this.process(r,0);let i=H(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let u=a/4,h=this.get();if(u>h.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)i.setUint32(4*f,h[f],c)}digest(){let{buffer:t,outputLen:o}=this;this.digestInto(t);let r=t.slice(0,o);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:o,buffer:r,length:s,finished:c,destroyed:n,pos:i}=this;return t.length=s,t.pos=i,t.finished=c,t.destroyed=n,s%o&&t.buffer.set(r),t}};var yt=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),g=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),m=new Uint32Array(64),S=class extends M{constructor(){super(64,32,8,!1),this.A=g[0]|0,this.B=g[1]|0,this.C=g[2]|0,this.D=g[3]|0,this.E=g[4]|0,this.F=g[5]|0,this.G=g[6]|0,this.H=g[7]|0}get(){let{A:t,B:o,C:r,D:s,E:c,F:n,G:i,H:a}=this;return[t,o,r,s,c,n,i,a]}set(t,o,r,s,c,n,i,a){this.A=t|0,this.B=o|0,this.C=r|0,this.D=s|0,this.E=c|0,this.F=n|0,this.G=i|0,this.H=a|0}process(t,o){for(let f=0;f<16;f++,o+=4)m[f]=t.getUint32(o,!1);for(let f=16;f<64;f++){let p=m[f-15],x=m[f-2],w=d(p,7)^d(p,18)^p>>>3,l=d(x,17)^d(x,19)^x>>>10;m[f]=l+m[f-7]+w+m[f-16]|0}let{A:r,B:s,C:c,D:n,E:i,F:a,G:u,H:h}=this;for(let f=0;f<64;f++){let p=d(i,6)^d(i,11)^d(i,25),x=h+p+Q(i,a,u)+yt[f]+m[f]|0,l=(d(r,2)^d(r,13)^d(r,22))+Y(r,s,c)|0;h=u,u=a,a=i,i=n+x|0,n=c,c=s,s=r,r=x+l|0}r=r+this.A|0,s=s+this.B|0,c=c+this.C|0,n=n+this.D|0,i=i+this.E|0,a=a+this.F|0,u=u+this.G|0,h=h+this.H|0,this.set(r,s,c,n,i,a,u,h)}roundClean(){m.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var V=J(()=>new S);var lt=G(ft()),B=G(pt());var vt=0,It=5,Nt=111,Rt=196,Ht={[vt]:{type:1,networks:[0]},[Nt]:{type:1,networks:[2,1]},[It]:{type:2,networks:[0]},[Rt]:{type:2,networks:[2,1]}},Mt=({address:e,network:t})=>{let r=(h=>{try{return(0,lt.base58_to_binary)(h)}catch{throw new k}})(e),{length:s}=r;if(s!==25)throw new A(`Expected the address to be 25 bytes, got ${s}.`);(h=>{let f=h.slice(s-4,s),p=h.slice(0,s-4),x=V.create();x.update(p);let w=V.create();w.update(x.digest());let l=w.digest().slice(0,4);if(f.some((L,C)=>L!==l[C]))throw new A(`Checksum mismatch expected ${f}, got ${l}.`)})(r);let n=r[0],i=Ht[n];if(xt(i))throw new U;let{type:a,networks:u}=i;if(!u.includes(t))throw new N;return{address:e,network:t,type:a,parser:"base58"}},Ot=({address:e,network:t})=>{let o=h=>{try{return h.startsWith("bc1p")||h.startsWith("tb1p")||h.startsWith("bcrt1p")?B.bech32m.decode(h):B.bech32.decode(h)}catch{throw new A}},{prefix:r,words:s}=o(e),n={bc:0,tb:2,bcrt:1}[r];if(xt(n))throw new k;if(n!==t)throw new I;let[i,...a]=s;if(i>1)throw new v;switch(B.bech32.fromWords(a).length){case 20:return{address:e,network:t,type:0,parser:"bip-173"};case 32:return{address:e,network:t,type:i===0?3:4,parser:"bip-173"};default:throw new T}},Ae=({address:e,network:t=0})=>{switch(e.charAt(0)){case"1":case"2":case"3":case"m":case"n":return Mt({address:e,network:t});case"b":case"B":case"t":case"T":return Ot({address:e,network:t});case"":throw new P;default:throw new U}};export{dt as BitcoinCanister,X as BtcAddressType,z as BtcNetwork,bt as CkBTCMinterCanister,Wt as MinterAlreadyProcessingError,Gt as MinterAmountTooLowError,jt as MinterGenericError,Xt as MinterInsufficientAllowanceError,zt as MinterInsufficientFundsError,qt as MinterMalformedAddressError,Vt as MinterNoNewUtxosError,$t as MinterRetrieveBtcError,Dt as MinterTemporaryUnavailableError,St as MinterUpdateBalanceError,T as ParseBtcAddressBadWitnessLengthError,b as ParseBtcAddressError,k as ParseBtcAddressInvalidError,A as ParseBtcAddressMalformedAddressError,P as ParseBtcAddressNoDataError,I as ParseBtcAddressUnexpectedHumanReadablePartError,U as ParseBtcAddressUnsupportedAddressTypeError,v as ParseBtcAddressUnsupportedWitnessVersionError,N as ParseBtcAddressWrongNetworkError,Jt as createRetrieveBtcError,Qt as createRetrieveBtcWithApprovalError,Kt as createUpdateBalanceError,Ae as parseBtcAddress,Ft as toGetUtxosParams};
|
|
1
|
+
import{a as Ft,b as dt}from"./chunk-NEYHWXBO.js";import{a as jt,b as Dt,c as Wt,d as St,e as Vt,f as $t,g as qt,h as Gt,i as zt,j as Xt,k as Kt,l as Jt,m as Qt,n as bt}from"./chunk-D2A54F3A.js";import{a as y,b as G}from"./chunk-IS3C7V4B.js";var O=y((ue,Z)=>{"use strict";var At="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";Z.exports=At});var et=y((pe,tt)=>{"use strict";var _t=O(),Et=e=>{if(!e||typeof e!="string")throw new Error(`Expected base58 string but got \u201C${e}\u201D`);if(e.match(/[IOl0]/gmu))throw new Error(`Invalid base58 character \u201C${e.match(/[IOl0]/gmu)}\u201D`);let t=e.match(/^1+/gmu),o=t?t[0].length:0,r=(e.length-o)*(Math.log(58)/Math.log(256))+1>>>0;return new Uint8Array([...new Uint8Array(o),...e.match(/.{1}/gmu).map(s=>_t.indexOf(s)).reduce((s,c)=>(s=s.map(n=>{let i=n*58+c;return c=i>>8,i}),s),new Uint8Array(r)).reverse().filter((s=>c=>s=s||c)(!1))])};tt.exports=Et});var ot=y((xe,nt)=>{"use strict";var rt=O(),Ct=()=>{let e=Array(256).fill(-1);for(let t=0;t<rt.length;++t)e[rt.charCodeAt(t)]=t;return e};nt.exports=Ct});var it=y((le,ct)=>{"use strict";var st=O(),kt=ot(),Ut=kt(),Bt=e=>{let t=[];for(let o of e){let r=o;for(let s=0;s<t.length;++s){let c=(Ut[t[s]]<<8)+r;t[s]=st.charCodeAt(c%58),r=c/58|0}for(;r;)t.push(st.charCodeAt(r%58)),r=r/58|0}for(let o of e){if(o)break;t.push(49)}return t.reverse(),String.fromCharCode(...t)};ct.exports=Bt});var ft=y($=>{"use strict";$.base58_to_binary=et();$.binary_to_base58=it()});var pt=y(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.bech32m=E.bech32=void 0;var F="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ht={};for(let e=0;e<F.length;e++){let t=F.charAt(e);ht[t]=e}function _(e){let t=e>>25;return(e&33554431)<<5^-(t>>0&1)&996825010^-(t>>1&1)&642813549^-(t>>2&1)&513874426^-(t>>3&1)&1027748829^-(t>>4&1)&705979059}function at(e){let t=1;for(let o=0;o<e.length;++o){let r=e.charCodeAt(o);if(r<33||r>126)return"Invalid prefix ("+e+")";t=_(t)^r>>5}t=_(t);for(let o=0;o<e.length;++o){let r=e.charCodeAt(o);t=_(t)^r&31}return t}function q(e,t,o,r){let s=0,c=0,n=(1<<o)-1,i=[];for(let a=0;a<e.length;++a)for(s=s<<t|e[a],c+=t;c>=o;)c-=o,i.push(s>>c&n);if(r)c>0&&i.push(s<<o-c&n);else{if(c>=t)return"Excess padding";if(s<<o-c&n)return"Non-zero padding"}return i}function Lt(e){return q(e,8,5,!0)}function Pt(e){let t=q(e,5,8,!1);if(Array.isArray(t))return t}function Tt(e){let t=q(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}function ut(e){let t;e==="bech32"?t=1:t=734539939;function o(n,i,a){if(a=a||90,n.length+7+i.length>a)throw new TypeError("Exceeds length limit");n=n.toLowerCase();let u=at(n);if(typeof u=="string")throw new Error(u);let h=n+"1";for(let f=0;f<i.length;++f){let p=i[f];if(p>>5)throw new Error("Non 5-bit word");u=_(u)^p,h+=F.charAt(p)}for(let f=0;f<6;++f)u=_(u);u^=t;for(let f=0;f<6;++f){let p=u>>(5-f)*5&31;h+=F.charAt(p)}return h}function r(n,i){if(i=i||90,n.length<8)return n+" too short";if(n.length>i)return"Exceeds length limit";let a=n.toLowerCase(),u=n.toUpperCase();if(n!==a&&n!==u)return"Mixed-case string "+n;n=a;let h=n.lastIndexOf("1");if(h===-1)return"No separator character for "+n;if(h===0)return"Missing prefix for "+n;let f=n.slice(0,h),p=n.slice(h+1);if(p.length<6)return"Data too short";let x=at(f);if(typeof x=="string")return x;let w=[];for(let l=0;l<p.length;++l){let L=p.charAt(l),C=ht[L];if(C===void 0)return"Unknown character "+L;x=_(x)^C,!(l+6>=p.length)&&w.push(C)}return x!==t?"Invalid checksum for "+n:{prefix:f,words:w}}function s(n,i){let a=r(n,i);if(typeof a=="object")return a}function c(n,i){let a=r(n,i);if(typeof a=="object")return a;throw new Error(a)}return{decodeUnsafe:s,decode:c,encode:o,toWords:Lt,fromWordsUnsafe:Pt,fromWords:Tt}}E.bech32=ut("bech32");E.bech32m=ut("bech32m")});var z=(r=>(r[r.Mainnet=0]="Mainnet",r[r.Regtest=1]="Regtest",r[r.Testnet=2]="Testnet",r))(z||{}),X=(c=>(c[c.P2wpkhV0=0]="P2wpkhV0",c[c.P2pkh=1]="P2pkh",c[c.P2sh=2]="P2sh",c[c.P2wsh=3]="P2wsh",c[c.P2tr=4]="P2tr",c))(X||{});var b=class extends Error{},k=class extends b{},P=class extends b{},U=class extends b{},T=class extends b{},v=class extends b{},I=class extends b{},A=class extends b{},N=class extends b{};import{isNullish as xt}from"@dfinity/utils";function wt(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function j(e,...t){if(!wt(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function D(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function K(e,t){j(e);let o=t.outputLen;if(e.length<o)throw new Error(`digestInto() expects output buffer of length at least ${o}`)}var H=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),d=(e,t)=>e<<32-t|e>>>t;var re=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function gt(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function W(e){return typeof e=="string"&&(e=gt(e)),j(e),e}var R=class{clone(){return this._cloneInto()}},ne={}.toString;function J(e){let t=r=>e().update(W(r)).digest(),o=e();return t.outputLen=o.outputLen,t.blockLen=o.blockLen,t.create=()=>e(),t}function mt(e,t,o,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,o,r);let s=BigInt(32),c=BigInt(4294967295),n=Number(o>>s&c),i=Number(o&c),a=r?4:0,u=r?0:4;e.setUint32(t+a,n,r),e.setUint32(t+u,i,r)}var Q=(e,t,o)=>e&t^~e&o,Y=(e,t,o)=>e&t^e&o^t&o,M=class extends R{constructor(t,o,r,s){super(),this.blockLen=t,this.outputLen=o,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=H(this.buffer)}update(t){D(this);let{view:o,buffer:r,blockLen:s}=this;t=W(t);let c=t.length;for(let n=0;n<c;){let i=Math.min(s-this.pos,c-n);if(i===s){let a=H(t);for(;s<=c-n;n+=s)this.process(a,n);continue}r.set(t.subarray(n,n+i),this.pos),this.pos+=i,n+=i,this.pos===s&&(this.process(o,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){D(this),K(t,this),this.finished=!0;let{buffer:o,view:r,blockLen:s,isLE:c}=this,{pos:n}=this;o[n++]=128,this.buffer.subarray(n).fill(0),this.padOffset>s-n&&(this.process(r,0),n=0);for(let f=n;f<s;f++)o[f]=0;mt(r,s-8,BigInt(this.length*8),c),this.process(r,0);let i=H(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let u=a/4,h=this.get();if(u>h.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)i.setUint32(4*f,h[f],c)}digest(){let{buffer:t,outputLen:o}=this;this.digestInto(t);let r=t.slice(0,o);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:o,buffer:r,length:s,finished:c,destroyed:n,pos:i}=this;return t.length=s,t.pos=i,t.finished=c,t.destroyed=n,s%o&&t.buffer.set(r),t}};var yt=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),g=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),m=new Uint32Array(64),S=class extends M{constructor(){super(64,32,8,!1),this.A=g[0]|0,this.B=g[1]|0,this.C=g[2]|0,this.D=g[3]|0,this.E=g[4]|0,this.F=g[5]|0,this.G=g[6]|0,this.H=g[7]|0}get(){let{A:t,B:o,C:r,D:s,E:c,F:n,G:i,H:a}=this;return[t,o,r,s,c,n,i,a]}set(t,o,r,s,c,n,i,a){this.A=t|0,this.B=o|0,this.C=r|0,this.D=s|0,this.E=c|0,this.F=n|0,this.G=i|0,this.H=a|0}process(t,o){for(let f=0;f<16;f++,o+=4)m[f]=t.getUint32(o,!1);for(let f=16;f<64;f++){let p=m[f-15],x=m[f-2],w=d(p,7)^d(p,18)^p>>>3,l=d(x,17)^d(x,19)^x>>>10;m[f]=l+m[f-7]+w+m[f-16]|0}let{A:r,B:s,C:c,D:n,E:i,F:a,G:u,H:h}=this;for(let f=0;f<64;f++){let p=d(i,6)^d(i,11)^d(i,25),x=h+p+Q(i,a,u)+yt[f]+m[f]|0,l=(d(r,2)^d(r,13)^d(r,22))+Y(r,s,c)|0;h=u,u=a,a=i,i=n+x|0,n=c,c=s,s=r,r=x+l|0}r=r+this.A|0,s=s+this.B|0,c=c+this.C|0,n=n+this.D|0,i=i+this.E|0,a=a+this.F|0,u=u+this.G|0,h=h+this.H|0,this.set(r,s,c,n,i,a,u,h)}roundClean(){m.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var V=J(()=>new S);var lt=G(ft()),B=G(pt());var vt=0,It=5,Nt=111,Rt=196,Ht={[vt]:{type:1,networks:[0]},[Nt]:{type:1,networks:[2,1]},[It]:{type:2,networks:[0]},[Rt]:{type:2,networks:[2,1]}},Mt=({address:e,network:t})=>{let r=(h=>{try{return(0,lt.base58_to_binary)(h)}catch{throw new k}})(e),{length:s}=r;if(s!==25)throw new A(`Expected the address to be 25 bytes, got ${s}.`);(h=>{let f=h.slice(s-4,s),p=h.slice(0,s-4),x=V.create();x.update(p);let w=V.create();w.update(x.digest());let l=w.digest().slice(0,4);if(f.some((L,C)=>L!==l[C]))throw new A(`Checksum mismatch expected ${f}, got ${l}.`)})(r);let n=r[0],i=Ht[n];if(xt(i))throw new U;let{type:a,networks:u}=i;if(!u.includes(t))throw new N;return{address:e,network:t,type:a,parser:"base58"}},Ot=({address:e,network:t})=>{let o=h=>{try{return h.startsWith("bc1p")||h.startsWith("tb1p")||h.startsWith("bcrt1p")?B.bech32m.decode(h):B.bech32.decode(h)}catch{throw new A}},{prefix:r,words:s}=o(e),n={bc:0,tb:2,bcrt:1}[r];if(xt(n))throw new k;if(n!==t)throw new I;let[i,...a]=s;if(i>1)throw new v;switch(B.bech32.fromWords(a).length){case 20:return{address:e,network:t,type:0,parser:"bip-173"};case 32:return{address:e,network:t,type:i===0?3:4,parser:"bip-173"};default:throw new T}},Ae=({address:e,network:t=0})=>{switch(e.charAt(0)){case"1":case"2":case"3":case"m":case"n":return Mt({address:e,network:t});case"b":case"B":case"t":case"T":return Ot({address:e,network:t});case"":throw new P;default:throw new U}};export{dt as BitcoinCanister,X as BtcAddressType,z as BtcNetwork,bt as CkBTCMinterCanister,Wt as MinterAlreadyProcessingError,Gt as MinterAmountTooLowError,jt as MinterGenericError,Xt as MinterInsufficientAllowanceError,zt as MinterInsufficientFundsError,qt as MinterMalformedAddressError,Vt as MinterNoNewUtxosError,$t as MinterRetrieveBtcError,Dt as MinterTemporaryUnavailableError,St as MinterUpdateBalanceError,T as ParseBtcAddressBadWitnessLengthError,b as ParseBtcAddressError,k as ParseBtcAddressInvalidError,A as ParseBtcAddressMalformedAddressError,P as ParseBtcAddressNoDataError,I as ParseBtcAddressUnexpectedHumanReadablePartError,U as ParseBtcAddressUnsupportedAddressTypeError,v as ParseBtcAddressUnsupportedWitnessVersionError,N as ParseBtcAddressWrongNetworkError,Jt as createRetrieveBtcError,Qt as createRetrieveBtcWithApprovalError,Kt as createUpdateBalanceError,Ae as parseBtcAddress,Ft as toGetUtxosParams};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
@noble/hashes/esm/utils.js:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dfinity/ckbtc",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "A library for interfacing with ckBTC.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/cjs/index.cjs.js",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
],
|
|
39
39
|
"homepage": "https://github.com/dfinity/ic-js#readme",
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@dfinity/agent": "^1.
|
|
42
|
-
"@dfinity/candid": "^1.
|
|
43
|
-
"@dfinity/principal": "^1.
|
|
44
|
-
"@dfinity/utils": "^2.
|
|
41
|
+
"@dfinity/agent": "^1.4.0",
|
|
42
|
+
"@dfinity/candid": "^1.4.0",
|
|
43
|
+
"@dfinity/principal": "^1.4.0",
|
|
44
|
+
"@dfinity/utils": "^2.4.0"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@noble/hashes": "^1.3.2",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Canister as q,createServices as F}from"@dfinity/utils";var x=({IDL:t})=>{let e=t.Variant({disabled:t.Null,enabled:t.Null}),c=t.Record({get_current_fee_percentiles:t.Nat,get_utxos_maximum:t.Nat,get_current_fee_percentiles_maximum:t.Nat,send_transaction_per_byte:t.Nat,get_balance:t.Nat,get_utxos_cycles_per_ten_instructions:t.Nat,get_utxos_base:t.Nat,get_balance_maximum:t.Nat,send_transaction_base:t.Nat}),n=t.Variant({mainnet:t.Null,regtest:t.Null,testnet:t.Null}),o=t.Record({api_access:t.Opt(e),lazily_evaluate_fee_percentiles:t.Opt(e),blocks_source:t.Opt(t.Principal),fees:t.Opt(c),watchdog_canister:t.Opt(t.Opt(t.Principal)),network:t.Opt(n),stability_threshold:t.Opt(t.Nat),syncing:t.Opt(e),burn_cycles:t.Opt(e),disable_api_if_not_fully_synced:t.Opt(e)}),a=t.Text,_=t.Record({network:n,address:a,min_confirmations:t.Opt(t.Nat32)}),i=t.Nat64,s=t.Nat32,p=t.Record({start_height:s,end_height:t.Opt(s)}),u=t.Vec(t.Nat8),d=t.Record({tip_height:s,block_headers:t.Vec(u)}),g=t.Record({network:n}),b=t.Nat64,r=t.Record({network:n,filter:t.Opt(t.Variant({page:t.Vec(t.Nat8),min_confirmations:t.Nat32})),address:a}),N=t.Vec(t.Nat8),f=t.Record({txid:t.Vec(t.Nat8),vout:t.Nat32}),m=t.Record({height:s,value:i,outpoint:f}),l=t.Record({next_page:t.Opt(t.Vec(t.Nat8)),tip_height:s,tip_block_hash:N,utxos:t.Vec(m)}),y=t.Record({transaction:t.Vec(t.Nat8),network:n}),O=t.Record({api_access:e,lazily_evaluate_fee_percentiles:e,blocks_source:t.Principal,fees:c,watchdog_canister:t.Opt(t.Principal),network:n,stability_threshold:t.Nat,syncing:e,burn_cycles:e,disable_api_if_not_fully_synced:e}),h=t.Record({api_access:t.Opt(e),lazily_evaluate_fee_percentiles:t.Opt(e),fees:t.Opt(c),watchdog_canister:t.Opt(t.Opt(t.Principal)),stability_threshold:t.Opt(t.Nat),syncing:t.Opt(e),burn_cycles:t.Opt(e),disable_api_if_not_fully_synced:t.Opt(e)});return t.Service({bitcoin_get_balance:t.Func([_],[i],[]),bitcoin_get_balance_query:t.Func([_],[i],[]),bitcoin_get_block_headers:t.Func([p],[d],[]),bitcoin_get_current_fee_percentiles:t.Func([g],[t.Vec(b)],[]),bitcoin_get_utxos:t.Func([r],[l],[]),bitcoin_get_utxos_query:t.Func([r],[l],[]),bitcoin_send_transaction:t.Func([y],[],[]),get_config:t.Func([],[O],[]),set_config:t.Func([h],[],[])})};var k=({IDL:t})=>{let e=t.Variant({disabled:t.Null,enabled:t.Null}),c=t.Record({get_current_fee_percentiles:t.Nat,get_utxos_maximum:t.Nat,get_current_fee_percentiles_maximum:t.Nat,send_transaction_per_byte:t.Nat,get_balance:t.Nat,get_utxos_cycles_per_ten_instructions:t.Nat,get_utxos_base:t.Nat,get_balance_maximum:t.Nat,send_transaction_base:t.Nat}),n=t.Variant({mainnet:t.Null,regtest:t.Null,testnet:t.Null}),o=t.Record({api_access:t.Opt(e),lazily_evaluate_fee_percentiles:t.Opt(e),blocks_source:t.Opt(t.Principal),fees:t.Opt(c),watchdog_canister:t.Opt(t.Opt(t.Principal)),network:t.Opt(n),stability_threshold:t.Opt(t.Nat),syncing:t.Opt(e),burn_cycles:t.Opt(e),disable_api_if_not_fully_synced:t.Opt(e)}),a=t.Text,_=t.Record({network:n,address:a,min_confirmations:t.Opt(t.Nat32)}),i=t.Nat64,s=t.Nat32,p=t.Record({start_height:s,end_height:t.Opt(s)}),u=t.Vec(t.Nat8),d=t.Record({tip_height:s,block_headers:t.Vec(u)}),g=t.Record({network:n}),b=t.Nat64,r=t.Record({network:n,filter:t.Opt(t.Variant({page:t.Vec(t.Nat8),min_confirmations:t.Nat32})),address:a}),N=t.Vec(t.Nat8),f=t.Record({txid:t.Vec(t.Nat8),vout:t.Nat32}),m=t.Record({height:s,value:i,outpoint:f}),l=t.Record({next_page:t.Opt(t.Vec(t.Nat8)),tip_height:s,tip_block_hash:N,utxos:t.Vec(m)}),y=t.Record({transaction:t.Vec(t.Nat8),network:n}),O=t.Record({api_access:e,lazily_evaluate_fee_percentiles:e,blocks_source:t.Principal,fees:c,watchdog_canister:t.Opt(t.Principal),network:n,stability_threshold:t.Nat,syncing:e,burn_cycles:e,disable_api_if_not_fully_synced:e}),h=t.Record({api_access:t.Opt(e),lazily_evaluate_fee_percentiles:t.Opt(e),fees:t.Opt(c),watchdog_canister:t.Opt(t.Opt(t.Principal)),stability_threshold:t.Opt(t.Nat),syncing:t.Opt(e),burn_cycles:t.Opt(e),disable_api_if_not_fully_synced:t.Opt(e)});return t.Service({bitcoin_get_balance:t.Func([_],[i],[]),bitcoin_get_balance_query:t.Func([_],[i],["query"]),bitcoin_get_block_headers:t.Func([p],[d],[]),bitcoin_get_current_fee_percentiles:t.Func([g],[t.Vec(b)],[]),bitcoin_get_utxos:t.Func([r],[l],[]),bitcoin_get_utxos_query:t.Func([r],[l],["query"]),bitcoin_send_transaction:t.Func([y],[],[]),get_config:t.Func([],[O],["query"]),set_config:t.Func([h],[],[])})};import{toNullable as V}from"@dfinity/utils";var w=({network:t,filter:e,...c})=>({filter:V(e),network:t==="testnet"?{testnet:null}:{mainnet:null},...c});var R=class t extends q{constructor(){super(...arguments);this.getUtxos=({certified:c=!0,...n})=>{let{bitcoin_get_utxos:o,bitcoin_get_utxos_query:a}=this.caller({certified:c});return(c?o:a)(w(n))}}static create(c){let{service:n,certifiedService:o,canisterId:a}=F({options:c,idlFactory:k,certifiedIdlFactory:x});return new t(a,n,o)}};export{w as a,R as b};
|
|
2
|
-
//# sourceMappingURL=chunk-KL2UT2R6.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/bitcoin.canister.ts", "../../candid/bitcoin.certified.idl.js", "../../candid/bitcoin.idl.js", "../../src/types/bitcoin.params.ts"],
|
|
4
|
-
"sourcesContent": ["import { Canister, createServices } from \"@dfinity/utils\";\nimport type {\n _SERVICE as BitcoinService,\n get_utxos_response,\n} from \"../candid/bitcoin\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/bitcoin.certified.idl\";\nimport { idlFactory } from \"../candid/bitcoin.idl\";\nimport { toGetUtxosParams, type GetUtxosParams } from \"./types/bitcoin.params\";\nimport type { CkBTCCanisterOptions } from \"./types/canister.options\";\n\nexport class BitcoinCanister extends Canister<BitcoinService> {\n static create(options: CkBTCCanisterOptions<BitcoinService>) {\n const { service, certifiedService, canisterId } =\n createServices<BitcoinService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new BitcoinCanister(canisterId, service, certifiedService);\n }\n\n /**\n * Given a `get_utxos_request`, which must specify a Bitcoin address and a Bitcoin network (`mainnet` or `testnet`), the function returns all unspent transaction outputs (UTXOs) associated with the provided address in the specified Bitcoin network based on the current view of the Bitcoin blockchain available to the Bitcoin component.\n *\n * @link https://internetcomputer.org/docs/current/references/ic-interface-spec#ic-bitcoin_get_utxos\n *\n * @param {Object} params\n * @param {BitcoinNetwork} params.network Tesnet or mainnet.\n * @param {Object} params.filter The optional filter parameter can be used to restrict the set of returned UTXOs, either providing a minimum number of confirmations or a page reference when pagination is used for addresses with many UTXOs.\n * @param {string} params.address A Bitcoin address.\n * @param {boolean} params.certified query or update call\n * @returns {Promise<bitcoin_get_utxos_result>} The UTXOs are returned sorted by block height in descending order.\n */\n getUtxos = ({\n certified = true,\n ...params\n }: GetUtxosParams): Promise<get_utxos_response> => {\n const { bitcoin_get_utxos, bitcoin_get_utxos_query } = this.caller({\n certified,\n });\n const fn = certified ? bitcoin_get_utxos : bitcoin_get_utxos_query;\n return fn(toGetUtxosParams(params));\n };\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ckbtc/candid/bitcoin.did */\nexport const idlFactory = ({ IDL }) => {\n const flag = IDL.Variant({ 'disabled' : IDL.Null, 'enabled' : IDL.Null });\n const fees = IDL.Record({\n 'get_current_fee_percentiles' : IDL.Nat,\n 'get_utxos_maximum' : IDL.Nat,\n 'get_current_fee_percentiles_maximum' : IDL.Nat,\n 'send_transaction_per_byte' : IDL.Nat,\n 'get_balance' : IDL.Nat,\n 'get_utxos_cycles_per_ten_instructions' : IDL.Nat,\n 'get_utxos_base' : IDL.Nat,\n 'get_balance_maximum' : IDL.Nat,\n 'send_transaction_base' : IDL.Nat,\n });\n const network = IDL.Variant({\n 'mainnet' : IDL.Null,\n 'regtest' : IDL.Null,\n 'testnet' : IDL.Null,\n });\n const init_config = IDL.Record({\n 'api_access' : IDL.Opt(flag),\n 'lazily_evaluate_fee_percentiles' : IDL.Opt(flag),\n 'blocks_source' : IDL.Opt(IDL.Principal),\n 'fees' : IDL.Opt(fees),\n 'watchdog_canister' : IDL.Opt(IDL.Opt(IDL.Principal)),\n 'network' : IDL.Opt(network),\n 'stability_threshold' : IDL.Opt(IDL.Nat),\n 'syncing' : IDL.Opt(flag),\n 'burn_cycles' : IDL.Opt(flag),\n 'disable_api_if_not_fully_synced' : IDL.Opt(flag),\n });\n const address = IDL.Text;\n const get_balance_request = IDL.Record({\n 'network' : network,\n 'address' : address,\n 'min_confirmations' : IDL.Opt(IDL.Nat32),\n });\n const satoshi = IDL.Nat64;\n const block_height = IDL.Nat32;\n const get_block_headers_request = IDL.Record({\n 'start_height' : block_height,\n 'end_height' : IDL.Opt(block_height),\n });\n const block_header = IDL.Vec(IDL.Nat8);\n const get_block_headers_response = IDL.Record({\n 'tip_height' : block_height,\n 'block_headers' : IDL.Vec(block_header),\n });\n const get_current_fee_percentiles_request = IDL.Record({\n 'network' : network,\n });\n const millisatoshi_per_byte = IDL.Nat64;\n const get_utxos_request = IDL.Record({\n 'network' : network,\n 'filter' : IDL.Opt(\n IDL.Variant({\n 'page' : IDL.Vec(IDL.Nat8),\n 'min_confirmations' : IDL.Nat32,\n })\n ),\n 'address' : address,\n });\n const block_hash = IDL.Vec(IDL.Nat8);\n const outpoint = IDL.Record({\n 'txid' : IDL.Vec(IDL.Nat8),\n 'vout' : IDL.Nat32,\n });\n const utxo = IDL.Record({\n 'height' : block_height,\n 'value' : satoshi,\n 'outpoint' : outpoint,\n });\n const get_utxos_response = IDL.Record({\n 'next_page' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'tip_height' : block_height,\n 'tip_block_hash' : block_hash,\n 'utxos' : IDL.Vec(utxo),\n });\n const send_transaction_request = IDL.Record({\n 'transaction' : IDL.Vec(IDL.Nat8),\n 'network' : network,\n });\n const config = IDL.Record({\n 'api_access' : flag,\n 'lazily_evaluate_fee_percentiles' : flag,\n 'blocks_source' : IDL.Principal,\n 'fees' : fees,\n 'watchdog_canister' : IDL.Opt(IDL.Principal),\n 'network' : network,\n 'stability_threshold' : IDL.Nat,\n 'syncing' : flag,\n 'burn_cycles' : flag,\n 'disable_api_if_not_fully_synced' : flag,\n });\n const set_config_request = IDL.Record({\n 'api_access' : IDL.Opt(flag),\n 'lazily_evaluate_fee_percentiles' : IDL.Opt(flag),\n 'fees' : IDL.Opt(fees),\n 'watchdog_canister' : IDL.Opt(IDL.Opt(IDL.Principal)),\n 'stability_threshold' : IDL.Opt(IDL.Nat),\n 'syncing' : IDL.Opt(flag),\n 'burn_cycles' : IDL.Opt(flag),\n 'disable_api_if_not_fully_synced' : IDL.Opt(flag),\n });\n return IDL.Service({\n 'bitcoin_get_balance' : IDL.Func([get_balance_request], [satoshi], []),\n 'bitcoin_get_balance_query' : IDL.Func(\n [get_balance_request],\n [satoshi],\n [],\n ),\n 'bitcoin_get_block_headers' : IDL.Func(\n [get_block_headers_request],\n [get_block_headers_response],\n [],\n ),\n 'bitcoin_get_current_fee_percentiles' : IDL.Func(\n [get_current_fee_percentiles_request],\n [IDL.Vec(millisatoshi_per_byte)],\n [],\n ),\n 'bitcoin_get_utxos' : IDL.Func(\n [get_utxos_request],\n [get_utxos_response],\n [],\n ),\n 'bitcoin_get_utxos_query' : IDL.Func(\n [get_utxos_request],\n [get_utxos_response],\n [],\n ),\n 'bitcoin_send_transaction' : IDL.Func([send_transaction_request], [], []),\n 'get_config' : IDL.Func([], [config], []),\n 'set_config' : IDL.Func([set_config_request], [], []),\n });\n};\nexport const init = ({ IDL }) => {\n const flag = IDL.Variant({ 'disabled' : IDL.Null, 'enabled' : IDL.Null });\n const fees = IDL.Record({\n 'get_current_fee_percentiles' : IDL.Nat,\n 'get_utxos_maximum' : IDL.Nat,\n 'get_current_fee_percentiles_maximum' : IDL.Nat,\n 'send_transaction_per_byte' : IDL.Nat,\n 'get_balance' : IDL.Nat,\n 'get_utxos_cycles_per_ten_instructions' : IDL.Nat,\n 'get_utxos_base' : IDL.Nat,\n 'get_balance_maximum' : IDL.Nat,\n 'send_transaction_base' : IDL.Nat,\n });\n const network = IDL.Variant({\n 'mainnet' : IDL.Null,\n 'regtest' : IDL.Null,\n 'testnet' : IDL.Null,\n });\n const init_config = IDL.Record({\n 'api_access' : IDL.Opt(flag),\n 'lazily_evaluate_fee_percentiles' : IDL.Opt(flag),\n 'blocks_source' : IDL.Opt(IDL.Principal),\n 'fees' : IDL.Opt(fees),\n 'watchdog_canister' : IDL.Opt(IDL.Opt(IDL.Principal)),\n 'network' : IDL.Opt(network),\n 'stability_threshold' : IDL.Opt(IDL.Nat),\n 'syncing' : IDL.Opt(flag),\n 'burn_cycles' : IDL.Opt(flag),\n 'disable_api_if_not_fully_synced' : IDL.Opt(flag),\n });\n return [init_config];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ckbtc/candid/bitcoin.did */\nexport const idlFactory = ({ IDL }) => {\n const flag = IDL.Variant({ 'disabled' : IDL.Null, 'enabled' : IDL.Null });\n const fees = IDL.Record({\n 'get_current_fee_percentiles' : IDL.Nat,\n 'get_utxos_maximum' : IDL.Nat,\n 'get_current_fee_percentiles_maximum' : IDL.Nat,\n 'send_transaction_per_byte' : IDL.Nat,\n 'get_balance' : IDL.Nat,\n 'get_utxos_cycles_per_ten_instructions' : IDL.Nat,\n 'get_utxos_base' : IDL.Nat,\n 'get_balance_maximum' : IDL.Nat,\n 'send_transaction_base' : IDL.Nat,\n });\n const network = IDL.Variant({\n 'mainnet' : IDL.Null,\n 'regtest' : IDL.Null,\n 'testnet' : IDL.Null,\n });\n const init_config = IDL.Record({\n 'api_access' : IDL.Opt(flag),\n 'lazily_evaluate_fee_percentiles' : IDL.Opt(flag),\n 'blocks_source' : IDL.Opt(IDL.Principal),\n 'fees' : IDL.Opt(fees),\n 'watchdog_canister' : IDL.Opt(IDL.Opt(IDL.Principal)),\n 'network' : IDL.Opt(network),\n 'stability_threshold' : IDL.Opt(IDL.Nat),\n 'syncing' : IDL.Opt(flag),\n 'burn_cycles' : IDL.Opt(flag),\n 'disable_api_if_not_fully_synced' : IDL.Opt(flag),\n });\n const address = IDL.Text;\n const get_balance_request = IDL.Record({\n 'network' : network,\n 'address' : address,\n 'min_confirmations' : IDL.Opt(IDL.Nat32),\n });\n const satoshi = IDL.Nat64;\n const block_height = IDL.Nat32;\n const get_block_headers_request = IDL.Record({\n 'start_height' : block_height,\n 'end_height' : IDL.Opt(block_height),\n });\n const block_header = IDL.Vec(IDL.Nat8);\n const get_block_headers_response = IDL.Record({\n 'tip_height' : block_height,\n 'block_headers' : IDL.Vec(block_header),\n });\n const get_current_fee_percentiles_request = IDL.Record({\n 'network' : network,\n });\n const millisatoshi_per_byte = IDL.Nat64;\n const get_utxos_request = IDL.Record({\n 'network' : network,\n 'filter' : IDL.Opt(\n IDL.Variant({\n 'page' : IDL.Vec(IDL.Nat8),\n 'min_confirmations' : IDL.Nat32,\n })\n ),\n 'address' : address,\n });\n const block_hash = IDL.Vec(IDL.Nat8);\n const outpoint = IDL.Record({\n 'txid' : IDL.Vec(IDL.Nat8),\n 'vout' : IDL.Nat32,\n });\n const utxo = IDL.Record({\n 'height' : block_height,\n 'value' : satoshi,\n 'outpoint' : outpoint,\n });\n const get_utxos_response = IDL.Record({\n 'next_page' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'tip_height' : block_height,\n 'tip_block_hash' : block_hash,\n 'utxos' : IDL.Vec(utxo),\n });\n const send_transaction_request = IDL.Record({\n 'transaction' : IDL.Vec(IDL.Nat8),\n 'network' : network,\n });\n const config = IDL.Record({\n 'api_access' : flag,\n 'lazily_evaluate_fee_percentiles' : flag,\n 'blocks_source' : IDL.Principal,\n 'fees' : fees,\n 'watchdog_canister' : IDL.Opt(IDL.Principal),\n 'network' : network,\n 'stability_threshold' : IDL.Nat,\n 'syncing' : flag,\n 'burn_cycles' : flag,\n 'disable_api_if_not_fully_synced' : flag,\n });\n const set_config_request = IDL.Record({\n 'api_access' : IDL.Opt(flag),\n 'lazily_evaluate_fee_percentiles' : IDL.Opt(flag),\n 'fees' : IDL.Opt(fees),\n 'watchdog_canister' : IDL.Opt(IDL.Opt(IDL.Principal)),\n 'stability_threshold' : IDL.Opt(IDL.Nat),\n 'syncing' : IDL.Opt(flag),\n 'burn_cycles' : IDL.Opt(flag),\n 'disable_api_if_not_fully_synced' : IDL.Opt(flag),\n });\n return IDL.Service({\n 'bitcoin_get_balance' : IDL.Func([get_balance_request], [satoshi], []),\n 'bitcoin_get_balance_query' : IDL.Func(\n [get_balance_request],\n [satoshi],\n ['query'],\n ),\n 'bitcoin_get_block_headers' : IDL.Func(\n [get_block_headers_request],\n [get_block_headers_response],\n [],\n ),\n 'bitcoin_get_current_fee_percentiles' : IDL.Func(\n [get_current_fee_percentiles_request],\n [IDL.Vec(millisatoshi_per_byte)],\n [],\n ),\n 'bitcoin_get_utxos' : IDL.Func(\n [get_utxos_request],\n [get_utxos_response],\n [],\n ),\n 'bitcoin_get_utxos_query' : IDL.Func(\n [get_utxos_request],\n [get_utxos_response],\n ['query'],\n ),\n 'bitcoin_send_transaction' : IDL.Func([send_transaction_request], [], []),\n 'get_config' : IDL.Func([], [config], ['query']),\n 'set_config' : IDL.Func([set_config_request], [], []),\n });\n};\nexport const init = ({ IDL }) => {\n const flag = IDL.Variant({ 'disabled' : IDL.Null, 'enabled' : IDL.Null });\n const fees = IDL.Record({\n 'get_current_fee_percentiles' : IDL.Nat,\n 'get_utxos_maximum' : IDL.Nat,\n 'get_current_fee_percentiles_maximum' : IDL.Nat,\n 'send_transaction_per_byte' : IDL.Nat,\n 'get_balance' : IDL.Nat,\n 'get_utxos_cycles_per_ten_instructions' : IDL.Nat,\n 'get_utxos_base' : IDL.Nat,\n 'get_balance_maximum' : IDL.Nat,\n 'send_transaction_base' : IDL.Nat,\n });\n const network = IDL.Variant({\n 'mainnet' : IDL.Null,\n 'regtest' : IDL.Null,\n 'testnet' : IDL.Null,\n });\n const init_config = IDL.Record({\n 'api_access' : IDL.Opt(flag),\n 'lazily_evaluate_fee_percentiles' : IDL.Opt(flag),\n 'blocks_source' : IDL.Opt(IDL.Principal),\n 'fees' : IDL.Opt(fees),\n 'watchdog_canister' : IDL.Opt(IDL.Opt(IDL.Principal)),\n 'network' : IDL.Opt(network),\n 'stability_threshold' : IDL.Opt(IDL.Nat),\n 'syncing' : IDL.Opt(flag),\n 'burn_cycles' : IDL.Opt(flag),\n 'disable_api_if_not_fully_synced' : IDL.Opt(flag),\n });\n return [init_config];\n};\n", "import { toNullable, type QueryParams } from \"@dfinity/utils\";\nimport type { get_utxos_request } from \"../../candid/bitcoin\";\n\nexport type BitcoinNetwork = \"testnet\" | \"mainnet\";\n\nexport type GetUtxosParams = Omit<get_utxos_request, \"network\" | \"filter\"> & {\n network: BitcoinNetwork;\n filter?: { page: Uint8Array | number[] } | { min_confirmations: number };\n} & QueryParams;\n\nexport const toGetUtxosParams = ({\n network,\n filter,\n ...rest\n}: GetUtxosParams): get_utxos_request => ({\n filter: toNullable(filter),\n network: network === \"testnet\" ? { testnet: null } : { mainnet: null },\n ...rest,\n});\n"],
|
|
5
|
-
"mappings": "AAAA,OAAS,YAAAA,EAAU,kBAAAC,MAAsB,iBCClC,IAAMC,EAAa,CAAC,CAAE,IAAAC,CAAI,IAAM,CACrC,IAAMC,EAAOD,EAAI,QAAQ,CAAE,SAAaA,EAAI,KAAM,QAAYA,EAAI,IAAK,CAAC,EAClEE,EAAOF,EAAI,OAAO,CACtB,4BAAgCA,EAAI,IACpC,kBAAsBA,EAAI,IAC1B,oCAAwCA,EAAI,IAC5C,0BAA8BA,EAAI,IAClC,YAAgBA,EAAI,IACpB,sCAA0CA,EAAI,IAC9C,eAAmBA,EAAI,IACvB,oBAAwBA,EAAI,IAC5B,sBAA0BA,EAAI,GAChC,CAAC,EACKG,EAAUH,EAAI,QAAQ,CAC1B,QAAYA,EAAI,KAChB,QAAYA,EAAI,KAChB,QAAYA,EAAI,IAClB,CAAC,E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,EAAmB,CAAC,CAC/B,QAAAC,EACA,OAAAC,EACA,GAAGC,CACL,KAA0C,CACxC,OAAQJ,EAAWG,CAAM,EACzB,QAASD,IAAY,UAAY,CAAE,QAAS,IAAK,EAAI,CAAE,QAAS,IAAK,EACrE,GAAGE,CACL,GHRO,IAAMC,EAAN,MAAMC,UAAwBC,CAAyB,CAAvD,kCAwBL,cAAW,CAAC,CACV,UAAAC,EAAY,GACZ,GAAGC,CACL,IAAmD,CACjD,GAAM,CAAE,kBAAAC,EAAmB,wBAAAC,CAAwB,EAAI,KAAK,OAAO,CACjE,UAAAH,CACF,CAAC,EAED,OADWA,EAAYE,EAAoBC,GACjCC,EAAiBH,CAAM,CAAC,CACpC,EAhCA,OAAO,OAAOI,EAA+C,CAC3D,GAAM,CAAE,QAAAC,EAAS,iBAAAC,EAAkB,WAAAC,CAAW,EAC5CC,EAA+B,CAC7B,QAAAJ,EACA,WAAAK,EACA,oBAAAA,CACF,CAAC,EAEH,OAAO,IAAIZ,EAAgBU,EAAYF,EAASC,CAAgB,CAClE,CAwBF",
|
|
6
|
-
"names": ["Canister", "createServices", "idlFactory", "IDL", "flag", "fees", "network", "init_config", "address", "get_balance_request", "satoshi", "block_height", "get_block_headers_request", "block_header", "get_block_headers_response", "get_current_fee_percentiles_request", "millisatoshi_per_byte", "get_utxos_request", "block_hash", "outpoint", "utxo", "get_utxos_response", "send_transaction_request", "config", "set_config_request", "idlFactory", "IDL", "flag", "fees", "network", "init_config", "address", "get_balance_request", "satoshi", "block_height", "get_block_headers_request", "block_header", "get_block_headers_response", "get_current_fee_percentiles_request", "millisatoshi_per_byte", "get_utxos_request", "block_hash", "outpoint", "utxo", "get_utxos_response", "send_transaction_request", "config", "set_config_request", "toNullable", "toGetUtxosParams", "network", "filter", "rest", "BitcoinCanister", "_BitcoinCanister", "Canister", "certified", "params", "bitcoin_get_utxos", "bitcoin_get_utxos_query", "toGetUtxosParams", "options", "service", "certifiedService", "canisterId", "createServices", "idlFactory"]
|
|
7
|
-
}
|