@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,59 @@
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 { getContract } from 'viem';
11
+ import { ERC20_ABI } from '../abis/erc20.js';
12
+ import { EvmAddressSchema } from '../types.js';
13
+ export class Erc20Contract {
14
+ address;
15
+ publicClient;
16
+ constructor(args) {
17
+ this.address = EvmAddressSchema.parse(args.address);
18
+ this.publicClient = args.publicClient;
19
+ }
20
+ async readDecimals() {
21
+ const c = getContract({
22
+ address: this.address,
23
+ abi: ERC20_ABI,
24
+ client: this.publicClient,
25
+ });
26
+ const d = await c.read.decimals();
27
+ if (typeof d !== 'number' || !Number.isInteger(d) || d < 0 || d > 36) {
28
+ throw new Error(`token returned bizarre decimals: ${String(d)}`);
29
+ }
30
+ return d;
31
+ }
32
+ async readBalanceOf(owner) {
33
+ const c = getContract({
34
+ address: this.address,
35
+ abi: ERC20_ABI,
36
+ client: this.publicClient,
37
+ });
38
+ const ownerNorm = EvmAddressSchema.parse(owner);
39
+ const balance = await c.read.balanceOf([ownerNorm]);
40
+ if (typeof balance !== 'bigint') {
41
+ throw new Error('balanceOf returned non-bigint');
42
+ }
43
+ return balance;
44
+ }
45
+ async readNonces(owner) {
46
+ const c = getContract({
47
+ address: this.address,
48
+ abi: ERC20_ABI,
49
+ client: this.publicClient,
50
+ });
51
+ const ownerNorm = EvmAddressSchema.parse(owner);
52
+ const nonce = await c.read.nonces([ownerNorm]);
53
+ if (typeof nonce !== 'bigint') {
54
+ throw new Error('nonces returned non-bigint');
55
+ }
56
+ return nonce;
57
+ }
58
+ }
59
+ //# sourceMappingURL=erc20.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erc20.js","sourceRoot":"","sources":["../../src/contracts/erc20.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,WAAW,EAAmC,MAAM,MAAM,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAO/C,MAAM,OAAO,aAAa;IACR,OAAO,CAAU;IAChB,YAAY,CAAe;IAE5C,YAAY,IAAuB;QACjC,IAAI,CAAC,OAAO,GAAG,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,MAAM,CAAC,GAAG,WAAW,CAAC;YACpB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,GAAG,EAAE,SAAS;YACd,MAAM,EAAE,IAAI,CAAC,YAAY;S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,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ export { ShopContract, type ShopContractArgs } from './shop.js';
2
+ export { Erc20Contract, type Erc20ContractArgs } from './erc20.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { ShopContract } from './shop.js';
2
+ export { Erc20Contract } from './erc20.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAyB,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,aAAa,EAA0B,MAAM,YAAY,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Typed Shop contract client.
3
+ *
4
+ * Uses viem's `getContract` over an `as const` ABI — every call goes
5
+ * through the typed surface; no `eth_call(arbitraryCalldata)`. Read
6
+ * methods are exposed directly; write methods produce an
7
+ * `EncodedCall` so consumers can show display-vs-bytes confirmation
8
+ * before passing to the wallet via @droplinked_inc/wallet-connection's
9
+ * `submitRawTransaction`.
10
+ *
11
+ * Contract addresses are NEVER fetched at runtime — they must be
12
+ * passed in by the consumer (recommended source: chain registry in
13
+ * @droplinked_inc/web3-kit), and once set on the client are immutable.
14
+ */
15
+ import { type Address, type PublicClient } from 'viem';
16
+ import { type EncodedCall } from '../encoders.js';
17
+ import { type IChainPayment, type PrivilegedActionAck } from '../types.js';
18
+ export interface ShopContractArgs {
19
+ /** Pinned shop contract address. Immutable for the lifetime of the client. */
20
+ readonly address: Address;
21
+ /** Optional read client for view calls. */
22
+ readonly publicClient?: PublicClient;
23
+ }
24
+ export declare class ShopContract {
25
+ readonly address: Address;
26
+ private readonly publicClient;
27
+ constructor(args: ShopContractArgs);
28
+ /** Read `signer()` view. */
29
+ readSigner(): Promise<Address>;
30
+ /** Read `manager()` view. */
31
+ readManager(): Promise<Address>;
32
+ /** Read `owner()` view. */
33
+ readOwner(): Promise<Address>;
34
+ /** Read `purchaseNonces(buyer)`. Single source of truth for replay defense. */
35
+ readPurchaseNonce(buyer: Address): Promise<bigint>;
36
+ /**
37
+ * Build the `setSigner(newSigner)` call. Privileged — requires the
38
+ * caller to explicitly opt in.
39
+ */
40
+ buildSetSigner(newSigner: Address, ack: PrivilegedActionAck): EncodedCall<{
41
+ newSigner: Address;
42
+ }>;
43
+ /**
44
+ * Build the `setManager(newManager)` call. Privileged — requires the
45
+ * caller to explicitly opt in.
46
+ */
47
+ buildSetManager(newManager: Address, ack: PrivilegedActionAck): EncodedCall<{
48
+ newManager: Address;
49
+ }>;
50
+ /** Build the `droplinkedPurchase(...)` call. */
51
+ buildDroplinkedPurchase(payment: IChainPayment): EncodedCall<IChainPayment>;
52
+ /** Sanity: a caller may want to assert at runtime that `this.address` matches an expectation. */
53
+ assertAddressIs(expected: Address): void;
54
+ private requirePublicClient;
55
+ }
56
+ //# sourceMappingURL=shop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shop.d.ts","sourceRoot":"","sources":["../../src/contracts/shop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,YAAY,EAClB,MAAM,MAAM,CAAC;AAEd,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACzB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,gBAAgB;IAC/B,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,2CAA2C;IAC3C,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;CACtC;AAED,qBAAa,YAAY;IACvB,SAAgB,OAAO,EAAE,OAAO,CAAC;IACjC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA2B;gBAE5C,IAAI,EAAE,gBAAgB;IAKlC,4BAA4B;IACtB,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAWpC,6BAA6B;IACvB,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAWrC,2BAA2B;IACrB,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAWnC,+EAA+E;IACzE,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAexD;;;OAGG;IACH,cAAc,CACZ,SAAS,EAAE,OAAO,EAClB,GAAG,EAAE,mBAAmB,GACvB,WAAW,CAAC;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC;IAOtC;;;OAGG;IACH,eAAe,CACb,UAAU,EAAE,OAAO,EACnB,GAAG,EAAE,mBAAmB,GACvB,WAAW,CAAC;QAAE,UAAU,EAAE,OAAO,CAAA;KAAE,CAAC;IAOvC,gDAAgD;IAChD,uBAAuB,CAAC,OAAO,EAAE,aAAa,GAAG,WAAW,CAAC,aAAa,CAAC;IAI3E,iGAAiG;IACjG,eAAe,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;IAOxC,OAAO,CAAC,mBAAmB;CAQ5B"}
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Typed Shop contract client.
3
+ *
4
+ * Uses viem's `getContract` over an `as const` ABI — every call goes
5
+ * through the typed surface; no `eth_call(arbitraryCalldata)`. Read
6
+ * methods are exposed directly; write methods produce an
7
+ * `EncodedCall` so consumers can show display-vs-bytes confirmation
8
+ * before passing to the wallet via @droplinked_inc/wallet-connection's
9
+ * `submitRawTransaction`.
10
+ *
11
+ * Contract addresses are NEVER fetched at runtime — they must be
12
+ * passed in by the consumer (recommended source: chain registry in
13
+ * @droplinked_inc/web3-kit), and once set on the client are immutable.
14
+ */
15
+ import { getContract, } from 'viem';
16
+ import { SHOP_ABI } from '../abis/shop.js';
17
+ import { encodeDroplinkedPurchase, encodeSetManager, encodeSetSigner, } from '../encoders.js';
18
+ import { ContractAddressMismatchError, PrivilegedActionNotAcknowledgedError, } from '../errors.js';
19
+ import { EvmAddressSchema, } from '../types.js';
20
+ export class ShopContract {
21
+ address;
22
+ publicClient;
23
+ constructor(args) {
24
+ this.address = EvmAddressSchema.parse(args.address);
25
+ this.publicClient = args.publicClient;
26
+ }
27
+ /** Read `signer()` view. */
28
+ async readSigner() {
29
+ const client = this.requirePublicClient('readSigner');
30
+ const contract = getContract({
31
+ address: this.address,
32
+ abi: SHOP_ABI,
33
+ client,
34
+ });
35
+ const signer = await contract.read.signer();
36
+ return EvmAddressSchema.parse(signer);
37
+ }
38
+ /** Read `manager()` view. */
39
+ async readManager() {
40
+ const client = this.requirePublicClient('readManager');
41
+ const contract = getContract({
42
+ address: this.address,
43
+ abi: SHOP_ABI,
44
+ client,
45
+ });
46
+ const manager = await contract.read.manager();
47
+ return EvmAddressSchema.parse(manager);
48
+ }
49
+ /** Read `owner()` view. */
50
+ async readOwner() {
51
+ const client = this.requirePublicClient('readOwner');
52
+ const contract = getContract({
53
+ address: this.address,
54
+ abi: SHOP_ABI,
55
+ client,
56
+ });
57
+ const owner = await contract.read.owner();
58
+ return EvmAddressSchema.parse(owner);
59
+ }
60
+ /** Read `purchaseNonces(buyer)`. Single source of truth for replay defense. */
61
+ async readPurchaseNonce(buyer) {
62
+ const client = this.requirePublicClient('readPurchaseNonce');
63
+ const buyerNorm = EvmAddressSchema.parse(buyer);
64
+ const contract = getContract({
65
+ address: this.address,
66
+ abi: SHOP_ABI,
67
+ client,
68
+ });
69
+ const nonce = await contract.read.purchaseNonces([buyerNorm]);
70
+ if (typeof nonce !== 'bigint') {
71
+ throw new Error('purchaseNonces returned non-bigint');
72
+ }
73
+ return nonce;
74
+ }
75
+ /**
76
+ * Build the `setSigner(newSigner)` call. Privileged — requires the
77
+ * caller to explicitly opt in.
78
+ */
79
+ buildSetSigner(newSigner, ack) {
80
+ if (ack?.acknowledgePrivilegedAction !== true) {
81
+ throw new PrivilegedActionNotAcknowledgedError('setSigner');
82
+ }
83
+ return encodeSetSigner({ newSigner, ack });
84
+ }
85
+ /**
86
+ * Build the `setManager(newManager)` call. Privileged — requires the
87
+ * caller to explicitly opt in.
88
+ */
89
+ buildSetManager(newManager, ack) {
90
+ if (ack?.acknowledgePrivilegedAction !== true) {
91
+ throw new PrivilegedActionNotAcknowledgedError('setManager');
92
+ }
93
+ return encodeSetManager({ newManager, ack });
94
+ }
95
+ /** Build the `droplinkedPurchase(...)` call. */
96
+ buildDroplinkedPurchase(payment) {
97
+ return encodeDroplinkedPurchase(payment);
98
+ }
99
+ /** Sanity: a caller may want to assert at runtime that `this.address` matches an expectation. */
100
+ assertAddressIs(expected) {
101
+ const exp = EvmAddressSchema.parse(expected);
102
+ if (this.address !== exp) {
103
+ throw new ContractAddressMismatchError(exp, this.address);
104
+ }
105
+ }
106
+ requirePublicClient(method) {
107
+ if (this.publicClient === undefined) {
108
+ throw new Error(`ShopContract.${method}() requires a publicClient on construction`);
109
+ }
110
+ return this.publicClient;
111
+ }
112
+ }
113
+ //# sourceMappingURL=shop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shop.js","sourceRoot":"","sources":["../../src/contracts/shop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EACL,WAAW,GAGZ,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,GAEhB,MAAM,gBAAgB,CAAC;AACxB,OAA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AAgB,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,gDAAgD;IAChD,uBAAuB,CAAC,OAAsB;QAC5C,OAAO,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED,iGAAiG;IACjG,eAAe,CAAC,QAAiB;QAC/B,MAAM,GAAG,GAAG,gBAAgB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC7C,IAAI,IAAI,CAAC,OAAO,KAAK,GAAG,EAAE,CAAC;YACzB,MAAM,IAAI,4BAA4B,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;IAEO,mBAAmB,CAAC,MAAc;QACxC,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CACb,gBAAgB,MAAM,4CAA4C,CACnE,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;CACF"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * `DropWeb3` — high-level facade kept for source-compatibility with
3
+ * `droplinked-web3@5.0.2` (which consumers like Next-ShopFront import
4
+ * as `new DropWeb3(network).web3Instance({...})`).
5
+ *
6
+ * Behavioral deltas vs v5.0.2:
7
+ * - Constructor takes ONLY `(network)`. The v5.0.2 second `shopId`
8
+ * argument was used to fetch contract addresses remotely from
9
+ * `apiv3dev.droplinked.com` — that single point of compromise has
10
+ * been removed. Consumers must now pass the shop + nft contract
11
+ * addresses explicitly via `web3Instance({ shopContractAddress,
12
+ * nftContractAddress })`.
13
+ * - `web3Instance()` is SYNCHRONOUS and returns the connector
14
+ * immediately. No background network fetch.
15
+ * - `getWalletInfo()` is intentionally removed — it bundled login,
16
+ * nonce read, and signing into one opaque side-effect. Consumers
17
+ * should call `walletLogin()` from
18
+ * @droplinked_inc/wallet-connection directly.
19
+ */
20
+ import { Network } from './types.js';
21
+ import { EvmProviderShim, type EvmProviderShimArgs } from './providers/evm-shim.js';
22
+ export interface DropWeb3InstanceArgs {
23
+ /** Required for `payment` / shop calls. */
24
+ readonly shopContractAddress?: `0x${string}`;
25
+ /** Required for `claim` flows. */
26
+ readonly nftContractAddress?: `0x${string}`;
27
+ /** Chain — passes through to wallet-connection. */
28
+ readonly chain?: EvmProviderShimArgs['chain'];
29
+ /** Wallet selection — defaults to Metamask. */
30
+ readonly preferredWallet?: EvmProviderShimArgs['wallet'];
31
+ /** Optional origin for typed-data signing. */
32
+ readonly origin?: string;
33
+ }
34
+ export declare class DropWeb3 {
35
+ readonly network: Network;
36
+ constructor(network: Network);
37
+ /**
38
+ * Returns an EVM provider shim wired up against the addresses the
39
+ * caller supplied. Throws if a v5.0.2-style remote-address-fetch
40
+ * call is attempted.
41
+ */
42
+ web3Instance(args: DropWeb3InstanceArgs): EvmProviderShim;
43
+ }
44
+ //# sourceMappingURL=drop-web3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drop-web3.d.ts","sourceRoot":"","sources":["../src/drop-web3.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEpF,MAAM,WAAW,oBAAoB;IACnC,2CAA2C;IAC3C,QAAQ,CAAC,mBAAmB,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IAC7C,kCAAkC;IAClC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IAC5C,mDAAmD;IACnD,QAAQ,CAAC,KAAK,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAC9C,+CAA+C;IAC/C,QAAQ,CAAC,eAAe,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACzD,8CAA8C;IAC9C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,qBAAa,QAAQ;IACnB,SAAgB,OAAO,EAAE,OAAO,CAAC;gBAErB,OAAO,EAAE,OAAO;IAS5B;;;;OAIG;IACH,YAAY,CAAC,IAAI,EAAE,oBAAoB,GAAG,eAAe;CAgC1D"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * `DropWeb3` — high-level facade kept for source-compatibility with
3
+ * `droplinked-web3@5.0.2` (which consumers like Next-ShopFront import
4
+ * as `new DropWeb3(network).web3Instance({...})`).
5
+ *
6
+ * Behavioral deltas vs v5.0.2:
7
+ * - Constructor takes ONLY `(network)`. The v5.0.2 second `shopId`
8
+ * argument was used to fetch contract addresses remotely from
9
+ * `apiv3dev.droplinked.com` — that single point of compromise has
10
+ * been removed. Consumers must now pass the shop + nft contract
11
+ * addresses explicitly via `web3Instance({ shopContractAddress,
12
+ * nftContractAddress })`.
13
+ * - `web3Instance()` is SYNCHRONOUS and returns the connector
14
+ * immediately. No background network fetch.
15
+ * - `getWalletInfo()` is intentionally removed — it bundled login,
16
+ * nonce read, and signing into one opaque side-effect. Consumers
17
+ * should call `walletLogin()` from
18
+ * @droplinked_inc/wallet-connection directly.
19
+ */
20
+ import { Network } from './types.js';
21
+ import { ChainNotImplementedException, InvalidParametersException } from './errors.js';
22
+ import { EvmProviderShim } from './providers/evm-shim.js';
23
+ export class DropWeb3 {
24
+ network;
25
+ constructor(network) {
26
+ if (!Object.values(Network).includes(network)) {
27
+ throw new InvalidParametersException(`network must be one of ${Object.values(Network).join(',')}, got ${String(network)}`);
28
+ }
29
+ this.network = network;
30
+ }
31
+ /**
32
+ * Returns an EVM provider shim wired up against the addresses the
33
+ * caller supplied. Throws if a v5.0.2-style remote-address-fetch
34
+ * call is attempted.
35
+ */
36
+ web3Instance(args) {
37
+ if (args.chain === undefined) {
38
+ throw new InvalidParametersException('web3Instance requires { chain } — remote chain inference removed in this rebuild');
39
+ }
40
+ // Non-EVM chains are intentionally NOT implemented in this rebuild
41
+ // — they were stubs in v5.0.2's .d.ts too. Consumers needing these
42
+ // should track the dedicated provider packages. Each non-EVM chain
43
+ // is enumerated explicitly so a silent fall-through to the EVM
44
+ // shim is impossible.
45
+ const NON_EVM_CHAINS = ['SOLANA', 'UNSTOPPABLE'];
46
+ if (NON_EVM_CHAINS.includes(args.chain)) {
47
+ throw new ChainNotImplementedException(`chain ${String(args.chain)} is not implemented in @droplinked_inc/web3 — use the dedicated provider package`);
48
+ }
49
+ return new EvmProviderShim({
50
+ chain: args.chain,
51
+ network: this.network,
52
+ ...(args.preferredWallet !== undefined
53
+ ? { wallet: args.preferredWallet }
54
+ : {}),
55
+ ...(args.shopContractAddress !== undefined
56
+ ? { shopContractAddress: args.shopContractAddress }
57
+ : {}),
58
+ ...(args.nftContractAddress !== undefined
59
+ ? { nftContractAddress: args.nftContractAddress }
60
+ : {}),
61
+ ...(args.origin !== undefined ? { origin: args.origin } : {}),
62
+ });
63
+ }
64
+ }
65
+ //# sourceMappingURL=drop-web3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drop-web3.js","sourceRoot":"","sources":["../src/drop-web3.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,eAAe,EAA4B,MAAM,yBAAyB,CAAC;AAepF,MAAM,OAAO,QAAQ;IACH,OAAO,CAAU;IAEjC,YAAY,OAAgB;QAC1B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9C,MAAM,IAAI,0BAA0B,CAClC,0BAA0B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,OAAO,CAAC,EAAE,CACrF,CAAC;Q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ACL,CAAC;CACF"}
@@ -0,0 +1,115 @@
1
+ /**
2
+ * ABI-encoding helpers with strict assertions.
3
+ *
4
+ * Every public function:
5
+ * 1. Validates inputs via zod (no `any` shapes accepted).
6
+ * 2. Encodes through viem's `encodeFunctionData` against a typed
7
+ * `as const` ABI — never via dynamic `eth_call(arbitraryCalldata)`.
8
+ * 3. Returns BOTH the calldata blob AND the decoded canonical form
9
+ * so callers can show display-vs-bytes confirmation to the user
10
+ * before signing.
11
+ * 4. Computes the function selector independently and asserts that
12
+ * the prefix of the calldata matches — defends against the
13
+ * pathological case where an ABI typo lets the wrong selector
14
+ * slip through.
15
+ *
16
+ * No code reuse from droplinked-web3@5.0.2.
17
+ */
18
+ import { type Address, type Hex } from 'viem';
19
+ import { type DeployShopInput, type IChainPayment } from './types.js';
20
+ export interface EncodedCall<T = unknown> {
21
+ /** Function name as it appears on-chain. */
22
+ readonly functionName: string;
23
+ /** Canonical 4-byte selector (lowercase 0x…). */
24
+ readonly selector: Hex;
25
+ /** ABI-encoded calldata: `selector || args`. Pass directly to wallet. */
26
+ readonly calldata: Hex;
27
+ /**
28
+ * Decoded canonical-form args. Consumer UIs MUST render this back to
29
+ * the user for confirmation before allowing the signature.
30
+ */
31
+ readonly args: T;
32
+ }
33
+ interface SelectorEntry {
34
+ readonly fullSig: string;
35
+ readonly abiName: string;
36
+ readonly contract: 'ERC20' | 'SHOP' | 'DEPLOYER' | 'AIRDROP';
37
+ }
38
+ /**
39
+ * Set of all selectors this package will EVER produce — derived
40
+ * structurally from the bundled ABIs. Used at the boundary as a
41
+ * second line of defense: even if a caller smuggles raw calldata
42
+ * into a downstream submit helper, the selector must appear here.
43
+ */
44
+ export declare const PACKAGE_SELECTOR_ALLOWLIST: ReadonlySet<Hex>;
45
+ /**
46
+ * Drainer-style selectors: explicitly named so the rejection message
47
+ * tells the user / log exactly what was refused. These are the
48
+ * canonical funds-extraction entry points.
49
+ *
50
+ * Note: this complements (does not replace) `PACKAGE_SELECTOR_ALLOWLIST`.
51
+ * If a selector is on BOTH lists, the allowlist takes precedence and
52
+ * we log a loud warning (currently impossible — none of the bundled
53
+ * ABIs include these).
54
+ */
55
+ export declare const KNOWN_DRAINER_SELECTORS: Readonly<Record<Hex, string>>;
56
+ /**
57
+ * Throws if `calldata` does NOT begin with a selector in the package
58
+ * allowlist OR appears on the drainer list. Native-currency transfers
59
+ * (calldata of `0x` or empty) are NOT accepted here — for native
60
+ * transfers callers should use the wallet-connection package's
61
+ * lower-level `submitRawTransaction` and rely on its destination pin.
62
+ */
63
+ export declare function assertCalldataAllowed(calldata: Hex): void;
64
+ /** Returns the function entry for a selector, or undefined if unknown. */
65
+ export declare function lookupSelector(selector: Hex): SelectorEntry | undefined;
66
+ export declare function encodeErc20Transfer(args: {
67
+ to: Address;
68
+ amount: bigint;
69
+ }): EncodedCall<{
70
+ to: Address;
71
+ amount: bigint;
72
+ }>;
73
+ export declare function encodeSetSigner(args: {
74
+ newSigner: Address;
75
+ ack: {
76
+ acknowledgePrivilegedAction: true;
77
+ };
78
+ }): EncodedCall<{
79
+ newSigner: Address;
80
+ }>;
81
+ export declare function encodeSetManager(args: {
82
+ newManager: Address;
83
+ ack: {
84
+ acknowledgePrivilegedAction: true;
85
+ };
86
+ }): EncodedCall<{
87
+ newManager: Address;
88
+ }>;
89
+ export declare function encodeDroplinkedPurchase(payment: IChainPayment): EncodedCall<IChainPayment>;
90
+ export declare function encodeDeployShop(input: DeployShopInput): EncodedCall<DeployShopInput>;
91
+ export declare function encodeAirdropErc20(args: {
92
+ token: Address;
93
+ receivers: readonly Address[];
94
+ amounts: readonly bigint[];
95
+ airdropId: Hex;
96
+ }): EncodedCall<{
97
+ token: Address;
98
+ receivers: readonly Address[];
99
+ amounts: readonly bigint[];
100
+ airdropId: Hex;
101
+ }>;
102
+ /**
103
+ * Render a human-readable summary of an encoded call, alongside the
104
+ * raw selector + calldata. Consumers MUST surface this in the UI
105
+ * before submitting the transaction so the user can confirm bytes
106
+ * match their intent.
107
+ */
108
+ export declare function renderCallForConfirmation(call: EncodedCall<unknown>): {
109
+ functionName: string;
110
+ selector: Hex;
111
+ calldata: Hex;
112
+ argsJson: string;
113
+ };
114
+ export {};
115
+ //# sourceMappingURL=encoders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encoders.d.ts","sourceRoot":"","sources":["../src/encoders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAML,KAAK,OAAO,EACZ,KAAK,GAAG,EACT,MAAM,MAAM,CAAC;AAUd,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,aAAa,EAEnB,MAAM,YAAY,CAAC;AAMpB,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,OAAO;IACtC,4CAA4C;IAC5C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,iDAAiD;IACjD,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC;IACvB,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;CAClB;AAMD,UAAU,aAAa;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;CAC9D;AAiCD;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,EAAE,WAAW,CAAC,GAAG,CAEvD,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAQjE,CAAC;AAMF;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,GAAG,GAAG,IAAI,CAyBzD;AAED,0EAA0E;AAC1E,wBAAgB,cAAc,CAAC,QAAQ,EAAE,GAAG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