@chainflip/sdk 1.9.4 → 1.9.5
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/funding.d.cts +11 -0
- package/dist/funding.d.ts +11 -0
- package/dist/swap.cjs +1 -1
- package/dist/swap.d.cts +26 -0
- package/dist/swap.d.ts +26 -0
- package/dist/swap.js +1 -1
- package/package.json +1 -1
package/dist/funding.d.cts
CHANGED
|
@@ -28,12 +28,23 @@ declare class FundingSDK {
|
|
|
28
28
|
private readonly rpcConfig;
|
|
29
29
|
private redemptionTax?;
|
|
30
30
|
constructor(options: FundingSDKOption);
|
|
31
|
+
/**
|
|
32
|
+
* @param accountId the hex-encoded validator account id
|
|
33
|
+
* @param amount the amount to fund in base units of FLIP
|
|
34
|
+
*/
|
|
31
35
|
fundStateChainAccount(accountId: `0x${string}`, amount: bigint, txOpts?: TransactionOptions): Promise<TransactionHash>;
|
|
36
|
+
/**
|
|
37
|
+
* @param accountId the hex-encoded validator account id
|
|
38
|
+
*/
|
|
32
39
|
executeRedemption(accountId: `0x${string}`, txOpts?: TransactionOptions): Promise<TransactionHash>;
|
|
33
40
|
getMinimumFunding(): Promise<bigint>;
|
|
34
41
|
getRedemptionDelay(): Promise<bigint>;
|
|
35
42
|
getFlipBalance(): Promise<bigint>;
|
|
36
43
|
getPendingRedemption(accountId: `0x${string}`): Promise<PendingRedemption | undefined>;
|
|
44
|
+
/**
|
|
45
|
+
* @param the amount of FLIP to request approval for
|
|
46
|
+
* @returns the transaction hash or null if no approval was required
|
|
47
|
+
*/
|
|
37
48
|
approveStateChainGateway(amount: bigint, txOpts?: TransactionOptions): Promise<TransactionHash | null>;
|
|
38
49
|
getRedemptionTax(): Promise<bigint>;
|
|
39
50
|
}
|
package/dist/funding.d.ts
CHANGED
|
@@ -28,12 +28,23 @@ declare class FundingSDK {
|
|
|
28
28
|
private readonly rpcConfig;
|
|
29
29
|
private redemptionTax?;
|
|
30
30
|
constructor(options: FundingSDKOption);
|
|
31
|
+
/**
|
|
32
|
+
* @param accountId the hex-encoded validator account id
|
|
33
|
+
* @param amount the amount to fund in base units of FLIP
|
|
34
|
+
*/
|
|
31
35
|
fundStateChainAccount(accountId: `0x${string}`, amount: bigint, txOpts?: TransactionOptions): Promise<TransactionHash>;
|
|
36
|
+
/**
|
|
37
|
+
* @param accountId the hex-encoded validator account id
|
|
38
|
+
*/
|
|
32
39
|
executeRedemption(accountId: `0x${string}`, txOpts?: TransactionOptions): Promise<TransactionHash>;
|
|
33
40
|
getMinimumFunding(): Promise<bigint>;
|
|
34
41
|
getRedemptionDelay(): Promise<bigint>;
|
|
35
42
|
getFlipBalance(): Promise<bigint>;
|
|
36
43
|
getPendingRedemption(accountId: `0x${string}`): Promise<PendingRedemption | undefined>;
|
|
44
|
+
/**
|
|
45
|
+
* @param the amount of FLIP to request approval for
|
|
46
|
+
* @returns the transaction hash or null if no approval was required
|
|
47
|
+
*/
|
|
37
48
|
approveStateChainGateway(amount: bigint, txOpts?: TransactionOptions): Promise<TransactionHash | null>;
|
|
38
49
|
getRedemptionTax(): Promise<bigint>;
|
|
39
50
|
}
|
package/dist/swap.cjs
CHANGED
|
@@ -656,7 +656,7 @@ var getChainData = (chain2, network, env) => ({
|
|
|
656
656
|
|
|
657
657
|
// package.json
|
|
658
658
|
var package_default = {
|
|
659
|
-
version: "1.9.
|
|
659
|
+
version: "1.9.5"};
|
|
660
660
|
|
|
661
661
|
// src/swap/consts.ts
|
|
662
662
|
var CF_SDK_VERSION_HEADERS = { "X-Chainflip-Sdk-Version": package_default.version };
|
package/dist/swap.d.cts
CHANGED
|
@@ -10,6 +10,7 @@ declare const ccmParamsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
10
10
|
gasBudget: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `0x${string}`, string>]>, `0x${string}`, string>;
|
|
11
11
|
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
12
12
|
ccmAdditionalData: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>>;
|
|
13
|
+
/** @deprecated DEPRECATED(1.8) pass additionalData instead */
|
|
13
14
|
cfParameters: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>>;
|
|
14
15
|
}, "strip", z.ZodTypeAny, {
|
|
15
16
|
message: `0x${string}`;
|
|
@@ -32,6 +33,7 @@ declare const ccmParamsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
32
33
|
cfParameters?: string | undefined;
|
|
33
34
|
}>;
|
|
34
35
|
type CcmParams = Omit<z.input<typeof ccmParamsSchema>, 'cfParameters'> & {
|
|
36
|
+
/** @deprecated DEPRECATED(1.8) pass additionalData instead */
|
|
35
37
|
cfParameters?: string;
|
|
36
38
|
};
|
|
37
39
|
declare const affiliateBroker: z.ZodEffects<z.ZodObject<{
|
|
@@ -479,9 +481,13 @@ interface DepositChannelFields {
|
|
|
479
481
|
expectedDepositAmount: string | undefined;
|
|
480
482
|
isExpired: boolean;
|
|
481
483
|
openedThroughBackend: boolean;
|
|
484
|
+
/** @deprecated DEPRECATED(1.8) use SwapStatusResponseV2['brokers'] instead */
|
|
482
485
|
brokerCommissionBps: number;
|
|
486
|
+
/** @deprecated DEPRECATED(1.8) use SwapStatusResponseV2['brokers'] instead */
|
|
483
487
|
affiliateBrokers: AffiliateBroker[];
|
|
488
|
+
/** @deprecated DEPRECATED(1.8) use SwapStatusResponseV2['fillOrKillParams'] instead */
|
|
484
489
|
fillOrKillParams: FillOrKillParamsWithMinPrice | undefined;
|
|
490
|
+
/** @deprecated DEPRECATED(1.8) use SwapStatusResponseV2['dcaParams'] instead */
|
|
485
491
|
dcaParams: DcaParams | undefined;
|
|
486
492
|
}
|
|
487
493
|
interface DepositFields {
|
|
@@ -520,9 +526,28 @@ interface SwapFields {
|
|
|
520
526
|
executedChunks: number;
|
|
521
527
|
remainingChunks: number;
|
|
522
528
|
} | undefined;
|
|
529
|
+
/**
|
|
530
|
+
* Represents details of an on-chain transaction associated with the swap.
|
|
531
|
+
* - `accountId`: The account identifier of the LP for the on-chain swap.
|
|
532
|
+
* - `outputAmount`: The amount of output tokens received from the swap.
|
|
533
|
+
* This is `undefined` if the swap has not been executed or it was fully
|
|
534
|
+
* refunded.
|
|
535
|
+
* - `refundAmount`: The amount of input tokens refunded due to a fully or
|
|
536
|
+
* partially refunded swap. This is `undefined` if no refund occurred.
|
|
537
|
+
*/
|
|
523
538
|
onChain: {
|
|
539
|
+
/** The account identifier of the LP for the on-chain swap */
|
|
524
540
|
accountId: string;
|
|
541
|
+
/**
|
|
542
|
+
* The amount of output tokens received from the swap. This is
|
|
543
|
+
* `undefined` if the swap has not been executed or it was fully
|
|
544
|
+
* refunded.
|
|
545
|
+
*/
|
|
525
546
|
outputAmount: string | undefined;
|
|
547
|
+
/**
|
|
548
|
+
* The amount of input tokens refunded due to a fully or partially
|
|
549
|
+
* refunded swap. This is `undefined` if no refund occurred.
|
|
550
|
+
*/
|
|
526
551
|
refundAmount: string | undefined;
|
|
527
552
|
} | undefined;
|
|
528
553
|
}
|
|
@@ -666,6 +691,7 @@ type SwapSDKOptions = {
|
|
|
666
691
|
backendUrl?: string;
|
|
667
692
|
broker?: {
|
|
668
693
|
url: string;
|
|
694
|
+
/** @deprecated DEPRECATED(1.8) set the brokerCommissionBps param of the requestDepositAddress and encodeVaultSwapData method instead */
|
|
669
695
|
commissionBps?: number;
|
|
670
696
|
};
|
|
671
697
|
rpcUrl?: string;
|
package/dist/swap.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ declare const ccmParamsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
10
10
|
gasBudget: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `0x${string}`, string>]>, `0x${string}`, string>;
|
|
11
11
|
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
12
12
|
ccmAdditionalData: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>>;
|
|
13
|
+
/** @deprecated DEPRECATED(1.8) pass additionalData instead */
|
|
13
14
|
cfParameters: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>>;
|
|
14
15
|
}, "strip", z.ZodTypeAny, {
|
|
15
16
|
message: `0x${string}`;
|
|
@@ -32,6 +33,7 @@ declare const ccmParamsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
32
33
|
cfParameters?: string | undefined;
|
|
33
34
|
}>;
|
|
34
35
|
type CcmParams = Omit<z.input<typeof ccmParamsSchema>, 'cfParameters'> & {
|
|
36
|
+
/** @deprecated DEPRECATED(1.8) pass additionalData instead */
|
|
35
37
|
cfParameters?: string;
|
|
36
38
|
};
|
|
37
39
|
declare const affiliateBroker: z.ZodEffects<z.ZodObject<{
|
|
@@ -479,9 +481,13 @@ interface DepositChannelFields {
|
|
|
479
481
|
expectedDepositAmount: string | undefined;
|
|
480
482
|
isExpired: boolean;
|
|
481
483
|
openedThroughBackend: boolean;
|
|
484
|
+
/** @deprecated DEPRECATED(1.8) use SwapStatusResponseV2['brokers'] instead */
|
|
482
485
|
brokerCommissionBps: number;
|
|
486
|
+
/** @deprecated DEPRECATED(1.8) use SwapStatusResponseV2['brokers'] instead */
|
|
483
487
|
affiliateBrokers: AffiliateBroker[];
|
|
488
|
+
/** @deprecated DEPRECATED(1.8) use SwapStatusResponseV2['fillOrKillParams'] instead */
|
|
484
489
|
fillOrKillParams: FillOrKillParamsWithMinPrice | undefined;
|
|
490
|
+
/** @deprecated DEPRECATED(1.8) use SwapStatusResponseV2['dcaParams'] instead */
|
|
485
491
|
dcaParams: DcaParams | undefined;
|
|
486
492
|
}
|
|
487
493
|
interface DepositFields {
|
|
@@ -520,9 +526,28 @@ interface SwapFields {
|
|
|
520
526
|
executedChunks: number;
|
|
521
527
|
remainingChunks: number;
|
|
522
528
|
} | undefined;
|
|
529
|
+
/**
|
|
530
|
+
* Represents details of an on-chain transaction associated with the swap.
|
|
531
|
+
* - `accountId`: The account identifier of the LP for the on-chain swap.
|
|
532
|
+
* - `outputAmount`: The amount of output tokens received from the swap.
|
|
533
|
+
* This is `undefined` if the swap has not been executed or it was fully
|
|
534
|
+
* refunded.
|
|
535
|
+
* - `refundAmount`: The amount of input tokens refunded due to a fully or
|
|
536
|
+
* partially refunded swap. This is `undefined` if no refund occurred.
|
|
537
|
+
*/
|
|
523
538
|
onChain: {
|
|
539
|
+
/** The account identifier of the LP for the on-chain swap */
|
|
524
540
|
accountId: string;
|
|
541
|
+
/**
|
|
542
|
+
* The amount of output tokens received from the swap. This is
|
|
543
|
+
* `undefined` if the swap has not been executed or it was fully
|
|
544
|
+
* refunded.
|
|
545
|
+
*/
|
|
525
546
|
outputAmount: string | undefined;
|
|
547
|
+
/**
|
|
548
|
+
* The amount of input tokens refunded due to a fully or partially
|
|
549
|
+
* refunded swap. This is `undefined` if no refund occurred.
|
|
550
|
+
*/
|
|
526
551
|
refundAmount: string | undefined;
|
|
527
552
|
} | undefined;
|
|
528
553
|
}
|
|
@@ -666,6 +691,7 @@ type SwapSDKOptions = {
|
|
|
666
691
|
backendUrl?: string;
|
|
667
692
|
broker?: {
|
|
668
693
|
url: string;
|
|
694
|
+
/** @deprecated DEPRECATED(1.8) set the brokerCommissionBps param of the requestDepositAddress and encodeVaultSwapData method instead */
|
|
669
695
|
commissionBps?: number;
|
|
670
696
|
};
|
|
671
697
|
rpcUrl?: string;
|
package/dist/swap.js
CHANGED
|
@@ -524,7 +524,7 @@ var getChainData = (chain2, network, env) => ({
|
|
|
524
524
|
|
|
525
525
|
// package.json
|
|
526
526
|
var package_default = {
|
|
527
|
-
version: "1.9.
|
|
527
|
+
version: "1.9.5"};
|
|
528
528
|
|
|
529
529
|
// src/swap/consts.ts
|
|
530
530
|
var CF_SDK_VERSION_HEADERS = { "X-Chainflip-Sdk-Version": package_default.version };
|