multicoyn-sdk 0.1.0 → 0.1.3

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 (40) hide show
  1. package/dist/App.d.ts +2 -0
  2. package/dist/{ccip-Do0z8AZp.js → ccip-DjOOvUZr.js} +1 -1
  3. package/dist/{ccip-BXLlQVZi.cjs → ccip-DqoTg55K.cjs} +1 -1
  4. package/dist/components/MulticoynButton.d.ts +14 -0
  5. package/dist/components/PaymentModal.d.ts +16 -0
  6. package/dist/components/PaymentSummary.d.ts +7 -0
  7. package/dist/components/TokenSlider.d.ts +8 -0
  8. package/dist/components/icons/CloseIcon.d.ts +6 -0
  9. package/dist/components/icons/InfoIcon.d.ts +6 -0
  10. package/dist/components/icons/ProcessingIcon.d.ts +6 -0
  11. package/dist/components/icons/SearchIcon.d.ts +6 -0
  12. package/dist/components/icons/SuccessIcon.d.ts +6 -0
  13. package/dist/components/icons/index.d.ts +5 -0
  14. package/dist/components/index.d.ts +5 -0
  15. package/dist/components/types.d.ts +42 -0
  16. package/dist/config/abis.d.ts +189 -0
  17. package/dist/config/chains.d.ts +47 -0
  18. package/dist/config/contracts.d.ts +12 -0
  19. package/dist/config/wagmi.d.ts +2 -0
  20. package/dist/constants/payment.d.ts +38 -0
  21. package/dist/hooks/index.d.ts +6 -0
  22. package/dist/hooks/useERC20.d.ts +286 -0
  23. package/dist/hooks/useMultiTokenBalances.d.ts +10 -0
  24. package/dist/hooks/useMultiTokenPrices.d.ts +17 -0
  25. package/dist/hooks/usePaymentModal.d.ts +11 -0
  26. package/dist/hooks/usePaymentRouter.d.ts +254 -0
  27. package/dist/hooks/useTokenRegistry.d.ts +409 -0
  28. package/dist/{index-QyDcHjLV.js → index-B_5-qm4i.js} +394 -391
  29. package/dist/{index-C71hhSSX.cjs → index-CIr9hCZh.cjs} +20 -20
  30. package/dist/index.cjs +1 -1
  31. package/dist/index.d.ts +11 -0
  32. package/dist/index.js +1 -1
  33. package/dist/lib/errors.d.ts +6 -0
  34. package/dist/lib/tokens.d.ts +9 -0
  35. package/dist/main.d.ts +1 -0
  36. package/dist/providers/PaymentContext.d.ts +11 -0
  37. package/dist/providers/PaymentProvider.d.ts +6 -0
  38. package/dist/providers/Web3Provider.d.ts +6 -0
  39. package/dist/providers/usePaymentConfig.d.ts +1 -0
  40. package/package.json +3 -3
@@ -0,0 +1,286 @@
1
+ export declare function useERC20(tokenAddress: `0x${string}`): {
2
+ transfer: (to: `0x${string}`, amount: bigint) => void;
3
+ approve: (spender: `0x${string}`, amount: bigint) => void;
4
+ transferFrom: (from: `0x${string}`, to: `0x${string}`, amount: bigint) => void;
5
+ useName: () => import("wagmi").UseReadContractReturnType<({
6
+ inputs: never[];
7
+ stateMutability: string;
8
+ type: string;
9
+ name?: undefined;
10
+ anonymous?: undefined;
11
+ outputs?: undefined;
12
+ } | {
13
+ inputs: {
14
+ internalType: string;
15
+ name: string;
16
+ type: string;
17
+ }[];
18
+ name: string;
19
+ type: string;
20
+ stateMutability?: undefined;
21
+ anonymous?: undefined;
22
+ outputs?: undefined;
23
+ } | {
24
+ anonymous: boolean;
25
+ inputs: {
26
+ indexed: boolean;
27
+ internalType: string;
28
+ name: string;
29
+ type: string;
30
+ }[];
31
+ name: string;
32
+ type: string;
33
+ stateMutability?: undefined;
34
+ outputs?: undefined;
35
+ } | {
36
+ inputs: {
37
+ internalType: string;
38
+ name: string;
39
+ type: string;
40
+ }[];
41
+ name: string;
42
+ outputs: {
43
+ internalType: string;
44
+ name: string;
45
+ type: string;
46
+ }[];
47
+ stateMutability: string;
48
+ type: string;
49
+ anonymous?: undefined;
50
+ })[], "name", readonly unknown[], unknown>;
51
+ useSymbol: () => import("wagmi").UseReadContractReturnType<({
52
+ inputs: never[];
53
+ stateMutability: string;
54
+ type: string;
55
+ name?: undefined;
56
+ anonymous?: undefined;
57
+ outputs?: undefined;
58
+ } | {
59
+ inputs: {
60
+ internalType: string;
61
+ name: string;
62
+ type: string;
63
+ }[];
64
+ name: string;
65
+ type: string;
66
+ stateMutability?: undefined;
67
+ anonymous?: undefined;
68
+ outputs?: undefined;
69
+ } | {
70
+ anonymous: boolean;
71
+ inputs: {
72
+ indexed: boolean;
73
+ internalType: string;
74
+ name: string;
75
+ type: string;
76
+ }[];
77
+ name: string;
78
+ type: string;
79
+ stateMutability?: undefined;
80
+ outputs?: undefined;
81
+ } | {
82
+ inputs: {
83
+ internalType: string;
84
+ name: string;
85
+ type: string;
86
+ }[];
87
+ name: string;
88
+ outputs: {
89
+ internalType: string;
90
+ name: string;
91
+ type: string;
92
+ }[];
93
+ stateMutability: string;
94
+ type: string;
95
+ anonymous?: undefined;
96
+ })[], "symbol", readonly unknown[], unknown>;
97
+ useDecimals: () => import("wagmi").UseReadContractReturnType<({
98
+ inputs: never[];
99
+ stateMutability: string;
100
+ type: string;
101
+ name?: undefined;
102
+ anonymous?: undefined;
103
+ outputs?: undefined;
104
+ } | {
105
+ inputs: {
106
+ internalType: string;
107
+ name: string;
108
+ type: string;
109
+ }[];
110
+ name: string;
111
+ type: string;
112
+ stateMutability?: undefined;
113
+ anonymous?: undefined;
114
+ outputs?: undefined;
115
+ } | {
116
+ anonymous: boolean;
117
+ inputs: {
118
+ indexed: boolean;
119
+ internalType: string;
120
+ name: string;
121
+ type: string;
122
+ }[];
123
+ name: string;
124
+ type: string;
125
+ stateMutability?: undefined;
126
+ outputs?: undefined;
127
+ } | {
128
+ inputs: {
129
+ internalType: string;
130
+ name: string;
131
+ type: string;
132
+ }[];
133
+ name: string;
134
+ outputs: {
135
+ internalType: string;
136
+ name: string;
137
+ type: string;
138
+ }[];
139
+ stateMutability: string;
140
+ type: string;
141
+ anonymous?: undefined;
142
+ })[], "decimals", readonly unknown[], unknown>;
143
+ useTotalSupply: () => import("wagmi").UseReadContractReturnType<({
144
+ inputs: never[];
145
+ stateMutability: string;
146
+ type: string;
147
+ name?: undefined;
148
+ anonymous?: undefined;
149
+ outputs?: undefined;
150
+ } | {
151
+ inputs: {
152
+ internalType: string;
153
+ name: string;
154
+ type: string;
155
+ }[];
156
+ name: string;
157
+ type: string;
158
+ stateMutability?: undefined;
159
+ anonymous?: undefined;
160
+ outputs?: undefined;
161
+ } | {
162
+ anonymous: boolean;
163
+ inputs: {
164
+ indexed: boolean;
165
+ internalType: string;
166
+ name: string;
167
+ type: string;
168
+ }[];
169
+ name: string;
170
+ type: string;
171
+ stateMutability?: undefined;
172
+ outputs?: undefined;
173
+ } | {
174
+ inputs: {
175
+ internalType: string;
176
+ name: string;
177
+ type: string;
178
+ }[];
179
+ name: string;
180
+ outputs: {
181
+ internalType: string;
182
+ name: string;
183
+ type: string;
184
+ }[];
185
+ stateMutability: string;
186
+ type: string;
187
+ anonymous?: undefined;
188
+ })[], "totalSupply", readonly unknown[], unknown>;
189
+ useBalanceOf: (account?: `0x${string}`) => import("wagmi").UseReadContractReturnType<({
190
+ inputs: never[];
191
+ stateMutability: string;
192
+ type: string;
193
+ name?: undefined;
194
+ anonymous?: undefined;
195
+ outputs?: undefined;
196
+ } | {
197
+ inputs: {
198
+ internalType: string;
199
+ name: string;
200
+ type: string;
201
+ }[];
202
+ name: string;
203
+ type: string;
204
+ stateMutability?: undefined;
205
+ anonymous?: undefined;
206
+ outputs?: undefined;
207
+ } | {
208
+ anonymous: boolean;
209
+ inputs: {
210
+ indexed: boolean;
211
+ internalType: string;
212
+ name: string;
213
+ type: string;
214
+ }[];
215
+ name: string;
216
+ type: string;
217
+ stateMutability?: undefined;
218
+ outputs?: undefined;
219
+ } | {
220
+ inputs: {
221
+ internalType: string;
222
+ name: string;
223
+ type: string;
224
+ }[];
225
+ name: string;
226
+ outputs: {
227
+ internalType: string;
228
+ name: string;
229
+ type: string;
230
+ }[];
231
+ stateMutability: string;
232
+ type: string;
233
+ anonymous?: undefined;
234
+ })[], "balanceOf", readonly unknown[], unknown>;
235
+ useAllowance: (owner?: `0x${string}`, spender?: `0x${string}`) => import("wagmi").UseReadContractReturnType<({
236
+ inputs: never[];
237
+ stateMutability: string;
238
+ type: string;
239
+ name?: undefined;
240
+ anonymous?: undefined;
241
+ outputs?: undefined;
242
+ } | {
243
+ inputs: {
244
+ internalType: string;
245
+ name: string;
246
+ type: string;
247
+ }[];
248
+ name: string;
249
+ type: string;
250
+ stateMutability?: undefined;
251
+ anonymous?: undefined;
252
+ outputs?: undefined;
253
+ } | {
254
+ anonymous: boolean;
255
+ inputs: {
256
+ indexed: boolean;
257
+ internalType: string;
258
+ name: string;
259
+ type: string;
260
+ }[];
261
+ name: string;
262
+ type: string;
263
+ stateMutability?: undefined;
264
+ outputs?: undefined;
265
+ } | {
266
+ inputs: {
267
+ internalType: string;
268
+ name: string;
269
+ type: string;
270
+ }[];
271
+ name: string;
272
+ outputs: {
273
+ internalType: string;
274
+ name: string;
275
+ type: string;
276
+ }[];
277
+ stateMutability: string;
278
+ type: string;
279
+ anonymous?: undefined;
280
+ })[], "allowance", readonly unknown[], unknown>;
281
+ hash: `0x${string}` | undefined;
282
+ isPending: boolean;
283
+ isConfirming: boolean;
284
+ isConfirmed: boolean;
285
+ error: import("@wagmi/core").WriteContractErrorType | null;
286
+ };
@@ -0,0 +1,10 @@
1
+ export declare function useMultiTokenBalances(): {
2
+ balances: {
3
+ ETH: number;
4
+ USDC: number;
5
+ USDT: number;
6
+ DAI: number;
7
+ WBTC: number;
8
+ };
9
+ isLoading: boolean;
10
+ };
@@ -0,0 +1,17 @@
1
+ export declare function useMultiTokenPrices(): {
2
+ prices: {
3
+ ETH: number;
4
+ USDC: number;
5
+ USDT: number;
6
+ DAI: number;
7
+ WBTC: number;
8
+ };
9
+ isLoading: boolean;
10
+ errors: {
11
+ ETH: import("viem").ReadContractErrorType | null;
12
+ USDC: import("viem").ReadContractErrorType | null;
13
+ USDT: import("viem").ReadContractErrorType | null;
14
+ DAI: import("viem").ReadContractErrorType | null;
15
+ WBTC: import("viem").ReadContractErrorType | null;
16
+ };
17
+ };
@@ -0,0 +1,11 @@
1
+ type ModalView = "form" | "processing" | "success";
2
+ export declare function usePaymentModal(): {
3
+ isOpen: boolean;
4
+ view: ModalView;
5
+ open: () => void;
6
+ close: () => void;
7
+ showProcessing: () => void;
8
+ showSuccess: () => void;
9
+ showForm: () => void;
10
+ };
11
+ export {};
@@ -0,0 +1,254 @@
1
+ interface Token {
2
+ address: `0x${string}`;
3
+ symbol: string;
4
+ decimals: number;
5
+ priceUSD: number;
6
+ percentage: number;
7
+ amount: number;
8
+ }
9
+ interface PaymentParams {
10
+ merchantAddress: `0x${string}`;
11
+ tokens: Token[];
12
+ totalAmountUSD: number;
13
+ settleInIDR: boolean;
14
+ }
15
+ export declare function usePaymentRouter(): {
16
+ executePayment: ({ merchantAddress, tokens, totalAmountUSD, settleInIDR, }: PaymentParams) => Promise<`0x${string}`>;
17
+ useTokenRegistry: () => import("wagmi").UseReadContractReturnType<({
18
+ inputs: {
19
+ internalType: string;
20
+ name: string;
21
+ type: string;
22
+ }[];
23
+ stateMutability: string;
24
+ type: string;
25
+ name?: undefined;
26
+ anonymous?: undefined;
27
+ outputs?: undefined;
28
+ } | {
29
+ inputs: {
30
+ internalType: string;
31
+ name: string;
32
+ type: string;
33
+ }[];
34
+ name: string;
35
+ type: string;
36
+ stateMutability?: undefined;
37
+ anonymous?: undefined;
38
+ outputs?: undefined;
39
+ } | {
40
+ anonymous: boolean;
41
+ inputs: {
42
+ indexed: boolean;
43
+ internalType: string;
44
+ name: string;
45
+ type: string;
46
+ }[];
47
+ name: string;
48
+ type: string;
49
+ stateMutability?: undefined;
50
+ outputs?: undefined;
51
+ } | {
52
+ inputs: {
53
+ internalType: string;
54
+ name: string;
55
+ type: string;
56
+ }[];
57
+ name: string;
58
+ outputs: {
59
+ internalType: string;
60
+ name: string;
61
+ type: string;
62
+ }[];
63
+ stateMutability: string;
64
+ type: string;
65
+ anonymous?: undefined;
66
+ } | {
67
+ inputs: {
68
+ internalType: string;
69
+ name: string;
70
+ type: string;
71
+ }[];
72
+ name: string;
73
+ outputs: {
74
+ components: {
75
+ internalType: string;
76
+ name: string;
77
+ type: string;
78
+ }[];
79
+ internalType: string;
80
+ name: string;
81
+ type: string;
82
+ }[];
83
+ stateMutability: string;
84
+ type: string;
85
+ anonymous?: undefined;
86
+ } | {
87
+ stateMutability: string;
88
+ type: string;
89
+ inputs?: undefined;
90
+ name?: undefined;
91
+ anonymous?: undefined;
92
+ outputs?: undefined;
93
+ })[], "tokenRegistry", readonly unknown[], unknown>;
94
+ useFeePercentage: () => import("wagmi").UseReadContractReturnType<({
95
+ inputs: {
96
+ internalType: string;
97
+ name: string;
98
+ type: string;
99
+ }[];
100
+ stateMutability: string;
101
+ type: string;
102
+ name?: undefined;
103
+ anonymous?: undefined;
104
+ outputs?: undefined;
105
+ } | {
106
+ inputs: {
107
+ internalType: string;
108
+ name: string;
109
+ type: string;
110
+ }[];
111
+ name: string;
112
+ type: string;
113
+ stateMutability?: undefined;
114
+ anonymous?: undefined;
115
+ outputs?: undefined;
116
+ } | {
117
+ anonymous: boolean;
118
+ inputs: {
119
+ indexed: boolean;
120
+ internalType: string;
121
+ name: string;
122
+ type: string;
123
+ }[];
124
+ name: string;
125
+ type: string;
126
+ stateMutability?: undefined;
127
+ outputs?: undefined;
128
+ } | {
129
+ inputs: {
130
+ internalType: string;
131
+ name: string;
132
+ type: string;
133
+ }[];
134
+ name: string;
135
+ outputs: {
136
+ internalType: string;
137
+ name: string;
138
+ type: string;
139
+ }[];
140
+ stateMutability: string;
141
+ type: string;
142
+ anonymous?: undefined;
143
+ } | {
144
+ inputs: {
145
+ internalType: string;
146
+ name: string;
147
+ type: string;
148
+ }[];
149
+ name: string;
150
+ outputs: {
151
+ components: {
152
+ internalType: string;
153
+ name: string;
154
+ type: string;
155
+ }[];
156
+ internalType: string;
157
+ name: string;
158
+ type: string;
159
+ }[];
160
+ stateMutability: string;
161
+ type: string;
162
+ anonymous?: undefined;
163
+ } | {
164
+ stateMutability: string;
165
+ type: string;
166
+ inputs?: undefined;
167
+ name?: undefined;
168
+ anonymous?: undefined;
169
+ outputs?: undefined;
170
+ })[], "feePercentage", readonly unknown[], unknown>;
171
+ usePaused: () => import("wagmi").UseReadContractReturnType<({
172
+ inputs: {
173
+ internalType: string;
174
+ name: string;
175
+ type: string;
176
+ }[];
177
+ stateMutability: string;
178
+ type: string;
179
+ name?: undefined;
180
+ anonymous?: undefined;
181
+ outputs?: undefined;
182
+ } | {
183
+ inputs: {
184
+ internalType: string;
185
+ name: string;
186
+ type: string;
187
+ }[];
188
+ name: string;
189
+ type: string;
190
+ stateMutability?: undefined;
191
+ anonymous?: undefined;
192
+ outputs?: undefined;
193
+ } | {
194
+ anonymous: boolean;
195
+ inputs: {
196
+ indexed: boolean;
197
+ internalType: string;
198
+ name: string;
199
+ type: string;
200
+ }[];
201
+ name: string;
202
+ type: string;
203
+ stateMutability?: undefined;
204
+ outputs?: undefined;
205
+ } | {
206
+ inputs: {
207
+ internalType: string;
208
+ name: string;
209
+ type: string;
210
+ }[];
211
+ name: string;
212
+ outputs: {
213
+ internalType: string;
214
+ name: string;
215
+ type: string;
216
+ }[];
217
+ stateMutability: string;
218
+ type: string;
219
+ anonymous?: undefined;
220
+ } | {
221
+ inputs: {
222
+ internalType: string;
223
+ name: string;
224
+ type: string;
225
+ }[];
226
+ name: string;
227
+ outputs: {
228
+ components: {
229
+ internalType: string;
230
+ name: string;
231
+ type: string;
232
+ }[];
233
+ internalType: string;
234
+ name: string;
235
+ type: string;
236
+ }[];
237
+ stateMutability: string;
238
+ type: string;
239
+ anonymous?: undefined;
240
+ } | {
241
+ stateMutability: string;
242
+ type: string;
243
+ inputs?: undefined;
244
+ name?: undefined;
245
+ anonymous?: undefined;
246
+ outputs?: undefined;
247
+ })[], "paused", readonly unknown[], unknown>;
248
+ hash: `0x${string}` | undefined;
249
+ isPending: boolean;
250
+ isConfirming: boolean;
251
+ isConfirmed: boolean;
252
+ error: import("@wagmi/core").WriteContractErrorType | null;
253
+ };
254
+ export {};