damm-sdk 1.4.16 → 1.4.17
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/dist/index.cjs +150 -1
- package/dist/index.cjs.map +5 -3
- package/dist/index.js +691 -421
- package/dist/index.js.map +7 -3
- package/dist/integrations/ccip/ccip.router.abi.d.ts +85 -0
- package/dist/integrations/ccip/ccip.router.abi.d.ts.map +1 -0
- package/dist/integrations/ccip/ccip.router.d.ts +72 -0
- package/dist/integrations/ccip/ccip.router.d.ts.map +1 -0
- package/dist/integrations/ccip/index.d.ts +3 -0
- package/dist/integrations/ccip/index.d.ts.map +1 -0
- package/dist/integrations/index.d.ts +1 -0
- package/dist/integrations/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/integrations/ccip/ccip.router.abi.ts +62 -0
- package/src/integrations/ccip/ccip.router.ts +172 -0
- package/src/integrations/ccip/index.ts +19 -0
- package/src/integrations/index.ts +1 -0
package/dist/index.cjs
CHANGED
|
@@ -44900,6 +44900,7 @@ __export(exports_src, {
|
|
|
44900
44900
|
initiateVaultClosingTrx: () => initiateVaultClosingTrx,
|
|
44901
44901
|
gnosisTrx: () => gnosisTrx,
|
|
44902
44902
|
getGnosisTrxSimulationResult: () => getGnosisTrxSimulationResult,
|
|
44903
|
+
getCCIPChainSelector: () => getCCIPChainSelector,
|
|
44903
44904
|
getAddressOrThrow: () => getAddressOrThrow,
|
|
44904
44905
|
getAddressNameOrThrow: () => getAddressNameOrThrow,
|
|
44905
44906
|
executeTrx: () => executeTrx,
|
|
@@ -44925,8 +44926,10 @@ __export(exports_src, {
|
|
|
44925
44926
|
closeVaultTrx: () => closeVaultTrx,
|
|
44926
44927
|
claimRedeemOriginArmTrx: () => claimRedeemOriginArmTrx,
|
|
44927
44928
|
claimFundingFeesTrx: () => claimFundingFeesTrx,
|
|
44929
|
+
ccipSendTrx: () => ccipSendTrx,
|
|
44928
44930
|
cancelOrderTrx: () => cancelOrderTrx,
|
|
44929
44931
|
calculateDeterministicVaultAddress: () => calculateDeterministicVaultAddress,
|
|
44932
|
+
buildCCIPMessage: () => buildCCIPMessage,
|
|
44930
44933
|
borrowMorphoBlueTrx: () => borrowMorphoBlueTrx,
|
|
44931
44934
|
borrowFromLendleTrx: () => borrowFromLendleTrx,
|
|
44932
44935
|
borrowFromAaveV3Trx: () => borrowFromAaveV3Trx,
|
|
@@ -45062,6 +45065,11 @@ __export(exports_src, {
|
|
|
45062
45065
|
CctpTokenMessengerV2Abi: () => token_messenger_v2_abi_default,
|
|
45063
45066
|
CctpMessageTransmitterV2Abi: () => message_transmitter_v2_abi_default,
|
|
45064
45067
|
CancelOrderCalldata: () => CancelOrderCalldata,
|
|
45068
|
+
CCIP_CHAIN_SELECTORS: () => CCIP_CHAIN_SELECTORS,
|
|
45069
|
+
CCIPSendCalldata: () => CCIPSendCalldata,
|
|
45070
|
+
CCIPRouterAbi: () => ccip_router_abi_default,
|
|
45071
|
+
CCIPGetFeeTrx: () => CCIPGetFeeTrx,
|
|
45072
|
+
CCIPGetFeeCalldata: () => CCIPGetFeeCalldata,
|
|
45065
45073
|
CALL_OP_CODE: () => CALL_OP_CODE,
|
|
45066
45074
|
BorrowMorphoBlueCalldata: () => BorrowMorphoBlueCalldata,
|
|
45067
45075
|
BorrowFromLendleCalldata: () => BorrowFromLendleCalldata,
|
|
@@ -93898,6 +93906,147 @@ var sendOFTTrx = ({
|
|
|
93898
93906
|
value: args.nativeFee
|
|
93899
93907
|
});
|
|
93900
93908
|
};
|
|
93909
|
+
// src/integrations/ccip/ccip.router.abi.ts
|
|
93910
|
+
var ccip_router_abi_default = [
|
|
93911
|
+
{
|
|
93912
|
+
inputs: [
|
|
93913
|
+
{ name: "destinationChainSelector", type: "uint64" },
|
|
93914
|
+
{
|
|
93915
|
+
name: "message",
|
|
93916
|
+
type: "tuple",
|
|
93917
|
+
components: [
|
|
93918
|
+
{ name: "receiver", type: "bytes" },
|
|
93919
|
+
{ name: "data", type: "bytes" },
|
|
93920
|
+
{
|
|
93921
|
+
name: "tokenAmounts",
|
|
93922
|
+
type: "tuple[]",
|
|
93923
|
+
components: [
|
|
93924
|
+
{ name: "token", type: "address" },
|
|
93925
|
+
{ name: "amount", type: "uint256" }
|
|
93926
|
+
]
|
|
93927
|
+
},
|
|
93928
|
+
{ name: "feeToken", type: "address" },
|
|
93929
|
+
{ name: "extraArgs", type: "bytes" }
|
|
93930
|
+
]
|
|
93931
|
+
}
|
|
93932
|
+
],
|
|
93933
|
+
name: "ccipSend",
|
|
93934
|
+
outputs: [{ name: "messageId", type: "bytes32" }],
|
|
93935
|
+
stateMutability: "payable",
|
|
93936
|
+
type: "function"
|
|
93937
|
+
},
|
|
93938
|
+
{
|
|
93939
|
+
inputs: [
|
|
93940
|
+
{ name: "destinationChainSelector", type: "uint64" },
|
|
93941
|
+
{
|
|
93942
|
+
name: "message",
|
|
93943
|
+
type: "tuple",
|
|
93944
|
+
components: [
|
|
93945
|
+
{ name: "receiver", type: "bytes" },
|
|
93946
|
+
{ name: "data", type: "bytes" },
|
|
93947
|
+
{
|
|
93948
|
+
name: "tokenAmounts",
|
|
93949
|
+
type: "tuple[]",
|
|
93950
|
+
components: [
|
|
93951
|
+
{ name: "token", type: "address" },
|
|
93952
|
+
{ name: "amount", type: "uint256" }
|
|
93953
|
+
]
|
|
93954
|
+
},
|
|
93955
|
+
{ name: "feeToken", type: "address" },
|
|
93956
|
+
{ name: "extraArgs", type: "bytes" }
|
|
93957
|
+
]
|
|
93958
|
+
}
|
|
93959
|
+
],
|
|
93960
|
+
name: "getFee",
|
|
93961
|
+
outputs: [{ name: "fee", type: "uint256" }],
|
|
93962
|
+
stateMutability: "view",
|
|
93963
|
+
type: "function"
|
|
93964
|
+
}
|
|
93965
|
+
];
|
|
93966
|
+
// src/integrations/ccip/ccip.router.ts
|
|
93967
|
+
var ccipRouterInterface = new exports_ethers.utils.Interface(ccip_router_abi_default);
|
|
93968
|
+
var CCIP_CHAIN_SELECTORS = Object.freeze({
|
|
93969
|
+
1: "5009297550715157269",
|
|
93970
|
+
42161: "4949039107694359620",
|
|
93971
|
+
8453: "15971525489660198786",
|
|
93972
|
+
10: "3734403246176062136",
|
|
93973
|
+
137: "4051577828743386545",
|
|
93974
|
+
56: "11344663589394136015",
|
|
93975
|
+
143: "8481857512324358265"
|
|
93976
|
+
});
|
|
93977
|
+
var getCCIPChainSelector = (chainId) => {
|
|
93978
|
+
const selector = CCIP_CHAIN_SELECTORS[chainId];
|
|
93979
|
+
if (!selector) {
|
|
93980
|
+
throw new Error(`CCIP: No chain selector for chainId ${chainId}`);
|
|
93981
|
+
}
|
|
93982
|
+
return selector;
|
|
93983
|
+
};
|
|
93984
|
+
var CCIPGetFeeCalldata = (args) => {
|
|
93985
|
+
return ccipRouterInterface.encodeFunctionData("getFee", [
|
|
93986
|
+
args.destinationChainSelector,
|
|
93987
|
+
{
|
|
93988
|
+
receiver: args.message.receiver,
|
|
93989
|
+
data: args.message.data,
|
|
93990
|
+
tokenAmounts: args.message.tokenAmounts.map((t) => ({
|
|
93991
|
+
token: t.token,
|
|
93992
|
+
amount: t.amount
|
|
93993
|
+
})),
|
|
93994
|
+
feeToken: args.message.feeToken,
|
|
93995
|
+
extraArgs: args.message.extraArgs
|
|
93996
|
+
}
|
|
93997
|
+
]);
|
|
93998
|
+
};
|
|
93999
|
+
var CCIPGetFeeTrx = ({
|
|
94000
|
+
routerAddress,
|
|
94001
|
+
args
|
|
94002
|
+
}) => {
|
|
94003
|
+
return createCall({
|
|
94004
|
+
operation: 0,
|
|
94005
|
+
to: routerAddress,
|
|
94006
|
+
data: CCIPGetFeeCalldata(args),
|
|
94007
|
+
value: 0n
|
|
94008
|
+
});
|
|
94009
|
+
};
|
|
94010
|
+
var CCIPSendCalldata = (args) => {
|
|
94011
|
+
return ccipRouterInterface.encodeFunctionData("ccipSend", [
|
|
94012
|
+
args.destinationChainSelector,
|
|
94013
|
+
{
|
|
94014
|
+
receiver: args.message.receiver,
|
|
94015
|
+
data: args.message.data,
|
|
94016
|
+
tokenAmounts: args.message.tokenAmounts.map((t) => ({
|
|
94017
|
+
token: t.token,
|
|
94018
|
+
amount: t.amount
|
|
94019
|
+
})),
|
|
94020
|
+
feeToken: args.message.feeToken,
|
|
94021
|
+
extraArgs: args.message.extraArgs
|
|
94022
|
+
}
|
|
94023
|
+
]);
|
|
94024
|
+
};
|
|
94025
|
+
var ccipSendTrx = ({
|
|
94026
|
+
routerAddress,
|
|
94027
|
+
args
|
|
94028
|
+
}) => {
|
|
94029
|
+
return createCall({
|
|
94030
|
+
operation: 0,
|
|
94031
|
+
to: routerAddress,
|
|
94032
|
+
data: CCIPSendCalldata(args),
|
|
94033
|
+
value: args.nativeFee
|
|
94034
|
+
});
|
|
94035
|
+
};
|
|
94036
|
+
var buildCCIPMessage = ({
|
|
94037
|
+
receiver,
|
|
94038
|
+
token,
|
|
94039
|
+
amount
|
|
94040
|
+
}) => {
|
|
94041
|
+
const receiverEncoded = "0x" + receiver.slice(2).padStart(64, "0");
|
|
94042
|
+
return Object.freeze({
|
|
94043
|
+
receiver: receiverEncoded,
|
|
94044
|
+
data: "0x",
|
|
94045
|
+
tokenAmounts: Object.freeze([Object.freeze({ token, amount })]),
|
|
94046
|
+
feeToken: "0x0000000000000000000000000000000000000000",
|
|
94047
|
+
extraArgs: "0x"
|
|
94048
|
+
});
|
|
94049
|
+
};
|
|
93901
94050
|
// src/integrations/cctp/token.messenger.v2.abi.ts
|
|
93902
94051
|
var token_messenger_v2_abi_default = [
|
|
93903
94052
|
{
|
|
@@ -95605,4 +95754,4 @@ var simulateOrThrow = async (env2) => {
|
|
|
95605
95754
|
};
|
|
95606
95755
|
};
|
|
95607
95756
|
|
|
95608
|
-
//# debugId=
|
|
95757
|
+
//# debugId=172EA3B42A715D0C64756E2164756E21
|