Skip to content

Commit

Permalink
chore(sdk): release @chainflip/sdk/v1.7.0-rc.0 (#1109)
Browse files Browse the repository at this point in the history
* chore(sdk): release @chainflip/sdk/v1.7.0-rc.0

* Remove deprecations
  • Loading branch information
niklasnatter authored Dec 6, 2024
1 parent 30e0e20 commit c4ff5f9
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 367 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@chainflip/sdk",
"version": "1.6.7-rc.5",
"version": "1.7.0-rc.0",
"description": "",
"exports": {
"./swap": {
Expand Down
26 changes: 9 additions & 17 deletions packages/sdk/src/swap/__tests__/sdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ describe(SwapSDK, () => {
srcChain: 'Bitcoin',
maxBoostFeeBps: 0,
channelOpeningFee: 0n,
ccmParams: undefined,
affiliateBrokers: [],
fillOrKillParams: {
retryDurationBlocks: 500,
Expand Down Expand Up @@ -470,7 +469,6 @@ describe(SwapSDK, () => {
srcChain: 'Bitcoin',
maxBoostFeeBps: 0,
channelOpeningFee: 0n,
ccmParams: undefined,
affiliateBrokers: [],
dcaParams: {
numberOfChunks: 100,
Expand Down Expand Up @@ -548,7 +546,6 @@ describe(SwapSDK, () => {
estimatedDepositChannelExpiryTime: undefined,
maxBoostFeeBps: 0,
channelOpeningFee: 0n,
ccmParams: undefined,
affiliateBrokers: [],
});
});
Expand Down Expand Up @@ -618,7 +615,6 @@ describe(SwapSDK, () => {
estimatedDepositChannelExpiryTime: undefined,
maxBoostFeeBps: 0,
channelOpeningFee: 0n,
ccmParams: undefined,
affiliateBrokers: [],
});
});
Expand Down Expand Up @@ -690,7 +686,6 @@ describe(SwapSDK, () => {
estimatedDepositChannelExpiryTime: undefined,
maxBoostFeeBps: 0,
channelOpeningFee: 0n,
ccmParams: undefined,
affiliateBrokers: [
{ account: 'cFHyJEHEQ1YkT9xuFnxnPWVkihpYEGjBg4WbF6vCPtSPQoE8n', commissionBps: 10 },
],
Expand Down Expand Up @@ -770,7 +765,6 @@ describe(SwapSDK, () => {
estimatedDepositChannelExpiryTime: undefined,
maxBoostFeeBps: 0,
channelOpeningFee: 0n,
ccmParams: undefined,
affiliateBrokers: [],
fillOrKillParams: {
retryDurationBlocks: 500,
Expand Down Expand Up @@ -865,7 +859,6 @@ describe(SwapSDK, () => {
},
maxBoostFeeBps: 0,
channelOpeningFee: 0n,
ccmParams: undefined,
affiliateBrokers: [],
dcaParams: {
numberOfChunks: 100,
Expand Down Expand Up @@ -940,7 +933,6 @@ describe(SwapSDK, () => {
estimatedDepositChannelExpiryTime: undefined,
maxBoostFeeBps: MAX_BOOST_FEE_BPS,
channelOpeningFee: 0n,
ccmParams: undefined,
affiliateBrokers: [],
});
});
Expand Down Expand Up @@ -998,6 +990,7 @@ describe(SwapSDK, () => {
depositChannelId: 'channel id',
depositAddress: 'deposit address',
brokerCommissionBps: 0,
ccmParams: undefined,
depositChannelExpiryBlock: 123n,
estimatedDepositChannelExpiryTime: 1698334470000,
amount: '1000000000000000000',
Expand All @@ -1009,7 +1002,6 @@ describe(SwapSDK, () => {
srcChain: 'Bitcoin',
maxBoostFeeBps: 0,
channelOpeningFee: 0n,
ccmParams: undefined,
dcaParams: undefined,
affiliateBrokers: [],
fillOrKillParams: {
Expand Down Expand Up @@ -1072,6 +1064,7 @@ describe(SwapSDK, () => {
depositChannelId: 'channel id',
depositAddress: 'deposit address',
brokerCommissionBps: 0,
ccmParams: undefined,
depositChannelExpiryBlock: 123n,
estimatedDepositChannelExpiryTime: 1698334470000,
amount: '1000000000000000000',
Expand All @@ -1083,7 +1076,6 @@ describe(SwapSDK, () => {
srcChain: 'Bitcoin',
maxBoostFeeBps: 0,
channelOpeningFee: 0n,
ccmParams: undefined,
dcaParams: undefined,
affiliateBrokers: [],
fillOrKillParams: {
Expand Down Expand Up @@ -1152,6 +1144,7 @@ describe(SwapSDK, () => {
depositChannelId: 'channel id',
depositAddress: 'deposit address',
brokerCommissionBps: 0,
ccmParams: undefined,
depositChannelExpiryBlock: 123n,
estimatedDepositChannelExpiryTime: 1698334470000,
amount: '1000000000000000000',
Expand All @@ -1163,7 +1156,6 @@ describe(SwapSDK, () => {
srcChain: 'Bitcoin',
maxBoostFeeBps: 0,
channelOpeningFee: 0n,
ccmParams: undefined,
affiliateBrokers: [],
dcaParams: {
numberOfChunks: 100,
Expand Down Expand Up @@ -1237,14 +1229,14 @@ describe(SwapSDK, () => {
srcAddress: 'mrV3ee4J3jipspCNPofzB2UbaVu7qgf9Ex',
destAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9b',
brokerCommissionBps: 15,
ccmParams: undefined,
amount: '1000000000000000000',
depositChannelId: '123-Bitcoin-15',
depositAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9a',
depositChannelExpiryBlock: 1234n,
estimatedDepositChannelExpiryTime: undefined,
maxBoostFeeBps: 0,
channelOpeningFee: 0n,
ccmParams: undefined,
affiliateBrokers: [],
dcaParams: undefined,
fillOrKillParams: undefined,
Expand Down Expand Up @@ -1311,14 +1303,14 @@ describe(SwapSDK, () => {
srcAddress: undefined,
destAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9b',
brokerCommissionBps: 15,
ccmParams: undefined,
amount: '1000000000000000000',
depositChannelId: '123-Bitcoin-15',
depositAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9a',
depositChannelExpiryBlock: 1234n,
estimatedDepositChannelExpiryTime: undefined,
maxBoostFeeBps: 0,
channelOpeningFee: 0n,
ccmParams: undefined,
affiliateBrokers: [],
dcaParams: undefined,
fillOrKillParams: undefined,
Expand Down Expand Up @@ -1387,14 +1379,14 @@ describe(SwapSDK, () => {
srcAddress: undefined,
destAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9b',
brokerCommissionBps: 15,
ccmParams: undefined,
amount: '1000000000000000000',
depositChannelId: '123-Bitcoin-15',
depositAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9a',
depositChannelExpiryBlock: 1234n,
estimatedDepositChannelExpiryTime: undefined,
maxBoostFeeBps: 0,
channelOpeningFee: 0n,
ccmParams: undefined,
affiliateBrokers: [
{ account: 'cFHyJEHEQ1YkT9xuFnxnPWVkihpYEGjBg4WbF6vCPtSPQoE8n', commissionBps: 10 },
],
Expand Down Expand Up @@ -1471,14 +1463,14 @@ describe(SwapSDK, () => {
srcAddress: undefined,
destAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9b',
brokerCommissionBps: 15,
ccmParams: undefined,
amount: '1000000000000000000',
depositChannelId: '123-Bitcoin-15',
depositAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9a',
depositChannelExpiryBlock: 1234n,
estimatedDepositChannelExpiryTime: undefined,
maxBoostFeeBps: 0,
channelOpeningFee: 0n,
ccmParams: undefined,
affiliateBrokers: [],
fillOrKillParams: {
retryDurationBlocks: 500,
Expand Down Expand Up @@ -1564,6 +1556,7 @@ describe(SwapSDK, () => {
srcAddress: undefined,
destAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9b',
brokerCommissionBps: 15,
ccmParams: undefined,
amount: '1000000000000000000',
depositChannelId: '123-Bitcoin-15',
depositAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9a',
Expand All @@ -1576,7 +1569,6 @@ describe(SwapSDK, () => {
},
maxBoostFeeBps: 0,
channelOpeningFee: 0n,
ccmParams: undefined,
affiliateBrokers: [],
dcaParams: {
numberOfChunks: 100,
Expand Down Expand Up @@ -1646,14 +1638,14 @@ describe(SwapSDK, () => {
srcAddress: undefined,
destAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9b',
brokerCommissionBps: 15,
ccmParams: undefined,
amount: '1000000000000000000',
depositChannelId: '123-Bitcoin-15',
depositAddress: '0x717e15853fd5f2ac6123e844c3a7c75976eaec9a',
depositChannelExpiryBlock: 1234n,
estimatedDepositChannelExpiryTime: undefined,
maxBoostFeeBps: MAX_BOOST_FEE_BPS,
channelOpeningFee: 0n,
ccmParams: undefined,
affiliateBrokers: [],
dcaParams: undefined,
fillOrKillParams: undefined,
Expand Down
6 changes: 0 additions & 6 deletions packages/sdk/src/swap/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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,
{
Expand Down
8 changes: 0 additions & 8 deletions packages/sdk/src/swap/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion packages/shared/src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Loading

0 comments on commit c4ff5f9

Please sign in to comment.