@ember-finance/sdk 2.10.3 → 2.11.0-ccip.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.
Files changed (42) hide show
  1. package/dist/src/abis/AtomicLiquidity.json +36 -46
  2. package/dist/src/abis/CcipRouter.json +58 -0
  3. package/dist/src/abis/index.d.ts +3 -1
  4. package/dist/src/abis/index.js +4 -1
  5. package/dist/src/api/v2/apis/vaults-api.d.ts +42 -0
  6. package/dist/src/api/v2/apis/vaults-api.js +87 -0
  7. package/dist/src/api/v2/models/chain.d.ts +6 -0
  8. package/dist/src/api/v2/models/coin-placement.d.ts +113 -0
  9. package/dist/src/api/v2/models/coin-placement.js +17 -0
  10. package/dist/src/api/v2/models/coin-placements-response.d.ts +25 -0
  11. package/dist/src/api/v2/models/coin-placements-response.js +14 -0
  12. package/dist/src/api/v2/models/evm-ccip-lane.d.ts +73 -0
  13. package/dist/src/api/v2/models/evm-ccip-lane.js +14 -0
  14. package/dist/src/api/v2/models/evm-ccip-rate-limits.d.ts +36 -0
  15. package/dist/src/api/v2/models/evm-ccip-rate-limits.js +14 -0
  16. package/dist/src/api/v2/models/evm-ccip-token-pool.d.ts +122 -0
  17. package/dist/src/api/v2/models/evm-ccip-token-pool.js +17 -0
  18. package/dist/src/api/v2/models/evm-contracts.d.ts +9 -0
  19. package/dist/src/api/v2/models/evm-oftadapter.d.ts +11 -0
  20. package/dist/src/api/v2/models/evm-oftadapter.js +4 -1
  21. package/dist/src/api/v2/models/evm-oftpeer.d.ts +12 -0
  22. package/dist/src/api/v2/models/index.d.ts +6 -0
  23. package/dist/src/api/v2/models/index.js +6 -0
  24. package/dist/src/api/v2/models/instant-withdraw-config.d.ts +21 -2
  25. package/dist/src/api/v2/models/poc-report-protocol-asset.d.ts +60 -0
  26. package/dist/src/api/v2/models/poc-report-protocol-asset.js +18 -0
  27. package/dist/src/api/v2/models/poc-report-protocol.d.ts +13 -0
  28. package/dist/src/api/v2/models/transparency-row.d.ts +1 -1
  29. package/dist/src/evm-vaults/interfaces/index.d.ts +39 -0
  30. package/dist/src/evm-vaults/on-chain-calls/tx-builder.d.ts +17 -11
  31. package/dist/src/evm-vaults/on-chain-calls/tx-builder.js +39 -12
  32. package/dist/src/evm-vaults/on-chain-calls/user.d.ts +35 -31
  33. package/dist/src/evm-vaults/on-chain-calls/user.js +69 -43
  34. package/dist/src/evm-vaults/on-chain-calls/vault-reader.d.ts +14 -1
  35. package/dist/src/evm-vaults/on-chain-calls/vault-reader.js +30 -0
  36. package/dist/src/evm-vaults/utils/ccip.d.ts +23 -0
  37. package/dist/src/evm-vaults/utils/ccip.js +32 -0
  38. package/dist/src/evm-vaults/utils/deployment-parser.d.ts +27 -1
  39. package/dist/src/evm-vaults/utils/deployment-parser.js +37 -0
  40. package/dist/src/evm-vaults/utils/index.d.ts +1 -0
  41. package/dist/src/evm-vaults/utils/index.js +1 -0
  42. package/package.json +2 -6
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Ember Protocol Vaults API
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 2.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { EvmCcipLane } from "./evm-ccip-lane.js";
13
+ /**
14
+ * The CCIP half of a vault\'s bridge, the counterpart to EvmOFTAdapter. A vault has one active transport; different vaults use different ones.
15
+ * @export
16
+ * @interface EvmCcipTokenPool
17
+ */
18
+ export interface EvmCcipTokenPool {
19
+ /**
20
+ * The CCIP token pool contract address
21
+ * @type {string}
22
+ * @memberof EvmCcipTokenPool
23
+ */
24
+ address?: string;
25
+ /**
26
+ * The contract name (e.g., EmberTokenPool)
27
+ * @type {string}
28
+ * @memberof EvmCcipTokenPool
29
+ */
30
+ contractName?: string;
31
+ /**
32
+ * Which bridge this entry describes. Read this rather than inferring the transport from which map the entry was found in.
33
+ * @type {string}
34
+ * @memberof EvmCcipTokenPool
35
+ */
36
+ bridgeTransport?: EvmCcipTokenPoolBridgeTransportEnum;
37
+ /**
38
+ * The pool\'s on-chain typeAndVersion (e.g., EmberBurnMintTokenPool 1.0.0)
39
+ * @type {string}
40
+ * @memberof EvmCcipTokenPool
41
+ */
42
+ typeAndVersion?: string;
43
+ /**
44
+ * The key of the associated vault
45
+ * @type {string}
46
+ * @memberof EvmCcipTokenPool
47
+ */
48
+ vaultKey?: string;
49
+ /**
50
+ * The address of the associated vault
51
+ * @type {string}
52
+ * @memberof EvmCcipTokenPool
53
+ */
54
+ vaultAddress?: string;
55
+ /**
56
+ * The receipt token symbol
57
+ * @type {string}
58
+ * @memberof EvmCcipTokenPool
59
+ */
60
+ receiptTokenSymbol?: string;
61
+ /**
62
+ * The receipt token decimals
63
+ * @type {number}
64
+ * @memberof EvmCcipTokenPool
65
+ */
66
+ decimals?: number;
67
+ /**
68
+ * The CCIP Router for this chain
69
+ * @type {string}
70
+ * @memberof EvmCcipTokenPool
71
+ */
72
+ router?: string;
73
+ /**
74
+ * The CCIP RMN proxy for this chain
75
+ * @type {string}
76
+ * @memberof EvmCcipTokenPool
77
+ */
78
+ rmnProxy?: string;
79
+ /**
80
+ * The CCIP token admin registry for this chain
81
+ * @type {string}
82
+ * @memberof EvmCcipTokenPool
83
+ */
84
+ tokenAdminRegistry?: string;
85
+ /**
86
+ * This chain\'s CCIP selector. A 64-bit value, carried as a string because it exceeds what a JSON number holds exactly.
87
+ * @type {string}
88
+ * @memberof EvmCcipTokenPool
89
+ */
90
+ chainSelector?: string;
91
+ /**
92
+ * The owner address
93
+ * @type {string}
94
+ * @memberof EvmCcipTokenPool
95
+ */
96
+ owner?: string;
97
+ /**
98
+ * The deployment timestamp
99
+ * @type {string}
100
+ * @memberof EvmCcipTokenPool
101
+ */
102
+ deployedAt?: string;
103
+ /**
104
+ * The block number at which the pool was deployed
105
+ * @type {number}
106
+ * @memberof EvmCcipTokenPool
107
+ */
108
+ deploymentBlockNumber?: number;
109
+ /**
110
+ * Map of configured destinations by remote CCIP chain selector
111
+ * @type {{ [key: string]: EvmCcipLane; }}
112
+ * @memberof EvmCcipTokenPool
113
+ */
114
+ lanes?: {
115
+ [key: string]: EvmCcipLane;
116
+ };
117
+ }
118
+ export declare const EvmCcipTokenPoolBridgeTransportEnum: {
119
+ readonly LayerZero: "LayerZero";
120
+ readonly Ccip: "CCIP";
121
+ };
122
+ export type EvmCcipTokenPoolBridgeTransportEnum = (typeof EvmCcipTokenPoolBridgeTransportEnum)[keyof typeof EvmCcipTokenPoolBridgeTransportEnum];
@@ -0,0 +1,17 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Ember Protocol Vaults API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: 2.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ export const EvmCcipTokenPoolBridgeTransportEnum = {
15
+ LayerZero: "LayerZero",
16
+ Ccip: "CCIP"
17
+ };
@@ -11,6 +11,7 @@
11
11
  */
12
12
  import type { EvmAtomicLiquidityLib } from "./evm-atomic-liquidity-lib.js";
13
13
  import type { EvmAtomicVault } from "./evm-atomic-vault.js";
14
+ import type { EvmCcipTokenPool } from "./evm-ccip-token-pool.js";
14
15
  import type { EvmDepositParkingLot } from "./evm-deposit-parking-lot.js";
15
16
  import type { EvmDepositToken } from "./evm-deposit-token.js";
16
17
  import type { EvmOFTAdapter } from "./evm-oftadapter.js";
@@ -80,6 +81,14 @@ export interface EvmContracts {
80
81
  oftAdapters?: {
81
82
  [key: string]: EvmOFTAdapter;
82
83
  };
84
+ /**
85
+ * Map of CCIP token pools by name
86
+ * @type {{ [key: string]: EvmCcipTokenPool; }}
87
+ * @memberof EvmContracts
88
+ */
89
+ ccipTokenPools?: {
90
+ [key: string]: EvmCcipTokenPool;
91
+ };
83
92
  /**
84
93
  *
85
94
  * @type {EvmVaultValidator}
@@ -82,6 +82,12 @@ export interface EvmOFTAdapter {
82
82
  * @memberof EvmOFTAdapter
83
83
  */
84
84
  deploymentBlockNumber?: number;
85
+ /**
86
+ * Which bridge this entry describes. Read this rather than inferring the transport from which map the entry was found in.
87
+ * @type {string}
88
+ * @memberof EvmOFTAdapter
89
+ */
90
+ bridgeTransport?: EvmOFTAdapterBridgeTransportEnum;
85
91
  /**
86
92
  * Map of peers by LayerZero endpoint ID
87
93
  * @type {{ [key: string]: EvmOFTPeer; }}
@@ -91,3 +97,8 @@ export interface EvmOFTAdapter {
91
97
  [key: string]: EvmOFTPeer;
92
98
  };
93
99
  }
100
+ export declare const EvmOFTAdapterBridgeTransportEnum: {
101
+ readonly LayerZero: "LayerZero";
102
+ readonly Ccip: "CCIP";
103
+ };
104
+ export type EvmOFTAdapterBridgeTransportEnum = (typeof EvmOFTAdapterBridgeTransportEnum)[keyof typeof EvmOFTAdapterBridgeTransportEnum];
@@ -11,4 +11,7 @@
11
11
  * https://openapi-generator.tech
12
12
  * Do not edit the class manually.
13
13
  */
14
- export {};
14
+ export const EvmOFTAdapterBridgeTransportEnum = {
15
+ LayerZero: "LayerZero",
16
+ Ccip: "CCIP"
17
+ };
@@ -15,6 +15,18 @@
15
15
  * @interface EvmOFTPeer
16
16
  */
17
17
  export interface EvmOFTPeer {
18
+ /**
19
+ * The remote chain\'s network name, e.g. atlantic. The map key is a LayerZero endpoint ID, which names nothing outside LayerZero, so read this instead.
20
+ * @type {string}
21
+ * @memberof EvmOFTPeer
22
+ */
23
+ remoteNetwork?: string;
24
+ /**
25
+ * The bridge contract at the far end, as a plain address. Same meaning as remoteAddress on a CCIP lane.
26
+ * @type {string}
27
+ * @memberof EvmOFTPeer
28
+ */
29
+ remoteAddress?: string;
18
30
  /**
19
31
  * The peer address in bytes32 format
20
32
  * @type {string}
@@ -15,6 +15,8 @@ export * from "./asset.js";
15
15
  export * from "./borrowed.js";
16
16
  export * from "./chain.js";
17
17
  export * from "./chain-vault-details.js";
18
+ export * from "./coin-placement.js";
19
+ export * from "./coin-placements-response.js";
18
20
  export * from "./coin-price.js";
19
21
  export * from "./defi-integration.js";
20
22
  export * from "./deposit-transaction.js";
@@ -22,6 +24,9 @@ export * from "./ember-position.js";
22
24
  export * from "./escrow-claim-transaction.js";
23
25
  export * from "./evm-atomic-liquidity-lib.js";
24
26
  export * from "./evm-atomic-vault.js";
27
+ export * from "./evm-ccip-lane.js";
28
+ export * from "./evm-ccip-rate-limits.js";
29
+ export * from "./evm-ccip-token-pool.js";
25
30
  export * from "./evm-contracts.js";
26
31
  export * from "./evm-deposit-parking-lot.js";
27
32
  export * from "./evm-deposit-token.js";
@@ -58,6 +63,7 @@ export * from "./poc-report-assets.js";
58
63
  export * from "./poc-report-exchange.js";
59
64
  export * from "./poc-report-exchanges.js";
60
65
  export * from "./poc-report-protocol.js";
66
+ export * from "./poc-report-protocol-asset.js";
61
67
  export * from "./poc-report-token.js";
62
68
  export * from "./poc-report-wallet.js";
63
69
  export * from "./poc-report-wallets.js";
@@ -15,6 +15,8 @@ export * from "./asset.js";
15
15
  export * from "./borrowed.js";
16
16
  export * from "./chain.js";
17
17
  export * from "./chain-vault-details.js";
18
+ export * from "./coin-placement.js";
19
+ export * from "./coin-placements-response.js";
18
20
  export * from "./coin-price.js";
19
21
  export * from "./defi-integration.js";
20
22
  export * from "./deposit-transaction.js";
@@ -22,6 +24,9 @@ export * from "./ember-position.js";
22
24
  export * from "./escrow-claim-transaction.js";
23
25
  export * from "./evm-atomic-liquidity-lib.js";
24
26
  export * from "./evm-atomic-vault.js";
27
+ export * from "./evm-ccip-lane.js";
28
+ export * from "./evm-ccip-rate-limits.js";
29
+ export * from "./evm-ccip-token-pool.js";
25
30
  export * from "./evm-contracts.js";
26
31
  export * from "./evm-deposit-parking-lot.js";
27
32
  export * from "./evm-deposit-token.js";
@@ -58,6 +63,7 @@ export * from "./poc-report-assets.js";
58
63
  export * from "./poc-report-exchange.js";
59
64
  export * from "./poc-report-exchanges.js";
60
65
  export * from "./poc-report-protocol.js";
66
+ export * from "./poc-report-protocol-asset.js";
61
67
  export * from "./poc-report-token.js";
62
68
  export * from "./poc-report-wallet.js";
63
69
  export * from "./poc-report-wallets.js";
@@ -70,6 +70,18 @@ export interface InstantWithdrawConfig {
70
70
  * @memberof InstantWithdrawConfig
71
71
  */
72
72
  maxUtilizationPercentageE18: string;
73
+ /**
74
+ * Per-swap minimum gross value, in COLLATERAL base units (not 1e18 — the collateral\'s own decimals). A swap whose gross falls below this is rejected outright, not merely repriced. \"0\" disables the floor. Null means we have not indexed a value yet (no EmberShareWhitelistUpdated consumed since the column was added) — NOT the same as \"0\", so do not render it as \"no minimum\".
75
+ * @type {string}
76
+ * @memberof InstantWithdrawConfig
77
+ */
78
+ minSwapGross?: string | null;
79
+ /**
80
+ * Absolute ceiling on this source share\'s post-swap held value, in COLLATERAL base units. Unlike maxUtilizationPercentageE18 this is not a fraction of the atomic vault\'s TVL, so it cannot be slipped by transiently inflating TVL. \"0\" disables the cap. Null means we have not indexed a value yet — NOT the same as \"0\", so do not render it as \"no cap\".
81
+ * @type {string}
82
+ * @memberof InstantWithdrawConfig
83
+ */
84
+ maxHeldValueAbsolute?: string | null;
73
85
  /**
74
86
  *
75
87
  * @type {Array<FeeMultiplierTier>}
@@ -89,13 +101,20 @@ export interface InstantWithdrawConfig {
89
101
  */
90
102
  currentUtilizationE18?: string | null;
91
103
  /**
92
- * Currently swappable capacity in USD (1e9 fixed-point) — min(epoch remaining capacity, ALV available liquidity). Null until the first refresh.
104
+ * DEPRECATED — use availableCapacityInUsdE9, which carries the same value under a name matching the rest of the API (`E9` elsewhere means \"same unit at 1e9 scale\", not \"converted to USD\"; compare totalDepositsE9 vs totalDepositsInUsdE9). Kept in sync; removed once consumers migrate.
93
105
  * @type {string}
94
106
  * @memberof InstantWithdrawConfig
107
+ * @deprecated
95
108
  */
96
109
  availableCapacityE9?: string | null;
97
110
  /**
98
- * Currently swappable capacity in collateral units — min(epoch remaining capacity, ALV available liquidity). Null until the first refresh.
111
+ * availableCapacity valued in USD, 1e9 fixed-point. Null until the first refresh.
112
+ * @type {string}
113
+ * @memberof InstantWithdrawConfig
114
+ */
115
+ availableCapacityInUsdE9?: string | null;
116
+ /**
117
+ * How much MORE of this source share the atomic vault can take in, in COLLATERAL base units — the minimum of every ceiling the swap path enforces: the 24h epoch capacity, the vault\'s backing (idle + strategy assets), the concentration headroom (maxUtilizationPercentageE18 x ALV total assets, less the value already held of this share), and the absolute headroom (maxHeldValueAbsolute less held). 0 when a ceiling is already reached. Null until the first refresh.
99
118
  * @type {string}
100
119
  * @memberof InstantWithdrawConfig
101
120
  */
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Ember Protocol Vaults API
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 2.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface PocReportProtocolAsset
16
+ */
17
+ export interface PocReportProtocolAsset {
18
+ /**
19
+ * The asset symbol (e.g., USDC)
20
+ * @type {string}
21
+ * @memberof PocReportProtocolAsset
22
+ */
23
+ symbol: string;
24
+ /**
25
+ * The asset contract address or coin type, when known
26
+ * @type {string}
27
+ * @memberof PocReportProtocolAsset
28
+ */
29
+ address?: string;
30
+ /**
31
+ * Which leg of the position this is. Borrow legs carry a negative value, so the legs sum to the position\'s net value.
32
+ * @type {string}
33
+ * @memberof PocReportProtocolAsset
34
+ */
35
+ side: PocReportProtocolAssetSideEnum;
36
+ /**
37
+ * The quantity held, in whole units of the asset
38
+ * @type {string}
39
+ * @memberof PocReportProtocolAsset
40
+ */
41
+ amount: string;
42
+ /**
43
+ * The value in e9 USD, negative for a borrow leg
44
+ * @type {string}
45
+ * @memberof PocReportProtocolAsset
46
+ */
47
+ valueUsdE9: string;
48
+ /**
49
+ * The asset icon url, when the data provider supplies one
50
+ * @type {string}
51
+ * @memberof PocReportProtocolAsset
52
+ */
53
+ logoUrl?: string;
54
+ }
55
+ export declare const PocReportProtocolAssetSideEnum: {
56
+ readonly Supply: "supply";
57
+ readonly Reward: "reward";
58
+ readonly Borrow: "borrow";
59
+ };
60
+ export type PocReportProtocolAssetSideEnum = (typeof PocReportProtocolAssetSideEnum)[keyof typeof PocReportProtocolAssetSideEnum];
@@ -0,0 +1,18 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Ember Protocol Vaults API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: 2.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ export const PocReportProtocolAssetSideEnum = {
15
+ Supply: "supply",
16
+ Reward: "reward",
17
+ Borrow: "borrow"
18
+ };
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { PocReportProtocolAsset } from "./poc-report-protocol-asset.js";
12
13
  /**
13
14
  *
14
15
  * @export
@@ -63,4 +64,16 @@ export interface PocReportProtocol {
63
64
  * @memberof PocReportProtocol
64
65
  */
65
66
  chainLogoUrl?: string;
67
+ /**
68
+ * The data provider\'s own identifier for the protocol (e.g. morphoblue). Stable across renames, unlike name.
69
+ * @type {string}
70
+ * @memberof PocReportProtocol
71
+ */
72
+ protocolId?: string;
73
+ /**
74
+ * What the position is actually held in. Absent when the provider reports a position as a single value with no breakdown.
75
+ * @type {Array<PocReportProtocolAsset>}
76
+ * @memberof PocReportProtocol
77
+ */
78
+ assets?: Array<PocReportProtocolAsset>;
66
79
  }
@@ -76,7 +76,7 @@ export interface TransparencyRow {
76
76
  */
77
77
  protocol?: string;
78
78
  /**
79
- * The asset symbol/name. Absent for protocol positions, which the upstream providers report as a single value without an asset breakdown.
79
+ * The asset symbol/name. A protocol position is emitted as one row per asset it is held in, so this is set whenever the provider breaks the position down; it stays absent only when it does not.
80
80
  * @type {string}
81
81
  * @memberof TransparencyRow
82
82
  */
@@ -237,6 +237,45 @@ export interface ICoverVaultCallOptions extends IUserCallOptions {
237
237
  /**
238
238
  * Optional parameters for high-level OFT bridge send calls.
239
239
  */
240
+ /**
241
+ * Parameters for a CCIP bridge send.
242
+ *
243
+ * Deliberately shaped like IOFTSendParam so the two transports read the same
244
+ * way, but CCIP names a destination by chain selector rather than endpoint id,
245
+ * and takes the receiver as a plain address — the SDK encodes it.
246
+ */
247
+ export interface ICcipSendParam {
248
+ /** CCIP chain selector of the destination. A 64-bit value, so a string. */
249
+ destinationChainSelector: string;
250
+ /** Recipient address on the destination chain */
251
+ receiver: string;
252
+ /** Amount to send in local token decimals */
253
+ amount: bigint;
254
+ /** Fee token; omit to pay in the chain's native currency */
255
+ feeToken?: string;
256
+ /** Destination execution gas. 0 for a plain token transfer. */
257
+ destinationGasLimit?: bigint;
258
+ }
259
+ /**
260
+ * A CCIP fee quote.
261
+ *
262
+ * CCIP charges one fee, unlike LayerZero's native/LZ token split, and does not
263
+ * quote the received amount separately: a burn-and-mint pool mints exactly what
264
+ * was burned, so the amount received is the amount sent.
265
+ */
266
+ export interface ICcipFeeQuote {
267
+ /** Fee required to send, in feeToken units (wei when paying natively) */
268
+ fee: bigint;
269
+ /** Token the fee is charged in; the zero address means native currency */
270
+ feeToken: string;
271
+ }
272
+ /** Overrides for a CCIP bridge send. */
273
+ export interface ICcipBridgeSendOptions extends IEvmCallOptions {
274
+ /** Fee token; omit to pay in the chain's native currency */
275
+ feeToken?: string;
276
+ /** Destination execution gas. 0 for a plain token transfer. */
277
+ destinationGasLimit?: bigint;
278
+ }
240
279
  export interface IBridgeSendOptions extends IEvmCallOptions {
241
280
  /** Minimum amount to receive on destination; defaults to amount */
242
281
  minAmount?: bigint;
@@ -1,5 +1,5 @@
1
1
  import { EVMDeploymentParser } from "../utils/index.js";
2
- import { EvmProtocolInfo, VaultPauseOperation, ITransactionCall, IPermitSignature, IOFTSendParam, IOFTMessagingFee } from "../interfaces/index.js";
2
+ import { EvmProtocolInfo, VaultPauseOperation, ITransactionCall, IPermitSignature, IOFTSendParam, IOFTMessagingFee, ICcipSendParam } from "../interfaces/index.js";
3
3
  import { NumStr } from "../../common/types.js";
4
4
  /**
5
5
  * EVM Transaction Builder for Ember Protocol (ERC-4626 Compatible)
@@ -522,6 +522,20 @@ export declare class EVMTxBuilder {
522
522
  * @returns Transaction call object
523
523
  */
524
524
  bridgeSend(adapterAddress: string, sendParam: IOFTSendParam, fee: IOFTMessagingFee, refundAddress: string): ITransactionCall;
525
+ /**
526
+ * Builds the CCIP send call.
527
+ *
528
+ * The counterpart to bridgeSend, but the call goes to Chainlink's Router
529
+ * rather than to our own pool: the Router pulls the tokens, charges the fee
530
+ * and hands off to the pool. That is also why the approval for a CCIP bridge
531
+ * goes to the Router and not to the pool.
532
+ *
533
+ * @param routerAddress The CCIP Router on the source chain
534
+ * @param sendParam Destination, receiver and amount
535
+ * @param tokenAddress The receipt token being bridged
536
+ * @param fee Fee from getCcipFeeQuote, sent as value when paying natively
537
+ */
538
+ ccipSend(routerAddress: string, sendParam: ICcipSendParam, tokenAddress: string, fee: bigint): ITransactionCall;
525
539
  private atomicCall;
526
540
  /** Claim the caller's own escrowed (deferred) holdback collateral. */
527
541
  atomicClaimHoldback(vaultAddress: string): ITransactionCall;
@@ -548,16 +562,8 @@ export declare class EVMTxBuilder {
548
562
  private atomicConfigCall;
549
563
  /** Instant (capped, fee'd) withdraw of `shares` to `receiver`; auto-pulls from strategy. */
550
564
  atomicInstantWithdraw(vaultAddress: string, shares: NumStr, receiver: string): ITransactionCall;
551
- /**
552
- * Swap `shareAmount` of a whitelisted source EmberShare into this vault's collateral.
553
- *
554
- * `minNetOut` is the audit-fix (A-9) slippage floor: reverts with
555
- * `SlippageToleranceExceeded` if the computed net payout falls below it.
556
- * Pass `0` to disable the guard; otherwise call
557
- * {@link EVMReaderCalls.previewSwapInstantWithdraw} beforehand and derive
558
- * `minNetOut` from `quote.netAmount` minus your tolerance.
559
- */
560
- atomicSwapEmberShares(vaultAddress: string, share: string, shareAmount: NumStr, receiver: string, minNetOut: NumStr): ITransactionCall;
565
+ /** Swap `shareAmount` of a whitelisted source EmberShare into this vault's collateral. */
566
+ atomicSwapEmberShares(vaultAddress: string, share: string, shareAmount: NumStr, receiver: string): ITransactionCall;
561
567
  /** Supply `assets` of idle collateral into the external ERC-4626 strategy. */
562
568
  atomicSupplyToStrategy(vaultAddress: string, assets: NumStr): ITransactionCall;
563
569
  /** Withdraw `assets` of collateral back from the strategy into the vault. */
@@ -4,6 +4,8 @@ import EmberETHVaultABI from "../../abis/EmberETHVault.json" with { type: "json"
4
4
  import EmberProtocolConfigABI from "../../abis/EmberProtocolConfig.json" with { type: "json" };
5
5
  import ERC20TokenABI from "../../abis/ERC20Token.json" with { type: "json" };
6
6
  import EmberVaultOFTAdapterABI from "../../abis/EmberVaultMintBurnOFTAdapter.json" with { type: "json" };
7
+ import CcipRouterABI from "../../abis/CcipRouter.json" with { type: "json" };
8
+ import { ZERO_ADDRESS, encodeCcipReceiver, encodeCcipExtraArgs } from "../utils/ccip.js";
7
9
  import AtomicLiquidityABI from "../../abis/AtomicLiquidity.json" with { type: "json" };
8
10
  import EmberDepositParkingLotABI from "../../abis/EmberDepositParkingLot.json" with { type: "json" };
9
11
  import OpenCoverVaultABI from "../../abis/OpenCoverVault.json" with { type: "json" };
@@ -1108,6 +1110,40 @@ export class EVMTxBuilder {
1108
1110
  chainId: this.getChainId()
1109
1111
  };
1110
1112
  }
1113
+ /**
1114
+ * Builds the CCIP send call.
1115
+ *
1116
+ * The counterpart to bridgeSend, but the call goes to Chainlink's Router
1117
+ * rather than to our own pool: the Router pulls the tokens, charges the fee
1118
+ * and hands off to the pool. That is also why the approval for a CCIP bridge
1119
+ * goes to the Router and not to the pool.
1120
+ *
1121
+ * @param routerAddress The CCIP Router on the source chain
1122
+ * @param sendParam Destination, receiver and amount
1123
+ * @param tokenAddress The receipt token being bridged
1124
+ * @param fee Fee from getCcipFeeQuote, sent as value when paying natively
1125
+ */
1126
+ ccipSend(routerAddress, sendParam, tokenAddress, fee) {
1127
+ const feeToken = sendParam.feeToken ?? ZERO_ADDRESS;
1128
+ return {
1129
+ to: routerAddress,
1130
+ functionName: "ccipSend",
1131
+ args: [
1132
+ sendParam.destinationChainSelector,
1133
+ {
1134
+ receiver: encodeCcipReceiver(sendParam.receiver),
1135
+ data: "0x",
1136
+ tokenAmounts: [{ token: tokenAddress, amount: sendParam.amount }],
1137
+ feeToken,
1138
+ extraArgs: encodeCcipExtraArgs(sendParam.destinationGasLimit)
1139
+ }
1140
+ ],
1141
+ abi: CcipRouterABI.abi,
1142
+ // Paying in a token means the Router pulls it instead, so no value.
1143
+ value: feeToken === ZERO_ADDRESS ? fee : 0n,
1144
+ chainId: this.getChainId()
1145
+ };
1146
+ }
1111
1147
  // ============================================
1112
1148
  // Atomic Liquidity Vault methods (BFE-817/818)
1113
1149
  //
@@ -1170,21 +1206,12 @@ export class EVMTxBuilder {
1170
1206
  atomicInstantWithdraw(vaultAddress, shares, receiver) {
1171
1207
  return this.atomicCall(vaultAddress, "instantWithdraw", [shares, receiver]);
1172
1208
  }
1173
- /**
1174
- * Swap `shareAmount` of a whitelisted source EmberShare into this vault's collateral.
1175
- *
1176
- * `minNetOut` is the audit-fix (A-9) slippage floor: reverts with
1177
- * `SlippageToleranceExceeded` if the computed net payout falls below it.
1178
- * Pass `0` to disable the guard; otherwise call
1179
- * {@link EVMReaderCalls.previewSwapInstantWithdraw} beforehand and derive
1180
- * `minNetOut` from `quote.netAmount` minus your tolerance.
1181
- */
1182
- atomicSwapEmberShares(vaultAddress, share, shareAmount, receiver, minNetOut) {
1209
+ /** Swap `shareAmount` of a whitelisted source EmberShare into this vault's collateral. */
1210
+ atomicSwapEmberShares(vaultAddress, share, shareAmount, receiver) {
1183
1211
  return this.atomicCall(vaultAddress, "swapEmberShares", [
1184
1212
  share,
1185
1213
  shareAmount,
1186
- receiver,
1187
- minNetOut
1214
+ receiver
1188
1215
  ]);
1189
1216
  }
1190
1217
  /** Supply `assets` of idle collateral into the external ERC-4626 strategy. */