@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,231 @@
1
+ export const idlFactory = ({ IDL }) => {
2
+ const SplitRule = IDL.Record({
3
+ 'account_canister_id' : IDL.Nat64,
4
+ 'percentage' : IDL.Nat16,
5
+ });
6
+ const Account = IDL.Record({
7
+ 'account_canister_id' : IDL.Nat64,
8
+ 'platform_fee_percentage' : IDL.Nat16,
9
+ 'subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),
10
+ 'wallet_address' : IDL.Text,
11
+ 'icp_account_identifier' : IDL.Opt(IDL.Text),
12
+ 'platform_fee_fixed' : IDL.Opt(IDL.Nat),
13
+ 'is_active' : IDL.Bool,
14
+ 'splits' : IDL.Vec(SplitRule),
15
+ });
16
+ const Result = IDL.Variant({ 'Ok' : IDL.Null, 'Err' : IDL.Text });
17
+ const TransactionStatus = IDL.Variant({
18
+ 'Failed' : IDL.Text,
19
+ 'Processed' : IDL.Null,
20
+ 'Received' : IDL.Null,
21
+ 'Completed' : IDL.Null,
22
+ 'Pending' : IDL.Null,
23
+ });
24
+ const Split = IDL.Record({
25
+ 'account_canister_id' : IDL.Nat64,
26
+ 'index_block' : IDL.Opt(IDL.Nat64),
27
+ 'timestamp' : IDL.Opt(IDL.Nat64),
28
+ 'account_percentage' : IDL.Nat16,
29
+ 'amount' : IDL.Nat,
30
+ });
31
+ const Transaction = IDL.Record({
32
+ 'id' : IDL.Nat,
33
+ 'status' : TransactionStatus,
34
+ 'account_canister_id' : IDL.Nat64,
35
+ 'platform_fee_amount' : IDL.Nat,
36
+ 'transfer_fee' : IDL.Nat,
37
+ 'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
38
+ 'timestamp_to_account' : IDL.Opt(IDL.Nat64),
39
+ 'notify_processing' : IDL.Bool,
40
+ 'timestamp' : IDL.Nat64,
41
+ 'index_received' : IDL.Opt(IDL.Nat64),
42
+ 'sender_principal_id' : IDL.Text,
43
+ 'account_amount' : IDL.Nat,
44
+ 'ledger_canister_id' : IDL.Text,
45
+ 'splits' : IDL.Vec(Split),
46
+ 'timestamp_received' : IDL.Opt(IDL.Nat64),
47
+ 'amount' : IDL.Nat,
48
+ });
49
+ const TransactionResult = IDL.Record({
50
+ 'transactions' : IDL.Vec(Transaction),
51
+ 'total_count' : IDL.Nat32,
52
+ 'has_more' : IDL.Bool,
53
+ });
54
+ const CanisterMetrics = IDL.Record({
55
+ 'total_accounts' : IDL.Nat32,
56
+ 'cycles_balance' : IDL.Nat64,
57
+ 'controllers' : IDL.Vec(IDL.Principal),
58
+ 'is_healthy' : IDL.Bool,
59
+ 'last_update_timestamp' : IDL.Nat64,
60
+ 'active_accounts' : IDL.Nat32,
61
+ 'memory_size_bytes' : IDL.Nat64,
62
+ 'total_transactions' : IDL.Nat32,
63
+ 'platform_wallet' : IDL.Text,
64
+ });
65
+ const Payout = IDL.Record({
66
+ 'id' : IDL.Nat,
67
+ 'fee' : IDL.Nat,
68
+ 'status' : TransactionStatus,
69
+ 'account_canister_id' : IDL.Nat64,
70
+ 'to_principal' : IDL.Text,
71
+ 'to_subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),
72
+ 'from_subaccount' : IDL.Vec(IDL.Nat8),
73
+ 'icp_account_identifier' : IDL.Opt(IDL.Text),
74
+ 'timestamp_created' : IDL.Nat64,
75
+ 'index' : IDL.Opt(IDL.Nat64),
76
+ 'ledger_canister_id' : IDL.Text,
77
+ 'timestamp_completed' : IDL.Opt(IDL.Nat64),
78
+ 'amount' : IDL.Nat,
79
+ 'status_message' : IDL.Opt(IDL.Text),
80
+ });
81
+ const Refund = IDL.Record({
82
+ 'status' : TransactionStatus,
83
+ 'timestamp_platform_to_account' : IDL.Opt(IDL.Nat64),
84
+ 'account_canister_id' : IDL.Nat64,
85
+ 'original_tx_id' : IDL.Nat,
86
+ 'notify_processing' : IDL.Bool,
87
+ 'timestamp_created' : IDL.Nat64,
88
+ 'timestamp_to_sender' : IDL.Opt(IDL.Nat64),
89
+ 'ledger_canister_id' : IDL.Text,
90
+ 'amount' : IDL.Nat,
91
+ 'platform_refund_amount' : IDL.Nat,
92
+ 'index_to_sender' : IDL.Opt(IDL.Nat64),
93
+ 'index_platform_to_account' : IDL.Opt(IDL.Nat64),
94
+ });
95
+ const PublicTxStatus = IDL.Record({
96
+ 'status' : TransactionStatus,
97
+ 'amount' : IDL.Nat,
98
+ });
99
+ const TransactionFilter = IDL.Record({
100
+ 'from_timestamp' : IDL.Opt(IDL.Nat64),
101
+ 'status' : IDL.Opt(TransactionStatus),
102
+ 'account_canister_id' : IDL.Opt(IDL.Nat64),
103
+ 'from_id' : IDL.Opt(IDL.Nat),
104
+ 'offset' : IDL.Opt(IDL.Nat32),
105
+ 'limit' : IDL.Opt(IDL.Nat32),
106
+ 'to_timestamp' : IDL.Opt(IDL.Nat64),
107
+ 'ledger_canister_id' : IDL.Opt(IDL.Text),
108
+ });
109
+ const Icrc21ConsentMessageMetadata = IDL.Record({
110
+ 'utc_offset_minutes' : IDL.Opt(IDL.Int16),
111
+ 'language' : IDL.Text,
112
+ });
113
+ const Icrc21DeviceSpec = IDL.Variant({
114
+ 'GenericDisplay' : IDL.Null,
115
+ 'LineDisplay' : IDL.Record({
116
+ 'characters_per_line' : IDL.Nat16,
117
+ 'lines_per_page' : IDL.Nat16,
118
+ }),
119
+ });
120
+ const Icrc21ConsentMessageSpec = IDL.Record({
121
+ 'metadata' : Icrc21ConsentMessageMetadata,
122
+ 'device_spec' : IDL.Opt(Icrc21DeviceSpec),
123
+ });
124
+ const Icrc21ConsentMessageRequest = IDL.Record({
125
+ 'arg' : IDL.Vec(IDL.Nat8),
126
+ 'method' : IDL.Text,
127
+ 'user_preferences' : Icrc21ConsentMessageSpec,
128
+ });
129
+ const Icrc21Page = IDL.Record({ 'lines' : IDL.Vec(IDL.Text) });
130
+ const Icrc21ConsentMessage = IDL.Variant({
131
+ 'LineDisplayMessage' : IDL.Record({ 'pages' : IDL.Vec(Icrc21Page) }),
132
+ 'GenericDisplayMessage' : IDL.Text,
133
+ });
134
+ const Icrc21ConsentInfo = IDL.Record({
135
+ 'metadata' : Icrc21ConsentMessageMetadata,
136
+ 'consent_message' : Icrc21ConsentMessage,
137
+ });
138
+ const Icrc21ErrorInfo = IDL.Record({ 'description' : IDL.Text });
139
+ const Icrc21Error = IDL.Variant({
140
+ 'GenericError' : IDL.Record({
141
+ 'description' : IDL.Text,
142
+ 'error_code' : IDL.Nat64,
143
+ }),
144
+ 'InsufficientPayment' : Icrc21ErrorInfo,
145
+ 'UnsupportedCanisterCall' : Icrc21ErrorInfo,
146
+ 'ConsentMessageUnavailable' : Icrc21ErrorInfo,
147
+ });
148
+ const Icrc21ConsentMessageResponse = IDL.Variant({
149
+ 'Ok' : Icrc21ConsentInfo,
150
+ 'Err' : Icrc21Error,
151
+ });
152
+ const AccountRecord = IDL.Record({
153
+ 'account_canister_id' : IDL.Nat64,
154
+ 'account' : Account,
155
+ });
156
+ const LedgerTransactionNotification = IDL.Record({
157
+ 'block_index' : IDL.Nat64,
158
+ 'ledger_canister_id' : IDL.Text,
159
+ });
160
+ const NotifyResult = IDL.Record({
161
+ 'id' : IDL.Text,
162
+ 'status' : TransactionStatus,
163
+ 'amount' : IDL.Nat,
164
+ });
165
+ const Result_1 = IDL.Variant({ 'Ok' : NotifyResult, 'Err' : IDL.Text });
166
+ const Result_2 = IDL.Variant({ 'Ok' : Payout, 'Err' : IDL.Text });
167
+ const Result_3 = IDL.Variant({ 'Ok' : IDL.Nat, 'Err' : IDL.Text });
168
+ const WithdrawRequest = IDL.Record({
169
+ 'recipient' : IDL.Text,
170
+ 'ledger_canister_id' : IDL.Text,
171
+ 'amount' : IDL.Nat,
172
+ });
173
+ const Result_4 = IDL.Variant({ 'Ok' : IDL.Text, 'Err' : IDL.Text });
174
+ return IDL.Service({
175
+ 'add_account' : IDL.Func([IDL.Nat64, Account], [Result], []),
176
+ 'get_account' : IDL.Func([IDL.Nat64], [IDL.Opt(Account)], ['query']),
177
+ 'get_account_transactions' : IDL.Func(
178
+ [IDL.Nat64, IDL.Opt(IDL.Nat32), IDL.Opt(IDL.Nat32)],
179
+ [TransactionResult],
180
+ ['query'],
181
+ ),
182
+ 'get_canister_info' : IDL.Func([], [CanisterMetrics], []),
183
+ 'get_controller' : IDL.Func([], [IDL.Principal], ['query']),
184
+ 'get_controllers' : IDL.Func([], [IDL.Vec(IDL.Principal)], ['query']),
185
+ 'get_ledger_transactions' : IDL.Func(
186
+ [IDL.Text, IDL.Opt(IDL.Nat32), IDL.Opt(IDL.Nat32)],
187
+ [TransactionResult],
188
+ ['query'],
189
+ ),
190
+ 'get_payout' : IDL.Func([IDL.Nat], [IDL.Opt(Payout)], ['query']),
191
+ 'get_platform_wallet' : IDL.Func([], [IDL.Text], ['query']),
192
+ 'get_refund_by_original_tx_id' : IDL.Func(
193
+ [IDL.Nat],
194
+ [IDL.Opt(Refund)],
195
+ ['query'],
196
+ ),
197
+ 'get_transaction' : IDL.Func([IDL.Nat], [IDL.Opt(Transaction)], ['query']),
198
+ 'get_transaction_status_public' : IDL.Func(
199
+ [IDL.Nat64, IDL.Nat, IDL.Opt(IDL.Nat64)],
200
+ [IDL.Opt(PublicTxStatus)],
201
+ ['query'],
202
+ ),
203
+ 'get_transactions' : IDL.Func(
204
+ [TransactionFilter],
205
+ [TransactionResult],
206
+ ['query'],
207
+ ),
208
+ 'icrc21_canister_call_consent_message' : IDL.Func(
209
+ [Icrc21ConsentMessageRequest],
210
+ [Icrc21ConsentMessageResponse],
211
+ [],
212
+ ),
213
+ 'initialize_controllers' : IDL.Func([], [Result], []),
214
+ 'list_accounts' : IDL.Func([], [IDL.Vec(AccountRecord)], ['query']),
215
+ 'notify_ledger_transaction' : IDL.Func(
216
+ [LedgerTransactionNotification],
217
+ [Result_1],
218
+ [],
219
+ ),
220
+ 'remove_account' : IDL.Func([IDL.Nat64], [Result], []),
221
+ 'request_payout' : IDL.Func([IDL.Nat64, IDL.Text, IDL.Nat], [Result_2], []),
222
+ 'request_refund' : IDL.Func([IDL.Nat], [Result_3], []),
223
+ 'retry_payout' : IDL.Func([IDL.Nat], [Result_2], []),
224
+ 'set_controller' : IDL.Func([IDL.Principal], [Result], []),
225
+ 'set_platform_wallet' : IDL.Func([IDL.Text], [Result], []),
226
+ 'update_account' : IDL.Func([IDL.Nat64, Account], [Result], []),
227
+ 'update_controllers' : IDL.Func([], [Result], []),
228
+ 'withdraw_funds' : IDL.Func([WithdrawRequest], [Result_4], []),
229
+ });
230
+ };
231
+ export const init = ({ IDL }) => { return []; };