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