@ic-pay/icpay-sdk 1.3.61

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 (38) hide show
  1. package/README.md +32 -0
  2. package/dist/declarations/icp-ledger/icp-ledger.did.d.ts +82 -0
  3. package/dist/declarations/icp-ledger/icp-ledger.did.js +76 -0
  4. package/dist/declarations/icpay_canister_backend/icpay_canister_backend.did +193 -0
  5. package/dist/declarations/icpay_canister_backend/icpay_canister_backend.did.d.ts +219 -0
  6. package/dist/declarations/icpay_canister_backend/icpay_canister_backend.did.js +231 -0
  7. package/dist/declarations/icrc-ledger/ledger.did +560 -0
  8. package/dist/declarations/icrc-ledger/ledger.did.d.ts +364 -0
  9. package/dist/declarations/icrc-ledger/ledger.did.js +530 -0
  10. package/dist/errors.d.ts +72 -0
  11. package/dist/errors.d.ts.map +1 -0
  12. package/dist/errors.js +162 -0
  13. package/dist/errors.js.map +1 -0
  14. package/dist/events.d.ts +24 -0
  15. package/dist/events.d.ts.map +1 -0
  16. package/dist/events.js +131 -0
  17. package/dist/events.js.map +1 -0
  18. package/dist/index.d.ts +163 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +1211 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/protected.d.ts +28 -0
  23. package/dist/protected.d.ts.map +1 -0
  24. package/dist/protected.js +336 -0
  25. package/dist/protected.js.map +1 -0
  26. package/dist/types/index.d.ts +482 -0
  27. package/dist/types/index.d.ts.map +1 -0
  28. package/dist/types/index.js +3 -0
  29. package/dist/types/index.js.map +1 -0
  30. package/dist/utils.d.ts +15 -0
  31. package/dist/utils.d.ts.map +1 -0
  32. package/dist/utils.js +42 -0
  33. package/dist/utils.js.map +1 -0
  34. package/dist/wallet.d.ts +83 -0
  35. package/dist/wallet.d.ts.map +1 -0
  36. package/dist/wallet.js +261 -0
  37. package/dist/wallet.js.map +1 -0
  38. package/package.json +58 -0
@@ -0,0 +1,364 @@
1
+ import type { Principal } from '@dfinity/principal';
2
+ import type { ActorMethod } from '@dfinity/agent';
3
+ import type { IDL } from '@dfinity/candid';
4
+
5
+ export interface Account {
6
+ 'owner' : Principal,
7
+ 'subaccount' : [] | [Subaccount],
8
+ }
9
+ export interface Allowance {
10
+ 'allowance' : bigint,
11
+ 'expires_at' : [] | [Timestamp],
12
+ }
13
+ export interface Allowance103 {
14
+ 'from_account' : Account,
15
+ 'to_spender' : Account,
16
+ 'allowance' : bigint,
17
+ 'expires_at' : [] | [bigint],
18
+ }
19
+ export interface AllowanceArgs { 'account' : Account, 'spender' : Account }
20
+ export interface Approve {
21
+ 'fee' : [] | [bigint],
22
+ 'from' : Account,
23
+ 'memo' : [] | [Uint8Array | number[]],
24
+ 'created_at_time' : [] | [Timestamp],
25
+ 'amount' : bigint,
26
+ 'expected_allowance' : [] | [bigint],
27
+ 'expires_at' : [] | [Timestamp],
28
+ 'spender' : Account,
29
+ }
30
+ export interface ApproveArgs {
31
+ 'fee' : [] | [bigint],
32
+ 'memo' : [] | [Uint8Array | number[]],
33
+ 'from_subaccount' : [] | [Uint8Array | number[]],
34
+ 'created_at_time' : [] | [Timestamp],
35
+ 'amount' : bigint,
36
+ 'expected_allowance' : [] | [bigint],
37
+ 'expires_at' : [] | [Timestamp],
38
+ 'spender' : Account,
39
+ }
40
+ export type ApproveError = {
41
+ 'GenericError' : { 'message' : string, 'error_code' : bigint }
42
+ } |
43
+ { 'TemporarilyUnavailable' : null } |
44
+ { 'Duplicate' : { 'duplicate_of' : BlockIndex } } |
45
+ { 'BadFee' : { 'expected_fee' : bigint } } |
46
+ { 'AllowanceChanged' : { 'current_allowance' : bigint } } |
47
+ { 'CreatedInFuture' : { 'ledger_time' : Timestamp } } |
48
+ { 'TooOld' : null } |
49
+ { 'Expired' : { 'ledger_time' : Timestamp } } |
50
+ { 'InsufficientFunds' : { 'balance' : bigint } };
51
+ export type ApproveResult = { 'Ok' : BlockIndex } |
52
+ { 'Err' : ApproveError };
53
+ export interface ArchiveInfo {
54
+ 'block_range_end' : BlockIndex,
55
+ 'canister_id' : Principal,
56
+ 'block_range_start' : BlockIndex,
57
+ }
58
+ export type Block = Value;
59
+ export type BlockIndex = bigint;
60
+ export interface BlockRange { 'blocks' : Array<Block> }
61
+ export interface Burn {
62
+ 'from' : Account,
63
+ 'memo' : [] | [Uint8Array | number[]],
64
+ 'created_at_time' : [] | [Timestamp],
65
+ 'amount' : bigint,
66
+ 'spender' : [] | [Account],
67
+ }
68
+ export interface ChangeArchiveOptions {
69
+ 'num_blocks_to_archive' : [] | [bigint],
70
+ 'max_transactions_per_response' : [] | [bigint],
71
+ 'trigger_threshold' : [] | [bigint],
72
+ 'more_controller_ids' : [] | [Array<Principal>],
73
+ 'max_message_size_bytes' : [] | [bigint],
74
+ 'cycles_for_archive_creation' : [] | [bigint],
75
+ 'node_max_memory_size_bytes' : [] | [bigint],
76
+ 'controller_id' : [] | [Principal],
77
+ }
78
+ export type ChangeFeeCollector = { 'SetTo' : Account } |
79
+ { 'Unset' : null };
80
+ export interface DataCertificate {
81
+ 'certificate' : [] | [Uint8Array | number[]],
82
+ 'hash_tree' : Uint8Array | number[],
83
+ }
84
+ export type Duration = bigint;
85
+ export interface FeatureFlags { 'icrc2' : boolean }
86
+ export interface GetAllowancesArgs {
87
+ 'take' : [] | [bigint],
88
+ 'prev_spender' : [] | [Account],
89
+ 'from_account' : [] | [Account],
90
+ }
91
+ export type GetAllowancesError = {
92
+ 'GenericError' : { 'message' : string, 'error_code' : bigint }
93
+ } |
94
+ { 'AccessDenied' : { 'reason' : string } };
95
+ export interface GetArchivesArgs { 'from' : [] | [Principal] }
96
+ export type GetArchivesResult = Array<
97
+ { 'end' : bigint, 'canister_id' : Principal, 'start' : bigint }
98
+ >;
99
+ export interface GetBlocksArgs { 'start' : BlockIndex, 'length' : bigint }
100
+ export interface GetBlocksResponse {
101
+ 'certificate' : [] | [Uint8Array | number[]],
102
+ 'first_index' : BlockIndex,
103
+ 'blocks' : Array<Block>,
104
+ 'chain_length' : bigint,
105
+ 'archived_blocks' : Array<
106
+ {
107
+ 'callback' : QueryBlockArchiveFn,
108
+ 'start' : BlockIndex,
109
+ 'length' : bigint,
110
+ }
111
+ >,
112
+ }
113
+ export interface GetBlocksResult {
114
+ 'log_length' : bigint,
115
+ 'blocks' : Array<{ 'id' : bigint, 'block' : ICRC3Value }>,
116
+ 'archived_blocks' : Array<
117
+ { 'args' : Array<GetBlocksArgs>, 'callback' : [Principal, string] }
118
+ >,
119
+ }
120
+ export type GetIndexPrincipalError = {
121
+ 'GenericError' : { 'description' : string, 'error_code' : bigint }
122
+ } |
123
+ { 'IndexPrincipalNotSet' : null };
124
+ export type GetIndexPrincipalResult = { 'Ok' : Principal } |
125
+ { 'Err' : GetIndexPrincipalError };
126
+ export interface GetTransactionsRequest { 'start' : TxIndex, 'length' : bigint }
127
+ export interface GetTransactionsResponse {
128
+ 'first_index' : TxIndex,
129
+ 'log_length' : bigint,
130
+ 'transactions' : Array<Transaction>,
131
+ 'archived_transactions' : Array<
132
+ { 'callback' : QueryArchiveFn, 'start' : TxIndex, 'length' : bigint }
133
+ >,
134
+ }
135
+ export interface HttpRequest {
136
+ 'url' : string,
137
+ 'method' : string,
138
+ 'body' : Uint8Array | number[],
139
+ 'headers' : Array<[string, string]>,
140
+ }
141
+ export interface HttpResponse {
142
+ 'body' : Uint8Array | number[],
143
+ 'headers' : Array<[string, string]>,
144
+ 'status_code' : number,
145
+ }
146
+ export interface ICRC3DataCertificate {
147
+ 'certificate' : Uint8Array | number[],
148
+ 'hash_tree' : Uint8Array | number[],
149
+ }
150
+ export type ICRC3Value = { 'Int' : bigint } |
151
+ { 'Map' : Array<[string, ICRC3Value]> } |
152
+ { 'Nat' : bigint } |
153
+ { 'Blob' : Uint8Array | number[] } |
154
+ { 'Text' : string } |
155
+ { 'Array' : Array<ICRC3Value> };
156
+ export interface InitArgs {
157
+ 'decimals' : [] | [number],
158
+ 'token_symbol' : string,
159
+ 'transfer_fee' : bigint,
160
+ 'metadata' : Array<[string, MetadataValue]>,
161
+ 'minting_account' : Account,
162
+ 'initial_balances' : Array<[Account, bigint]>,
163
+ 'fee_collector_account' : [] | [Account],
164
+ 'archive_options' : {
165
+ 'num_blocks_to_archive' : bigint,
166
+ 'max_transactions_per_response' : [] | [bigint],
167
+ 'trigger_threshold' : bigint,
168
+ 'more_controller_ids' : [] | [Array<Principal>],
169
+ 'max_message_size_bytes' : [] | [bigint],
170
+ 'cycles_for_archive_creation' : [] | [bigint],
171
+ 'node_max_memory_size_bytes' : [] | [bigint],
172
+ 'controller_id' : Principal,
173
+ },
174
+ 'max_memo_length' : [] | [number],
175
+ 'index_principal' : [] | [Principal],
176
+ 'token_name' : string,
177
+ 'feature_flags' : [] | [FeatureFlags],
178
+ }
179
+ export type LedgerArg = { 'Upgrade' : [] | [UpgradeArgs] } |
180
+ { 'Init' : InitArgs };
181
+ export type Map = Array<[string, Value]>;
182
+ export type MetadataValue = { 'Int' : bigint } |
183
+ { 'Nat' : bigint } |
184
+ { 'Blob' : Uint8Array | number[] } |
185
+ { 'Text' : string };
186
+ export interface Mint {
187
+ 'to' : Account,
188
+ 'memo' : [] | [Uint8Array | number[]],
189
+ 'created_at_time' : [] | [Timestamp],
190
+ 'amount' : bigint,
191
+ }
192
+ export type QueryArchiveFn = ActorMethod<
193
+ [GetTransactionsRequest],
194
+ TransactionRange
195
+ >;
196
+ export type QueryBlockArchiveFn = ActorMethod<[GetBlocksArgs], BlockRange>;
197
+ export interface StandardRecord { 'url' : string, 'name' : string }
198
+ export type Subaccount = Uint8Array | number[];
199
+ export type Timestamp = bigint;
200
+ export type Tokens = bigint;
201
+ export interface Transaction {
202
+ 'burn' : [] | [Burn],
203
+ 'kind' : string,
204
+ 'mint' : [] | [Mint],
205
+ 'approve' : [] | [Approve],
206
+ 'timestamp' : Timestamp,
207
+ 'transfer' : [] | [Transfer],
208
+ }
209
+ export interface TransactionRange { 'transactions' : Array<Transaction> }
210
+ export interface Transfer {
211
+ 'to' : Account,
212
+ 'fee' : [] | [bigint],
213
+ 'from' : Account,
214
+ 'memo' : [] | [Uint8Array | number[]],
215
+ 'created_at_time' : [] | [Timestamp],
216
+ 'amount' : bigint,
217
+ 'spender' : [] | [Account],
218
+ }
219
+ export interface TransferArg {
220
+ 'to' : Account,
221
+ 'fee' : [] | [Tokens],
222
+ 'memo' : [] | [Uint8Array | number[]],
223
+ 'from_subaccount' : [] | [Subaccount],
224
+ 'created_at_time' : [] | [Timestamp],
225
+ 'amount' : Tokens,
226
+ }
227
+ export type TransferError = {
228
+ 'GenericError' : { 'message' : string, 'error_code' : bigint }
229
+ } |
230
+ { 'TemporarilyUnavailable' : null } |
231
+ { 'BadBurn' : { 'min_burn_amount' : Tokens } } |
232
+ { 'Duplicate' : { 'duplicate_of' : BlockIndex } } |
233
+ { 'BadFee' : { 'expected_fee' : Tokens } } |
234
+ { 'CreatedInFuture' : { 'ledger_time' : Timestamp } } |
235
+ { 'TooOld' : null } |
236
+ { 'InsufficientFunds' : { 'balance' : Tokens } };
237
+ export interface TransferFromArgs {
238
+ 'to' : Account,
239
+ 'fee' : [] | [Tokens],
240
+ 'spender_subaccount' : [] | [Subaccount],
241
+ 'from' : Account,
242
+ 'memo' : [] | [Uint8Array | number[]],
243
+ 'created_at_time' : [] | [Timestamp],
244
+ 'amount' : Tokens,
245
+ }
246
+ export type TransferFromError = {
247
+ 'GenericError' : { 'message' : string, 'error_code' : bigint }
248
+ } |
249
+ { 'TemporarilyUnavailable' : null } |
250
+ { 'InsufficientAllowance' : { 'allowance' : Tokens } } |
251
+ { 'BadBurn' : { 'min_burn_amount' : Tokens } } |
252
+ { 'Duplicate' : { 'duplicate_of' : BlockIndex } } |
253
+ { 'BadFee' : { 'expected_fee' : Tokens } } |
254
+ { 'CreatedInFuture' : { 'ledger_time' : Timestamp } } |
255
+ { 'TooOld' : null } |
256
+ { 'InsufficientFunds' : { 'balance' : Tokens } };
257
+ export type TransferFromResult = { 'Ok' : BlockIndex } |
258
+ { 'Err' : TransferFromError };
259
+ export type TransferResult = { 'Ok' : BlockIndex } |
260
+ { 'Err' : TransferError };
261
+ export type TxIndex = bigint;
262
+ export interface UpgradeArgs {
263
+ 'change_archive_options' : [] | [ChangeArchiveOptions],
264
+ 'token_symbol' : [] | [string],
265
+ 'transfer_fee' : [] | [bigint],
266
+ 'metadata' : [] | [Array<[string, MetadataValue]>],
267
+ 'change_fee_collector' : [] | [ChangeFeeCollector],
268
+ 'max_memo_length' : [] | [number],
269
+ 'index_principal' : [] | [Principal],
270
+ 'token_name' : [] | [string],
271
+ 'feature_flags' : [] | [FeatureFlags],
272
+ }
273
+ export type Value = { 'Int' : bigint } |
274
+ { 'Map' : Map } |
275
+ { 'Nat' : bigint } |
276
+ { 'Nat64' : bigint } |
277
+ { 'Blob' : Uint8Array | number[] } |
278
+ { 'Text' : string } |
279
+ { 'Array' : Array<Value> };
280
+ export type icrc103_get_allowances_response = { 'Ok' : Array<Allowance103> } |
281
+ { 'Err' : GetAllowancesError };
282
+ export interface icrc21_consent_info {
283
+ 'metadata' : icrc21_consent_message_metadata,
284
+ 'consent_message' : icrc21_consent_message,
285
+ }
286
+ export type icrc21_consent_message = {
287
+ 'LineDisplayMessage' : { 'pages' : Array<{ 'lines' : Array<string> }> }
288
+ } |
289
+ { 'GenericDisplayMessage' : string };
290
+ export interface icrc21_consent_message_metadata {
291
+ 'utc_offset_minutes' : [] | [number],
292
+ 'language' : string,
293
+ }
294
+ export interface icrc21_consent_message_request {
295
+ 'arg' : Uint8Array | number[],
296
+ 'method' : string,
297
+ 'user_preferences' : icrc21_consent_message_spec,
298
+ }
299
+ export type icrc21_consent_message_response = { 'Ok' : icrc21_consent_info } |
300
+ { 'Err' : icrc21_error };
301
+ export interface icrc21_consent_message_spec {
302
+ 'metadata' : icrc21_consent_message_metadata,
303
+ 'device_spec' : [] | [
304
+ { 'GenericDisplay' : null } |
305
+ {
306
+ 'LineDisplay' : {
307
+ 'characters_per_line' : number,
308
+ 'lines_per_page' : number,
309
+ }
310
+ }
311
+ ],
312
+ }
313
+ export type icrc21_error = {
314
+ 'GenericError' : { 'description' : string, 'error_code' : bigint }
315
+ } |
316
+ { 'InsufficientPayment' : icrc21_error_info } |
317
+ { 'UnsupportedCanisterCall' : icrc21_error_info } |
318
+ { 'ConsentMessageUnavailable' : icrc21_error_info };
319
+ export interface icrc21_error_info { 'description' : string }
320
+ export interface _SERVICE {
321
+ 'archives' : ActorMethod<[], Array<ArchiveInfo>>,
322
+ 'get_blocks' : ActorMethod<[GetBlocksArgs], GetBlocksResponse>,
323
+ 'get_data_certificate' : ActorMethod<[], DataCertificate>,
324
+ 'get_transactions' : ActorMethod<
325
+ [GetTransactionsRequest],
326
+ GetTransactionsResponse
327
+ >,
328
+ 'icrc103_get_allowances' : ActorMethod<
329
+ [GetAllowancesArgs],
330
+ icrc103_get_allowances_response
331
+ >,
332
+ 'icrc106_get_index_principal' : ActorMethod<[], GetIndexPrincipalResult>,
333
+ 'icrc10_supported_standards' : ActorMethod<
334
+ [],
335
+ Array<{ 'url' : string, 'name' : string }>
336
+ >,
337
+ 'icrc1_balance_of' : ActorMethod<[Account], Tokens>,
338
+ 'icrc1_decimals' : ActorMethod<[], number>,
339
+ 'icrc1_fee' : ActorMethod<[], Tokens>,
340
+ 'icrc1_metadata' : ActorMethod<[], Array<[string, MetadataValue]>>,
341
+ 'icrc1_minting_account' : ActorMethod<[], [] | [Account]>,
342
+ 'icrc1_name' : ActorMethod<[], string>,
343
+ 'icrc1_supported_standards' : ActorMethod<[], Array<StandardRecord>>,
344
+ 'icrc1_symbol' : ActorMethod<[], string>,
345
+ 'icrc1_total_supply' : ActorMethod<[], Tokens>,
346
+ 'icrc1_transfer' : ActorMethod<[TransferArg], TransferResult>,
347
+ 'icrc21_canister_call_consent_message' : ActorMethod<
348
+ [icrc21_consent_message_request],
349
+ icrc21_consent_message_response
350
+ >,
351
+ 'icrc2_allowance' : ActorMethod<[AllowanceArgs], Allowance>,
352
+ 'icrc2_approve' : ActorMethod<[ApproveArgs], ApproveResult>,
353
+ 'icrc2_transfer_from' : ActorMethod<[TransferFromArgs], TransferFromResult>,
354
+ 'icrc3_get_archives' : ActorMethod<[GetArchivesArgs], GetArchivesResult>,
355
+ 'icrc3_get_blocks' : ActorMethod<[Array<GetBlocksArgs>], GetBlocksResult>,
356
+ 'icrc3_get_tip_certificate' : ActorMethod<[], [] | [ICRC3DataCertificate]>,
357
+ 'icrc3_supported_block_types' : ActorMethod<
358
+ [],
359
+ Array<{ 'url' : string, 'block_type' : string }>
360
+ >,
361
+ 'is_ledger_ready' : ActorMethod<[], boolean>,
362
+ }
363
+ export declare const idlFactory: IDL.InterfaceFactory;
364
+ export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];