@droplinked_inc/web3 1.0.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/LICENSE +21 -0
- package/MIGRATION.md +152 -0
- package/README.md +112 -0
- package/THREAT_MODEL.md +115 -0
- package/dist/abis/airdrop.d.ts +81 -0
- package/dist/abis/airdrop.d.ts.map +1 -0
- package/dist/abis/airdrop.js +58 -0
- package/dist/abis/airdrop.js.map +1 -0
- package/dist/abis/deployer.d.ts +54 -0
- package/dist/abis/deployer.d.ts.map +1 -0
- package/dist/abis/deployer.js +41 -0
- package/dist/abis/deployer.js.map +1 -0
- package/dist/abis/erc20.d.ts +102 -0
- package/dist/abis/erc20.d.ts.map +1 -0
- package/dist/abis/erc20.js +87 -0
- package/dist/abis/erc20.js.map +1 -0
- package/dist/abis/index.d.ts +5 -0
- package/dist/abis/index.d.ts.map +1 -0
- package/dist/abis/index.js +5 -0
- package/dist/abis/index.js.map +1 -0
- package/dist/abis/shop.d.ts +213 -0
- package/dist/abis/shop.d.ts.map +1 -0
- package/dist/abis/shop.js +162 -0
- package/dist/abis/shop.js.map +1 -0
- package/dist/contracts/erc20.d.ts +23 -0
- package/dist/contracts/erc20.d.ts.map +1 -0
- package/dist/contracts/erc20.js +59 -0
- package/dist/contracts/erc20.js.map +1 -0
- package/dist/contracts/index.d.ts +3 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +3 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/shop.d.ts +56 -0
- package/dist/contracts/shop.d.ts.map +1 -0
- package/dist/contracts/shop.js +113 -0
- package/dist/contracts/shop.js.map +1 -0
- package/dist/drop-web3.d.ts +44 -0
- package/dist/drop-web3.d.ts.map +1 -0
- package/dist/drop-web3.js +65 -0
- package/dist/drop-web3.js.map +1 -0
- package/dist/encoders.d.ts +115 -0
- package/dist/encoders.d.ts.map +1 -0
- package/dist/encoders.js +198 -0
- package/dist/encoders.js.map +1 -0
- package/dist/errors.d.ts +111 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +206 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/evm-shim.d.ts +77 -0
- package/dist/providers/evm-shim.d.ts.map +1 -0
- package/dist/providers/evm-shim.js +86 -0
- package/dist/providers/evm-shim.js.map +1 -0
- package/dist/signing.d.ts +157 -0
- package/dist/signing.d.ts.map +1 -0
- package/dist/signing.js +187 -0
- package/dist/signing.js.map +1 -0
- package/dist/types.d.ts +705 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +271 -0
- package/dist/types.js.map +1 -0
- package/package.json +57 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,705 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public types + zod schemas for @droplinked_inc/web3.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the on-the-wire shape of droplinked-web3@5.0.2 where the
|
|
5
|
+
* consumers (Next-ShopFront) depend on it, but every shape that crosses
|
|
6
|
+
* a trust boundary is z.parse()'d before use. No `any`.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import type { Address } from 'viem';
|
|
10
|
+
/**
|
|
11
|
+
* Chain identifier. Kept as string-valued enum (not the numeric enum
|
|
12
|
+
* in v5.0.2 — those values were unstable across releases).
|
|
13
|
+
*/
|
|
14
|
+
export declare enum Chain {
|
|
15
|
+
POLYGON = "POLYGON",
|
|
16
|
+
BINANCE = "BINANCE",
|
|
17
|
+
BASE = "BASE",
|
|
18
|
+
LINEA = "LINEA",
|
|
19
|
+
ETH = "ETH",
|
|
20
|
+
SOLANA = "SOLANA",
|
|
21
|
+
REDBELLY = "REDBELLY",
|
|
22
|
+
SKALE = "SKALE",
|
|
23
|
+
BITLAYER = "BITLAYER",
|
|
24
|
+
/**
|
|
25
|
+
* Unstoppable Domains chain — explicitly enumerated so the
|
|
26
|
+
* dispatcher in `DropWeb3.web3Instance()` can throw a typed
|
|
27
|
+
* `ChainNotImplementedException` rather than silently falling
|
|
28
|
+
* through to the EVM provider shim. Mirrors the SOLANA pattern.
|
|
29
|
+
*/
|
|
30
|
+
UNSTOPPABLE = "UNSTOPPABLE"
|
|
31
|
+
}
|
|
32
|
+
export declare enum Network {
|
|
33
|
+
MAINNET = "MAINNET",
|
|
34
|
+
TESTNET = "TESTNET",
|
|
35
|
+
DEV = "DEV"
|
|
36
|
+
}
|
|
37
|
+
export declare enum ChainWallet {
|
|
38
|
+
Metamask = "Metamask",
|
|
39
|
+
CoinBase = "CoinBase",
|
|
40
|
+
Phantom = "Phantom",
|
|
41
|
+
BaseSmartWallet = "BaseSmartWallet"
|
|
42
|
+
}
|
|
43
|
+
export declare enum PaymentTokens {
|
|
44
|
+
ETH = "ETH",
|
|
45
|
+
USDC = "USDC",
|
|
46
|
+
USDT = "USDT",
|
|
47
|
+
BNB = "BNB",
|
|
48
|
+
MATIC = "MATIC",
|
|
49
|
+
BTC = "BTC"
|
|
50
|
+
}
|
|
51
|
+
export declare enum Web3Actions {
|
|
52
|
+
LOGIN = "LOGIN",
|
|
53
|
+
DEPLOY = "DEPLOY",
|
|
54
|
+
RECORD = "RECORD",
|
|
55
|
+
PAYMENT = "PAYMENT",
|
|
56
|
+
CLAIM = "CLAIM",
|
|
57
|
+
AIRDROP = "AIRDROP"
|
|
58
|
+
}
|
|
59
|
+
export declare enum NFTType {
|
|
60
|
+
ERC1155 = "ERC1155",
|
|
61
|
+
ERC721 = "ERC721"
|
|
62
|
+
}
|
|
63
|
+
export declare enum ProductType {
|
|
64
|
+
DIGITAL = "DIGITAL",
|
|
65
|
+
POD = "POD",
|
|
66
|
+
PHYSICAL = "PHYSICAL"
|
|
67
|
+
}
|
|
68
|
+
export declare enum PaymentMethodType {
|
|
69
|
+
NATIVE_TOKEN = "NATIVE_TOKEN",
|
|
70
|
+
USD = "USD",
|
|
71
|
+
TOKEN = "TOKEN"
|
|
72
|
+
}
|
|
73
|
+
export declare enum TokenStandard {
|
|
74
|
+
ERC20 = "ERC20",
|
|
75
|
+
ERC721 = "ERC721",
|
|
76
|
+
ERC1155 = "ERC1155"
|
|
77
|
+
}
|
|
78
|
+
export declare const ChainSchema: z.ZodNativeEnum<typeof Chain>;
|
|
79
|
+
export declare const NetworkSchema: z.ZodNativeEnum<typeof Network>;
|
|
80
|
+
export declare const ChainWalletSchema: z.ZodNativeEnum<typeof ChainWallet>;
|
|
81
|
+
export declare const PaymentTokensSchema: z.ZodNativeEnum<typeof PaymentTokens>;
|
|
82
|
+
export declare const Web3ActionsSchema: z.ZodNativeEnum<typeof Web3Actions>;
|
|
83
|
+
export declare const TokenStandardSchema: z.ZodNativeEnum<typeof TokenStandard>;
|
|
84
|
+
export declare const ProductTypeSchema: z.ZodNativeEnum<typeof ProductType>;
|
|
85
|
+
/**
|
|
86
|
+
* Lowercase 0x-prefixed 40-hex-char EVM address.
|
|
87
|
+
* Validation is by regex AND EIP-55 checksum tolerance (any case input,
|
|
88
|
+
* we normalize to lowercase).
|
|
89
|
+
*/
|
|
90
|
+
export declare const EvmAddressSchema: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
91
|
+
export type EvmAddress = Address;
|
|
92
|
+
export declare const HexStringSchema: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
93
|
+
export declare const TxHashSchema: z.ZodString;
|
|
94
|
+
export declare const Bytes32Schema: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
95
|
+
/** Accept bigint, integer number, or numeric string; coerce to bigint. */
|
|
96
|
+
export declare const Uint256Schema: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>;
|
|
97
|
+
export type Uint256 = bigint;
|
|
98
|
+
export declare const ZERO_ADDRESS: Address;
|
|
99
|
+
export declare const DeployShopInputSchema: z.ZodObject<{
|
|
100
|
+
shopName: z.ZodString;
|
|
101
|
+
shopAddress: z.ZodString;
|
|
102
|
+
shopLogo: z.ZodString;
|
|
103
|
+
shopDescription: z.ZodString;
|
|
104
|
+
}, "strip", z.ZodTypeAny, {
|
|
105
|
+
shopName: string;
|
|
106
|
+
shopAddress: string;
|
|
107
|
+
shopLogo: string;
|
|
108
|
+
shopDescription: string;
|
|
109
|
+
}, {
|
|
110
|
+
shopName: string;
|
|
111
|
+
shopAddress: string;
|
|
112
|
+
shopLogo: string;
|
|
113
|
+
shopDescription: string;
|
|
114
|
+
}>;
|
|
115
|
+
export type DeployShopInput = z.infer<typeof DeployShopInputSchema>;
|
|
116
|
+
export declare const DeployShopResponseSchema: z.ZodObject<{
|
|
117
|
+
deployedShopAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
118
|
+
deployedNFTAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
119
|
+
transactionHash: z.ZodString;
|
|
120
|
+
}, "strip", z.ZodTypeAny, {
|
|
121
|
+
deployedShopAddress: `0x${string}`;
|
|
122
|
+
deployedNFTAddress: `0x${string}`;
|
|
123
|
+
transactionHash: string;
|
|
124
|
+
}, {
|
|
125
|
+
deployedShopAddress: string;
|
|
126
|
+
deployedNFTAddress: string;
|
|
127
|
+
transactionHash: string;
|
|
128
|
+
}>;
|
|
129
|
+
export type DeployShopResponse = z.infer<typeof DeployShopResponseSchema>;
|
|
130
|
+
export declare const ProductDetailsSchema: z.ZodObject<{
|
|
131
|
+
productTitle: z.ZodString;
|
|
132
|
+
description: z.ZodString;
|
|
133
|
+
commission: z.ZodNumber;
|
|
134
|
+
type: z.ZodNativeEnum<typeof ProductType>;
|
|
135
|
+
acceptsManageWallet: z.ZodBoolean;
|
|
136
|
+
royalty: z.ZodNumber;
|
|
137
|
+
}, "strip", z.ZodTypeAny, {
|
|
138
|
+
type: ProductType;
|
|
139
|
+
productTitle: string;
|
|
140
|
+
description: string;
|
|
141
|
+
commission: number;
|
|
142
|
+
acceptsManageWallet: boolean;
|
|
143
|
+
royalty: number;
|
|
144
|
+
}, {
|
|
145
|
+
type: ProductType;
|
|
146
|
+
productTitle: string;
|
|
147
|
+
description: string;
|
|
148
|
+
commission: number;
|
|
149
|
+
acceptsManageWallet: boolean;
|
|
150
|
+
royalty: number;
|
|
151
|
+
}>;
|
|
152
|
+
export type IProductDetails = z.infer<typeof ProductDetailsSchema>;
|
|
153
|
+
export declare const SKUDetailsSchema: z.ZodObject<{
|
|
154
|
+
skuProperties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
155
|
+
imageUrl: z.ZodString;
|
|
156
|
+
amount: z.ZodNumber;
|
|
157
|
+
skuID: z.ZodString;
|
|
158
|
+
}, "strip", z.ZodTypeAny, {
|
|
159
|
+
skuProperties: Record<string, unknown>;
|
|
160
|
+
imageUrl: string;
|
|
161
|
+
amount: number;
|
|
162
|
+
skuID: string;
|
|
163
|
+
}, {
|
|
164
|
+
skuProperties: Record<string, unknown>;
|
|
165
|
+
imageUrl: string;
|
|
166
|
+
amount: number;
|
|
167
|
+
skuID: string;
|
|
168
|
+
}>;
|
|
169
|
+
export type ISKUDetails = z.infer<typeof SKUDetailsSchema>;
|
|
170
|
+
export declare const RecordResponseSchema: z.ZodObject<{
|
|
171
|
+
transactionHash: z.ZodString;
|
|
172
|
+
productId: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>>;
|
|
173
|
+
amountRecorded: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>>;
|
|
174
|
+
transactionId: z.ZodString;
|
|
175
|
+
}, "strip", z.ZodTypeAny, {
|
|
176
|
+
transactionHash: string;
|
|
177
|
+
transactionId: string;
|
|
178
|
+
productId?: bigint | undefined;
|
|
179
|
+
amountRecorded?: bigint | undefined;
|
|
180
|
+
}, {
|
|
181
|
+
transactionHash: string;
|
|
182
|
+
transactionId: string;
|
|
183
|
+
productId?: string | number | bigint | undefined;
|
|
184
|
+
amountRecorded?: string | number | bigint | undefined;
|
|
185
|
+
}>;
|
|
186
|
+
export type RecordResponse = z.infer<typeof RecordResponseSchema>;
|
|
187
|
+
export declare const PurchaseDataSchema: z.ZodObject<{
|
|
188
|
+
id: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>;
|
|
189
|
+
amount: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>;
|
|
190
|
+
isAffiliate: z.ZodBoolean;
|
|
191
|
+
shopAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
192
|
+
}, "strip", z.ZodTypeAny, {
|
|
193
|
+
shopAddress: `0x${string}`;
|
|
194
|
+
amount: bigint;
|
|
195
|
+
id: bigint;
|
|
196
|
+
isAffiliate: boolean;
|
|
197
|
+
}, {
|
|
198
|
+
shopAddress: string;
|
|
199
|
+
amount: string | number | bigint;
|
|
200
|
+
id: string | number | bigint;
|
|
201
|
+
isAffiliate: boolean;
|
|
202
|
+
}>;
|
|
203
|
+
export type PurchaseData = z.infer<typeof PurchaseDataSchema>;
|
|
204
|
+
export declare const PurchaseConfirmationItemSchema: z.ZodObject<{
|
|
205
|
+
amount: z.ZodNumber;
|
|
206
|
+
productId: z.ZodString;
|
|
207
|
+
nullifier: z.ZodString;
|
|
208
|
+
}, "strip", z.ZodTypeAny, {
|
|
209
|
+
amount: number;
|
|
210
|
+
productId: string;
|
|
211
|
+
nullifier: string;
|
|
212
|
+
}, {
|
|
213
|
+
amount: number;
|
|
214
|
+
productId: string;
|
|
215
|
+
nullifier: string;
|
|
216
|
+
}>;
|
|
217
|
+
export type PurchaseConfirmationItem = z.infer<typeof PurchaseConfirmationItemSchema>;
|
|
218
|
+
export declare const PurchaseSignatureSchema: z.ZodObject<{
|
|
219
|
+
signature: z.ZodString;
|
|
220
|
+
purchaseData: z.ZodArray<z.ZodObject<{
|
|
221
|
+
amount: z.ZodNumber;
|
|
222
|
+
productId: z.ZodString;
|
|
223
|
+
nullifier: z.ZodString;
|
|
224
|
+
}, "strip", z.ZodTypeAny, {
|
|
225
|
+
amount: number;
|
|
226
|
+
productId: string;
|
|
227
|
+
nullifier: string;
|
|
228
|
+
}, {
|
|
229
|
+
amount: number;
|
|
230
|
+
productId: string;
|
|
231
|
+
nullifier: string;
|
|
232
|
+
}>, "many">;
|
|
233
|
+
chainId: z.ZodNumber;
|
|
234
|
+
verifyingContract: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
235
|
+
shopAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
236
|
+
nonce: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>;
|
|
237
|
+
deadline: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>;
|
|
238
|
+
}, "strip", z.ZodTypeAny, {
|
|
239
|
+
shopAddress: `0x${string}`;
|
|
240
|
+
signature: string;
|
|
241
|
+
purchaseData: {
|
|
242
|
+
amount: number;
|
|
243
|
+
productId: string;
|
|
244
|
+
nullifier: string;
|
|
245
|
+
}[];
|
|
246
|
+
chainId: number;
|
|
247
|
+
verifyingContract: `0x${string}`;
|
|
248
|
+
nonce: bigint;
|
|
249
|
+
deadline: bigint;
|
|
250
|
+
}, {
|
|
251
|
+
shopAddress: string;
|
|
252
|
+
signature: string;
|
|
253
|
+
purchaseData: {
|
|
254
|
+
amount: number;
|
|
255
|
+
productId: string;
|
|
256
|
+
nullifier: string;
|
|
257
|
+
}[];
|
|
258
|
+
chainId: number;
|
|
259
|
+
verifyingContract: string;
|
|
260
|
+
nonce: string | number | bigint;
|
|
261
|
+
deadline: string | number | bigint;
|
|
262
|
+
}>;
|
|
263
|
+
export type PurchaseSignature = z.infer<typeof PurchaseSignatureSchema>;
|
|
264
|
+
export declare const ClaimNFTInputsSchema: z.ZodObject<{
|
|
265
|
+
signature: z.ZodObject<{
|
|
266
|
+
signature: z.ZodString;
|
|
267
|
+
purchaseData: z.ZodArray<z.ZodObject<{
|
|
268
|
+
amount: z.ZodNumber;
|
|
269
|
+
productId: z.ZodString;
|
|
270
|
+
nullifier: z.ZodString;
|
|
271
|
+
}, "strip", z.ZodTypeAny, {
|
|
272
|
+
amount: number;
|
|
273
|
+
productId: string;
|
|
274
|
+
nullifier: string;
|
|
275
|
+
}, {
|
|
276
|
+
amount: number;
|
|
277
|
+
productId: string;
|
|
278
|
+
nullifier: string;
|
|
279
|
+
}>, "many">;
|
|
280
|
+
chainId: z.ZodNumber;
|
|
281
|
+
verifyingContract: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
282
|
+
shopAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
283
|
+
nonce: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>;
|
|
284
|
+
deadline: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>;
|
|
285
|
+
}, "strip", z.ZodTypeAny, {
|
|
286
|
+
shopAddress: `0x${string}`;
|
|
287
|
+
signature: string;
|
|
288
|
+
purchaseData: {
|
|
289
|
+
amount: number;
|
|
290
|
+
productId: string;
|
|
291
|
+
nullifier: string;
|
|
292
|
+
}[];
|
|
293
|
+
chainId: number;
|
|
294
|
+
verifyingContract: `0x${string}`;
|
|
295
|
+
nonce: bigint;
|
|
296
|
+
deadline: bigint;
|
|
297
|
+
}, {
|
|
298
|
+
shopAddress: string;
|
|
299
|
+
signature: string;
|
|
300
|
+
purchaseData: {
|
|
301
|
+
amount: number;
|
|
302
|
+
productId: string;
|
|
303
|
+
nullifier: string;
|
|
304
|
+
}[];
|
|
305
|
+
chainId: number;
|
|
306
|
+
verifyingContract: string;
|
|
307
|
+
nonce: string | number | bigint;
|
|
308
|
+
deadline: string | number | bigint;
|
|
309
|
+
}>;
|
|
310
|
+
}, "strip", z.ZodTypeAny, {
|
|
311
|
+
signature: {
|
|
312
|
+
shopAddress: `0x${string}`;
|
|
313
|
+
signature: string;
|
|
314
|
+
purchaseData: {
|
|
315
|
+
amount: number;
|
|
316
|
+
productId: string;
|
|
317
|
+
nullifier: string;
|
|
318
|
+
}[];
|
|
319
|
+
chainId: number;
|
|
320
|
+
verifyingContract: `0x${string}`;
|
|
321
|
+
nonce: bigint;
|
|
322
|
+
deadline: bigint;
|
|
323
|
+
};
|
|
324
|
+
}, {
|
|
325
|
+
signature: {
|
|
326
|
+
shopAddress: string;
|
|
327
|
+
signature: string;
|
|
328
|
+
purchaseData: {
|
|
329
|
+
amount: number;
|
|
330
|
+
productId: string;
|
|
331
|
+
nullifier: string;
|
|
332
|
+
}[];
|
|
333
|
+
chainId: number;
|
|
334
|
+
verifyingContract: string;
|
|
335
|
+
nonce: string | number | bigint;
|
|
336
|
+
deadline: string | number | bigint;
|
|
337
|
+
};
|
|
338
|
+
}>;
|
|
339
|
+
export type ClaimNFTInputs = z.infer<typeof ClaimNFTInputsSchema>;
|
|
340
|
+
export declare const CartItemSchema: z.ZodObject<{
|
|
341
|
+
id: z.ZodNumber;
|
|
342
|
+
amount: z.ZodNumber;
|
|
343
|
+
isAffiliate: z.ZodBoolean;
|
|
344
|
+
shopAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
345
|
+
}, "strip", z.ZodTypeAny, {
|
|
346
|
+
shopAddress: `0x${string}`;
|
|
347
|
+
amount: number;
|
|
348
|
+
id: number;
|
|
349
|
+
isAffiliate: boolean;
|
|
350
|
+
}, {
|
|
351
|
+
shopAddress: string;
|
|
352
|
+
amount: number;
|
|
353
|
+
id: number;
|
|
354
|
+
isAffiliate: boolean;
|
|
355
|
+
}>;
|
|
356
|
+
export type CartItem = z.infer<typeof CartItemSchema>;
|
|
357
|
+
export declare const ChainPaymentSchema: z.ZodEffects<z.ZodObject<{
|
|
358
|
+
chainLinkRoundId: z.ZodOptional<z.ZodString>;
|
|
359
|
+
totalPrice: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>;
|
|
360
|
+
tbdValues: z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>, "many">;
|
|
361
|
+
tbdReceivers: z.ZodArray<z.ZodEffects<z.ZodString, `0x${string}`, string>, "many">;
|
|
362
|
+
tokenAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
|
|
363
|
+
cartItems: z.ZodArray<z.ZodObject<{
|
|
364
|
+
id: z.ZodNumber;
|
|
365
|
+
amount: z.ZodNumber;
|
|
366
|
+
isAffiliate: z.ZodBoolean;
|
|
367
|
+
shopAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
368
|
+
}, "strip", z.ZodTypeAny, {
|
|
369
|
+
shopAddress: `0x${string}`;
|
|
370
|
+
amount: number;
|
|
371
|
+
id: number;
|
|
372
|
+
isAffiliate: boolean;
|
|
373
|
+
}, {
|
|
374
|
+
shopAddress: string;
|
|
375
|
+
amount: number;
|
|
376
|
+
id: number;
|
|
377
|
+
isAffiliate: boolean;
|
|
378
|
+
}>, "many">;
|
|
379
|
+
memo: z.ZodString;
|
|
380
|
+
}, "strip", z.ZodTypeAny, {
|
|
381
|
+
totalPrice: bigint;
|
|
382
|
+
tbdValues: bigint[];
|
|
383
|
+
tbdReceivers: `0x${string}`[];
|
|
384
|
+
cartItems: {
|
|
385
|
+
shopAddress: `0x${string}`;
|
|
386
|
+
amount: number;
|
|
387
|
+
id: number;
|
|
388
|
+
isAffiliate: boolean;
|
|
389
|
+
}[];
|
|
390
|
+
memo: string;
|
|
391
|
+
chainLinkRoundId?: string | undefined;
|
|
392
|
+
tokenAddress?: `0x${string}` | undefined;
|
|
393
|
+
}, {
|
|
394
|
+
totalPrice: string | number | bigint;
|
|
395
|
+
tbdValues: (string | number | bigint)[];
|
|
396
|
+
tbdReceivers: string[];
|
|
397
|
+
cartItems: {
|
|
398
|
+
shopAddress: string;
|
|
399
|
+
amount: number;
|
|
400
|
+
id: number;
|
|
401
|
+
isAffiliate: boolean;
|
|
402
|
+
}[];
|
|
403
|
+
memo: string;
|
|
404
|
+
chainLinkRoundId?: string | undefined;
|
|
405
|
+
tokenAddress?: string | undefined;
|
|
406
|
+
}>, {
|
|
407
|
+
totalPrice: bigint;
|
|
408
|
+
tbdValues: bigint[];
|
|
409
|
+
tbdReceivers: `0x${string}`[];
|
|
410
|
+
cartItems: {
|
|
411
|
+
shopAddress: `0x${string}`;
|
|
412
|
+
amount: number;
|
|
413
|
+
id: number;
|
|
414
|
+
isAffiliate: boolean;
|
|
415
|
+
}[];
|
|
416
|
+
memo: string;
|
|
417
|
+
chainLinkRoundId?: string | undefined;
|
|
418
|
+
tokenAddress?: `0x${string}` | undefined;
|
|
419
|
+
}, {
|
|
420
|
+
totalPrice: string | number | bigint;
|
|
421
|
+
tbdValues: (string | number | bigint)[];
|
|
422
|
+
tbdReceivers: string[];
|
|
423
|
+
cartItems: {
|
|
424
|
+
shopAddress: string;
|
|
425
|
+
amount: number;
|
|
426
|
+
id: number;
|
|
427
|
+
isAffiliate: boolean;
|
|
428
|
+
}[];
|
|
429
|
+
memo: string;
|
|
430
|
+
chainLinkRoundId?: string | undefined;
|
|
431
|
+
tokenAddress?: string | undefined;
|
|
432
|
+
}>;
|
|
433
|
+
export type IChainPayment = z.infer<typeof ChainPaymentSchema>;
|
|
434
|
+
export declare const AirdropReceiverSchema: z.ZodObject<{
|
|
435
|
+
receiver: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
436
|
+
amount: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>;
|
|
437
|
+
}, "strip", z.ZodTypeAny, {
|
|
438
|
+
amount: bigint;
|
|
439
|
+
receiver: `0x${string}`;
|
|
440
|
+
}, {
|
|
441
|
+
amount: string | number | bigint;
|
|
442
|
+
receiver: string;
|
|
443
|
+
}>;
|
|
444
|
+
export type AirdropReceiver = z.infer<typeof AirdropReceiverSchema>;
|
|
445
|
+
export declare const Erc20AirdropSchema: z.ZodObject<{
|
|
446
|
+
type: z.ZodLiteral<TokenStandard.ERC20>;
|
|
447
|
+
tokenAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
448
|
+
receivers: z.ZodArray<z.ZodObject<{
|
|
449
|
+
receiver: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
450
|
+
amount: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>;
|
|
451
|
+
}, "strip", z.ZodTypeAny, {
|
|
452
|
+
amount: bigint;
|
|
453
|
+
receiver: `0x${string}`;
|
|
454
|
+
}, {
|
|
455
|
+
amount: string | number | bigint;
|
|
456
|
+
receiver: string;
|
|
457
|
+
}>, "many">;
|
|
458
|
+
airdropId: z.ZodString;
|
|
459
|
+
chunkSize: z.ZodOptional<z.ZodNumber>;
|
|
460
|
+
}, "strip", z.ZodTypeAny, {
|
|
461
|
+
type: TokenStandard.ERC20;
|
|
462
|
+
tokenAddress: `0x${string}`;
|
|
463
|
+
receivers: {
|
|
464
|
+
amount: bigint;
|
|
465
|
+
receiver: `0x${string}`;
|
|
466
|
+
}[];
|
|
467
|
+
airdropId: string;
|
|
468
|
+
chunkSize?: number | undefined;
|
|
469
|
+
}, {
|
|
470
|
+
type: TokenStandard.ERC20;
|
|
471
|
+
tokenAddress: string;
|
|
472
|
+
receivers: {
|
|
473
|
+
amount: string | number | bigint;
|
|
474
|
+
receiver: string;
|
|
475
|
+
}[];
|
|
476
|
+
airdropId: string;
|
|
477
|
+
chunkSize?: number | undefined;
|
|
478
|
+
}>;
|
|
479
|
+
export declare const Erc721AirdropSchema: z.ZodObject<{
|
|
480
|
+
type: z.ZodLiteral<TokenStandard.ERC721>;
|
|
481
|
+
tokenAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
482
|
+
receivers: z.ZodArray<z.ZodObject<{
|
|
483
|
+
receiver: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
484
|
+
amount: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>;
|
|
485
|
+
}, "strip", z.ZodTypeAny, {
|
|
486
|
+
amount: bigint;
|
|
487
|
+
receiver: `0x${string}`;
|
|
488
|
+
}, {
|
|
489
|
+
amount: string | number | bigint;
|
|
490
|
+
receiver: string;
|
|
491
|
+
}>, "many">;
|
|
492
|
+
airdropId: z.ZodString;
|
|
493
|
+
chunkSize: z.ZodOptional<z.ZodNumber>;
|
|
494
|
+
}, "strip", z.ZodTypeAny, {
|
|
495
|
+
type: TokenStandard.ERC721;
|
|
496
|
+
tokenAddress: `0x${string}`;
|
|
497
|
+
receivers: {
|
|
498
|
+
amount: bigint;
|
|
499
|
+
receiver: `0x${string}`;
|
|
500
|
+
}[];
|
|
501
|
+
airdropId: string;
|
|
502
|
+
chunkSize?: number | undefined;
|
|
503
|
+
}, {
|
|
504
|
+
type: TokenStandard.ERC721;
|
|
505
|
+
tokenAddress: string;
|
|
506
|
+
receivers: {
|
|
507
|
+
amount: string | number | bigint;
|
|
508
|
+
receiver: string;
|
|
509
|
+
}[];
|
|
510
|
+
airdropId: string;
|
|
511
|
+
chunkSize?: number | undefined;
|
|
512
|
+
}>;
|
|
513
|
+
export declare const Erc1155AirdropSchema: z.ZodObject<{
|
|
514
|
+
type: z.ZodLiteral<TokenStandard.ERC1155>;
|
|
515
|
+
tokenAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
516
|
+
tokenId: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>;
|
|
517
|
+
receivers: z.ZodArray<z.ZodObject<{
|
|
518
|
+
receiver: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
519
|
+
amount: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>;
|
|
520
|
+
}, "strip", z.ZodTypeAny, {
|
|
521
|
+
amount: bigint;
|
|
522
|
+
receiver: `0x${string}`;
|
|
523
|
+
}, {
|
|
524
|
+
amount: string | number | bigint;
|
|
525
|
+
receiver: string;
|
|
526
|
+
}>, "many">;
|
|
527
|
+
airdropId: z.ZodString;
|
|
528
|
+
chunkSize: z.ZodOptional<z.ZodNumber>;
|
|
529
|
+
}, "strip", z.ZodTypeAny, {
|
|
530
|
+
type: TokenStandard.ERC1155;
|
|
531
|
+
tokenAddress: `0x${string}`;
|
|
532
|
+
receivers: {
|
|
533
|
+
amount: bigint;
|
|
534
|
+
receiver: `0x${string}`;
|
|
535
|
+
}[];
|
|
536
|
+
airdropId: string;
|
|
537
|
+
tokenId: bigint;
|
|
538
|
+
chunkSize?: number | undefined;
|
|
539
|
+
}, {
|
|
540
|
+
type: TokenStandard.ERC1155;
|
|
541
|
+
tokenAddress: string;
|
|
542
|
+
receivers: {
|
|
543
|
+
amount: string | number | bigint;
|
|
544
|
+
receiver: string;
|
|
545
|
+
}[];
|
|
546
|
+
airdropId: string;
|
|
547
|
+
tokenId: string | number | bigint;
|
|
548
|
+
chunkSize?: number | undefined;
|
|
549
|
+
}>;
|
|
550
|
+
export declare const ITokenDetailsSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
551
|
+
type: z.ZodLiteral<TokenStandard.ERC20>;
|
|
552
|
+
tokenAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
553
|
+
receivers: z.ZodArray<z.ZodObject<{
|
|
554
|
+
receiver: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
555
|
+
amount: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>;
|
|
556
|
+
}, "strip", z.ZodTypeAny, {
|
|
557
|
+
amount: bigint;
|
|
558
|
+
receiver: `0x${string}`;
|
|
559
|
+
}, {
|
|
560
|
+
amount: string | number | bigint;
|
|
561
|
+
receiver: string;
|
|
562
|
+
}>, "many">;
|
|
563
|
+
airdropId: z.ZodString;
|
|
564
|
+
chunkSize: z.ZodOptional<z.ZodNumber>;
|
|
565
|
+
}, "strip", z.ZodTypeAny, {
|
|
566
|
+
type: TokenStandard.ERC20;
|
|
567
|
+
tokenAddress: `0x${string}`;
|
|
568
|
+
receivers: {
|
|
569
|
+
amount: bigint;
|
|
570
|
+
receiver: `0x${string}`;
|
|
571
|
+
}[];
|
|
572
|
+
airdropId: string;
|
|
573
|
+
chunkSize?: number | undefined;
|
|
574
|
+
}, {
|
|
575
|
+
type: TokenStandard.ERC20;
|
|
576
|
+
tokenAddress: string;
|
|
577
|
+
receivers: {
|
|
578
|
+
amount: string | number | bigint;
|
|
579
|
+
receiver: string;
|
|
580
|
+
}[];
|
|
581
|
+
airdropId: string;
|
|
582
|
+
chunkSize?: number | undefined;
|
|
583
|
+
}>, z.ZodObject<{
|
|
584
|
+
type: z.ZodLiteral<TokenStandard.ERC721>;
|
|
585
|
+
tokenAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
586
|
+
receivers: z.ZodArray<z.ZodObject<{
|
|
587
|
+
receiver: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
588
|
+
amount: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>;
|
|
589
|
+
}, "strip", z.ZodTypeAny, {
|
|
590
|
+
amount: bigint;
|
|
591
|
+
receiver: `0x${string}`;
|
|
592
|
+
}, {
|
|
593
|
+
amount: string | number | bigint;
|
|
594
|
+
receiver: string;
|
|
595
|
+
}>, "many">;
|
|
596
|
+
airdropId: z.ZodString;
|
|
597
|
+
chunkSize: z.ZodOptional<z.ZodNumber>;
|
|
598
|
+
}, "strip", z.ZodTypeAny, {
|
|
599
|
+
type: TokenStandard.ERC721;
|
|
600
|
+
tokenAddress: `0x${string}`;
|
|
601
|
+
receivers: {
|
|
602
|
+
amount: bigint;
|
|
603
|
+
receiver: `0x${string}`;
|
|
604
|
+
}[];
|
|
605
|
+
airdropId: string;
|
|
606
|
+
chunkSize?: number | undefined;
|
|
607
|
+
}, {
|
|
608
|
+
type: TokenStandard.ERC721;
|
|
609
|
+
tokenAddress: string;
|
|
610
|
+
receivers: {
|
|
611
|
+
amount: string | number | bigint;
|
|
612
|
+
receiver: string;
|
|
613
|
+
}[];
|
|
614
|
+
airdropId: string;
|
|
615
|
+
chunkSize?: number | undefined;
|
|
616
|
+
}>, z.ZodObject<{
|
|
617
|
+
type: z.ZodLiteral<TokenStandard.ERC1155>;
|
|
618
|
+
tokenAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
619
|
+
tokenId: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>;
|
|
620
|
+
receivers: z.ZodArray<z.ZodObject<{
|
|
621
|
+
receiver: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
622
|
+
amount: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>;
|
|
623
|
+
}, "strip", z.ZodTypeAny, {
|
|
624
|
+
amount: bigint;
|
|
625
|
+
receiver: `0x${string}`;
|
|
626
|
+
}, {
|
|
627
|
+
amount: string | number | bigint;
|
|
628
|
+
receiver: string;
|
|
629
|
+
}>, "many">;
|
|
630
|
+
airdropId: z.ZodString;
|
|
631
|
+
chunkSize: z.ZodOptional<z.ZodNumber>;
|
|
632
|
+
}, "strip", z.ZodTypeAny, {
|
|
633
|
+
type: TokenStandard.ERC1155;
|
|
634
|
+
tokenAddress: `0x${string}`;
|
|
635
|
+
receivers: {
|
|
636
|
+
amount: bigint;
|
|
637
|
+
receiver: `0x${string}`;
|
|
638
|
+
}[];
|
|
639
|
+
airdropId: string;
|
|
640
|
+
tokenId: bigint;
|
|
641
|
+
chunkSize?: number | undefined;
|
|
642
|
+
}, {
|
|
643
|
+
type: TokenStandard.ERC1155;
|
|
644
|
+
tokenAddress: string;
|
|
645
|
+
receivers: {
|
|
646
|
+
amount: string | number | bigint;
|
|
647
|
+
receiver: string;
|
|
648
|
+
}[];
|
|
649
|
+
airdropId: string;
|
|
650
|
+
tokenId: string | number | bigint;
|
|
651
|
+
chunkSize?: number | undefined;
|
|
652
|
+
}>]>;
|
|
653
|
+
export type ITokenDetails = z.infer<typeof ITokenDetailsSchema>;
|
|
654
|
+
export declare const LoginResultSchema: z.ZodObject<{
|
|
655
|
+
address: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
656
|
+
signature: z.ZodString;
|
|
657
|
+
nonce: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, bigint, string | number | bigint>, bigint, string | number | bigint>;
|
|
658
|
+
date: z.ZodString;
|
|
659
|
+
}, "strip", z.ZodTypeAny, {
|
|
660
|
+
date: string;
|
|
661
|
+
signature: string;
|
|
662
|
+
nonce: bigint;
|
|
663
|
+
address: `0x${string}`;
|
|
664
|
+
}, {
|
|
665
|
+
date: string;
|
|
666
|
+
signature: string;
|
|
667
|
+
nonce: string | number | bigint;
|
|
668
|
+
address: string;
|
|
669
|
+
}>;
|
|
670
|
+
export type ILoginResult = z.infer<typeof LoginResultSchema>;
|
|
671
|
+
export declare const PaymentInputsSchema: z.ZodObject<{
|
|
672
|
+
cartID: z.ZodString;
|
|
673
|
+
paymentToken: z.ZodNativeEnum<typeof PaymentTokens>;
|
|
674
|
+
paymentType: z.ZodNativeEnum<typeof Chain>;
|
|
675
|
+
}, "strip", z.ZodTypeAny, {
|
|
676
|
+
cartID: string;
|
|
677
|
+
paymentToken: PaymentTokens;
|
|
678
|
+
paymentType: Chain;
|
|
679
|
+
}, {
|
|
680
|
+
cartID: string;
|
|
681
|
+
paymentToken: PaymentTokens;
|
|
682
|
+
paymentType: Chain;
|
|
683
|
+
}>;
|
|
684
|
+
export type IPaymentInputs = z.infer<typeof PaymentInputsSchema>;
|
|
685
|
+
export interface PrivilegedActionAck {
|
|
686
|
+
/**
|
|
687
|
+
* Must be `true` for setSigner / setManager / setShopContractAddress
|
|
688
|
+
* and other privileged calls. Forces the caller to write the literal
|
|
689
|
+
* boolean — guards against accidental misuse from generic flows.
|
|
690
|
+
*/
|
|
691
|
+
acknowledgePrivilegedAction: true;
|
|
692
|
+
}
|
|
693
|
+
export interface ModalInterface {
|
|
694
|
+
waiting(message: string): void;
|
|
695
|
+
success(message: string): void;
|
|
696
|
+
error(message: string): void;
|
|
697
|
+
close(): void;
|
|
698
|
+
}
|
|
699
|
+
export declare class DefaultModal implements ModalInterface {
|
|
700
|
+
waiting(_message: string): void;
|
|
701
|
+
success(_message: string): void;
|
|
702
|
+
error(_message: string): void;
|
|
703
|
+
close(): void;
|
|
704
|
+
}
|
|
705
|
+
//# sourceMappingURL=types.d.ts.map
|