@manifoldxyz/dropkit 0.2.1 → 0.4.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/README.md +98 -3
- package/dist/cart.cjs +1832 -0
- package/dist/cart.cjs.map +1 -0
- package/dist/cart.d.cts +216 -0
- package/dist/cart.d.ts +216 -0
- package/dist/cart.js +1832 -0
- package/dist/cart.js.map +1 -0
- package/dist/chunk-GO4TR3HB.cjs +1406 -0
- package/dist/chunk-GO4TR3HB.cjs.map +1 -0
- package/dist/chunk-SUJQB3SL.js +1406 -0
- package/dist/chunk-SUJQB3SL.js.map +1 -0
- package/dist/index.cjs +1004 -1647
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -194
- package/dist/index.d.ts +5 -194
- package/dist/index.js +724 -1353
- package/dist/index.js.map +1 -1
- package/dist/types-BjKGb6c7.d.cts +210 -0
- package/dist/types-BjKGb6c7.d.ts +210 -0
- package/package.json +11 -1
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { Address, Abi, Hex } from 'viem';
|
|
2
|
+
|
|
3
|
+
declare const UNSUPPORTED_REASONS: readonly ["UNKNOWN_EXTENSION", "AMBIGUOUS_EXTENSION", "CLAIM_NOT_FOUND", "DROP_NOT_FOUND", "SIGNATURE_CLAIM", "INVALID_CONFIG", "CONNECT_WIDGET_TOO_OLD"];
|
|
4
|
+
declare const INELIGIBLE_REASONS: readonly ["NOT_ON_ALLOWLIST", "ALLOWLIST_USED", "WALLET_LIMIT", "SIMULATION_REVERTED"];
|
|
5
|
+
declare const ERROR_REASONS: readonly ["USER_REJECTED", "TX_REVERTED", "RATE_LIMITED", "RPC_ERROR", "CHAIN_SWITCH_FAILED", "ALLOWLIST_UNAVAILABLE", "BRIDGE_UNAVAILABLE", "BRIDGE_REFUNDED", "BRIDGE_FAILED", "BRIDGE_TIMEOUT"];
|
|
6
|
+
/** insufficient-funds carries this reason so data-reason is never empty in that state. */
|
|
7
|
+
declare const FUNDS_REASONS: readonly ["INSUFFICIENT_FUNDS"];
|
|
8
|
+
type UnsupportedReason = (typeof UNSUPPORTED_REASONS)[number];
|
|
9
|
+
type IneligibleReason = (typeof INELIGIBLE_REASONS)[number];
|
|
10
|
+
type ErrorReason = (typeof ERROR_REASONS)[number];
|
|
11
|
+
type ReasonCode = UnsupportedReason | IneligibleReason | ErrorReason | (typeof FUNDS_REASONS)[number];
|
|
12
|
+
declare const REASON_CODES: readonly ReasonCode[];
|
|
13
|
+
/**
|
|
14
|
+
* Thrown by adapters, rpc and wallet code; the hook maps it to the matching state.
|
|
15
|
+
* `message` is plain English and, for INVALID_CONFIG, names the exact bad field
|
|
16
|
+
* (e.g. `mint.args[1] "{qty}" is not a known placeholder`).
|
|
17
|
+
*/
|
|
18
|
+
declare class MintError extends Error {
|
|
19
|
+
readonly reason: ReasonCode;
|
|
20
|
+
/** INVALID_CONFIG only: dotted path of the bad field, e.g. "mint.args[1]" or "price". */
|
|
21
|
+
readonly field?: string;
|
|
22
|
+
/** 'relay' or 'tl-stacks': the message is a decoded destination revert, shown as-is. */
|
|
23
|
+
readonly domain?: 'relay' | 'tl-stacks';
|
|
24
|
+
constructor(reason: ReasonCode, message: string, opts?: {
|
|
25
|
+
field?: string;
|
|
26
|
+
cause?: unknown;
|
|
27
|
+
domain?: 'relay' | 'tl-stacks';
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
declare function isMintError(e: unknown): e is MintError;
|
|
31
|
+
|
|
32
|
+
declare const MINT_STATES: readonly ["loading", "unsupported", "upcoming", "ended", "sold-out", "disconnected", "connecting", "live", "ineligible", "insufficient-funds", "switching-chain", "approving", "minting", "confirming", "success", "error"];
|
|
33
|
+
type MintStateName = (typeof MINT_STATES)[number];
|
|
34
|
+
/** States where mint() does something (spec: Clickable column). */
|
|
35
|
+
declare const CLICKABLE_STATES: readonly MintStateName[];
|
|
36
|
+
/** uint16 mintCount cap on Manifold extensions; also the global quantity cap. */
|
|
37
|
+
declare const MAX_QUANTITY = 65535;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Placeholders: {recipient} {payer} {quantity} {unitPrice} {totalPrice}. Integers beyond
|
|
41
|
+
* Number.MAX_SAFE_INTEGER must be bigint or a decimal string (an unsafe number is INVALID_CONFIG).
|
|
42
|
+
*/
|
|
43
|
+
type ArgTemplate = string | number | bigint | boolean | ArgTemplate[];
|
|
44
|
+
type FieldSource = {
|
|
45
|
+
value: bigint;
|
|
46
|
+
} | {
|
|
47
|
+
value: string;
|
|
48
|
+
unit: 'display';
|
|
49
|
+
} | {
|
|
50
|
+
read: {
|
|
51
|
+
functionName: string;
|
|
52
|
+
args?: ArgTemplate[];
|
|
53
|
+
output?: number | string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
type Erc20Ref = {
|
|
57
|
+
address: Address;
|
|
58
|
+
};
|
|
59
|
+
type ManifoldClaimConfig = {
|
|
60
|
+
type: 'manifold-claim';
|
|
61
|
+
chainId: number;
|
|
62
|
+
creatorContract: Address;
|
|
63
|
+
/** Studio instance id == on-chain claim index (V6+ extensions). Decimal string. */
|
|
64
|
+
instanceId: string;
|
|
65
|
+
/** Optional; auto-discovered when omitted. */
|
|
66
|
+
extension?: Address;
|
|
67
|
+
};
|
|
68
|
+
type ContractConfig = {
|
|
69
|
+
type: 'contract';
|
|
70
|
+
chainId: number;
|
|
71
|
+
/** Mint call target. */
|
|
72
|
+
address: Address;
|
|
73
|
+
/** Where Transfer logs come from; defaults to address. */
|
|
74
|
+
tokenContract?: Address;
|
|
75
|
+
abi: Abi;
|
|
76
|
+
mint: {
|
|
77
|
+
functionName: string;
|
|
78
|
+
args: ArgTemplate[];
|
|
79
|
+
};
|
|
80
|
+
price: FieldSource & {
|
|
81
|
+
currency: 'native' | Erc20Ref;
|
|
82
|
+
per?: 'unit' | 'total';
|
|
83
|
+
};
|
|
84
|
+
totalMinted?: FieldSource;
|
|
85
|
+
/** 0 or absent = open edition. */
|
|
86
|
+
maxSupply?: FieldSource;
|
|
87
|
+
walletMinted?: FieldSource;
|
|
88
|
+
walletMax?: FieldSource;
|
|
89
|
+
startTime?: FieldSource;
|
|
90
|
+
endTime?: FieldSource;
|
|
91
|
+
};
|
|
92
|
+
type TlStacksConfig = {
|
|
93
|
+
type: 'tl-stacks';
|
|
94
|
+
chainId: number;
|
|
95
|
+
/** TL Stacks 721 v2.3.x. 0x384092784cfaa91efaa77870c04d958e20840242 on every supported chain. */
|
|
96
|
+
stacks: Address;
|
|
97
|
+
/** The TL creator contract the drop mints from. */
|
|
98
|
+
nftContract: Address;
|
|
99
|
+
/** The drop's allowlist file (TL's allowlistUrl or a copy in the same format). Required for a presale. */
|
|
100
|
+
allowlistUrl?: string;
|
|
101
|
+
};
|
|
102
|
+
type MintConfig = ManifoldClaimConfig | ContractConfig | TlStacksConfig;
|
|
103
|
+
/** chainId -> JSON-RPC URL (agent's domain-restricted key). */
|
|
104
|
+
type RpcUrls = Record<number, string>;
|
|
105
|
+
type Money = {
|
|
106
|
+
value: bigint;
|
|
107
|
+
decimals: number;
|
|
108
|
+
symbol: string;
|
|
109
|
+
formatted: string;
|
|
110
|
+
};
|
|
111
|
+
type DropInfo = {
|
|
112
|
+
chainId: number;
|
|
113
|
+
unitPrice: Money;
|
|
114
|
+
/** Manifold MINT_FEE / MINT_FEE_MERKLE per unit (native). Zero Money for external contracts. For tl-stacks it is TL's protocol fee. */
|
|
115
|
+
unitFee: Money;
|
|
116
|
+
totalMinted: bigint;
|
|
117
|
+
/** null = open edition. */
|
|
118
|
+
maxSupply: bigint | null;
|
|
119
|
+
startTime: number | null;
|
|
120
|
+
endTime: number | null;
|
|
121
|
+
isAllowlist: boolean;
|
|
122
|
+
/** ERC20 the price is paid in; null = native. */
|
|
123
|
+
paymentToken: Address | null;
|
|
124
|
+
/** External price is per transaction ('total') rather than per unit. */
|
|
125
|
+
pricePer: 'unit' | 'total';
|
|
126
|
+
/** Unix seconds when the current sale phase ends and the price or eligibility can change. null = none before endTime. */
|
|
127
|
+
phaseEndsAt?: number | null;
|
|
128
|
+
/** When set and changed by a re-read, the button drops its wallet read and reads again before it is live. */
|
|
129
|
+
walletKey?: string;
|
|
130
|
+
};
|
|
131
|
+
type WalletInfo = {
|
|
132
|
+
address: Address;
|
|
133
|
+
chainId: number;
|
|
134
|
+
recipient: Address;
|
|
135
|
+
walletMinted: bigint | null;
|
|
136
|
+
walletMax: bigint | null;
|
|
137
|
+
allowlistRemaining: number | null;
|
|
138
|
+
};
|
|
139
|
+
type MintedToken = {
|
|
140
|
+
contract: Address;
|
|
141
|
+
tokenId: bigint;
|
|
142
|
+
amount: bigint;
|
|
143
|
+
};
|
|
144
|
+
type MintResult = {
|
|
145
|
+
txHash: Hex;
|
|
146
|
+
explorerUrl: string | null;
|
|
147
|
+
tokens: MintedToken[];
|
|
148
|
+
/** The quantity the collector asked for. tokens.length can be lower when the sale mints part of it. */
|
|
149
|
+
requested: number;
|
|
150
|
+
/** Set when the mint went through Relay: the deposit on the pay chain and Relay's request id. */
|
|
151
|
+
relay?: {
|
|
152
|
+
requestId: Hex;
|
|
153
|
+
originTxHash: Hex;
|
|
154
|
+
originChainId: number;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
/** How the mint is paid (spec relay-cross-chain-mint #public-api). */
|
|
158
|
+
type Route = {
|
|
159
|
+
kind: 'direct';
|
|
160
|
+
chainId: number;
|
|
161
|
+
} | {
|
|
162
|
+
kind: 'relay';
|
|
163
|
+
/** The chain the collector pays on. */
|
|
164
|
+
originChainId: number;
|
|
165
|
+
/** What leaves the wallet on the origin chain: mint + Relay fee. */
|
|
166
|
+
amountIn: Money;
|
|
167
|
+
/** Relay's fee (fees.relayer). */
|
|
168
|
+
relayFee: Money;
|
|
169
|
+
/** Origin-chain gas Relay estimates for the deposit (fees.gas). */
|
|
170
|
+
originGas: Money;
|
|
171
|
+
/** Unix seconds. */
|
|
172
|
+
quotedAt: number;
|
|
173
|
+
};
|
|
174
|
+
/** Cross-chain options on useMint / MintButton. */
|
|
175
|
+
type CrossChainOption = boolean | {
|
|
176
|
+
chains?: number[];
|
|
177
|
+
};
|
|
178
|
+
/** Immutable context frozen when mint is clicked (spec #state-management). */
|
|
179
|
+
type Attempt = {
|
|
180
|
+
attemptId: number;
|
|
181
|
+
config: MintConfig;
|
|
182
|
+
payer: Address;
|
|
183
|
+
recipient: Address;
|
|
184
|
+
quantity: number;
|
|
185
|
+
chainId: number;
|
|
186
|
+
tokenContract: Address;
|
|
187
|
+
/** Chain the collector pays on; equals chainId for a direct mint. */
|
|
188
|
+
originChainId: number;
|
|
189
|
+
};
|
|
190
|
+
type MintEventType = 'state' | 'attempt' | 'approve-submitted' | 'tx-submitted' | 'success' | 'error';
|
|
191
|
+
/** onEvent payload. No wallet address is included. */
|
|
192
|
+
type MintEvent = {
|
|
193
|
+
type: MintEventType;
|
|
194
|
+
state: MintStateName;
|
|
195
|
+
reason: ReasonCode | null;
|
|
196
|
+
chainId: number;
|
|
197
|
+
txHash?: Hex;
|
|
198
|
+
quantity: number;
|
|
199
|
+
config: {
|
|
200
|
+
type: MintConfig['type'];
|
|
201
|
+
chainId: number;
|
|
202
|
+
address: Address;
|
|
203
|
+
};
|
|
204
|
+
/** 'relay' when the mint is (or would be) paid on another chain through Relay. */
|
|
205
|
+
route: 'direct' | 'relay';
|
|
206
|
+
/** Chain the collector pays on. chainId stays the drop chain. */
|
|
207
|
+
originChainId: number;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
export { type ArgTemplate as A, type CrossChainOption as C, type DropInfo as D, type Erc20Ref as E, type FieldSource as F, type IneligibleReason as I, type ManifoldClaimConfig as M, type ReasonCode as R, type TlStacksConfig as T, type UnsupportedReason as U, type WalletInfo as W, type Money as a, type RpcUrls as b, type MintConfig as c, type MintEvent as d, type MintStateName as e, type MintResult as f, type Route as g, type Attempt as h, CLICKABLE_STATES as i, type ContractConfig as j, type ErrorReason as k, MAX_QUANTITY as l, MINT_STATES as m, MintError as n, type MintEventType as o, type MintedToken as p, REASON_CODES as q, isMintError as r };
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { Address, Abi, Hex } from 'viem';
|
|
2
|
+
|
|
3
|
+
declare const UNSUPPORTED_REASONS: readonly ["UNKNOWN_EXTENSION", "AMBIGUOUS_EXTENSION", "CLAIM_NOT_FOUND", "DROP_NOT_FOUND", "SIGNATURE_CLAIM", "INVALID_CONFIG", "CONNECT_WIDGET_TOO_OLD"];
|
|
4
|
+
declare const INELIGIBLE_REASONS: readonly ["NOT_ON_ALLOWLIST", "ALLOWLIST_USED", "WALLET_LIMIT", "SIMULATION_REVERTED"];
|
|
5
|
+
declare const ERROR_REASONS: readonly ["USER_REJECTED", "TX_REVERTED", "RATE_LIMITED", "RPC_ERROR", "CHAIN_SWITCH_FAILED", "ALLOWLIST_UNAVAILABLE", "BRIDGE_UNAVAILABLE", "BRIDGE_REFUNDED", "BRIDGE_FAILED", "BRIDGE_TIMEOUT"];
|
|
6
|
+
/** insufficient-funds carries this reason so data-reason is never empty in that state. */
|
|
7
|
+
declare const FUNDS_REASONS: readonly ["INSUFFICIENT_FUNDS"];
|
|
8
|
+
type UnsupportedReason = (typeof UNSUPPORTED_REASONS)[number];
|
|
9
|
+
type IneligibleReason = (typeof INELIGIBLE_REASONS)[number];
|
|
10
|
+
type ErrorReason = (typeof ERROR_REASONS)[number];
|
|
11
|
+
type ReasonCode = UnsupportedReason | IneligibleReason | ErrorReason | (typeof FUNDS_REASONS)[number];
|
|
12
|
+
declare const REASON_CODES: readonly ReasonCode[];
|
|
13
|
+
/**
|
|
14
|
+
* Thrown by adapters, rpc and wallet code; the hook maps it to the matching state.
|
|
15
|
+
* `message` is plain English and, for INVALID_CONFIG, names the exact bad field
|
|
16
|
+
* (e.g. `mint.args[1] "{qty}" is not a known placeholder`).
|
|
17
|
+
*/
|
|
18
|
+
declare class MintError extends Error {
|
|
19
|
+
readonly reason: ReasonCode;
|
|
20
|
+
/** INVALID_CONFIG only: dotted path of the bad field, e.g. "mint.args[1]" or "price". */
|
|
21
|
+
readonly field?: string;
|
|
22
|
+
/** 'relay' or 'tl-stacks': the message is a decoded destination revert, shown as-is. */
|
|
23
|
+
readonly domain?: 'relay' | 'tl-stacks';
|
|
24
|
+
constructor(reason: ReasonCode, message: string, opts?: {
|
|
25
|
+
field?: string;
|
|
26
|
+
cause?: unknown;
|
|
27
|
+
domain?: 'relay' | 'tl-stacks';
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
declare function isMintError(e: unknown): e is MintError;
|
|
31
|
+
|
|
32
|
+
declare const MINT_STATES: readonly ["loading", "unsupported", "upcoming", "ended", "sold-out", "disconnected", "connecting", "live", "ineligible", "insufficient-funds", "switching-chain", "approving", "minting", "confirming", "success", "error"];
|
|
33
|
+
type MintStateName = (typeof MINT_STATES)[number];
|
|
34
|
+
/** States where mint() does something (spec: Clickable column). */
|
|
35
|
+
declare const CLICKABLE_STATES: readonly MintStateName[];
|
|
36
|
+
/** uint16 mintCount cap on Manifold extensions; also the global quantity cap. */
|
|
37
|
+
declare const MAX_QUANTITY = 65535;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Placeholders: {recipient} {payer} {quantity} {unitPrice} {totalPrice}. Integers beyond
|
|
41
|
+
* Number.MAX_SAFE_INTEGER must be bigint or a decimal string (an unsafe number is INVALID_CONFIG).
|
|
42
|
+
*/
|
|
43
|
+
type ArgTemplate = string | number | bigint | boolean | ArgTemplate[];
|
|
44
|
+
type FieldSource = {
|
|
45
|
+
value: bigint;
|
|
46
|
+
} | {
|
|
47
|
+
value: string;
|
|
48
|
+
unit: 'display';
|
|
49
|
+
} | {
|
|
50
|
+
read: {
|
|
51
|
+
functionName: string;
|
|
52
|
+
args?: ArgTemplate[];
|
|
53
|
+
output?: number | string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
type Erc20Ref = {
|
|
57
|
+
address: Address;
|
|
58
|
+
};
|
|
59
|
+
type ManifoldClaimConfig = {
|
|
60
|
+
type: 'manifold-claim';
|
|
61
|
+
chainId: number;
|
|
62
|
+
creatorContract: Address;
|
|
63
|
+
/** Studio instance id == on-chain claim index (V6+ extensions). Decimal string. */
|
|
64
|
+
instanceId: string;
|
|
65
|
+
/** Optional; auto-discovered when omitted. */
|
|
66
|
+
extension?: Address;
|
|
67
|
+
};
|
|
68
|
+
type ContractConfig = {
|
|
69
|
+
type: 'contract';
|
|
70
|
+
chainId: number;
|
|
71
|
+
/** Mint call target. */
|
|
72
|
+
address: Address;
|
|
73
|
+
/** Where Transfer logs come from; defaults to address. */
|
|
74
|
+
tokenContract?: Address;
|
|
75
|
+
abi: Abi;
|
|
76
|
+
mint: {
|
|
77
|
+
functionName: string;
|
|
78
|
+
args: ArgTemplate[];
|
|
79
|
+
};
|
|
80
|
+
price: FieldSource & {
|
|
81
|
+
currency: 'native' | Erc20Ref;
|
|
82
|
+
per?: 'unit' | 'total';
|
|
83
|
+
};
|
|
84
|
+
totalMinted?: FieldSource;
|
|
85
|
+
/** 0 or absent = open edition. */
|
|
86
|
+
maxSupply?: FieldSource;
|
|
87
|
+
walletMinted?: FieldSource;
|
|
88
|
+
walletMax?: FieldSource;
|
|
89
|
+
startTime?: FieldSource;
|
|
90
|
+
endTime?: FieldSource;
|
|
91
|
+
};
|
|
92
|
+
type TlStacksConfig = {
|
|
93
|
+
type: 'tl-stacks';
|
|
94
|
+
chainId: number;
|
|
95
|
+
/** TL Stacks 721 v2.3.x. 0x384092784cfaa91efaa77870c04d958e20840242 on every supported chain. */
|
|
96
|
+
stacks: Address;
|
|
97
|
+
/** The TL creator contract the drop mints from. */
|
|
98
|
+
nftContract: Address;
|
|
99
|
+
/** The drop's allowlist file (TL's allowlistUrl or a copy in the same format). Required for a presale. */
|
|
100
|
+
allowlistUrl?: string;
|
|
101
|
+
};
|
|
102
|
+
type MintConfig = ManifoldClaimConfig | ContractConfig | TlStacksConfig;
|
|
103
|
+
/** chainId -> JSON-RPC URL (agent's domain-restricted key). */
|
|
104
|
+
type RpcUrls = Record<number, string>;
|
|
105
|
+
type Money = {
|
|
106
|
+
value: bigint;
|
|
107
|
+
decimals: number;
|
|
108
|
+
symbol: string;
|
|
109
|
+
formatted: string;
|
|
110
|
+
};
|
|
111
|
+
type DropInfo = {
|
|
112
|
+
chainId: number;
|
|
113
|
+
unitPrice: Money;
|
|
114
|
+
/** Manifold MINT_FEE / MINT_FEE_MERKLE per unit (native). Zero Money for external contracts. For tl-stacks it is TL's protocol fee. */
|
|
115
|
+
unitFee: Money;
|
|
116
|
+
totalMinted: bigint;
|
|
117
|
+
/** null = open edition. */
|
|
118
|
+
maxSupply: bigint | null;
|
|
119
|
+
startTime: number | null;
|
|
120
|
+
endTime: number | null;
|
|
121
|
+
isAllowlist: boolean;
|
|
122
|
+
/** ERC20 the price is paid in; null = native. */
|
|
123
|
+
paymentToken: Address | null;
|
|
124
|
+
/** External price is per transaction ('total') rather than per unit. */
|
|
125
|
+
pricePer: 'unit' | 'total';
|
|
126
|
+
/** Unix seconds when the current sale phase ends and the price or eligibility can change. null = none before endTime. */
|
|
127
|
+
phaseEndsAt?: number | null;
|
|
128
|
+
/** When set and changed by a re-read, the button drops its wallet read and reads again before it is live. */
|
|
129
|
+
walletKey?: string;
|
|
130
|
+
};
|
|
131
|
+
type WalletInfo = {
|
|
132
|
+
address: Address;
|
|
133
|
+
chainId: number;
|
|
134
|
+
recipient: Address;
|
|
135
|
+
walletMinted: bigint | null;
|
|
136
|
+
walletMax: bigint | null;
|
|
137
|
+
allowlistRemaining: number | null;
|
|
138
|
+
};
|
|
139
|
+
type MintedToken = {
|
|
140
|
+
contract: Address;
|
|
141
|
+
tokenId: bigint;
|
|
142
|
+
amount: bigint;
|
|
143
|
+
};
|
|
144
|
+
type MintResult = {
|
|
145
|
+
txHash: Hex;
|
|
146
|
+
explorerUrl: string | null;
|
|
147
|
+
tokens: MintedToken[];
|
|
148
|
+
/** The quantity the collector asked for. tokens.length can be lower when the sale mints part of it. */
|
|
149
|
+
requested: number;
|
|
150
|
+
/** Set when the mint went through Relay: the deposit on the pay chain and Relay's request id. */
|
|
151
|
+
relay?: {
|
|
152
|
+
requestId: Hex;
|
|
153
|
+
originTxHash: Hex;
|
|
154
|
+
originChainId: number;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
/** How the mint is paid (spec relay-cross-chain-mint #public-api). */
|
|
158
|
+
type Route = {
|
|
159
|
+
kind: 'direct';
|
|
160
|
+
chainId: number;
|
|
161
|
+
} | {
|
|
162
|
+
kind: 'relay';
|
|
163
|
+
/** The chain the collector pays on. */
|
|
164
|
+
originChainId: number;
|
|
165
|
+
/** What leaves the wallet on the origin chain: mint + Relay fee. */
|
|
166
|
+
amountIn: Money;
|
|
167
|
+
/** Relay's fee (fees.relayer). */
|
|
168
|
+
relayFee: Money;
|
|
169
|
+
/** Origin-chain gas Relay estimates for the deposit (fees.gas). */
|
|
170
|
+
originGas: Money;
|
|
171
|
+
/** Unix seconds. */
|
|
172
|
+
quotedAt: number;
|
|
173
|
+
};
|
|
174
|
+
/** Cross-chain options on useMint / MintButton. */
|
|
175
|
+
type CrossChainOption = boolean | {
|
|
176
|
+
chains?: number[];
|
|
177
|
+
};
|
|
178
|
+
/** Immutable context frozen when mint is clicked (spec #state-management). */
|
|
179
|
+
type Attempt = {
|
|
180
|
+
attemptId: number;
|
|
181
|
+
config: MintConfig;
|
|
182
|
+
payer: Address;
|
|
183
|
+
recipient: Address;
|
|
184
|
+
quantity: number;
|
|
185
|
+
chainId: number;
|
|
186
|
+
tokenContract: Address;
|
|
187
|
+
/** Chain the collector pays on; equals chainId for a direct mint. */
|
|
188
|
+
originChainId: number;
|
|
189
|
+
};
|
|
190
|
+
type MintEventType = 'state' | 'attempt' | 'approve-submitted' | 'tx-submitted' | 'success' | 'error';
|
|
191
|
+
/** onEvent payload. No wallet address is included. */
|
|
192
|
+
type MintEvent = {
|
|
193
|
+
type: MintEventType;
|
|
194
|
+
state: MintStateName;
|
|
195
|
+
reason: ReasonCode | null;
|
|
196
|
+
chainId: number;
|
|
197
|
+
txHash?: Hex;
|
|
198
|
+
quantity: number;
|
|
199
|
+
config: {
|
|
200
|
+
type: MintConfig['type'];
|
|
201
|
+
chainId: number;
|
|
202
|
+
address: Address;
|
|
203
|
+
};
|
|
204
|
+
/** 'relay' when the mint is (or would be) paid on another chain through Relay. */
|
|
205
|
+
route: 'direct' | 'relay';
|
|
206
|
+
/** Chain the collector pays on. chainId stays the drop chain. */
|
|
207
|
+
originChainId: number;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
export { type ArgTemplate as A, type CrossChainOption as C, type DropInfo as D, type Erc20Ref as E, type FieldSource as F, type IneligibleReason as I, type ManifoldClaimConfig as M, type ReasonCode as R, type TlStacksConfig as T, type UnsupportedReason as U, type WalletInfo as W, type Money as a, type RpcUrls as b, type MintConfig as c, type MintEvent as d, type MintStateName as e, type MintResult as f, type Route as g, type Attempt as h, CLICKABLE_STATES as i, type ContractConfig as j, type ErrorReason as k, MAX_QUANTITY as l, MINT_STATES as m, MintError as n, type MintEventType as o, type MintedToken as p, REASON_CODES as q, isMintError as r };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manifoldxyz/dropkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "React building blocks for Manifold creator drop sites.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -24,6 +24,16 @@
|
|
|
24
24
|
"default": "./dist/index.cjs"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
|
+
"./cart": {
|
|
28
|
+
"import": {
|
|
29
|
+
"types": "./dist/cart.d.ts",
|
|
30
|
+
"default": "./dist/cart.js"
|
|
31
|
+
},
|
|
32
|
+
"require": {
|
|
33
|
+
"types": "./dist/cart.d.cts",
|
|
34
|
+
"default": "./dist/cart.cjs"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
27
37
|
"./package.json": "./package.json"
|
|
28
38
|
},
|
|
29
39
|
"files": [
|