@circle-fin/adapter-ethers-v6 1.6.4 → 1.6.5
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/CHANGELOG.md +6 -0
- package/index.cjs +5821 -2306
- package/index.d.ts +478 -7
- package/index.mjs +5821 -2306
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -168,6 +168,43 @@ interface BaseChainDefinition {
|
|
|
168
168
|
* ```
|
|
169
169
|
*/
|
|
170
170
|
kitContracts?: KitContracts;
|
|
171
|
+
/**
|
|
172
|
+
* Optional Gateway contract configuration for Gateway protocol support.
|
|
173
|
+
*
|
|
174
|
+
* @description When provided, the chain supports the Gateway protocol for
|
|
175
|
+
* cross-chain transfers. Gateway provides an alternative bridging mechanism
|
|
176
|
+
* with its own set of smart contracts (GatewayWallet and GatewayMinter).
|
|
177
|
+
*
|
|
178
|
+
* Use the {@link isGatewayV1Supported} type guard to check if a chain
|
|
179
|
+
* supports Gateway v1 before accessing these properties.
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```typescript
|
|
183
|
+
* // Chain with Gateway v1 support
|
|
184
|
+
* const chainWithGateway: ChainDefinition = {
|
|
185
|
+
* // ... other properties
|
|
186
|
+
* gateway: {
|
|
187
|
+
* domain: 6,
|
|
188
|
+
* forwarderSupported: { source: true, destination: true },
|
|
189
|
+
* contracts: {
|
|
190
|
+
* v1: {
|
|
191
|
+
* wallet: '0x1234567890abcdef1234567890abcdef12345678',
|
|
192
|
+
* minter: '0xabcdef1234567890abcdef1234567890abcdef12'
|
|
193
|
+
* }
|
|
194
|
+
* }
|
|
195
|
+
* }
|
|
196
|
+
* }
|
|
197
|
+
*
|
|
198
|
+
* // Check Gateway support
|
|
199
|
+
* if (isGatewayV1Supported(chainWithGateway)) {
|
|
200
|
+
* console.log('Gateway wallet:', chainWithGateway.gateway.contracts.v1.wallet)
|
|
201
|
+
* }
|
|
202
|
+
* ```
|
|
203
|
+
*
|
|
204
|
+
* @see {@link GatewayConfig} for the structure of Gateway configuration.
|
|
205
|
+
* @see {@link isGatewayV1Supported} for checking Gateway v1 support.
|
|
206
|
+
*/
|
|
207
|
+
gateway?: GatewayConfig;
|
|
171
208
|
}
|
|
172
209
|
/**
|
|
173
210
|
* Represents chain definitions for Ethereum Virtual Machine (EVM) compatible blockchains.
|
|
@@ -449,6 +486,128 @@ interface CCTPConfig {
|
|
|
449
486
|
* ```
|
|
450
487
|
*/
|
|
451
488
|
type KitContractType = 'bridge' | 'adapter';
|
|
489
|
+
/**
|
|
490
|
+
* Configuration for Gateway v1 contracts.
|
|
491
|
+
*
|
|
492
|
+
* @description Contains the addresses for the GatewayWallet and GatewayMinter
|
|
493
|
+
* smart contracts that enable Gateway functionality on a chain.
|
|
494
|
+
*
|
|
495
|
+
* @example
|
|
496
|
+
* ```typescript
|
|
497
|
+
* import type { GatewayV1Contracts } from '@core/chains'
|
|
498
|
+
*
|
|
499
|
+
* const v1Contracts: GatewayV1Contracts = {
|
|
500
|
+
* wallet: '0x1234567890abcdef1234567890abcdef12345678',
|
|
501
|
+
* minter: '0xabcdef1234567890abcdef1234567890abcdef12'
|
|
502
|
+
* }
|
|
503
|
+
* ```
|
|
504
|
+
*/
|
|
505
|
+
interface GatewayV1Contracts {
|
|
506
|
+
/**
|
|
507
|
+
* The address of the GatewayWallet smart contract.
|
|
508
|
+
*
|
|
509
|
+
* @description The GatewayWallet contract manages wallet operations
|
|
510
|
+
* for Gateway transactions.
|
|
511
|
+
*
|
|
512
|
+
* Address format varies by blockchain:
|
|
513
|
+
* - EVM chains: 40-character hexadecimal with 0x prefix (e.g., "0x1234...")
|
|
514
|
+
* - Solana: Base58-encoded 32-byte address (e.g., "9WzDX...")
|
|
515
|
+
*
|
|
516
|
+
* @example "0x1234567890abcdef1234567890abcdef12345678"
|
|
517
|
+
*/
|
|
518
|
+
wallet: string;
|
|
519
|
+
/**
|
|
520
|
+
* The address of the GatewayMinter smart contract.
|
|
521
|
+
*
|
|
522
|
+
* @description The GatewayMinter contract handles minting operations
|
|
523
|
+
* for Gateway transactions.
|
|
524
|
+
*
|
|
525
|
+
* Address format varies by blockchain:
|
|
526
|
+
* - EVM chains: 40-character hexadecimal with 0x prefix (e.g., "0x1234...")
|
|
527
|
+
* - Solana: Base58-encoded 32-byte address (e.g., "9WzDX...")
|
|
528
|
+
*
|
|
529
|
+
* @example "0xabcdef1234567890abcdef1234567890abcdef12"
|
|
530
|
+
*/
|
|
531
|
+
minter: string;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Versioned map of Gateway contract configurations.
|
|
535
|
+
*
|
|
536
|
+
* @description Maps protocol versions to their contract addresses, following
|
|
537
|
+
* the same pattern as {@link CCTPContracts}. Each version is optional so that
|
|
538
|
+
* chains can support any combination of Gateway protocol versions.
|
|
539
|
+
*
|
|
540
|
+
* @example
|
|
541
|
+
* ```typescript
|
|
542
|
+
* import type { GatewayContracts } from '@core/chains'
|
|
543
|
+
*
|
|
544
|
+
* const contracts: GatewayContracts = {
|
|
545
|
+
* v1: {
|
|
546
|
+
* wallet: '0x1234567890abcdef1234567890abcdef12345678',
|
|
547
|
+
* minter: '0xabcdef1234567890abcdef1234567890abcdef12'
|
|
548
|
+
* }
|
|
549
|
+
* }
|
|
550
|
+
* ```
|
|
551
|
+
*/
|
|
552
|
+
type GatewayContracts = Partial<{
|
|
553
|
+
v1: GatewayV1Contracts;
|
|
554
|
+
}>;
|
|
555
|
+
/**
|
|
556
|
+
* Configuration for the Gateway protocol on a blockchain.
|
|
557
|
+
*
|
|
558
|
+
* @description Contains the Gateway domain identifier and version-specific
|
|
559
|
+
* contract configurations. Follows the same structure as {@link CCTPConfig}:
|
|
560
|
+
* a domain number plus a versioned contracts map.
|
|
561
|
+
*
|
|
562
|
+
* @example
|
|
563
|
+
* ```typescript
|
|
564
|
+
* import type { GatewayConfig } from '@core/chains'
|
|
565
|
+
*
|
|
566
|
+
* const gatewayConfig: GatewayConfig = {
|
|
567
|
+
* domain: 0,
|
|
568
|
+
* forwarderSupported: { source: true, destination: true },
|
|
569
|
+
* contracts: {
|
|
570
|
+
* v1: {
|
|
571
|
+
* wallet: '0x1234567890abcdef1234567890abcdef12345678',
|
|
572
|
+
* minter: '0xabcdef1234567890abcdef1234567890abcdef12'
|
|
573
|
+
* }
|
|
574
|
+
* }
|
|
575
|
+
* }
|
|
576
|
+
* ```
|
|
577
|
+
*/
|
|
578
|
+
interface GatewayConfig {
|
|
579
|
+
/**
|
|
580
|
+
* The Gateway domain identifier for this chain.
|
|
581
|
+
*
|
|
582
|
+
* @description Similar to CCTP domains, this number uniquely identifies
|
|
583
|
+
* the chain within the Gateway protocol.
|
|
584
|
+
*
|
|
585
|
+
* @example 0 for Ethereum, 6 for Base
|
|
586
|
+
*/
|
|
587
|
+
domain: number;
|
|
588
|
+
/**
|
|
589
|
+
* Version-specific Gateway contract addresses.
|
|
590
|
+
*
|
|
591
|
+
* @description Contains the addresses for each supported Gateway protocol
|
|
592
|
+
* version, following the same pattern as {@link CCTPContracts}.
|
|
593
|
+
*/
|
|
594
|
+
contracts: GatewayContracts;
|
|
595
|
+
/**
|
|
596
|
+
* Indicate whether the chain supports the Forwarding Service as a source
|
|
597
|
+
* and/or destination within the Gateway protocol.
|
|
598
|
+
*
|
|
599
|
+
* @example
|
|
600
|
+
* ```typescript
|
|
601
|
+
* forwarderSupported: { source: true, destination: true }
|
|
602
|
+
* ```
|
|
603
|
+
*/
|
|
604
|
+
forwarderSupported: {
|
|
605
|
+
/** Whether this chain can be used as a source in forwarded transfers. */
|
|
606
|
+
source: boolean;
|
|
607
|
+
/** Whether this chain can be used as a destination in forwarded transfers. */
|
|
608
|
+
destination: boolean;
|
|
609
|
+
};
|
|
610
|
+
}
|
|
452
611
|
/**
|
|
453
612
|
* Kit-specific contract addresses for enhanced chain functionality.
|
|
454
613
|
*
|
|
@@ -763,10 +922,39 @@ type EvmPreparedChainRequestParams = {
|
|
|
763
922
|
functionName: string;
|
|
764
923
|
/** The arguments to pass to the function. */
|
|
765
924
|
args: unknown[];
|
|
925
|
+
/**
|
|
926
|
+
* Specific block number to read contract state at (read-only calls only).
|
|
927
|
+
* Used for historical reads, e.g. checking delegate status at Gateway's
|
|
928
|
+
* processed height rather than the latest block. Ignored for write
|
|
929
|
+
* operations (transactions).
|
|
930
|
+
*/
|
|
931
|
+
blockNumber?: bigint;
|
|
766
932
|
} & Partial<EvmEstimateOverrides>;
|
|
933
|
+
/**
|
|
934
|
+
* Parameters for preparing an EIP-712 typed data signing request (EVM).
|
|
935
|
+
* When executed, returns the signature hex string.
|
|
936
|
+
*/
|
|
937
|
+
interface EvmSignTypedDataPreparedChainRequestParams {
|
|
938
|
+
type: 'evm-sign-typed-data';
|
|
939
|
+
typedData: {
|
|
940
|
+
types: Record<string, unknown[]>;
|
|
941
|
+
domain: Record<string, unknown>;
|
|
942
|
+
primaryType: string;
|
|
943
|
+
message: Record<string, unknown>;
|
|
944
|
+
};
|
|
945
|
+
}
|
|
767
946
|
/**
|
|
768
947
|
* Solana-specific parameters for preparing a transaction.
|
|
769
|
-
*
|
|
948
|
+
*
|
|
949
|
+
* @example
|
|
950
|
+
* ```typescript
|
|
951
|
+
* import type { SolanaPreparedChainRequestParams } from '@core/adapter'
|
|
952
|
+
*
|
|
953
|
+
* const params: SolanaPreparedChainRequestParams = {
|
|
954
|
+
* instructions: [transferInstruction],
|
|
955
|
+
* addressLookupTables: [],
|
|
956
|
+
* }
|
|
957
|
+
* ```
|
|
770
958
|
*/
|
|
771
959
|
interface SolanaPreparedChainRequestParams {
|
|
772
960
|
/**
|
|
@@ -807,6 +995,24 @@ interface SolanaPreparedChainRequestParams {
|
|
|
807
995
|
*/
|
|
808
996
|
addressLookupTableAddresses?: string[];
|
|
809
997
|
}
|
|
998
|
+
/**
|
|
999
|
+
* Parameters for preparing a message signing request (Solana).
|
|
1000
|
+
* When executed, returns the signature.
|
|
1001
|
+
*
|
|
1002
|
+
* @example
|
|
1003
|
+
* ```typescript
|
|
1004
|
+
* import type { SolanaSignMessagePreparedChainRequestParams } from '@core/adapter'
|
|
1005
|
+
*
|
|
1006
|
+
* const params: SolanaSignMessagePreparedChainRequestParams = {
|
|
1007
|
+
* type: 'solana-sign-message',
|
|
1008
|
+
* message: new TextEncoder().encode('Sign this message'),
|
|
1009
|
+
* }
|
|
1010
|
+
* ```
|
|
1011
|
+
*/
|
|
1012
|
+
interface SolanaSignMessagePreparedChainRequestParams {
|
|
1013
|
+
type: 'solana-sign-message';
|
|
1014
|
+
message: Uint8Array;
|
|
1015
|
+
}
|
|
810
1016
|
/**
|
|
811
1017
|
* Solana-specific configuration for transaction estimation.
|
|
812
1018
|
* @interface SolanaEstimateOverrides
|
|
@@ -879,7 +1085,7 @@ interface NoopPreparedChainRequest {
|
|
|
879
1085
|
* Union type for all supported contract execution parameters.
|
|
880
1086
|
* Currently only supports EVM chains, but can be extended for other chains.
|
|
881
1087
|
*/
|
|
882
|
-
type PreparedChainRequestParams = EvmPreparedChainRequestParams | SolanaPreparedChainRequestParams;
|
|
1088
|
+
type PreparedChainRequestParams = EvmPreparedChainRequestParams | EvmSignTypedDataPreparedChainRequestParams | SolanaPreparedChainRequestParams | SolanaSignMessagePreparedChainRequestParams;
|
|
883
1089
|
/**
|
|
884
1090
|
* Response from waiting for a transaction to be mined and confirmed on the blockchain.
|
|
885
1091
|
*
|
|
@@ -2230,6 +2436,18 @@ interface USDCActionMap {
|
|
|
2230
2436
|
* This is a read-only operation.
|
|
2231
2437
|
*/
|
|
2232
2438
|
balanceOf: Omit<BaseUSDCActions['balanceOf'], 'tokenAddress'>;
|
|
2439
|
+
/**
|
|
2440
|
+
* Get the EIP-712 domain name of the USDC contract on the current chain.
|
|
2441
|
+
*
|
|
2442
|
+
* Automatically uses the USDC contract address for the current chain.
|
|
2443
|
+
* This is a read-only operation with no parameters.
|
|
2444
|
+
*/
|
|
2445
|
+
name: ActionParameters & {
|
|
2446
|
+
/**
|
|
2447
|
+
* Optional chain override; defaults to the operation context chain.
|
|
2448
|
+
*/
|
|
2449
|
+
chain?: ChainDefinition;
|
|
2450
|
+
};
|
|
2233
2451
|
}
|
|
2234
2452
|
|
|
2235
2453
|
/**
|
|
@@ -2272,6 +2490,252 @@ interface USDTActionMap {
|
|
|
2272
2490
|
transfer: BaseUSDTActions['transfer'];
|
|
2273
2491
|
}
|
|
2274
2492
|
|
|
2493
|
+
/**
|
|
2494
|
+
* Versioned wrapper for Gateway action namespaces.
|
|
2495
|
+
*
|
|
2496
|
+
* Follows the same pattern as {@link CCTPActionMap}: each version is a
|
|
2497
|
+
* nested namespace so that action keys read `gateway.v1.deposit`, etc.
|
|
2498
|
+
*
|
|
2499
|
+
* @see {@link GatewayV1ActionMap} for v1 action definitions
|
|
2500
|
+
*/
|
|
2501
|
+
interface GatewayActionMap {
|
|
2502
|
+
/** Gateway protocol v1 operations. */
|
|
2503
|
+
readonly v1: GatewayV1ActionMap;
|
|
2504
|
+
}
|
|
2505
|
+
/**
|
|
2506
|
+
* Action map for Circle Gateway Wallet v1 contract operations.
|
|
2507
|
+
*
|
|
2508
|
+
* Mirrors the GatewayWallet interface: deposit variants, delegate management,
|
|
2509
|
+
* and balance queries.
|
|
2510
|
+
*
|
|
2511
|
+
* @see https://developers.circle.com/gateway/references/contract-interfaces-and-events
|
|
2512
|
+
* @see https://developers.circle.com/gateway/references/solana-programs
|
|
2513
|
+
*/
|
|
2514
|
+
interface GatewayV1ActionMap {
|
|
2515
|
+
/**
|
|
2516
|
+
* Deposit tokens after approving the Gateway contract. Balance is credited to the caller.
|
|
2517
|
+
*
|
|
2518
|
+
* Corresponds to `deposit(address token, uint256 value)`.
|
|
2519
|
+
*/
|
|
2520
|
+
deposit: ActionParameters & {
|
|
2521
|
+
/** Token contract address (e.g. USDC). */
|
|
2522
|
+
token: string;
|
|
2523
|
+
/** Amount in token's smallest unit. */
|
|
2524
|
+
value: bigint;
|
|
2525
|
+
/** Chain with Gateway v1 (optional; defaults to operation context chain). */
|
|
2526
|
+
chain?: ChainDefinition;
|
|
2527
|
+
};
|
|
2528
|
+
/**
|
|
2529
|
+
* Deposit tokens on behalf of another address after approving. Balance is credited to `depositor`.
|
|
2530
|
+
*
|
|
2531
|
+
* Corresponds to `depositFor(address token, address depositor, uint256 value)`.
|
|
2532
|
+
*/
|
|
2533
|
+
depositFor: ActionParameters & {
|
|
2534
|
+
/** Token contract address. */
|
|
2535
|
+
token: string;
|
|
2536
|
+
/** Address that will own the resulting balance. */
|
|
2537
|
+
depositor: string;
|
|
2538
|
+
/** Amount in token's smallest unit. */
|
|
2539
|
+
value: bigint;
|
|
2540
|
+
/** Chain with Gateway v1 (optional; defaults to operation context chain). */
|
|
2541
|
+
chain?: ChainDefinition;
|
|
2542
|
+
};
|
|
2543
|
+
/**
|
|
2544
|
+
* Deposit with EIP-2612 permit (gasless approval via signature).
|
|
2545
|
+
*
|
|
2546
|
+
* Corresponds to `depositWithPermit(token, owner, value, deadline, signature)` (bytes)
|
|
2547
|
+
* or the overload with (v, r, s). Use `signature` for EIP-7597 (SCA); use (v, r, s) for EOA.
|
|
2548
|
+
*/
|
|
2549
|
+
depositWithPermit: ActionParameters & {
|
|
2550
|
+
/** Token contract address. */
|
|
2551
|
+
token: string;
|
|
2552
|
+
/** Depositor's address (owner in permit). */
|
|
2553
|
+
owner: string;
|
|
2554
|
+
/** Amount in token's smallest unit. */
|
|
2555
|
+
value: bigint;
|
|
2556
|
+
/** Permit deadline (Unix timestamp) or max uint256 for no expiration. */
|
|
2557
|
+
deadline: bigint;
|
|
2558
|
+
/** Signature as bytes (EIP-7597) or omit and use v, r, s. */
|
|
2559
|
+
signature?: `0x${string}`;
|
|
2560
|
+
/** ECDSA v (when not using signature bytes). */
|
|
2561
|
+
v?: number;
|
|
2562
|
+
/** ECDSA r (when not using signature bytes). */
|
|
2563
|
+
r?: `0x${string}`;
|
|
2564
|
+
/** ECDSA s (when not using signature bytes). */
|
|
2565
|
+
s?: `0x${string}`;
|
|
2566
|
+
/** Chain with Gateway v1 (optional; defaults to operation context chain). */
|
|
2567
|
+
chain?: ChainDefinition;
|
|
2568
|
+
};
|
|
2569
|
+
/**
|
|
2570
|
+
* Deposit with EIP-3009 transferWithAuthorization (receiveWithAuthorization).
|
|
2571
|
+
*
|
|
2572
|
+
* Corresponds to `depositWithAuthorization(token, from, value, validAfter, validBefore, nonce, signature)`
|
|
2573
|
+
* or the overload with (v, r, s).
|
|
2574
|
+
*/
|
|
2575
|
+
depositWithAuthorization: ActionParameters & {
|
|
2576
|
+
/** Token contract address. */
|
|
2577
|
+
token: string;
|
|
2578
|
+
/** Depositor's address (from in authorization). */
|
|
2579
|
+
from: string;
|
|
2580
|
+
/** Amount in token's smallest unit. */
|
|
2581
|
+
value: bigint;
|
|
2582
|
+
/** Unix timestamp after which the authorization is valid. */
|
|
2583
|
+
validAfter: bigint;
|
|
2584
|
+
/** Unix timestamp before which the authorization is valid. */
|
|
2585
|
+
validBefore: bigint;
|
|
2586
|
+
/** Unique nonce (bytes32). */
|
|
2587
|
+
nonce: `0x${string}`;
|
|
2588
|
+
/** Signature as bytes (EIP-7598) or omit and use v, r, s. */
|
|
2589
|
+
signature?: `0x${string}`;
|
|
2590
|
+
/** ECDSA v (when not using signature bytes). */
|
|
2591
|
+
v?: number;
|
|
2592
|
+
/** ECDSA r (when not using signature bytes). */
|
|
2593
|
+
r?: `0x${string}`;
|
|
2594
|
+
/** ECDSA s (when not using signature bytes). */
|
|
2595
|
+
s?: `0x${string}`;
|
|
2596
|
+
/** Chain with Gateway v1 (optional; defaults to operation context chain). */
|
|
2597
|
+
chain?: ChainDefinition;
|
|
2598
|
+
};
|
|
2599
|
+
/**
|
|
2600
|
+
* Grant spending rights to a delegate on the caller's Gateway account.
|
|
2601
|
+
*
|
|
2602
|
+
* Corresponds to `addDelegate(address token, address delegate)`.
|
|
2603
|
+
*/
|
|
2604
|
+
addDelegate: ActionParameters & {
|
|
2605
|
+
/** Token contract address (e.g. USDC). */
|
|
2606
|
+
token: string;
|
|
2607
|
+
/** Address to authorize as a delegate. */
|
|
2608
|
+
delegate: string;
|
|
2609
|
+
/** Chain with Gateway v1 (optional; defaults to operation context chain). */
|
|
2610
|
+
chain?: ChainDefinition;
|
|
2611
|
+
};
|
|
2612
|
+
/**
|
|
2613
|
+
* Revoke spending rights from a delegate on the caller's Gateway account.
|
|
2614
|
+
*
|
|
2615
|
+
* Corresponds to `removeDelegate(address token, address delegate)`.
|
|
2616
|
+
*/
|
|
2617
|
+
removeDelegate: ActionParameters & {
|
|
2618
|
+
/** Token contract address (e.g. USDC). */
|
|
2619
|
+
token: string;
|
|
2620
|
+
/** Address to revoke as a delegate. */
|
|
2621
|
+
delegate: string;
|
|
2622
|
+
/** Chain with Gateway v1 (optional; defaults to operation context chain). */
|
|
2623
|
+
chain?: ChainDefinition;
|
|
2624
|
+
};
|
|
2625
|
+
/**
|
|
2626
|
+
* Check whether an address is authorized as a delegate for a depositor's balance.
|
|
2627
|
+
*
|
|
2628
|
+
* Corresponds to `isAuthorizedForBalance(address token, address depositor, address addr)`.
|
|
2629
|
+
*/
|
|
2630
|
+
isDelegate: ActionParameters & {
|
|
2631
|
+
/** Token contract address (e.g. USDC). */
|
|
2632
|
+
token: string;
|
|
2633
|
+
/** The depositor (balance owner) address. */
|
|
2634
|
+
depositor: string;
|
|
2635
|
+
/** The address to check for delegate status. */
|
|
2636
|
+
delegate: string;
|
|
2637
|
+
/** Chain with Gateway v1 (optional; defaults to operation context chain). */
|
|
2638
|
+
chain?: ChainDefinition;
|
|
2639
|
+
/** EVM: specific block number to read state at (for finality-aware checks). */
|
|
2640
|
+
blockNumber?: bigint;
|
|
2641
|
+
/** Solana: commitment level for the account read. */
|
|
2642
|
+
commitment?: 'confirmed' | 'finalized';
|
|
2643
|
+
};
|
|
2644
|
+
/**
|
|
2645
|
+
* Start a delayed fund removal from a Gateway account.
|
|
2646
|
+
*
|
|
2647
|
+
* Corresponds to `initiateWithdrawal(address token, uint256 value)` (EVM)
|
|
2648
|
+
* or the `initiate_withdrawal` instruction (Solana).
|
|
2649
|
+
*/
|
|
2650
|
+
initiateWithdrawal: ActionParameters & {
|
|
2651
|
+
/** Token contract address (e.g. USDC). */
|
|
2652
|
+
token: string;
|
|
2653
|
+
/** Amount in token's smallest unit. */
|
|
2654
|
+
value: bigint;
|
|
2655
|
+
/** Chain with Gateway v1 (optional; defaults to operation context chain). */
|
|
2656
|
+
chain?: ChainDefinition;
|
|
2657
|
+
};
|
|
2658
|
+
/**
|
|
2659
|
+
* Complete a fund removal after the withdrawal delay has elapsed.
|
|
2660
|
+
*
|
|
2661
|
+
* Corresponds to `withdraw(address token)` (EVM) or the `withdraw`
|
|
2662
|
+
* instruction (Solana). No amount parameter -- the contract returns the
|
|
2663
|
+
* full pending withdrawal balance.
|
|
2664
|
+
*/
|
|
2665
|
+
withdraw: ActionParameters & {
|
|
2666
|
+
/** Token contract address (e.g. USDC). */
|
|
2667
|
+
token: string;
|
|
2668
|
+
/** Chain with Gateway v1 (optional; defaults to operation context chain). */
|
|
2669
|
+
chain?: ChainDefinition;
|
|
2670
|
+
};
|
|
2671
|
+
/**
|
|
2672
|
+
* Read the pending withdrawal balance for a depositor.
|
|
2673
|
+
*
|
|
2674
|
+
* Corresponds to `withdrawingBalance(address token, address depositor)` (EVM)
|
|
2675
|
+
* or reading `withdrawing_amount` from the `GatewayDeposit` PDA (Solana).
|
|
2676
|
+
*/
|
|
2677
|
+
withdrawingBalance: ActionParameters & {
|
|
2678
|
+
/** Token contract address (e.g. USDC). */
|
|
2679
|
+
token: string;
|
|
2680
|
+
/** The depositor whose pending withdrawal to query. */
|
|
2681
|
+
depositor: string;
|
|
2682
|
+
/** Chain with Gateway v1 (optional; defaults to operation context chain). */
|
|
2683
|
+
chain?: ChainDefinition;
|
|
2684
|
+
};
|
|
2685
|
+
/**
|
|
2686
|
+
* Read the block number at which a pending withdrawal can be completed.
|
|
2687
|
+
*
|
|
2688
|
+
* Corresponds to `withdrawalBlock(address token, address depositor)` (EVM)
|
|
2689
|
+
* or reading `withdrawal_block` from the `GatewayDeposit` PDA (Solana).
|
|
2690
|
+
*/
|
|
2691
|
+
withdrawalBlock: ActionParameters & {
|
|
2692
|
+
/** Token contract address (e.g. USDC). */
|
|
2693
|
+
token: string;
|
|
2694
|
+
/** The depositor whose withdrawal block to query. */
|
|
2695
|
+
depositor: string;
|
|
2696
|
+
/** Chain with Gateway v1 (optional; defaults to operation context chain). */
|
|
2697
|
+
chain?: ChainDefinition;
|
|
2698
|
+
};
|
|
2699
|
+
/**
|
|
2700
|
+
* Execute gatewayBurn on the Gateway Wallet contract.
|
|
2701
|
+
* Burns tokens from a source chain as part of a cross-chain spend.
|
|
2702
|
+
*
|
|
2703
|
+
* Corresponds to `gatewayBurn(bytes calldataBytes, bytes signature)`.
|
|
2704
|
+
*/
|
|
2705
|
+
gatewayBurn: ActionParameters & {
|
|
2706
|
+
/** ABI-encoded burn intent calldata. */
|
|
2707
|
+
calldataBytes: `0x${string}`;
|
|
2708
|
+
/** Signature over the burn intent(s). */
|
|
2709
|
+
signature: `0x${string}`;
|
|
2710
|
+
/** Chain with Gateway v1 (optional; defaults to operation context chain). */
|
|
2711
|
+
chain?: ChainDefinition;
|
|
2712
|
+
};
|
|
2713
|
+
/**
|
|
2714
|
+
* Execute gatewayMint on the Gateway Minter contract.
|
|
2715
|
+
* Mints tokens on the destination chain to complete a cross-chain spend.
|
|
2716
|
+
*
|
|
2717
|
+
* Corresponds to `gatewayMint(bytes attestationPayload, bytes signature)`.
|
|
2718
|
+
*/
|
|
2719
|
+
gatewayMint: ActionParameters & {
|
|
2720
|
+
/** Attestation payload from the Gateway API. */
|
|
2721
|
+
attestation: `0x${string}`;
|
|
2722
|
+
/** Signature over the attestation. */
|
|
2723
|
+
signature: `0x${string}`;
|
|
2724
|
+
/** Chain with Gateway v1 (optional; defaults to operation context chain). */
|
|
2725
|
+
chain?: ChainDefinition;
|
|
2726
|
+
};
|
|
2727
|
+
/**
|
|
2728
|
+
* Sign burn intents using EIP-712 typed data (EVM) or binary encoding (Solana).
|
|
2729
|
+
* Returns the signature needed for the Gateway API transfer call.
|
|
2730
|
+
*/
|
|
2731
|
+
signBurnIntents: ActionParameters & {
|
|
2732
|
+
/** EIP-712 typed data for EVM, or binary-encoded data for Solana. */
|
|
2733
|
+
typedData: unknown;
|
|
2734
|
+
/** Chain with Gateway v1 (optional; defaults to operation context chain). */
|
|
2735
|
+
chain?: ChainDefinition;
|
|
2736
|
+
};
|
|
2737
|
+
}
|
|
2738
|
+
|
|
2275
2739
|
/**
|
|
2276
2740
|
* Native token-related action maps for the bridge kit.
|
|
2277
2741
|
*
|
|
@@ -2326,14 +2790,16 @@ interface NativeActionMap {
|
|
|
2326
2790
|
interface ActionMap {
|
|
2327
2791
|
/** CCTP-specific operations with automatic address resolution. */
|
|
2328
2792
|
readonly cctp: CCTPActionMap;
|
|
2793
|
+
/** Gateway Wallet operations, versioned (e.g. gateway.v1.deposit). */
|
|
2794
|
+
readonly gateway: GatewayActionMap;
|
|
2795
|
+
/** Native token operations (ETH, SOL, MATIC, etc.). */
|
|
2796
|
+
readonly native: NativeActionMap;
|
|
2329
2797
|
/** General token operations requiring explicit token addresses. */
|
|
2330
2798
|
readonly token: TokenActionMap;
|
|
2331
2799
|
/** USDC-specific operations with automatic address resolution. */
|
|
2332
2800
|
readonly usdc: USDCActionMap;
|
|
2333
2801
|
/** USDT-specific operations with automatic address resolution. */
|
|
2334
2802
|
readonly usdt: USDTActionMap;
|
|
2335
|
-
/** Native token operations. */
|
|
2336
|
-
readonly native: NativeActionMap;
|
|
2337
2803
|
/** Swap operations for DEX aggregator integrations. */
|
|
2338
2804
|
readonly swap: SwapActionMap;
|
|
2339
2805
|
}
|
|
@@ -3150,6 +3616,11 @@ type InferAdapterCapabilities<T extends Partial<AdapterCapabilities>> = T & {
|
|
|
3150
3616
|
* Represents the domain separator fields as defined by the EIP-712 standard.
|
|
3151
3617
|
* Used to prevent signature replay across different domains (contracts, chains, etc).
|
|
3152
3618
|
*
|
|
3619
|
+
* `chainId` and `verifyingContract` are **required** to ensure cross-chain and
|
|
3620
|
+
* cross-contract replay protection for CCTP v2 permits and authorisations.
|
|
3621
|
+
* For Gateway burn-intent signing (which embeds replay-protection in the
|
|
3622
|
+
* message body), use {@link GatewayEIP712Domain} instead.
|
|
3623
|
+
*
|
|
3153
3624
|
* @see {@link https://eips.ethereum.org/EIPS/eip-712}
|
|
3154
3625
|
*
|
|
3155
3626
|
* @example
|
|
@@ -3167,9 +3638,9 @@ interface EIP712Domain {
|
|
|
3167
3638
|
name: string;
|
|
3168
3639
|
/** Current major version of the signing domain (e.g., "2") */
|
|
3169
3640
|
version: string;
|
|
3170
|
-
/** EVM chain ID where the contract is deployed */
|
|
3641
|
+
/** EVM chain ID where the contract is deployed — required for cross-chain replay protection. */
|
|
3171
3642
|
chainId: number | bigint;
|
|
3172
|
-
/** Address of the contract that will verify the signature */
|
|
3643
|
+
/** Address of the contract that will verify the signature — required to bind the signature to a specific contract. */
|
|
3173
3644
|
verifyingContract: `0x${string}`;
|
|
3174
3645
|
/** Optional salt for domain separation (as hex string) */
|
|
3175
3646
|
salt?: `0x${string}`;
|
|
@@ -3649,7 +4120,7 @@ type EIP2612NonceFetcher = (token: `0x${string}`, owner: `0x${string}`) => Promi
|
|
|
3649
4120
|
* automatically using the adapter's `fetchEIP2612Nonce` method, which queries
|
|
3650
4121
|
* the token contract's `nonces(owner)` function.
|
|
3651
4122
|
*
|
|
3652
|
-
* **Deadline Calculation**: If no deadline is provided, it defaults to
|
|
4123
|
+
* **Deadline Calculation**: If no deadline is provided, it defaults to 1 hour
|
|
3653
4124
|
* from the current time (computed using `computeDefaultDeadline`).
|
|
3654
4125
|
*
|
|
3655
4126
|
* @param meta - Domain metadata for the token contract
|