@stablechain/sdk 1.0.4 → 1.0.6
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 +878 -0
- package/dist/chunk-QQ26UI3F.cjs +665 -0
- package/dist/chunk-VS6GBRDF.js +665 -0
- package/dist/erc3009.cjs +26 -0
- package/dist/erc3009.d.cts +429 -0
- package/dist/erc3009.d.ts +429 -0
- package/dist/erc3009.js +26 -0
- package/dist/index.cjs +824 -326
- package/dist/index.d.cts +223 -14
- package/dist/index.d.ts +223 -14
- package/dist/index.js +724 -226
- package/package.json +6 -1
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
import { Address, Hex, Account, Client, Hash } from 'viem';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Overrides for the EIP-712 domain used when signing an authorization.
|
|
5
|
+
*
|
|
6
|
+
* When omitted, the domain is resolved from the token contract at runtime:
|
|
7
|
+
* `eip712Domain()` (EIP-5267) is tried first, falling back to reading `name()`
|
|
8
|
+
* with `version` defaulting to `"1"`. `chainId` falls back to the client chain
|
|
9
|
+
* and `verifyingContract` to the token address.
|
|
10
|
+
*/
|
|
11
|
+
interface Erc3009DomainOverrides {
|
|
12
|
+
name?: string;
|
|
13
|
+
version?: string;
|
|
14
|
+
chainId?: number;
|
|
15
|
+
verifyingContract?: Address;
|
|
16
|
+
}
|
|
17
|
+
/** A fully-specified ERC-3009 authorization message. */
|
|
18
|
+
interface Authorization {
|
|
19
|
+
from: Address;
|
|
20
|
+
to: Address;
|
|
21
|
+
/** Token amount in the token's smallest unit (raw, not human-scaled). */
|
|
22
|
+
value: bigint;
|
|
23
|
+
/** Unix seconds after which the authorization becomes valid (0 = immediately). */
|
|
24
|
+
validAfter: bigint;
|
|
25
|
+
/** Unix seconds after which the authorization is no longer valid. */
|
|
26
|
+
validBefore: bigint;
|
|
27
|
+
/** 32-byte unique nonce. */
|
|
28
|
+
nonce: Hex;
|
|
29
|
+
}
|
|
30
|
+
/** A signed authorization, with the signature split for `(v, r, s)` contract calls. */
|
|
31
|
+
interface SignedAuthorization {
|
|
32
|
+
authorization: Authorization;
|
|
33
|
+
/** 65-byte serialized signature. */
|
|
34
|
+
signature: Hex;
|
|
35
|
+
v: number;
|
|
36
|
+
r: Hex;
|
|
37
|
+
s: Hex;
|
|
38
|
+
}
|
|
39
|
+
interface SignTransferAuthorizationParameters {
|
|
40
|
+
/** ERC-3009 token contract. Defaults to STABLE_USDT_ADDRESS. */
|
|
41
|
+
token?: Address;
|
|
42
|
+
/** Authorizer/sender. Defaults to the client/parameters account address. */
|
|
43
|
+
from?: Address;
|
|
44
|
+
to: Address;
|
|
45
|
+
/** Token amount in the token's smallest unit (raw, not human-scaled). */
|
|
46
|
+
value: bigint;
|
|
47
|
+
/** Unix seconds; defaults to 0 (valid immediately). */
|
|
48
|
+
validAfter?: bigint;
|
|
49
|
+
/** Unix seconds after which the authorization expires. Required. */
|
|
50
|
+
validBefore: bigint;
|
|
51
|
+
/** 32-byte unique nonce. Defaults to a cryptographically random value. */
|
|
52
|
+
nonce?: Hex;
|
|
53
|
+
/** EIP-712 domain overrides — resolved from the token when omitted. */
|
|
54
|
+
domain?: Erc3009DomainOverrides;
|
|
55
|
+
/** Signing account — defaults to the client's account. */
|
|
56
|
+
account?: Account | Address;
|
|
57
|
+
}
|
|
58
|
+
/** Same shape as {@link SignTransferAuthorizationParameters}. */
|
|
59
|
+
type SignReceiveAuthorizationParameters = SignTransferAuthorizationParameters;
|
|
60
|
+
/**
|
|
61
|
+
* Submit a `transferWithAuthorization`. Pass a pre-signed authorization
|
|
62
|
+
* (`{ authorization, v, r, s }`) to relay one signed elsewhere, or the raw
|
|
63
|
+
* sign parameters to sign-and-submit in one call.
|
|
64
|
+
*/
|
|
65
|
+
type TransferWithAuthorizationParameters = {
|
|
66
|
+
signed: SignedAuthorization;
|
|
67
|
+
token?: Address;
|
|
68
|
+
} | SignTransferAuthorizationParameters;
|
|
69
|
+
type ReceiveWithAuthorizationParameters = {
|
|
70
|
+
signed: SignedAuthorization;
|
|
71
|
+
token?: Address;
|
|
72
|
+
} | SignReceiveAuthorizationParameters;
|
|
73
|
+
interface CancelAuthorizationParameters {
|
|
74
|
+
/** ERC-3009 token contract. Defaults to STABLE_USDT_ADDRESS. */
|
|
75
|
+
token?: Address;
|
|
76
|
+
/** Authorizer whose nonce is being cancelled. Defaults to the client account. */
|
|
77
|
+
authorizer?: Address;
|
|
78
|
+
/** The nonce to cancel. */
|
|
79
|
+
nonce: Hex;
|
|
80
|
+
/** EIP-712 domain overrides — resolved from the token when omitted. */
|
|
81
|
+
domain?: Erc3009DomainOverrides;
|
|
82
|
+
/** Signing account — defaults to the client's account. */
|
|
83
|
+
account?: Account | Address;
|
|
84
|
+
}
|
|
85
|
+
interface GetAuthorizationStateParameters {
|
|
86
|
+
/** ERC-3009 token contract. Defaults to STABLE_USDT_ADDRESS. */
|
|
87
|
+
token?: Address;
|
|
88
|
+
authorizer: Address;
|
|
89
|
+
nonce: Hex;
|
|
90
|
+
}
|
|
91
|
+
type VerifyFailureReason = "invalid_signature" | "signer_mismatch" | "already_used" | "not_yet_valid" | "expired" | "expiring_soon" | "insufficient_funds" | "would_revert";
|
|
92
|
+
interface VerifyAuthorizationParameters {
|
|
93
|
+
/** ERC-3009 token contract. Defaults to STABLE_USDT_ADDRESS. */
|
|
94
|
+
token?: Address;
|
|
95
|
+
signed: SignedAuthorization;
|
|
96
|
+
/** Primary type the authorization was signed with. Default "TransferWithAuthorization". */
|
|
97
|
+
primaryType?: "TransferWithAuthorization" | "ReceiveWithAuthorization";
|
|
98
|
+
/** EIP-712 domain overrides — resolved from the token when omitted. */
|
|
99
|
+
domain?: Erc3009DomainOverrides;
|
|
100
|
+
/** Flag as `expiring_soon` if it expires within this many seconds. Default 0. */
|
|
101
|
+
expiryMarginSeconds?: number;
|
|
102
|
+
/** Unix seconds to check the time window against. Defaults to the latest block timestamp. */
|
|
103
|
+
now?: bigint;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Result of a gas-free preflight. `ok` is true only when `reasons` is empty.
|
|
107
|
+
* ERC-3009 does not reserve funds, so `insufficient_funds` is advisory — the
|
|
108
|
+
* balance can change before settlement.
|
|
109
|
+
*/
|
|
110
|
+
interface VerifyAuthorizationResult {
|
|
111
|
+
ok: boolean;
|
|
112
|
+
reasons: VerifyFailureReason[];
|
|
113
|
+
/** Recovered signer — present when the signature is structurally valid. */
|
|
114
|
+
signer?: Address;
|
|
115
|
+
/** `balanceOf(from)` at check time. */
|
|
116
|
+
balance?: bigint;
|
|
117
|
+
/** `value - balance` when the sender is short. */
|
|
118
|
+
shortfall?: bigint;
|
|
119
|
+
/** Decoded revert reason from the `eth_call` dry-run, when it would revert. */
|
|
120
|
+
revertReason?: string;
|
|
121
|
+
}
|
|
122
|
+
interface GetAuthorizationUsageParameters {
|
|
123
|
+
/** ERC-3009 token contract. Defaults to STABLE_USDT_ADDRESS. */
|
|
124
|
+
token?: Address;
|
|
125
|
+
authorizer: Address;
|
|
126
|
+
nonce: Hex;
|
|
127
|
+
/**
|
|
128
|
+
* Block range to scan for the `AuthorizationUsed` event. Both `authorizer`
|
|
129
|
+
* and `nonce` are indexed, so the filter is cheap, but public RPCs may
|
|
130
|
+
* reject unbounded ranges — pass a `fromBlock` floor (e.g. the token's
|
|
131
|
+
* deploy block) for large chains. Defaults to `earliest`..`latest`.
|
|
132
|
+
*/
|
|
133
|
+
fromBlock?: bigint | "earliest";
|
|
134
|
+
toBlock?: bigint | "latest";
|
|
135
|
+
}
|
|
136
|
+
interface AuthorizationUsage {
|
|
137
|
+
used: boolean;
|
|
138
|
+
/** Transaction that consumed the authorization, when found. */
|
|
139
|
+
txHash?: Hex;
|
|
140
|
+
blockNumber?: bigint;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Encoded call ready for a relayer or the enterprise gas-waiver rail to submit.
|
|
144
|
+
* Includes the signed authorization so callers can inspect/store it.
|
|
145
|
+
*/
|
|
146
|
+
interface PreparedAuthorizationCall {
|
|
147
|
+
to: Address;
|
|
148
|
+
data: Hex;
|
|
149
|
+
value: bigint;
|
|
150
|
+
chainId: number;
|
|
151
|
+
signed: SignedAuthorization;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Sign an ERC-3009 `TransferWithAuthorization` (EIP-712). Produces a portable,
|
|
156
|
+
* serializable authorization that anyone can later submit on-chain — the signer
|
|
157
|
+
* pays no gas and need not be the submitter.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* const signed = await signTransferAuthorization(walletClient, {
|
|
161
|
+
* to: vendor,
|
|
162
|
+
* value: 1_250_000n, // 1.25 USDT0 (6 decimals)
|
|
163
|
+
* validBefore: BigInt(nowSeconds + 3600),
|
|
164
|
+
* });
|
|
165
|
+
*/
|
|
166
|
+
declare function signTransferAuthorization(client: Client, parameters: SignTransferAuthorizationParameters): Promise<SignedAuthorization>;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Sign an ERC-3009 `ReceiveWithAuthorization` (EIP-712). Identical to
|
|
170
|
+
* {@link signTransferAuthorization} except the resulting authorization can only
|
|
171
|
+
* be submitted by the recipient (`to`), which prevents front-running when `to`
|
|
172
|
+
* is a contract that reacts on receipt.
|
|
173
|
+
*/
|
|
174
|
+
declare function signReceiveAuthorization(client: Client, parameters: SignReceiveAuthorizationParameters): Promise<SignedAuthorization>;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Submit a `transferWithAuthorization`. Pass a pre-signed authorization
|
|
178
|
+
* (`{ signed }`) to relay one produced elsewhere, or the raw sign parameters to
|
|
179
|
+
* sign-and-submit in one call. Anyone may submit this variant.
|
|
180
|
+
*
|
|
181
|
+
* Returns the transaction hash without waiting for a receipt (like viem's
|
|
182
|
+
* `writeContract`).
|
|
183
|
+
*/
|
|
184
|
+
declare function transferWithAuthorization(client: Client, parameters: TransferWithAuthorizationParameters): Promise<Hash>;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Submit a `receiveWithAuthorization`. Unlike `transferWithAuthorization`, the
|
|
188
|
+
* caller MUST be the recipient (`to`) — enforced on-chain via `msg.sender`, and
|
|
189
|
+
* checked here up front so callers get a clear error before broadcasting.
|
|
190
|
+
*
|
|
191
|
+
* Returns the transaction hash without waiting for a receipt.
|
|
192
|
+
*/
|
|
193
|
+
declare function receiveWithAuthorization(client: Client, parameters: ReceiveWithAuthorizationParameters): Promise<Hash>;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Sign and submit a `cancelAuthorization`, revoking an unused nonce. Requires
|
|
197
|
+
* the authorizer's signature. Best-effort: a cancel can lose a race to an
|
|
198
|
+
* in-flight settlement of the same nonce, in which case the cancel reverts.
|
|
199
|
+
*
|
|
200
|
+
* Returns the transaction hash without waiting for a receipt.
|
|
201
|
+
*/
|
|
202
|
+
declare function cancelAuthorization(client: Client, parameters: CancelAuthorizationParameters): Promise<Hash>;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Sign a transfer authorization and return the encoded call WITHOUT submitting
|
|
206
|
+
* it — ready for a relayer or the enterprise gas-waiver rail to broadcast. This
|
|
207
|
+
* is the seam between core (produces the signed call) and any external
|
|
208
|
+
* submission path (consumes `{ to, data, value, chainId }`).
|
|
209
|
+
*/
|
|
210
|
+
declare function prepareTransferWithAuthorization(client: Client, parameters: SignTransferAuthorizationParameters): Promise<PreparedAuthorizationCall>;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Gas-free preflight over a signed authorization, cheapest checks first:
|
|
214
|
+
* signature recovery → on-chain nonce state → time window → payer solvency →
|
|
215
|
+
* `eth_call` dry-run. Returns structured reasons instead of throwing, so a payee
|
|
216
|
+
* can screen a queue of authorizations before spending gas on any of them.
|
|
217
|
+
*
|
|
218
|
+
* Note: ERC-3009 does not reserve funds, so `insufficient_funds` is advisory —
|
|
219
|
+
* the sender's balance can change before settlement actually lands.
|
|
220
|
+
*/
|
|
221
|
+
declare function verifyAuthorization(client: Client, parameters: VerifyAuthorizationParameters): Promise<VerifyAuthorizationResult>;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Read `authorizationState(authorizer, nonce)` — `true` once the nonce has been
|
|
225
|
+
* used or cancelled. A cheap gas-free check before relaying.
|
|
226
|
+
*/
|
|
227
|
+
declare function getAuthorizationState(client: Client, parameters: GetAuthorizationStateParameters): Promise<boolean>;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Resolve whether (and in which transaction) an authorization was consumed, by
|
|
231
|
+
* querying the `AuthorizationUsed(authorizer, nonce)` event. Both fields are
|
|
232
|
+
* indexed, so this needs no indexer — one `eth_getLogs`.
|
|
233
|
+
*
|
|
234
|
+
* Doubles as the idempotency primitive: if a settle is retried and the nonce
|
|
235
|
+
* already landed, this returns the original transaction instead of a revert.
|
|
236
|
+
*/
|
|
237
|
+
declare function getAuthorizationUsage(client: Client, parameters: GetAuthorizationUsageParameters): Promise<AuthorizationUsage>;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* viem client decorator — attach the ERC-3009 actions to any client:
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* const client = createWalletClient({ account, chain, transport: http() })
|
|
244
|
+
* .extend(erc3009Actions);
|
|
245
|
+
* const signed = await client.signTransferAuthorization({ to, value, validBefore });
|
|
246
|
+
*/
|
|
247
|
+
declare function erc3009Actions(client: Client): {
|
|
248
|
+
signTransferAuthorization: (p: SignTransferAuthorizationParameters) => Promise<SignedAuthorization>;
|
|
249
|
+
signReceiveAuthorization: (p: SignReceiveAuthorizationParameters) => Promise<SignedAuthorization>;
|
|
250
|
+
transferWithAuthorization: (p: TransferWithAuthorizationParameters) => Promise<`0x${string}`>;
|
|
251
|
+
receiveWithAuthorization: (p: ReceiveWithAuthorizationParameters) => Promise<`0x${string}`>;
|
|
252
|
+
cancelAuthorization: (p: CancelAuthorizationParameters) => Promise<`0x${string}`>;
|
|
253
|
+
prepareTransferWithAuthorization: (p: SignTransferAuthorizationParameters) => Promise<PreparedAuthorizationCall>;
|
|
254
|
+
verifyAuthorization: (p: VerifyAuthorizationParameters) => Promise<VerifyAuthorizationResult>;
|
|
255
|
+
getAuthorizationState: (p: GetAuthorizationStateParameters) => Promise<boolean>;
|
|
256
|
+
getAuthorizationUsage: (p: GetAuthorizationUsageParameters) => Promise<AuthorizationUsage>;
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* ERC-3009 "Transfer With Authorization" surface, plus EIP-5267 `eip712Domain()`
|
|
261
|
+
* used to resolve the signing domain at runtime. Signatures are passed in the
|
|
262
|
+
* canonical `(v, r, s)` form, which USDT0 and USDC-style tokens both accept.
|
|
263
|
+
*/
|
|
264
|
+
declare const ERC3009_ABI: readonly [{
|
|
265
|
+
readonly type: "function";
|
|
266
|
+
readonly name: "transferWithAuthorization";
|
|
267
|
+
readonly stateMutability: "nonpayable";
|
|
268
|
+
readonly inputs: readonly [{
|
|
269
|
+
readonly name: "from";
|
|
270
|
+
readonly type: "address";
|
|
271
|
+
}, {
|
|
272
|
+
readonly name: "to";
|
|
273
|
+
readonly type: "address";
|
|
274
|
+
}, {
|
|
275
|
+
readonly name: "value";
|
|
276
|
+
readonly type: "uint256";
|
|
277
|
+
}, {
|
|
278
|
+
readonly name: "validAfter";
|
|
279
|
+
readonly type: "uint256";
|
|
280
|
+
}, {
|
|
281
|
+
readonly name: "validBefore";
|
|
282
|
+
readonly type: "uint256";
|
|
283
|
+
}, {
|
|
284
|
+
readonly name: "nonce";
|
|
285
|
+
readonly type: "bytes32";
|
|
286
|
+
}, {
|
|
287
|
+
readonly name: "v";
|
|
288
|
+
readonly type: "uint8";
|
|
289
|
+
}, {
|
|
290
|
+
readonly name: "r";
|
|
291
|
+
readonly type: "bytes32";
|
|
292
|
+
}, {
|
|
293
|
+
readonly name: "s";
|
|
294
|
+
readonly type: "bytes32";
|
|
295
|
+
}];
|
|
296
|
+
readonly outputs: readonly [];
|
|
297
|
+
}, {
|
|
298
|
+
readonly type: "function";
|
|
299
|
+
readonly name: "receiveWithAuthorization";
|
|
300
|
+
readonly stateMutability: "nonpayable";
|
|
301
|
+
readonly inputs: readonly [{
|
|
302
|
+
readonly name: "from";
|
|
303
|
+
readonly type: "address";
|
|
304
|
+
}, {
|
|
305
|
+
readonly name: "to";
|
|
306
|
+
readonly type: "address";
|
|
307
|
+
}, {
|
|
308
|
+
readonly name: "value";
|
|
309
|
+
readonly type: "uint256";
|
|
310
|
+
}, {
|
|
311
|
+
readonly name: "validAfter";
|
|
312
|
+
readonly type: "uint256";
|
|
313
|
+
}, {
|
|
314
|
+
readonly name: "validBefore";
|
|
315
|
+
readonly type: "uint256";
|
|
316
|
+
}, {
|
|
317
|
+
readonly name: "nonce";
|
|
318
|
+
readonly type: "bytes32";
|
|
319
|
+
}, {
|
|
320
|
+
readonly name: "v";
|
|
321
|
+
readonly type: "uint8";
|
|
322
|
+
}, {
|
|
323
|
+
readonly name: "r";
|
|
324
|
+
readonly type: "bytes32";
|
|
325
|
+
}, {
|
|
326
|
+
readonly name: "s";
|
|
327
|
+
readonly type: "bytes32";
|
|
328
|
+
}];
|
|
329
|
+
readonly outputs: readonly [];
|
|
330
|
+
}, {
|
|
331
|
+
readonly type: "function";
|
|
332
|
+
readonly name: "cancelAuthorization";
|
|
333
|
+
readonly stateMutability: "nonpayable";
|
|
334
|
+
readonly inputs: readonly [{
|
|
335
|
+
readonly name: "authorizer";
|
|
336
|
+
readonly type: "address";
|
|
337
|
+
}, {
|
|
338
|
+
readonly name: "nonce";
|
|
339
|
+
readonly type: "bytes32";
|
|
340
|
+
}, {
|
|
341
|
+
readonly name: "v";
|
|
342
|
+
readonly type: "uint8";
|
|
343
|
+
}, {
|
|
344
|
+
readonly name: "r";
|
|
345
|
+
readonly type: "bytes32";
|
|
346
|
+
}, {
|
|
347
|
+
readonly name: "s";
|
|
348
|
+
readonly type: "bytes32";
|
|
349
|
+
}];
|
|
350
|
+
readonly outputs: readonly [];
|
|
351
|
+
}, {
|
|
352
|
+
readonly type: "function";
|
|
353
|
+
readonly name: "authorizationState";
|
|
354
|
+
readonly stateMutability: "view";
|
|
355
|
+
readonly inputs: readonly [{
|
|
356
|
+
readonly name: "authorizer";
|
|
357
|
+
readonly type: "address";
|
|
358
|
+
}, {
|
|
359
|
+
readonly name: "nonce";
|
|
360
|
+
readonly type: "bytes32";
|
|
361
|
+
}];
|
|
362
|
+
readonly outputs: readonly [{
|
|
363
|
+
readonly name: "";
|
|
364
|
+
readonly type: "bool";
|
|
365
|
+
}];
|
|
366
|
+
}, {
|
|
367
|
+
readonly type: "function";
|
|
368
|
+
readonly name: "balanceOf";
|
|
369
|
+
readonly stateMutability: "view";
|
|
370
|
+
readonly inputs: readonly [{
|
|
371
|
+
readonly name: "account";
|
|
372
|
+
readonly type: "address";
|
|
373
|
+
}];
|
|
374
|
+
readonly outputs: readonly [{
|
|
375
|
+
readonly name: "";
|
|
376
|
+
readonly type: "uint256";
|
|
377
|
+
}];
|
|
378
|
+
}, {
|
|
379
|
+
readonly type: "event";
|
|
380
|
+
readonly name: "AuthorizationUsed";
|
|
381
|
+
readonly anonymous: false;
|
|
382
|
+
readonly inputs: readonly [{
|
|
383
|
+
readonly name: "authorizer";
|
|
384
|
+
readonly type: "address";
|
|
385
|
+
readonly indexed: true;
|
|
386
|
+
}, {
|
|
387
|
+
readonly name: "nonce";
|
|
388
|
+
readonly type: "bytes32";
|
|
389
|
+
readonly indexed: true;
|
|
390
|
+
}];
|
|
391
|
+
}, {
|
|
392
|
+
readonly type: "function";
|
|
393
|
+
readonly name: "eip712Domain";
|
|
394
|
+
readonly stateMutability: "view";
|
|
395
|
+
readonly inputs: readonly [];
|
|
396
|
+
readonly outputs: readonly [{
|
|
397
|
+
readonly name: "fields";
|
|
398
|
+
readonly type: "bytes1";
|
|
399
|
+
}, {
|
|
400
|
+
readonly name: "name";
|
|
401
|
+
readonly type: "string";
|
|
402
|
+
}, {
|
|
403
|
+
readonly name: "version";
|
|
404
|
+
readonly type: "string";
|
|
405
|
+
}, {
|
|
406
|
+
readonly name: "chainId";
|
|
407
|
+
readonly type: "uint256";
|
|
408
|
+
}, {
|
|
409
|
+
readonly name: "verifyingContract";
|
|
410
|
+
readonly type: "address";
|
|
411
|
+
}, {
|
|
412
|
+
readonly name: "salt";
|
|
413
|
+
readonly type: "bytes32";
|
|
414
|
+
}, {
|
|
415
|
+
readonly name: "extensions";
|
|
416
|
+
readonly type: "uint256[]";
|
|
417
|
+
}];
|
|
418
|
+
}, {
|
|
419
|
+
readonly type: "function";
|
|
420
|
+
readonly name: "name";
|
|
421
|
+
readonly stateMutability: "view";
|
|
422
|
+
readonly inputs: readonly [];
|
|
423
|
+
readonly outputs: readonly [{
|
|
424
|
+
readonly name: "";
|
|
425
|
+
readonly type: "string";
|
|
426
|
+
}];
|
|
427
|
+
}];
|
|
428
|
+
|
|
429
|
+
export { type Authorization, type AuthorizationUsage, type CancelAuthorizationParameters, ERC3009_ABI, type Erc3009DomainOverrides, type GetAuthorizationStateParameters, type GetAuthorizationUsageParameters, type PreparedAuthorizationCall, type ReceiveWithAuthorizationParameters, type SignReceiveAuthorizationParameters, type SignTransferAuthorizationParameters, type SignedAuthorization, type TransferWithAuthorizationParameters, type VerifyAuthorizationParameters, type VerifyAuthorizationResult, type VerifyFailureReason, cancelAuthorization, erc3009Actions, getAuthorizationState, getAuthorizationUsage, prepareTransferWithAuthorization, receiveWithAuthorization, signReceiveAuthorization, signTransferAuthorization, transferWithAuthorization, verifyAuthorization };
|
package/dist/erc3009.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ERC3009_ABI,
|
|
3
|
+
cancelAuthorization,
|
|
4
|
+
erc3009Actions,
|
|
5
|
+
getAuthorizationState,
|
|
6
|
+
getAuthorizationUsage,
|
|
7
|
+
prepareTransferWithAuthorization,
|
|
8
|
+
receiveWithAuthorization,
|
|
9
|
+
signReceiveAuthorization,
|
|
10
|
+
signTransferAuthorization,
|
|
11
|
+
transferWithAuthorization,
|
|
12
|
+
verifyAuthorization
|
|
13
|
+
} from "./chunk-VS6GBRDF.js";
|
|
14
|
+
export {
|
|
15
|
+
ERC3009_ABI,
|
|
16
|
+
cancelAuthorization,
|
|
17
|
+
erc3009Actions,
|
|
18
|
+
getAuthorizationState,
|
|
19
|
+
getAuthorizationUsage,
|
|
20
|
+
prepareTransferWithAuthorization,
|
|
21
|
+
receiveWithAuthorization,
|
|
22
|
+
signReceiveAuthorization,
|
|
23
|
+
signTransferAuthorization,
|
|
24
|
+
transferWithAuthorization,
|
|
25
|
+
verifyAuthorization
|
|
26
|
+
};
|