@circle-fin/adapter-ethers-v6 1.0.1 → 1.1.1
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 +105 -0
- package/README.md +41 -29
- package/{index.cjs.js → index.cjs} +739 -62
- package/index.cjs.map +1 -0
- package/index.d.ts +34 -21
- package/index.mjs +738 -61
- package/package.json +5 -3
- package/index.cjs.js.map +0 -1
package/index.cjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/index.d.ts
CHANGED
|
@@ -596,10 +596,11 @@ interface EvmPreparedChainRequest {
|
|
|
596
596
|
* Estimate the gas cost for the contract execution.
|
|
597
597
|
*
|
|
598
598
|
* @param overrides - Optional parameters to override the default estimation behavior
|
|
599
|
+
* @param fallback - Optional fallback gas information to use if the estimation fails
|
|
599
600
|
* @returns A promise that resolves to the estimated gas information
|
|
600
601
|
* @throws If the estimation fails
|
|
601
602
|
*/
|
|
602
|
-
estimate(overrides?: EvmEstimateOverrides): Promise<EstimatedGas>;
|
|
603
|
+
estimate(overrides?: EvmEstimateOverrides, fallback?: EstimatedGas): Promise<EstimatedGas>;
|
|
603
604
|
/**
|
|
604
605
|
* Execute the prepared contract call.
|
|
605
606
|
*
|
|
@@ -677,7 +678,7 @@ interface SolanaPreparedChainRequest {
|
|
|
677
678
|
/** The type of the chain request. */
|
|
678
679
|
type: 'solana';
|
|
679
680
|
/** Estimate the compute units and fee for the transaction. */
|
|
680
|
-
estimate(overrides?: SolanaEstimateOverrides): Promise<EstimatedGas>;
|
|
681
|
+
estimate(overrides?: SolanaEstimateOverrides, fallback?: EstimatedGas): Promise<EstimatedGas>;
|
|
681
682
|
/** Execute the prepared transaction. */
|
|
682
683
|
execute(overrides?: SolanaExecuteOverrides): Promise<string>;
|
|
683
684
|
}
|
|
@@ -709,7 +710,7 @@ interface NoopPreparedChainRequest {
|
|
|
709
710
|
* Placeholder for the estimate method.
|
|
710
711
|
* @returns The estimated gas cost.
|
|
711
712
|
*/
|
|
712
|
-
estimate: () => Promise<EstimatedGas>;
|
|
713
|
+
estimate: (overrides?: EvmEstimateOverrides | SolanaEstimateOverrides, fallback?: EstimatedGas) => Promise<EstimatedGas>;
|
|
713
714
|
/**
|
|
714
715
|
* Placeholder for the execute method.
|
|
715
716
|
* @returns The transaction hash.
|
|
@@ -1178,6 +1179,14 @@ interface CCTPv2ActionMap {
|
|
|
1178
1179
|
* the adapter's default address.
|
|
1179
1180
|
*/
|
|
1180
1181
|
readonly destinationAddress?: string;
|
|
1182
|
+
/**
|
|
1183
|
+
* The mint recipient address from the decoded CCTP message.
|
|
1184
|
+
*
|
|
1185
|
+
* This is the actual address encoded in the burn message where tokens will be minted.
|
|
1186
|
+
* For Solana, this is already the Associated Token Account (ATA) address, not the owner.
|
|
1187
|
+
* For EVM chains, this is the recipient's wallet address.
|
|
1188
|
+
*/
|
|
1189
|
+
readonly mintRecipient?: string;
|
|
1181
1190
|
};
|
|
1182
1191
|
/**
|
|
1183
1192
|
* Initiate a cross-chain USDC transfer using a custom bridge contract with preapproval funnel.
|
|
@@ -1967,10 +1976,23 @@ interface AdapterCapabilities {
|
|
|
1967
1976
|
*/
|
|
1968
1977
|
declare abstract class Adapter<TAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities> {
|
|
1969
1978
|
/**
|
|
1970
|
-
* The type of the chain.
|
|
1971
|
-
*
|
|
1979
|
+
* The type of the chain for this adapter.
|
|
1980
|
+
*
|
|
1981
|
+
* - For concrete adapters, this should be a real chain type (e.g., `'evm'`, `'solana'`, etc.) from the ChainType union.
|
|
1982
|
+
* - For hybrid adapters (adapters that route to concrete adapters supporting multiple ecosystems),
|
|
1983
|
+
* set this property to the string literal `'hybrid'`.
|
|
1984
|
+
*
|
|
1985
|
+
* Note: `'hybrid'` is not a legal ChainType and should only be used as a marker for multi-ecosystem adapters.
|
|
1986
|
+
* Hybrid adapters do not interact directly with any chain, but instead route requests to a concrete underlying adapter.
|
|
1987
|
+
*
|
|
1988
|
+
* @example
|
|
1989
|
+
* // For an EVM-only adapter:
|
|
1990
|
+
* chainType = 'evm'
|
|
1991
|
+
*
|
|
1992
|
+
* // For a hybrid adapter:
|
|
1993
|
+
* chainType = 'hybrid'
|
|
1972
1994
|
*/
|
|
1973
|
-
abstract chainType: ChainType;
|
|
1995
|
+
abstract chainType: ChainType | 'hybrid';
|
|
1974
1996
|
/**
|
|
1975
1997
|
* Capabilities of this adapter, defining address control model and supported chains.
|
|
1976
1998
|
*
|
|
@@ -2052,7 +2074,7 @@ declare abstract class Adapter<TAdapterCapabilities extends AdapterCapabilities
|
|
|
2052
2074
|
* })
|
|
2053
2075
|
* ```
|
|
2054
2076
|
*/
|
|
2055
|
-
prepareAction<TActionKey extends ActionKeys>(action: TActionKey, params: ActionPayload<TActionKey>, ctx
|
|
2077
|
+
prepareAction<TActionKey extends ActionKeys>(action: TActionKey, params: ActionPayload<TActionKey>, ctx: OperationContext<TAdapterCapabilities>): Promise<PreparedChainRequest>;
|
|
2056
2078
|
/**
|
|
2057
2079
|
* Prepares a transaction for future gas estimation and execution.
|
|
2058
2080
|
*
|
|
@@ -2106,10 +2128,10 @@ declare abstract class Adapter<TAdapterCapabilities extends AdapterCapabilities
|
|
|
2106
2128
|
* This address is used as the default sender for transactions
|
|
2107
2129
|
* and interactions initiated by this adapter.
|
|
2108
2130
|
*
|
|
2109
|
-
* @param chain -
|
|
2131
|
+
* @param chain - The chain to use for address resolution.
|
|
2110
2132
|
* @returns A promise that resolves to the blockchain address as a string.
|
|
2111
2133
|
*/
|
|
2112
|
-
abstract getAddress(chain
|
|
2134
|
+
abstract getAddress(chain: ChainDefinition): Promise<string>;
|
|
2113
2135
|
/**
|
|
2114
2136
|
* Switches the adapter to operate on the specified chain.
|
|
2115
2137
|
*
|
|
@@ -2180,7 +2202,7 @@ declare abstract class Adapter<TAdapterCapabilities extends AdapterCapabilities
|
|
|
2180
2202
|
* Validate that the target chain is supported by this adapter.
|
|
2181
2203
|
*
|
|
2182
2204
|
* @param targetChain - The chain to validate.
|
|
2183
|
-
* @throws
|
|
2205
|
+
* @throws KitError with INVALID_CHAIN code if the chain is not supported by this adapter.
|
|
2184
2206
|
*/
|
|
2185
2207
|
validateChainSupport(targetChain: ChainDefinition): void;
|
|
2186
2208
|
/**
|
|
@@ -3043,7 +3065,7 @@ declare class EthersAdapter<TAdapterCapabilities extends AdapterCapabilities = A
|
|
|
3043
3065
|
* adapter interface, it is effectively required and enforced at runtime. This ensures
|
|
3044
3066
|
* the adapter is connected to the correct chain before querying the signer.
|
|
3045
3067
|
*
|
|
3046
|
-
* @param chain - The chain to use for address resolution
|
|
3068
|
+
* @param chain - The chain to use for address resolution.
|
|
3047
3069
|
* @returns A promise that resolves to the signer's address
|
|
3048
3070
|
* @throws Error when no chain is provided
|
|
3049
3071
|
*
|
|
@@ -3055,17 +3077,8 @@ declare class EthersAdapter<TAdapterCapabilities extends AdapterCapabilities = A
|
|
|
3055
3077
|
* const address = await adapter.getAddress(Ethereum)
|
|
3056
3078
|
* console.log('Wallet address:', address)
|
|
3057
3079
|
* ```
|
|
3058
|
-
*
|
|
3059
|
-
* @example
|
|
3060
|
-
* ```typescript
|
|
3061
|
-
* // In practice, address resolution happens automatically
|
|
3062
|
-
* const prepared = await adapter.prepare(params, {
|
|
3063
|
-
* chain: 'Ethereum'
|
|
3064
|
-
* // Address automatically resolved via getAddress() internally
|
|
3065
|
-
* })
|
|
3066
|
-
* ```
|
|
3067
3080
|
*/
|
|
3068
|
-
getAddress(chain
|
|
3081
|
+
getAddress(chain: EVMChainDefinition): Promise<string>;
|
|
3069
3082
|
/**
|
|
3070
3083
|
* Waits for a transaction to be mined and confirmed on the blockchain.
|
|
3071
3084
|
*
|