@chainflip/sdk 1.6.7-rc.4 → 1.7.0-rc.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.
- package/dist/{chunk-G76RI3QK.mjs → chunk-KLBPIDTY.mjs} +2 -38
- package/dist/funding.js +0 -92
- package/dist/funding.mjs +1 -1
- package/dist/swap.d.mts +2 -5
- package/dist/swap.d.ts +2 -5
- package/dist/swap.js +165 -11734
- package/dist/swap.mjs +67 -11601
- package/package.json +9 -3
|
@@ -1,37 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HttpClient, constants } from '@chainflip/rpc';
|
|
2
2
|
import { Interface, Contract } from 'ethers';
|
|
3
3
|
|
|
4
|
-
var __create = Object.create;
|
|
5
4
|
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
6
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
12
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
13
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
14
|
-
};
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
28
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
29
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
30
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
31
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
32
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
33
|
-
mod
|
|
34
|
-
));
|
|
35
7
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
36
8
|
|
|
37
9
|
// ../shared/src/enums.ts
|
|
@@ -2288,14 +2260,6 @@ var _Vault__factory = class _Vault__factory {
|
|
|
2288
2260
|
__name(_Vault__factory, "Vault__factory");
|
|
2289
2261
|
__publicField(_Vault__factory, "abi", _abi3);
|
|
2290
2262
|
var Vault__factory = _Vault__factory;
|
|
2291
|
-
|
|
2292
|
-
// ../shared/src/consts.ts
|
|
2293
|
-
({
|
|
2294
|
-
[ChainflipNetworks.backspin]: 1e3,
|
|
2295
|
-
[ChainflipNetworks.sisyphos]: 1e3,
|
|
2296
|
-
[ChainflipNetworks.perseverance]: 1e3,
|
|
2297
|
-
[ChainflipNetworks.mainnet]: 1e3
|
|
2298
|
-
});
|
|
2299
2263
|
var ETHEREUM_EVM_CHAIN_ID = {
|
|
2300
2264
|
[ChainflipNetworks.backspin]: 10997,
|
|
2301
2265
|
[ChainflipNetworks.sisyphos]: 11155111,
|
|
@@ -2406,4 +2370,4 @@ var getFlipBalance = /* @__PURE__ */ __name(async (network, signer) => {
|
|
|
2406
2370
|
return flip.balanceOf(await signer.getAddress());
|
|
2407
2371
|
}, "getFlipBalance");
|
|
2408
2372
|
|
|
2409
|
-
export { Assets, ChainflipNetworks, Chains, InternalAssets, StateChainGateway__factory, Vault__factory,
|
|
2373
|
+
export { Assets, ChainflipNetworks, Chains, InternalAssets, StateChainGateway__factory, Vault__factory, __name, __publicField, approve, assert, assetConstants, chainConstants, checkAllowance, extractOverrides, getAllBoostPoolsDepth, getAssetAndChain, getEnvironment, getEvmChainId, getFlipBalance, getFundingEnvironment, getInternalAsset, getInternalAssets, getStateChainGatewayContractAddress, getSupportedAssets, getTokenContractAddress, getVaultContractAddress, isNotNullish, isString, isTestnet, isValidAssetAndChain, readChainAssetValue };
|
package/dist/funding.js
CHANGED
|
@@ -798,78 +798,6 @@ var ChainflipNetworks = arrayToMap([
|
|
|
798
798
|
"perseverance",
|
|
799
799
|
"mainnet"
|
|
800
800
|
]);
|
|
801
|
-
({
|
|
802
|
-
[InternalAssets.Eth]: {
|
|
803
|
-
chain: Chains.Ethereum,
|
|
804
|
-
asset: Assets.ETH,
|
|
805
|
-
name: "Ether",
|
|
806
|
-
decimals: 18,
|
|
807
|
-
contractId: 1
|
|
808
|
-
},
|
|
809
|
-
[InternalAssets.Flip]: {
|
|
810
|
-
chain: Chains.Ethereum,
|
|
811
|
-
asset: Assets.FLIP,
|
|
812
|
-
name: "FLIP",
|
|
813
|
-
decimals: 18,
|
|
814
|
-
contractId: 2
|
|
815
|
-
},
|
|
816
|
-
[InternalAssets.Usdc]: {
|
|
817
|
-
chain: Chains.Ethereum,
|
|
818
|
-
asset: Assets.USDC,
|
|
819
|
-
name: "USDC",
|
|
820
|
-
decimals: 6,
|
|
821
|
-
contractId: 3
|
|
822
|
-
},
|
|
823
|
-
[InternalAssets.Usdt]: {
|
|
824
|
-
chain: Chains.Ethereum,
|
|
825
|
-
asset: Assets.USDT,
|
|
826
|
-
name: "USDT",
|
|
827
|
-
decimals: 6,
|
|
828
|
-
contractId: 8
|
|
829
|
-
},
|
|
830
|
-
[InternalAssets.Dot]: {
|
|
831
|
-
chain: Chains.Polkadot,
|
|
832
|
-
asset: Assets.DOT,
|
|
833
|
-
name: "Polkadot",
|
|
834
|
-
decimals: 10,
|
|
835
|
-
contractId: 4
|
|
836
|
-
},
|
|
837
|
-
[InternalAssets.Btc]: {
|
|
838
|
-
chain: Chains.Bitcoin,
|
|
839
|
-
asset: Assets.BTC,
|
|
840
|
-
name: "Bitcoin",
|
|
841
|
-
decimals: 8,
|
|
842
|
-
contractId: 5
|
|
843
|
-
},
|
|
844
|
-
[InternalAssets.ArbEth]: {
|
|
845
|
-
chain: Chains.Arbitrum,
|
|
846
|
-
asset: Assets.ETH,
|
|
847
|
-
name: "Arbitrum Ether",
|
|
848
|
-
decimals: 18,
|
|
849
|
-
contractId: 6
|
|
850
|
-
},
|
|
851
|
-
[InternalAssets.ArbUsdc]: {
|
|
852
|
-
chain: Chains.Arbitrum,
|
|
853
|
-
asset: Assets.USDC,
|
|
854
|
-
name: "Arbitrum USDC",
|
|
855
|
-
decimals: 6,
|
|
856
|
-
contractId: 7
|
|
857
|
-
},
|
|
858
|
-
[InternalAssets.Sol]: {
|
|
859
|
-
chain: Chains.Solana,
|
|
860
|
-
asset: Assets.SOL,
|
|
861
|
-
name: "Solana",
|
|
862
|
-
decimals: 9,
|
|
863
|
-
contractId: 9
|
|
864
|
-
},
|
|
865
|
-
[InternalAssets.SolUsdc]: {
|
|
866
|
-
chain: Chains.Solana,
|
|
867
|
-
asset: Assets.USDC,
|
|
868
|
-
name: "Solana USDC",
|
|
869
|
-
decimals: 6,
|
|
870
|
-
contractId: 10
|
|
871
|
-
}
|
|
872
|
-
});
|
|
873
801
|
var chainConstants = {
|
|
874
802
|
[Chains.Ethereum]: {
|
|
875
803
|
assets: [
|
|
@@ -957,26 +885,6 @@ function getInternalAsset(asset, assert2 = true) {
|
|
|
957
885
|
return chain[asset.asset];
|
|
958
886
|
}
|
|
959
887
|
__name(getInternalAsset, "getInternalAsset");
|
|
960
|
-
|
|
961
|
-
// ../shared/src/consts.ts
|
|
962
|
-
({
|
|
963
|
-
[ChainflipNetworks.backspin]: 1e3,
|
|
964
|
-
[ChainflipNetworks.sisyphos]: 1e3,
|
|
965
|
-
[ChainflipNetworks.perseverance]: 1e3,
|
|
966
|
-
[ChainflipNetworks.mainnet]: 1e3
|
|
967
|
-
});
|
|
968
|
-
({
|
|
969
|
-
[ChainflipNetworks.backspin]: 10997,
|
|
970
|
-
[ChainflipNetworks.sisyphos]: 11155111,
|
|
971
|
-
[ChainflipNetworks.perseverance]: 11155111,
|
|
972
|
-
[ChainflipNetworks.mainnet]: 1
|
|
973
|
-
});
|
|
974
|
-
({
|
|
975
|
-
[ChainflipNetworks.backspin]: 412346,
|
|
976
|
-
[ChainflipNetworks.sisyphos]: 421614,
|
|
977
|
-
[ChainflipNetworks.perseverance]: 421614,
|
|
978
|
-
[ChainflipNetworks.mainnet]: 42161
|
|
979
|
-
});
|
|
980
888
|
var SEPOLIA_USDC_CONTRACT_ADDRESS = "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238";
|
|
981
889
|
var SEPOLIA_USDT_CONTRACT_ADDRESS = "0x27CEA6Eb8a21Aae05Eb29C91c5CA10592892F584";
|
|
982
890
|
var ADDRESSES = {
|
package/dist/funding.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __name, __publicField,
|
|
1
|
+
import { __name, __publicField, getFlipBalance, getFundingEnvironment, getStateChainGatewayContractAddress, approve, getTokenContractAddress, InternalAssets, checkAllowance, assert, extractOverrides, ChainflipNetworks, StateChainGateway__factory } from './chunk-KLBPIDTY.mjs';
|
|
2
2
|
|
|
3
3
|
// ../shared/src/stateChainGateway/utils.ts
|
|
4
4
|
var getStateChainGateway = /* @__PURE__ */ __name((networkOpts) => {
|
package/dist/swap.d.mts
CHANGED
|
@@ -125,7 +125,6 @@ interface ExecuteSwapParams {
|
|
|
125
125
|
amount: string;
|
|
126
126
|
destAddress: string;
|
|
127
127
|
ccmParams?: CcmParams;
|
|
128
|
-
ccmMetadata?: CcmParams;
|
|
129
128
|
}
|
|
130
129
|
|
|
131
130
|
interface ChainData {
|
|
@@ -178,7 +177,6 @@ interface DepositAddressRequest extends QuoteRequest {
|
|
|
178
177
|
srcAddress?: string;
|
|
179
178
|
fillOrKillParams?: FillOrKillParamsWithMinPrice;
|
|
180
179
|
dcaParams?: DcaParams;
|
|
181
|
-
ccmMetadata?: CcmParams;
|
|
182
180
|
}
|
|
183
181
|
interface DepositAddressResponse extends DepositAddressRequest {
|
|
184
182
|
depositChannelId: string;
|
|
@@ -203,8 +201,6 @@ interface SwapStatusResponseCommonFields$1 extends ChainsAndAssets {
|
|
|
203
201
|
swapScheduledAt: number | undefined;
|
|
204
202
|
swapScheduledBlockIndex: string | undefined;
|
|
205
203
|
lastStatechainUpdateAt: number | undefined;
|
|
206
|
-
depositTransactionHash: string | undefined;
|
|
207
|
-
ccmMetadata?: CcmParams;
|
|
208
204
|
}
|
|
209
205
|
interface DepositAddressFields extends SwapStatusResponseCommonFields$1 {
|
|
210
206
|
depositAddress: string;
|
|
@@ -362,7 +358,8 @@ declare enum FailureMode {
|
|
|
362
358
|
IngressIgnored = "DEPOSIT_TOO_SMALL",
|
|
363
359
|
SwapEgressIgnored = "SWAP_OUTPUT_TOO_SMALL",
|
|
364
360
|
RefundEgressIgnored = "REFUND_OUTPUT_TOO_SMALL",
|
|
365
|
-
BroadcastAborted = "SENDING_FAILED"
|
|
361
|
+
BroadcastAborted = "SENDING_FAILED",
|
|
362
|
+
TransactionRejectedByBroker = "DEPOSIT_REJECTED"
|
|
366
363
|
}
|
|
367
364
|
|
|
368
365
|
interface Failure {
|
package/dist/swap.d.ts
CHANGED
|
@@ -125,7 +125,6 @@ interface ExecuteSwapParams {
|
|
|
125
125
|
amount: string;
|
|
126
126
|
destAddress: string;
|
|
127
127
|
ccmParams?: CcmParams;
|
|
128
|
-
ccmMetadata?: CcmParams;
|
|
129
128
|
}
|
|
130
129
|
|
|
131
130
|
interface ChainData {
|
|
@@ -178,7 +177,6 @@ interface DepositAddressRequest extends QuoteRequest {
|
|
|
178
177
|
srcAddress?: string;
|
|
179
178
|
fillOrKillParams?: FillOrKillParamsWithMinPrice;
|
|
180
179
|
dcaParams?: DcaParams;
|
|
181
|
-
ccmMetadata?: CcmParams;
|
|
182
180
|
}
|
|
183
181
|
interface DepositAddressResponse extends DepositAddressRequest {
|
|
184
182
|
depositChannelId: string;
|
|
@@ -203,8 +201,6 @@ interface SwapStatusResponseCommonFields$1 extends ChainsAndAssets {
|
|
|
203
201
|
swapScheduledAt: number | undefined;
|
|
204
202
|
swapScheduledBlockIndex: string | undefined;
|
|
205
203
|
lastStatechainUpdateAt: number | undefined;
|
|
206
|
-
depositTransactionHash: string | undefined;
|
|
207
|
-
ccmMetadata?: CcmParams;
|
|
208
204
|
}
|
|
209
205
|
interface DepositAddressFields extends SwapStatusResponseCommonFields$1 {
|
|
210
206
|
depositAddress: string;
|
|
@@ -362,7 +358,8 @@ declare enum FailureMode {
|
|
|
362
358
|
IngressIgnored = "DEPOSIT_TOO_SMALL",
|
|
363
359
|
SwapEgressIgnored = "SWAP_OUTPUT_TOO_SMALL",
|
|
364
360
|
RefundEgressIgnored = "REFUND_OUTPUT_TOO_SMALL",
|
|
365
|
-
BroadcastAborted = "SENDING_FAILED"
|
|
361
|
+
BroadcastAborted = "SENDING_FAILED",
|
|
362
|
+
TransactionRejectedByBroker = "DEPOSIT_REJECTED"
|
|
366
363
|
}
|
|
367
364
|
|
|
368
365
|
interface Failure {
|