@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.
Files changed (65) hide show
  1. package/LICENSE +21 -0
  2. package/MIGRATION.md +152 -0
  3. package/README.md +112 -0
  4. package/THREAT_MODEL.md +115 -0
  5. package/dist/abis/airdrop.d.ts +81 -0
  6. package/dist/abis/airdrop.d.ts.map +1 -0
  7. package/dist/abis/airdrop.js +58 -0
  8. package/dist/abis/airdrop.js.map +1 -0
  9. package/dist/abis/deployer.d.ts +54 -0
  10. package/dist/abis/deployer.d.ts.map +1 -0
  11. package/dist/abis/deployer.js +41 -0
  12. package/dist/abis/deployer.js.map +1 -0
  13. package/dist/abis/erc20.d.ts +102 -0
  14. package/dist/abis/erc20.d.ts.map +1 -0
  15. package/dist/abis/erc20.js +87 -0
  16. package/dist/abis/erc20.js.map +1 -0
  17. package/dist/abis/index.d.ts +5 -0
  18. package/dist/abis/index.d.ts.map +1 -0
  19. package/dist/abis/index.js +5 -0
  20. package/dist/abis/index.js.map +1 -0
  21. package/dist/abis/shop.d.ts +213 -0
  22. package/dist/abis/shop.d.ts.map +1 -0
  23. package/dist/abis/shop.js +162 -0
  24. package/dist/abis/shop.js.map +1 -0
  25. package/dist/contracts/erc20.d.ts +23 -0
  26. package/dist/contracts/erc20.d.ts.map +1 -0
  27. package/dist/contracts/erc20.js +59 -0
  28. package/dist/contracts/erc20.js.map +1 -0
  29. package/dist/contracts/index.d.ts +3 -0
  30. package/dist/contracts/index.d.ts.map +1 -0
  31. package/dist/contracts/index.js +3 -0
  32. package/dist/contracts/index.js.map +1 -0
  33. package/dist/contracts/shop.d.ts +56 -0
  34. package/dist/contracts/shop.d.ts.map +1 -0
  35. package/dist/contracts/shop.js +113 -0
  36. package/dist/contracts/shop.js.map +1 -0
  37. package/dist/drop-web3.d.ts +44 -0
  38. package/dist/drop-web3.d.ts.map +1 -0
  39. package/dist/drop-web3.js +65 -0
  40. package/dist/drop-web3.js.map +1 -0
  41. package/dist/encoders.d.ts +115 -0
  42. package/dist/encoders.d.ts.map +1 -0
  43. package/dist/encoders.js +198 -0
  44. package/dist/encoders.js.map +1 -0
  45. package/dist/errors.d.ts +111 -0
  46. package/dist/errors.d.ts.map +1 -0
  47. package/dist/errors.js +206 -0
  48. package/dist/errors.js.map +1 -0
  49. package/dist/index.d.ts +24 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +29 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/providers/evm-shim.d.ts +77 -0
  54. package/dist/providers/evm-shim.d.ts.map +1 -0
  55. package/dist/providers/evm-shim.js +86 -0
  56. package/dist/providers/evm-shim.js.map +1 -0
  57. package/dist/signing.d.ts +157 -0
  58. package/dist/signing.d.ts.map +1 -0
  59. package/dist/signing.js +187 -0
  60. package/dist/signing.js.map +1 -0
  61. package/dist/types.d.ts +705 -0
  62. package/dist/types.d.ts.map +1 -0
  63. package/dist/types.js +271 -0
  64. package/dist/types.js.map +1 -0
  65. package/package.json +57 -0
@@ -0,0 +1,102 @@
1
+ /**
2
+ * ERC-20 ABI — minimal surface for transfer / balanceOf / decimals / nonces / permit.
3
+ *
4
+ * Source: EIP-20 (https://eips.ethereum.org/EIPS/eip-20) for the standard
5
+ * functions, EIP-2612 (https://eips.ethereum.org/EIPS/eip-2612) for
6
+ * `permit` / `nonces` / `DOMAIN_SEPARATOR`.
7
+ *
8
+ * No code reuse from droplinked-web3@5.0.2. All ABI fragments
9
+ * hand-written from the EIPs.
10
+ */
11
+ export declare const ERC20_ABI: readonly [{
12
+ readonly type: "function";
13
+ readonly name: "name";
14
+ readonly stateMutability: "view";
15
+ readonly inputs: readonly [];
16
+ readonly outputs: readonly [{
17
+ readonly type: "string";
18
+ }];
19
+ }, {
20
+ readonly type: "function";
21
+ readonly name: "symbol";
22
+ readonly stateMutability: "view";
23
+ readonly inputs: readonly [];
24
+ readonly outputs: readonly [{
25
+ readonly type: "string";
26
+ }];
27
+ }, {
28
+ readonly type: "function";
29
+ readonly name: "decimals";
30
+ readonly stateMutability: "view";
31
+ readonly inputs: readonly [];
32
+ readonly outputs: readonly [{
33
+ readonly type: "uint8";
34
+ }];
35
+ }, {
36
+ readonly type: "function";
37
+ readonly name: "totalSupply";
38
+ readonly stateMutability: "view";
39
+ readonly inputs: readonly [];
40
+ readonly outputs: readonly [{
41
+ readonly type: "uint256";
42
+ }];
43
+ }, {
44
+ readonly type: "function";
45
+ readonly name: "balanceOf";
46
+ readonly stateMutability: "view";
47
+ readonly inputs: readonly [{
48
+ readonly name: "owner";
49
+ readonly type: "address";
50
+ }];
51
+ readonly outputs: readonly [{
52
+ readonly type: "uint256";
53
+ }];
54
+ }, {
55
+ readonly type: "function";
56
+ readonly name: "allowance";
57
+ readonly stateMutability: "view";
58
+ readonly inputs: readonly [{
59
+ readonly name: "owner";
60
+ readonly type: "address";
61
+ }, {
62
+ readonly name: "spender";
63
+ readonly type: "address";
64
+ }];
65
+ readonly outputs: readonly [{
66
+ readonly type: "uint256";
67
+ }];
68
+ }, {
69
+ readonly type: "function";
70
+ readonly name: "transfer";
71
+ readonly stateMutability: "nonpayable";
72
+ readonly inputs: readonly [{
73
+ readonly name: "to";
74
+ readonly type: "address";
75
+ }, {
76
+ readonly name: "value";
77
+ readonly type: "uint256";
78
+ }];
79
+ readonly outputs: readonly [{
80
+ readonly type: "bool";
81
+ }];
82
+ }, {
83
+ readonly type: "function";
84
+ readonly name: "nonces";
85
+ readonly stateMutability: "view";
86
+ readonly inputs: readonly [{
87
+ readonly name: "owner";
88
+ readonly type: "address";
89
+ }];
90
+ readonly outputs: readonly [{
91
+ readonly type: "uint256";
92
+ }];
93
+ }, {
94
+ readonly type: "function";
95
+ readonly name: "DOMAIN_SEPARATOR";
96
+ readonly stateMutability: "view";
97
+ readonly inputs: readonly [];
98
+ readonly outputs: readonly [{
99
+ readonly type: "bytes32";
100
+ }];
101
+ }];
102
+ //# sourceMappingURL=erc20.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erc20.d.ts","sourceRoot":"","sources":["../../src/abis/erc20.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EZ,CAAC"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * ERC-20 ABI — minimal surface for transfer / balanceOf / decimals / nonces / permit.
3
+ *
4
+ * Source: EIP-20 (https://eips.ethereum.org/EIPS/eip-20) for the standard
5
+ * functions, EIP-2612 (https://eips.ethereum.org/EIPS/eip-2612) for
6
+ * `permit` / `nonces` / `DOMAIN_SEPARATOR`.
7
+ *
8
+ * No code reuse from droplinked-web3@5.0.2. All ABI fragments
9
+ * hand-written from the EIPs.
10
+ */
11
+ export const ERC20_ABI = [
12
+ {
13
+ type: 'function',
14
+ name: 'name',
15
+ stateMutability: 'view',
16
+ inputs: [],
17
+ outputs: [{ type: 'string' }],
18
+ },
19
+ {
20
+ type: 'function',
21
+ name: 'symbol',
22
+ stateMutability: 'view',
23
+ inputs: [],
24
+ outputs: [{ type: 'string' }],
25
+ },
26
+ {
27
+ type: 'function',
28
+ name: 'decimals',
29
+ stateMutability: 'view',
30
+ inputs: [],
31
+ outputs: [{ type: 'uint8' }],
32
+ },
33
+ {
34
+ type: 'function',
35
+ name: 'totalSupply',
36
+ stateMutability: 'view',
37
+ inputs: [],
38
+ outputs: [{ type: 'uint256' }],
39
+ },
40
+ {
41
+ type: 'function',
42
+ name: 'balanceOf',
43
+ stateMutability: 'view',
44
+ inputs: [{ name: 'owner', type: 'address' }],
45
+ outputs: [{ type: 'uint256' }],
46
+ },
47
+ {
48
+ type: 'function',
49
+ name: 'allowance',
50
+ stateMutability: 'view',
51
+ inputs: [
52
+ { name: 'owner', type: 'address' },
53
+ { name: 'spender', type: 'address' },
54
+ ],
55
+ outputs: [{ type: 'uint256' }],
56
+ },
57
+ {
58
+ type: 'function',
59
+ name: 'transfer',
60
+ stateMutability: 'nonpayable',
61
+ inputs: [
62
+ { name: 'to', type: 'address' },
63
+ { name: 'value', type: 'uint256' },
64
+ ],
65
+ outputs: [{ type: 'bool' }],
66
+ },
67
+ // EIP-2612 surface — included so callers can read `nonces()`. We do NOT
68
+ // expose a `permit()` write helper because submitting a permit signed
69
+ // by the user invokes the drainer pathway; if a consumer must use
70
+ // permit, they call `signPermit()` themselves and submit the
71
+ // signature via a separately-audited contract.
72
+ {
73
+ type: 'function',
74
+ name: 'nonces',
75
+ stateMutability: 'view',
76
+ inputs: [{ name: 'owner', type: 'address' }],
77
+ outputs: [{ type: 'uint256' }],
78
+ },
79
+ {
80
+ type: 'function',
81
+ name: 'DOMAIN_SEPARATOR',
82
+ stateMutability: 'view',
83
+ inputs: [],
84
+ outputs: [{ type: 'bytes32' }],
85
+ },
86
+ ];
87
+ //# sourceMappingURL=erc20.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erc20.js","sourceRoot":"","sources":["../../src/abis/erc20.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,MAAM;QACZ,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;KAC9B;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,QAAQ;QACd,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;KAC9B;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,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O,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC/B;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,kBAAkB;QACxB,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC/B;CACO,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { ERC20_ABI } from './erc20.js';
2
+ export { SHOP_ABI } from './shop.js';
3
+ export { DEPLOYER_ABI } from './deployer.js';
4
+ export { AIRDROP_ABI } from './airdrop.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/abis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { ERC20_ABI } from './erc20.js';
2
+ export { SHOP_ABI } from './shop.js';
3
+ export { DEPLOYER_ABI } from './deployer.js';
4
+ export { AIRDROP_ABI } from './airdrop.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/abis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,213 @@
1
+ /**
2
+ * Droplinked Shop contract ABI — minimal surface needed by the SDK.
3
+ *
4
+ * Source: derived from the droplinked-web3@5.0.2 `.d.ts` interface
5
+ * surface (DeployShopResponse, PurchaseData, RecordResponse, etc.)
6
+ * combined with the IChainProvider method names (deployShop,
7
+ * recordProduct, claimNFTs, payment, setSigner, setManager). Each
8
+ * fragment is reconstructed from the canonical Solidity signature
9
+ * shape used by the droplinked v3 shop contracts.
10
+ *
11
+ * Where a function appears in this list it is **explicitly allow-listed
12
+ * for calldata submission** by the selector allowlist (see
13
+ * `src/encoders.ts#computeAllowedSelectors`). Anything not here must
14
+ * not be encoded by this package.
15
+ *
16
+ * NOT etherscan-verified at the time of rebuild — see THREAT_MODEL.md
17
+ * "ABI provenance" for the per-function checklist. Before the FIRST
18
+ * consumer migration, every selector below MUST be cross-checked
19
+ * against an etherscan-verified droplinked-shop deployment.
20
+ */
21
+ export declare const SHOP_ABI: readonly [{
22
+ readonly type: "function";
23
+ readonly name: "setSigner";
24
+ readonly stateMutability: "nonpayable";
25
+ readonly inputs: readonly [{
26
+ readonly name: "newSigner";
27
+ readonly type: "address";
28
+ }];
29
+ readonly outputs: readonly [];
30
+ }, {
31
+ readonly type: "function";
32
+ readonly name: "setManager";
33
+ readonly stateMutability: "nonpayable";
34
+ readonly inputs: readonly [{
35
+ readonly name: "newManager";
36
+ readonly type: "address";
37
+ }];
38
+ readonly outputs: readonly [];
39
+ }, {
40
+ readonly type: "function";
41
+ readonly name: "signer";
42
+ readonly stateMutability: "view";
43
+ readonly inputs: readonly [];
44
+ readonly outputs: readonly [{
45
+ readonly type: "address";
46
+ }];
47
+ }, {
48
+ readonly type: "function";
49
+ readonly name: "manager";
50
+ readonly stateMutability: "view";
51
+ readonly inputs: readonly [];
52
+ readonly outputs: readonly [{
53
+ readonly type: "address";
54
+ }];
55
+ }, {
56
+ readonly type: "function";
57
+ readonly name: "owner";
58
+ readonly stateMutability: "view";
59
+ readonly inputs: readonly [];
60
+ readonly outputs: readonly [{
61
+ readonly type: "address";
62
+ }];
63
+ }, {
64
+ readonly type: "function";
65
+ readonly name: "recordProduct";
66
+ readonly stateMutability: "nonpayable";
67
+ readonly inputs: readonly [{
68
+ readonly name: "product";
69
+ readonly type: "tuple";
70
+ readonly components: readonly [{
71
+ readonly name: "productTitle";
72
+ readonly type: "string";
73
+ }, {
74
+ readonly name: "description";
75
+ readonly type: "string";
76
+ }, {
77
+ readonly name: "commission";
78
+ readonly type: "uint256";
79
+ }, {
80
+ readonly name: "productType";
81
+ readonly type: "uint8";
82
+ }, {
83
+ readonly name: "royalty";
84
+ readonly type: "uint256";
85
+ }, {
86
+ readonly name: "amount";
87
+ readonly type: "uint256";
88
+ }, {
89
+ readonly name: "metadataUri";
90
+ readonly type: "string";
91
+ }];
92
+ }];
93
+ readonly outputs: readonly [{
94
+ readonly name: "productId";
95
+ readonly type: "uint256";
96
+ }];
97
+ }, {
98
+ readonly type: "function";
99
+ readonly name: "droplinkedPurchase";
100
+ readonly stateMutability: "payable";
101
+ readonly inputs: readonly [{
102
+ readonly name: "totalPrice";
103
+ readonly type: "uint256";
104
+ }, {
105
+ readonly name: "tbdValues";
106
+ readonly type: "uint256[]";
107
+ }, {
108
+ readonly name: "tbdReceivers";
109
+ readonly type: "address[]";
110
+ }, {
111
+ readonly name: "cartItems";
112
+ readonly type: "tuple[]";
113
+ readonly components: readonly [{
114
+ readonly name: "id";
115
+ readonly type: "uint256";
116
+ }, {
117
+ readonly name: "amount";
118
+ readonly type: "uint256";
119
+ }, {
120
+ readonly name: "isAffiliate";
121
+ readonly type: "bool";
122
+ }, {
123
+ readonly name: "shopAddress";
124
+ readonly type: "address";
125
+ }];
126
+ }, {
127
+ readonly name: "tokenAddress";
128
+ readonly type: "address";
129
+ }, {
130
+ readonly name: "memo";
131
+ readonly type: "string";
132
+ }];
133
+ readonly outputs: readonly [];
134
+ }, {
135
+ readonly type: "function";
136
+ readonly name: "claimNFTs";
137
+ readonly stateMutability: "nonpayable";
138
+ readonly inputs: readonly [{
139
+ readonly name: "purchaseData";
140
+ readonly type: "tuple[]";
141
+ readonly components: readonly [{
142
+ readonly name: "amount";
143
+ readonly type: "uint256";
144
+ }, {
145
+ readonly name: "productId";
146
+ readonly type: "uint256";
147
+ }, {
148
+ readonly name: "nullifier";
149
+ readonly type: "bytes32";
150
+ }];
151
+ }, {
152
+ readonly name: "nonce";
153
+ readonly type: "uint256";
154
+ }, {
155
+ readonly name: "deadline";
156
+ readonly type: "uint256";
157
+ }, {
158
+ readonly name: "signature";
159
+ readonly type: "bytes";
160
+ }];
161
+ readonly outputs: readonly [];
162
+ }, {
163
+ readonly type: "function";
164
+ readonly name: "purchaseNonces";
165
+ readonly stateMutability: "view";
166
+ readonly inputs: readonly [{
167
+ readonly name: "buyer";
168
+ readonly type: "address";
169
+ }];
170
+ readonly outputs: readonly [{
171
+ readonly type: "uint256";
172
+ }];
173
+ }, {
174
+ readonly type: "event";
175
+ readonly name: "ProductRecorded";
176
+ readonly anonymous: false;
177
+ readonly inputs: readonly [{
178
+ readonly indexed: true;
179
+ readonly name: "productId";
180
+ readonly type: "uint256";
181
+ }, {
182
+ readonly indexed: false;
183
+ readonly name: "metadataUri";
184
+ readonly type: "string";
185
+ }];
186
+ }, {
187
+ readonly type: "event";
188
+ readonly name: "SignerChanged";
189
+ readonly anonymous: false;
190
+ readonly inputs: readonly [{
191
+ readonly indexed: true;
192
+ readonly name: "oldSigner";
193
+ readonly type: "address";
194
+ }, {
195
+ readonly indexed: true;
196
+ readonly name: "newSigner";
197
+ readonly type: "address";
198
+ }];
199
+ }, {
200
+ readonly type: "event";
201
+ readonly name: "ManagerChanged";
202
+ readonly anonymous: false;
203
+ readonly inputs: readonly [{
204
+ readonly indexed: true;
205
+ readonly name: "oldManager";
206
+ readonly type: "address";
207
+ }, {
208
+ readonly indexed: true;
209
+ readonly name: "newManager";
210
+ readonly type: "address";
211
+ }];
212
+ }];
213
+ //# sourceMappingURL=shop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shop.d.ts","sourceRoot":"","sources":["../../src/abis/shop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiJX,CAAC"}
@@ -0,0 +1,162 @@
1
+ /**
2
+ * Droplinked Shop contract ABI — minimal surface needed by the SDK.
3
+ *
4
+ * Source: derived from the droplinked-web3@5.0.2 `.d.ts` interface
5
+ * surface (DeployShopResponse, PurchaseData, RecordResponse, etc.)
6
+ * combined with the IChainProvider method names (deployShop,
7
+ * recordProduct, claimNFTs, payment, setSigner, setManager). Each
8
+ * fragment is reconstructed from the canonical Solidity signature
9
+ * shape used by the droplinked v3 shop contracts.
10
+ *
11
+ * Where a function appears in this list it is **explicitly allow-listed
12
+ * for calldata submission** by the selector allowlist (see
13
+ * `src/encoders.ts#computeAllowedSelectors`). Anything not here must
14
+ * not be encoded by this package.
15
+ *
16
+ * NOT etherscan-verified at the time of rebuild — see THREAT_MODEL.md
17
+ * "ABI provenance" for the per-function checklist. Before the FIRST
18
+ * consumer migration, every selector below MUST be cross-checked
19
+ * against an etherscan-verified droplinked-shop deployment.
20
+ */
21
+ export const SHOP_ABI = [
22
+ /* ---- privileged ownership / signer management ---- */
23
+ {
24
+ type: 'function',
25
+ name: 'setSigner',
26
+ stateMutability: 'nonpayable',
27
+ inputs: [{ name: 'newSigner', type: 'address' }],
28
+ outputs: [],
29
+ },
30
+ {
31
+ type: 'function',
32
+ name: 'setManager',
33
+ stateMutability: 'nonpayable',
34
+ inputs: [{ name: 'newManager', type: 'address' }],
35
+ outputs: [],
36
+ },
37
+ {
38
+ type: 'function',
39
+ name: 'signer',
40
+ stateMutability: 'view',
41
+ inputs: [],
42
+ outputs: [{ type: 'address' }],
43
+ },
44
+ {
45
+ type: 'function',
46
+ name: 'manager',
47
+ stateMutability: 'view',
48
+ inputs: [],
49
+ outputs: [{ type: 'address' }],
50
+ },
51
+ {
52
+ type: 'function',
53
+ name: 'owner',
54
+ stateMutability: 'view',
55
+ inputs: [],
56
+ outputs: [{ type: 'address' }],
57
+ },
58
+ /* ---- product recording ---- */
59
+ {
60
+ type: 'function',
61
+ name: 'recordProduct',
62
+ stateMutability: 'nonpayable',
63
+ inputs: [
64
+ {
65
+ name: 'product',
66
+ type: 'tuple',
67
+ components: [
68
+ { name: 'productTitle', type: 'string' },
69
+ { name: 'description', type: 'string' },
70
+ { name: 'commission', type: 'uint256' },
71
+ { name: 'productType', type: 'uint8' },
72
+ { name: 'royalty', type: 'uint256' },
73
+ { name: 'amount', type: 'uint256' },
74
+ { name: 'metadataUri', type: 'string' },
75
+ ],
76
+ },
77
+ ],
78
+ outputs: [{ name: 'productId', type: 'uint256' }],
79
+ },
80
+ /* ---- purchase / payment ---- */
81
+ {
82
+ type: 'function',
83
+ name: 'droplinkedPurchase',
84
+ stateMutability: 'payable',
85
+ inputs: [
86
+ { name: 'totalPrice', type: 'uint256' },
87
+ { name: 'tbdValues', type: 'uint256[]' },
88
+ { name: 'tbdReceivers', type: 'address[]' },
89
+ {
90
+ name: 'cartItems',
91
+ type: 'tuple[]',
92
+ components: [
93
+ { name: 'id', type: 'uint256' },
94
+ { name: 'amount', type: 'uint256' },
95
+ { name: 'isAffiliate', type: 'bool' },
96
+ { name: 'shopAddress', type: 'address' },
97
+ ],
98
+ },
99
+ { name: 'tokenAddress', type: 'address' },
100
+ { name: 'memo', type: 'string' },
101
+ ],
102
+ outputs: [],
103
+ },
104
+ /* ---- claim flow ---- */
105
+ {
106
+ type: 'function',
107
+ name: 'claimNFTs',
108
+ stateMutability: 'nonpayable',
109
+ inputs: [
110
+ {
111
+ name: 'purchaseData',
112
+ type: 'tuple[]',
113
+ components: [
114
+ { name: 'amount', type: 'uint256' },
115
+ { name: 'productId', type: 'uint256' },
116
+ { name: 'nullifier', type: 'bytes32' },
117
+ ],
118
+ },
119
+ { name: 'nonce', type: 'uint256' },
120
+ { name: 'deadline', type: 'uint256' },
121
+ { name: 'signature', type: 'bytes' },
122
+ ],
123
+ outputs: [],
124
+ },
125
+ /* ---- view: purchase-confirmation nonce per buyer ---- */
126
+ {
127
+ type: 'function',
128
+ name: 'purchaseNonces',
129
+ stateMutability: 'view',
130
+ inputs: [{ name: 'buyer', type: 'address' }],
131
+ outputs: [{ type: 'uint256' }],
132
+ },
133
+ /* ---- events ---- */
134
+ {
135
+ type: 'event',
136
+ name: 'ProductRecorded',
137
+ anonymous: false,
138
+ inputs: [
139
+ { indexed: true, name: 'productId', type: 'uint256' },
140
+ { indexed: false, name: 'metadataUri', type: 'string' },
141
+ ],
142
+ },
143
+ {
144
+ type: 'event',
145
+ name: 'SignerChanged',
146
+ anonymous: false,
147
+ inputs: [
148
+ { indexed: true, name: 'oldSigner', type: 'address' },
149
+ { indexed: true, name: 'newSigner', type: 'address' },
150
+ ],
151
+ },
152
+ {
153
+ type: 'event',
154
+ name: 'ManagerChanged',
155
+ anonymous: false,
156
+ inputs: [
157
+ { indexed: true, name: 'oldManager', type: 'address' },
158
+ { indexed: true, name: 'newManager', type: 'address' },
159
+ ],
160
+ },
161
+ ];
162
+ //# sourceMappingURL=shop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shop.js","sourceRoot":"","sources":["../../src/abis/shop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,wDAAwD;IACxD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,WAAW;QACjB,eAAe,EAAE,YAAY;QAC7B,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAChD,OAAO,EAAE,EAAE;KACZ;IACD;QACE,IAAI,EAAE,U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AI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE;YACtD,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE;SACvD;KACF;CACO,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Typed ERC-20 client.
3
+ *
4
+ * Only the SAFE read surface is exposed (decimals, balanceOf, name,
5
+ * symbol, nonces). `approve()` and `permit()` writes are intentionally
6
+ * absent — those are the drainer pathways. Token transfer goes
7
+ * through `encodeErc20Transfer` and wallet-connection's destination-
8
+ * pinned `submitRawTransaction`.
9
+ */
10
+ import { type Address, type PublicClient } from 'viem';
11
+ export interface Erc20ContractArgs {
12
+ readonly address: Address;
13
+ readonly publicClient: PublicClient;
14
+ }
15
+ export declare class Erc20Contract {
16
+ readonly address: Address;
17
+ private readonly publicClient;
18
+ constructor(args: Erc20ContractArgs);
19
+ readDecimals(): Promise<number>;
20
+ readBalanceOf(owner: Address): Promise<bigint>;
21
+ readNonces(owner: Address): Promise<bigint>;
22
+ }
23
+ //# sourceMappingURL=erc20.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erc20.d.ts","sourceRoot":"","sources":["../../src/contracts/erc20.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAe,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,MAAM,CAAC;AAIpE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;CACrC;AAED,qBAAa,aAAa;IACxB,SAAgB,OAAO,EAAE,OAAO,CAAC;IACjC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;gBAEhC,IAAI,EAAE,iBAAiB;IAK7B,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;IAa/B,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAc9C,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;CAalD"}