diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d9ac830d..e40c7b6dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,14 @@ which it is deprecated. - Fill or Kill parameters are now mandatory when opening a deposit channel through the default broker endpoint. If you are using your own broker, the parameters are still optional for now. +- `SwapSDK.prototype.getStatus`: deprecated `depositTransactionHash` was removed. + Use `depositTransactionRef` instead. +- `SwapSDK.prototype.getStatus`: deprecated `ccmMetadata` was removed. + Use `ccmParams` instead. +- `SwapSDK.prototype.requestDepositAddress`: deprecated `ccmMetadata` was removed. + Use `ccmParams` instead. +- `SwapSDK.prototype.executeSwap`: deprecated `ccmMetadata` was removed. + Use `ccmParams` instead. ## 1.6.6 diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 955a8f180..e014a7690 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@chainflip/sdk", - "version": "1.6.7-rc.5", + "version": "1.7.0-rc.0", "description": "", "exports": { "./swap": { diff --git a/packages/sdk/src/swap/__tests__/sdk.test.ts b/packages/sdk/src/swap/__tests__/sdk.test.ts index d02ae573c..b53726473 100644 --- a/packages/sdk/src/swap/__tests__/sdk.test.ts +++ b/packages/sdk/src/swap/__tests__/sdk.test.ts @@ -396,7 +396,6 @@ describe(SwapSDK, () => { srcChain: 'Bitcoin', maxBoostFeeBps: 0, channelOpeningFee: 0n, - ccmParams: undefined, affiliateBrokers: [], fillOrKillParams: { retryDurationBlocks: 500, @@ -470,7 +469,6 @@ describe(SwapSDK, () => { srcChain: 'Bitcoin', maxBoostFeeBps: 0, channelOpeningFee: 0n, - ccmParams: undefined, affiliateBrokers: [], dcaParams: { numberOfChunks: 100, @@ -548,7 +546,6 @@ describe(SwapSDK, () => { estimatedDepositChannelExpiryTime: undefined, maxBoostFeeBps: 0, channelOpeningFee: 0n, - ccmParams: undefined, affiliateBrokers: [], }); }); @@ -618,7 +615,6 @@ describe(SwapSDK, () => { estimatedDepositChannelExpiryTime: undefined, maxBoostFeeBps: 0, channelOpeningFee: 0n, - ccmParams: undefined, affiliateBrokers: [], }); }); @@ -690,7 +686,6 @@ describe(SwapSDK, () => { estimatedDepositChannelExpiryTime: undefined, maxBoostFeeBps: 0, channelOpeningFee: 0n, - ccmParams: undefined, affiliateBrokers: [ { account: 'cFHyJEHEQ1YkT9xuFnxnPWVkihpYEGjBg4WbF6vCPtSPQoE8n', commissionBps: 10 }, ], @@ -770,7 +765,6 @@ describe(SwapSDK, () => { estimatedDepositChannelExpiryTime: undefined, maxBoostFeeBps: 0, channelOpeningFee: 0n, - ccmParams: undefined, affiliateBrokers: [], fillOrKillParams: { retryDurationBlocks: 500, @@ -865,7 +859,6 @@ describe(SwapSDK, () => { }, maxBoostFeeBps: 0, channelOpeningFee: 0n, - ccmParams: undefined, affiliateBrokers: [], dcaParams: { numberOfChunks: 100, @@ -940,7 +933,6 @@ describe(SwapSDK, () => { estimatedDepositChannelExpiryTime: undefined, maxBoostFeeBps: MAX_BOOST_FEE_BPS, channelOpeningFee: 0n, - ccmParams: undefined, affiliateBrokers: [], }); }); @@ -998,6 +990,7 @@ describe(SwapSDK, () => { depositChannelId: 'channel id', depositAddress: 'deposit address', brokerCommissionBps: 0, + ccmParams: undefined, depositChannelExpiryBlock: 123n, estimatedDepositChannelExpiryTime: 1698334470000, amount: '1000000000000000000', @@ -1009,7 +1002,6 @@ describe(SwapSDK, () => { srcChain: 'Bitcoin', maxBoostFeeBps: 0, channelOpeningFee: 0n, - ccmParams: undefined, dcaParams: undefined, affiliateBrokers: [], fillOrKillParams: { @@ -1072,6 +1064,7 @@ describe(SwapSDK, () => { depositChannelId: 'channel id', depositAddress: 'deposit address', brokerCommissionBps: 0, + ccmParams: undefined, depositChannelExpiryBlock: 123n, estimatedDepositChannelExpiryTime: 1698334470000, amount: '1000000000000000000', @@ -1083,7 +1076,6 @@ describe(SwapSDK, () => { srcChain: 'Bitcoin', maxBoostFeeBps: 0, channelOpeningFee: 0n, - ccmParams: undefined, dcaParams: undefined, affiliateBrokers: [], fillOrKillParams: { @@ -1152,6 +1144,7 @@ describe(SwapSDK, () => { depositChannelId: 'channel id', depositAddress: 'deposit address', brokerCommissionBps: 0, + ccmParams: undefined, depositChannelExpiryBlock: 123n, estimatedDepositChannelExpiryTime: 1698334470000, amount: '1000000000000000000', @@ -1163,7 +1156,6 @@ describe(SwapSDK, () => { srcChain: 'Bitcoin', maxBoostFeeBps: 0, channelOpeningFee: 0n, - ccmParams: undefined, affiliateBrokers: [], dcaParams: { numberOfChunks: 100, @@ -1237,6 +1229,7 @@ describe(SwapSDK, () => { srcAddress: 'mrV3ee4J3jipspCNPofzB2UbaVu7qgf9Ex', destAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9b', brokerCommissionBps: 15, + ccmParams: undefined, amount: '1000000000000000000', depositChannelId: '123-Bitcoin-15', depositAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9a', @@ -1244,7 +1237,6 @@ describe(SwapSDK, () => { estimatedDepositChannelExpiryTime: undefined, maxBoostFeeBps: 0, channelOpeningFee: 0n, - ccmParams: undefined, affiliateBrokers: [], dcaParams: undefined, fillOrKillParams: undefined, @@ -1311,6 +1303,7 @@ describe(SwapSDK, () => { srcAddress: undefined, destAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9b', brokerCommissionBps: 15, + ccmParams: undefined, amount: '1000000000000000000', depositChannelId: '123-Bitcoin-15', depositAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9a', @@ -1318,7 +1311,6 @@ describe(SwapSDK, () => { estimatedDepositChannelExpiryTime: undefined, maxBoostFeeBps: 0, channelOpeningFee: 0n, - ccmParams: undefined, affiliateBrokers: [], dcaParams: undefined, fillOrKillParams: undefined, @@ -1387,6 +1379,7 @@ describe(SwapSDK, () => { srcAddress: undefined, destAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9b', brokerCommissionBps: 15, + ccmParams: undefined, amount: '1000000000000000000', depositChannelId: '123-Bitcoin-15', depositAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9a', @@ -1394,7 +1387,6 @@ describe(SwapSDK, () => { estimatedDepositChannelExpiryTime: undefined, maxBoostFeeBps: 0, channelOpeningFee: 0n, - ccmParams: undefined, affiliateBrokers: [ { account: 'cFHyJEHEQ1YkT9xuFnxnPWVkihpYEGjBg4WbF6vCPtSPQoE8n', commissionBps: 10 }, ], @@ -1471,6 +1463,7 @@ describe(SwapSDK, () => { srcAddress: undefined, destAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9b', brokerCommissionBps: 15, + ccmParams: undefined, amount: '1000000000000000000', depositChannelId: '123-Bitcoin-15', depositAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9a', @@ -1478,7 +1471,6 @@ describe(SwapSDK, () => { estimatedDepositChannelExpiryTime: undefined, maxBoostFeeBps: 0, channelOpeningFee: 0n, - ccmParams: undefined, affiliateBrokers: [], fillOrKillParams: { retryDurationBlocks: 500, @@ -1564,6 +1556,7 @@ describe(SwapSDK, () => { srcAddress: undefined, destAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9b', brokerCommissionBps: 15, + ccmParams: undefined, amount: '1000000000000000000', depositChannelId: '123-Bitcoin-15', depositAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9a', @@ -1576,7 +1569,6 @@ describe(SwapSDK, () => { }, maxBoostFeeBps: 0, channelOpeningFee: 0n, - ccmParams: undefined, affiliateBrokers: [], dcaParams: { numberOfChunks: 100, @@ -1646,6 +1638,7 @@ describe(SwapSDK, () => { srcAddress: undefined, destAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9b', brokerCommissionBps: 15, + ccmParams: undefined, amount: '1000000000000000000', depositChannelId: '123-Bitcoin-15', depositAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9a', @@ -1653,7 +1646,6 @@ describe(SwapSDK, () => { estimatedDepositChannelExpiryTime: undefined, maxBoostFeeBps: MAX_BOOST_FEE_BPS, channelOpeningFee: 0n, - ccmParams: undefined, affiliateBrokers: [], dcaParams: undefined, fillOrKillParams: undefined, diff --git a/packages/sdk/src/swap/sdk.ts b/packages/sdk/src/swap/sdk.ts index ecbb3f4e2..bc1c6ad84 100644 --- a/packages/sdk/src/swap/sdk.ts +++ b/packages/sdk/src/swap/sdk.ts @@ -234,9 +234,6 @@ export class SwapSDK { } : undefined; - // DEPRECATED(1.5): use ccmParams instead of ccmMetadata - depositAddressRequest.ccmParams ??= depositAddressRequest.ccmMetadata; // eslint-disable-line no-param-reassign - let response; if (this.options.broker !== undefined) { @@ -315,9 +312,6 @@ export class SwapSDK { await this.validateSwapAmount({ chain: srcChain, asset: srcAsset }, BigInt(amount)); - // DEPRECATED(1.5): use ccmParams instead of ccmMetadata - params.ccmParams ??= params.ccmMetadata; // eslint-disable-line no-param-reassign - const tx = await executeSwap( params, { diff --git a/packages/sdk/src/swap/types.ts b/packages/sdk/src/swap/types.ts index 44c99e030..80c5dd162 100644 --- a/packages/sdk/src/swap/types.ts +++ b/packages/sdk/src/swap/types.ts @@ -67,9 +67,6 @@ export interface DepositAddressRequest extends QuoteRequest { srcAddress?: string; fillOrKillParams?: FillOrKillParamsWithMinPrice; dcaParams?: DcaParams; - - /** @deprecated DEPRECATED(1.5): use ccmParams instead of ccmMetadata */ - ccmMetadata?: CcmParams; } export interface DepositAddressResponse extends DepositAddressRequest { @@ -97,11 +94,6 @@ interface SwapStatusResponseCommonFields extends ChainsAndAssets { swapScheduledAt: number | undefined; swapScheduledBlockIndex: string | undefined; lastStatechainUpdateAt: number | undefined; - - /** @deprecated DEPRECATED(1.5): use depositTransactionRef instead */ - depositTransactionHash: string | undefined; - /** @deprecated DEPRECATED(1.5): use ccmParams instead of ccmMetadata */ - ccmMetadata?: CcmParams; } interface DepositAddressFields extends SwapStatusResponseCommonFields { diff --git a/packages/shared/src/schemas.ts b/packages/shared/src/schemas.ts index dc0c78f0c..36169562f 100644 --- a/packages/shared/src/schemas.ts +++ b/packages/shared/src/schemas.ts @@ -114,7 +114,6 @@ export const openSwapDepositChannelSchema = z destChain: chain, destAddress: z.string(), amount: numericString, - ccmMetadata: ccmParamsSchema.optional(), // DEPRECATED(1.5): use ccmParams instead of ccmMetadata ccmParams: ccmParamsSchema.optional(), maxBoostFeeBps: z.number().optional(), srcAddress: z.string().optional(), diff --git a/packages/shared/src/vault/__tests__/__snapshots__/executeSwap.test.ts.snap b/packages/shared/src/vault/__tests__/__snapshots__/executeSwap.test.ts.snap index cde5e61dd..a550c7791 100644 --- a/packages/shared/src/vault/__tests__/__snapshots__/executeSwap.test.ts.snap +++ b/packages/shared/src/vault/__tests__/__snapshots__/executeSwap.test.ts.snap @@ -52,53 +52,6 @@ exports[`executeSwap can be invoked with localnet options 2`] = ` ] `; -exports[`executeSwap submits a native call ({ - srcAsset: 'ETH', - srcChain: 'Ethereum', - destAsset: 'FLIP', - destChain: 'Ethereum', - destAddress: '0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2', - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' } -}) 1`] = ` -[ - [ - 1, - "0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2", - 2, - "0xdeadc0de", - "0x65", - "0x", - { - "value": "1", - }, - ], -] -`; - -exports[`executeSwap submits a native call ({ - srcAsset: 'ETH', - srcChain: 'Ethereum', - destAsset: 'FLIP', - destChain: 'Ethereum', - destAddress: '0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2', - ccmParams: { message: '0xcafebeef', gasBudget: '102' }, - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' } -}) 1`] = ` -[ - [ - 1, - "0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2", - 2, - "0xcafebeef", - "0x66", - "0x", - { - "value": "1", - }, - ], -] -`; - exports[`executeSwap submits a native call ({ srcAsset: 'ETH', srcChain: 'Ethereum', @@ -122,53 +75,6 @@ exports[`executeSwap submits a native call ({ ] `; -exports[`executeSwap submits a native call ({ - srcAsset: 'ETH', - srcChain: 'Ethereum', - destAsset: 'USDC', - destChain: 'Ethereum', - destAddress: '0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2', - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' } -}) 1`] = ` -[ - [ - 1, - "0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2", - 3, - "0xdeadc0de", - "0x65", - "0x", - { - "value": "1", - }, - ], -] -`; - -exports[`executeSwap submits a native call ({ - srcAsset: 'ETH', - srcChain: 'Ethereum', - destAsset: 'USDC', - destChain: 'Ethereum', - destAddress: '0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2', - ccmParams: { message: '0xcafebeef', gasBudget: '102' }, - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' } -}) 1`] = ` -[ - [ - 1, - "0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2", - 3, - "0xcafebeef", - "0x66", - "0x", - { - "value": "1", - }, - ], -] -`; - exports[`executeSwap submits a native call ({ srcAsset: 'ETH', srcChain: 'Ethereum', @@ -292,86 +198,6 @@ exports[`executeSwap submits a native swap ({ ] `; -exports[`executeSwap submits a token call ({ - destAsset: 'ETH', - destChain: 'Ethereum', - destAddress: '0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2', - srcAsset: 'FLIP', - srcChain: 'Ethereum', - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' } -}) 1`] = ` -[ - [ - 1, - "0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2", - 1, - "0xdeadc0de", - "0x65", - "0xcD079EAB6B5443b545788Fd210C8800FEADd87fa", - "1", - "0x", - {}, - ], -] -`; - -exports[`executeSwap submits a token call ({ - destAsset: 'ETH', - destChain: 'Ethereum', - destAddress: '0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2', - srcAsset: 'FLIP', - srcChain: 'Ethereum', - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' } -}) 2`] = ` -[ - [ - "MY ADDRESS", - "0xa94d6b1853F3cb611Ed3cCb701b4fdA5a9DACe85", - ], -] -`; - -exports[`executeSwap submits a token call ({ - destAsset: 'ETH', - destChain: 'Ethereum', - destAddress: '0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2', - srcAsset: 'FLIP', - srcChain: 'Ethereum', - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' }, - ccmParams: { message: '0xcafebeef', gasBudget: '102' } -}) 1`] = ` -[ - [ - 1, - "0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2", - 1, - "0xcafebeef", - "0x66", - "0xcD079EAB6B5443b545788Fd210C8800FEADd87fa", - "1", - "0x", - {}, - ], -] -`; - -exports[`executeSwap submits a token call ({ - destAsset: 'ETH', - destChain: 'Ethereum', - destAddress: '0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2', - srcAsset: 'FLIP', - srcChain: 'Ethereum', - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' }, - ccmParams: { message: '0xcafebeef', gasBudget: '102' } -}) 2`] = ` -[ - [ - "MY ADDRESS", - "0xa94d6b1853F3cb611Ed3cCb701b4fdA5a9DACe85", - ], -] -`; - exports[`executeSwap submits a token call ({ destAsset: 'ETH', destChain: 'Ethereum', @@ -411,86 +237,6 @@ exports[`executeSwap submits a token call ({ ] `; -exports[`executeSwap submits a token call ({ - destAsset: 'ETH', - destChain: 'Ethereum', - destAddress: '0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2', - srcAsset: 'USDC', - srcChain: 'Ethereum', - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' } -}) 1`] = ` -[ - [ - 1, - "0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2", - 1, - "0xdeadc0de", - "0x65", - "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238", - "1", - "0x", - {}, - ], -] -`; - -exports[`executeSwap submits a token call ({ - destAsset: 'ETH', - destChain: 'Ethereum', - destAddress: '0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2', - srcAsset: 'USDC', - srcChain: 'Ethereum', - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' } -}) 2`] = ` -[ - [ - "MY ADDRESS", - "0xa94d6b1853F3cb611Ed3cCb701b4fdA5a9DACe85", - ], -] -`; - -exports[`executeSwap submits a token call ({ - destAsset: 'ETH', - destChain: 'Ethereum', - destAddress: '0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2', - srcAsset: 'USDC', - srcChain: 'Ethereum', - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' }, - ccmParams: { message: '0xcafebeef', gasBudget: '102' } -}) 1`] = ` -[ - [ - 1, - "0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2", - 1, - "0xcafebeef", - "0x66", - "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238", - "1", - "0x", - {}, - ], -] -`; - -exports[`executeSwap submits a token call ({ - destAsset: 'ETH', - destChain: 'Ethereum', - destAddress: '0x6Aa69332B63bB5b1d7Ca5355387EDd5624e181F2', - srcAsset: 'USDC', - srcChain: 'Ethereum', - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' }, - ccmParams: { message: '0xcafebeef', gasBudget: '102' } -}) 2`] = ` -[ - [ - "MY ADDRESS", - "0xa94d6b1853F3cb611Ed3cCb701b4fdA5a9DACe85", - ], -] -`; - exports[`executeSwap submits a token call ({ destAsset: 'ETH', destChain: 'Ethereum', diff --git a/packages/shared/src/vault/__tests__/executeSwap.test.ts b/packages/shared/src/vault/__tests__/executeSwap.test.ts index 402021e49..24d9c230f 100644 --- a/packages/shared/src/vault/__tests__/executeSwap.test.ts +++ b/packages/shared/src/vault/__tests__/executeSwap.test.ts @@ -474,40 +474,6 @@ describe(executeSwap, () => { destAddress: ETH_ADDRESS, ccmParams: { message: '0xdeadc0de', gasBudget: '101' }, }, - { - srcAsset: Assets.ETH, - srcChain: Chains.Ethereum, - destAsset: Assets.FLIP, - destChain: Chains.Ethereum, - destAddress: ETH_ADDRESS, - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' }, - }, - { - srcAsset: Assets.ETH, - srcChain: Chains.Ethereum, - destAsset: Assets.USDC, - destChain: Chains.Ethereum, - destAddress: ETH_ADDRESS, - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' }, - }, - { - srcAsset: Assets.ETH, - srcChain: Chains.Ethereum, - destAsset: Assets.FLIP, - destChain: Chains.Ethereum, - destAddress: ETH_ADDRESS, - ccmParams: { message: '0xcafebeef', gasBudget: '102' }, - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' }, - }, - { - srcAsset: Assets.ETH, - srcChain: Chains.Ethereum, - destAsset: Assets.USDC, - destChain: Chains.Ethereum, - destAddress: ETH_ADDRESS, - ccmParams: { message: '0xcafebeef', gasBudget: '102' }, - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' }, - }, ])('submits a native call (%O)', async (params) => { const wait = jest.fn().mockResolvedValue({ status: 1 }); const callSpy = jest.spyOn(MockVault.prototype, 'xCallNative').mockResolvedValue({ @@ -547,28 +513,6 @@ describe(executeSwap, () => { srcChain: Chains.Ethereum, ccmParams: { message: '0xdeadc0de', gasBudget: '101' }, }, - { - srcAsset: Assets.FLIP, - srcChain: Chains.Ethereum, - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' }, - }, - { - srcAsset: Assets.USDC, - srcChain: Chains.Ethereum, - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' }, - }, - { - srcAsset: Assets.FLIP, - srcChain: Chains.Ethereum, - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' }, - ccmParams: { message: '0xcafebeef', gasBudget: '102' }, - }, - { - srcAsset: Assets.USDC, - srcChain: Chains.Ethereum, - ccmMetadata: { message: '0xdeadc0de', gasBudget: '101' }, - ccmParams: { message: '0xcafebeef', gasBudget: '102' }, - }, ] as const ).flatMap( (src) => diff --git a/packages/shared/src/vault/executeSwap.ts b/packages/shared/src/vault/executeSwap.ts index 3c7ef0d4c..ee2932607 100644 --- a/packages/shared/src/vault/executeSwap.ts +++ b/packages/shared/src/vault/executeSwap.ts @@ -125,7 +125,7 @@ const swapToken = async ( }; const callNative = async ( - params: Required, 'ccmParams'>, + params: Required, networkOpts: SwapNetworkOptions, txOpts: TransactionOptions, ): Promise => { @@ -150,7 +150,7 @@ const callNative = async ( }; const callToken = async ( - params: Required, 'ccmParams'>, + params: Required, networkOpts: SwapNetworkOptions, txOpts: TransactionOptions, ): Promise => { @@ -183,7 +183,7 @@ const callToken = async ( }; const executeSwap = async ( - { ccmParams, ccmMetadata, ...params }: ExecuteSwapParams, + { ccmParams: unvalidatedCcmParams, ...params }: ExecuteSwapParams, networkOpts: SwapNetworkOptions, txOpts: TransactionOptions, ): Promise => { @@ -192,7 +192,6 @@ const executeSwap = async ( assertValidAddress(params.destChain, params.destAddress, networkOpts.network); await assertSignerIsConnectedToChain(networkOpts, params.srcChain); - const unvalidatedCcmParams = ccmParams || ccmMetadata; const internalSrcAsset = getInternalAsset({ asset: params.srcAsset, chain: params.srcChain }); if (unvalidatedCcmParams) { diff --git a/packages/shared/src/vault/index.ts b/packages/shared/src/vault/index.ts index b20a40455..315afd555 100644 --- a/packages/shared/src/vault/index.ts +++ b/packages/shared/src/vault/index.ts @@ -13,9 +13,6 @@ export interface ExecuteSwapParams { amount: string; destAddress: string; ccmParams?: CcmParams; - - /** @deprecated DEPRECATED(1.5): use ccmParams instead of ccmMetadata */ - ccmMetadata?: CcmParams; } export type SwapNetworkOptions = diff --git a/packages/swap/src/handlers/__tests__/__snapshots__/openSwapDepositChannel.test.ts.snap b/packages/swap/src/handlers/__tests__/__snapshots__/openSwapDepositChannel.test.ts.snap index 310f73c42..8f8a82fde 100644 --- a/packages/swap/src/handlers/__tests__/__snapshots__/openSwapDepositChannel.test.ts.snap +++ b/packages/swap/src/handlers/__tests__/__snapshots__/openSwapDepositChannel.test.ts.snap @@ -4,7 +4,6 @@ exports[`openSwapDepositChannel creates channel and stores channel and quote in [ [ { - "ccmParams": undefined, "destAddress": "5FAGoHvkBsUMnoD3W95JoVTvT8jgeFpjhFK8W73memyGBcBd", "destAsset": "DOT", "destChain": "Polkadot", @@ -86,7 +85,6 @@ exports[`openSwapDepositChannel creates channel and stores it in the database 1` [ [ { - "ccmParams": undefined, "destAddress": "5FAGoHvkBsUMnoD3W95JoVTvT8jgeFpjhFK8W73memyGBcBd", "destAsset": "DOT", "destChain": "Polkadot", @@ -142,7 +140,6 @@ exports[`openSwapDepositChannel creates channel with boost and dca and stores qu [ [ { - "ccmParams": undefined, "dcaParams": { "chunkIntervalBlocks": 2, "numberOfChunks": 3, @@ -228,7 +225,6 @@ exports[`openSwapDepositChannel creates channel with boost fee and stores it in [ [ { - "ccmParams": undefined, "destAddress": "0xFcd3C82b154CB4717Ac98718D0Fd13EEBA3D2754", "destAsset": "USDC", "destChain": "Ethereum", @@ -342,7 +338,6 @@ exports[`openSwapDepositChannel creates channel with fill or kill params and sto [ [ { - "ccmParams": undefined, "dcaParams": { "chunkIntervalBlocks": 2, "numberOfChunks": 3, diff --git a/packages/swap/src/handlers/openSwapDepositChannel.ts b/packages/swap/src/handlers/openSwapDepositChannel.ts index 2c6a0ed20..b113b48d3 100644 --- a/packages/swap/src/handlers/openSwapDepositChannel.ts +++ b/packages/swap/src/handlers/openSwapDepositChannel.ts @@ -72,9 +72,6 @@ export default async function openSwapDepositChannel( throw ServiceError.badRequest('too many channels'); } - // DEPRECATED(1.5): use ccmParams instead of ccmMetadata - input.ccmParams ??= input.ccmMetadata; // eslint-disable-line no-param-reassign - const swapDepositAddress = await broker.requestSwapDepositAddress( input, { url: env.RPC_BROKER_HTTPS_URL }, diff --git a/packages/swap/src/routes/__tests__/swap.test.ts b/packages/swap/src/routes/__tests__/swap.test.ts index f0e01e3ed..897160d1a 100644 --- a/packages/swap/src/routes/__tests__/swap.test.ts +++ b/packages/swap/src/routes/__tests__/swap.test.ts @@ -478,10 +478,6 @@ describe('server', () => { expect(status).toBe(200); expect(body).toMatchInlineSnapshot(` { - "ccmMetadata": { - "gasBudget": "100000", - "message": "0xdeadbeef", - }, "ccmParams": { "gasBudget": "100000", "message": "0xdeadbeef", @@ -629,7 +625,6 @@ describe('server', () => { "depositChannelOpenedThroughBackend": false, "depositReceivedAt": 552000, "depositReceivedBlockIndex": "92-400", - "depositTransactionHash": "0xa2d5df86c6ec123283eb052c598a0f4b650367a81ad141b9ff3adb0286a86c17", "depositTransactionRef": "0xa2d5df86c6ec123283eb052c598a0f4b650367a81ad141b9ff3adb0286a86c17", "destAddress": "1yMmfLti1k3huRQM2c47WugwonQMqTvQ2GUFxnU7Pcs7xPo", "destAsset": "DOT", @@ -1307,7 +1302,6 @@ describe('server', () => { "depositAmount": "5000000000000000000", "depositReceivedAt": 552000, "depositReceivedBlockIndex": "92-400", - "depositTransactionHash": "0xb2dcb9ce8d50f0ab869995fee8482bcf304ffcfe5681ca748f90e34c0ad7b241", "depositTransactionRef": "0xb2dcb9ce8d50f0ab869995fee8482bcf304ffcfe5681ca748f90e34c0ad7b241", "destAddress": "1yMmfLti1k3huRQM2c47WugwonQMqTvQ2GUFxnU7Pcs7xPo", "destAsset": "DOT", diff --git a/packages/swap/src/routes/swap.ts b/packages/swap/src/routes/swap.ts index 162da27c8..6b098123a 100644 --- a/packages/swap/src/routes/swap.ts +++ b/packages/swap/src/routes/swap.ts @@ -166,7 +166,6 @@ router.get( swapId: swapRequest?.nativeId.toString(), depositAmount: readField(swapRequest, failedSwap, 'depositAmount')?.toFixed() ?? pendingDeposit?.amount, - depositTransactionHash: depositTransactionRef, // DEPRECATED(1.5): use depositTransactionRef instead depositTransactionRef, depositTransactionConfirmations: pendingDeposit?.transactionConfirmations, depositReceivedAt: swapRequest?.depositFinalisedAt?.valueOf(), @@ -196,7 +195,6 @@ router.get( estimatedDepositChannelExpiryTime: swapDepositChannel?.estimatedExpiryAt?.valueOf(), isDepositChannelExpired: swapDepositChannel?.isExpired, ccmDepositReceivedBlockIndex: swapRequest?.ccmDepositReceivedBlockIndex ?? undefined, - ccmMetadata: ccmParams, // DEPRECATED(1.5): use ccmParams instead ccmParams, depositChannelOpenedThroughBackend: swapDepositChannel?.openedThroughBackend, broadcastTransactionRef: egress?.broadcast?.transactionRef ?? egressTrackerTxRef, diff --git a/scripts/releases.json b/scripts/releases.json index e004eaecc..70e6fd980 100644 --- a/scripts/releases.json +++ b/scripts/releases.json @@ -1 +1 @@ -["1.6", "1.5", "1.4", "1.3", "1.2", "1.1", "0.2"] +["1.7", "1.6", "1.5", "1.4", "1.3", "1.2", "1.1", "0.2"]