@chainflip/sdk 1.5.1-react-native.0 → 1.5.1-react-native.2
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/{broker-36RMMXYV.mjs → broker-VQF7PNXJ.mjs} +11 -17
- package/dist/{chunk-M32JHS3U.mjs → chunk-AXKJJ3VI.mjs} +11 -5
- package/dist/{chunk-3V7QJANN.mjs → chunk-EBZERIHA.mjs} +34 -3
- package/dist/{chunk-ZMUWWD4I.mjs → chunk-HCJJCKYQ.mjs} +1862 -243
- package/dist/{contracts-Cb-5VdIi.d.mts → contracts-DmShvHR7.d.mts} +9 -3
- package/dist/{contracts-Cb-5VdIi.d.ts → contracts-DmShvHR7.d.ts} +9 -3
- package/dist/funding.d.mts +1 -1
- package/dist/funding.d.ts +1 -1
- package/dist/funding.js +44 -7
- package/dist/funding.mjs +2 -2
- package/dist/swap.d.mts +8 -5
- package/dist/swap.d.ts +8 -5
- package/dist/swap.js +2056 -311
- package/dist/swap.mjs +21 -11
- package/package.json +2 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
type ArrayToMap<T extends readonly string[]> = {
|
|
2
2
|
[K in T[number]]: K;
|
|
3
3
|
};
|
|
4
|
-
declare const InternalAssets: ArrayToMap<readonly ["Flip", "Usdc", "Dot", "Eth", "Btc", "Usdt", "ArbUsdc", "ArbEth"]>;
|
|
4
|
+
declare const InternalAssets: ArrayToMap<readonly ["Flip", "Usdc", "Dot", "Eth", "Btc", "Usdt", "ArbUsdc", "ArbEth", "Sol", "SolUsdc"]>;
|
|
5
5
|
type InternalAsset = (typeof InternalAssets)[keyof typeof InternalAssets];
|
|
6
|
-
declare const Chains: ArrayToMap<readonly ["Bitcoin", "Ethereum", "Polkadot", "Arbitrum"]>;
|
|
6
|
+
declare const Chains: ArrayToMap<readonly ["Bitcoin", "Ethereum", "Polkadot", "Arbitrum", "Solana"]>;
|
|
7
7
|
type Chain = (typeof Chains)[keyof typeof Chains];
|
|
8
|
-
declare const Assets: ArrayToMap<readonly ["FLIP", "USDC", "DOT", "ETH", "BTC", "USDT"]>;
|
|
8
|
+
declare const Assets: ArrayToMap<readonly ["FLIP", "USDC", "DOT", "ETH", "BTC", "USDT", "SOL"]>;
|
|
9
9
|
type Asset = (typeof Assets)[keyof typeof Assets];
|
|
10
10
|
declare const ChainflipNetworks: ArrayToMap<readonly ["backspin", "sisyphos", "perseverance", "mainnet"]>;
|
|
11
11
|
type ChainflipNetwork = (typeof ChainflipNetworks)[keyof typeof ChainflipNetworks];
|
|
@@ -34,6 +34,12 @@ declare const chainConstants: {
|
|
|
34
34
|
readonly contractId: 4;
|
|
35
35
|
readonly blockTimeSeconds: 0.26;
|
|
36
36
|
};
|
|
37
|
+
readonly Solana: {
|
|
38
|
+
readonly assets: ["SOL", "USDC"];
|
|
39
|
+
readonly gasAsset: "SOL";
|
|
40
|
+
readonly contractId: 5;
|
|
41
|
+
readonly blockTimeSeconds: number;
|
|
42
|
+
};
|
|
37
43
|
};
|
|
38
44
|
type AssetOfChain<C extends Chain> = (typeof chainConstants)[C]['assets'][number];
|
|
39
45
|
type UncheckedAssetAndChain = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
type ArrayToMap<T extends readonly string[]> = {
|
|
2
2
|
[K in T[number]]: K;
|
|
3
3
|
};
|
|
4
|
-
declare const InternalAssets: ArrayToMap<readonly ["Flip", "Usdc", "Dot", "Eth", "Btc", "Usdt", "ArbUsdc", "ArbEth"]>;
|
|
4
|
+
declare const InternalAssets: ArrayToMap<readonly ["Flip", "Usdc", "Dot", "Eth", "Btc", "Usdt", "ArbUsdc", "ArbEth", "Sol", "SolUsdc"]>;
|
|
5
5
|
type InternalAsset = (typeof InternalAssets)[keyof typeof InternalAssets];
|
|
6
|
-
declare const Chains: ArrayToMap<readonly ["Bitcoin", "Ethereum", "Polkadot", "Arbitrum"]>;
|
|
6
|
+
declare const Chains: ArrayToMap<readonly ["Bitcoin", "Ethereum", "Polkadot", "Arbitrum", "Solana"]>;
|
|
7
7
|
type Chain = (typeof Chains)[keyof typeof Chains];
|
|
8
|
-
declare const Assets: ArrayToMap<readonly ["FLIP", "USDC", "DOT", "ETH", "BTC", "USDT"]>;
|
|
8
|
+
declare const Assets: ArrayToMap<readonly ["FLIP", "USDC", "DOT", "ETH", "BTC", "USDT", "SOL"]>;
|
|
9
9
|
type Asset = (typeof Assets)[keyof typeof Assets];
|
|
10
10
|
declare const ChainflipNetworks: ArrayToMap<readonly ["backspin", "sisyphos", "perseverance", "mainnet"]>;
|
|
11
11
|
type ChainflipNetwork = (typeof ChainflipNetworks)[keyof typeof ChainflipNetworks];
|
|
@@ -34,6 +34,12 @@ declare const chainConstants: {
|
|
|
34
34
|
readonly contractId: 4;
|
|
35
35
|
readonly blockTimeSeconds: 0.26;
|
|
36
36
|
};
|
|
37
|
+
readonly Solana: {
|
|
38
|
+
readonly assets: ["SOL", "USDC"];
|
|
39
|
+
readonly gasAsset: "SOL";
|
|
40
|
+
readonly contractId: 5;
|
|
41
|
+
readonly blockTimeSeconds: number;
|
|
42
|
+
};
|
|
37
43
|
};
|
|
38
44
|
type AssetOfChain<C extends Chain> = (typeof chainConstants)[C]['assets'][number];
|
|
39
45
|
type UncheckedAssetAndChain = {
|
package/dist/funding.d.mts
CHANGED
package/dist/funding.d.ts
CHANGED
package/dist/funding.js
CHANGED
|
@@ -772,13 +772,16 @@ var InternalAssets = arrayToMap([
|
|
|
772
772
|
"Btc",
|
|
773
773
|
"Usdt",
|
|
774
774
|
"ArbUsdc",
|
|
775
|
-
"ArbEth"
|
|
775
|
+
"ArbEth",
|
|
776
|
+
"Sol",
|
|
777
|
+
"SolUsdc"
|
|
776
778
|
]);
|
|
777
779
|
var Chains = arrayToMap([
|
|
778
780
|
"Bitcoin",
|
|
779
781
|
"Ethereum",
|
|
780
782
|
"Polkadot",
|
|
781
|
-
"Arbitrum"
|
|
783
|
+
"Arbitrum",
|
|
784
|
+
"Solana"
|
|
782
785
|
]);
|
|
783
786
|
var Assets = arrayToMap([
|
|
784
787
|
"FLIP",
|
|
@@ -786,7 +789,8 @@ var Assets = arrayToMap([
|
|
|
786
789
|
"DOT",
|
|
787
790
|
"ETH",
|
|
788
791
|
"BTC",
|
|
789
|
-
"USDT"
|
|
792
|
+
"USDT",
|
|
793
|
+
"SOL"
|
|
790
794
|
]);
|
|
791
795
|
var ChainflipNetworks = arrayToMap([
|
|
792
796
|
"backspin",
|
|
@@ -850,6 +854,20 @@ var ChainflipNetworks = arrayToMap([
|
|
|
850
854
|
name: "Arbitrum USDC",
|
|
851
855
|
decimals: 6,
|
|
852
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
|
|
853
871
|
}
|
|
854
872
|
});
|
|
855
873
|
var chainConstants = {
|
|
@@ -888,6 +906,15 @@ var chainConstants = {
|
|
|
888
906
|
gasAsset: Assets.ETH,
|
|
889
907
|
contractId: 4,
|
|
890
908
|
blockTimeSeconds: 0.26
|
|
909
|
+
},
|
|
910
|
+
[Chains.Solana]: {
|
|
911
|
+
assets: [
|
|
912
|
+
Assets.SOL,
|
|
913
|
+
Assets.USDC
|
|
914
|
+
],
|
|
915
|
+
gasAsset: Assets.SOL,
|
|
916
|
+
contractId: 5,
|
|
917
|
+
blockTimeSeconds: (400 + 800) / 2 / 1e3
|
|
891
918
|
}
|
|
892
919
|
};
|
|
893
920
|
function isValidAssetAndChain(assetAndChain) {
|
|
@@ -920,6 +947,10 @@ function getInternalAsset(asset, assert2 = true) {
|
|
|
920
947
|
[Chains.Arbitrum]: {
|
|
921
948
|
[Assets.USDC]: InternalAssets.ArbUsdc,
|
|
922
949
|
[Assets.ETH]: InternalAssets.ArbEth
|
|
950
|
+
},
|
|
951
|
+
[Chains.Solana]: {
|
|
952
|
+
[Assets.SOL]: InternalAssets.Sol,
|
|
953
|
+
[Assets.USDC]: InternalAssets.SolUsdc
|
|
923
954
|
}
|
|
924
955
|
};
|
|
925
956
|
const chain = map[asset.chain];
|
|
@@ -956,7 +987,9 @@ var ADDRESSES = {
|
|
|
956
987
|
ARBUSDC_CONTRACT_ADDRESS: "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
|
|
957
988
|
VAULT_CONTRACT_ADDRESS: "0xB7A5bd0345EF1Cc5E66bf61BdeC17D2461fBd968",
|
|
958
989
|
STATE_CHAIN_GATEWAY_ADDRESS: "0xeEBe00Ac0756308ac4AaBfD76c05c4F3088B8883",
|
|
959
|
-
ARB_VAULT_CONTRACT_ADDRESS: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
|
|
990
|
+
ARB_VAULT_CONTRACT_ADDRESS: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
|
|
991
|
+
// TODO(solana)
|
|
992
|
+
SOLUSDC_CONTRACT_ADDRESS: ""
|
|
960
993
|
},
|
|
961
994
|
[ChainflipNetworks.sisyphos]: {
|
|
962
995
|
FLIP_CONTRACT_ADDRESS: "0xcD079EAB6B5443b545788Fd210C8800FEADd87fa",
|
|
@@ -965,7 +998,8 @@ var ADDRESSES = {
|
|
|
965
998
|
ARBUSDC_CONTRACT_ADDRESS: "0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d",
|
|
966
999
|
VAULT_CONTRACT_ADDRESS: "0xa94d6b1853F3cb611Ed3cCb701b4fdA5a9DACe85",
|
|
967
1000
|
STATE_CHAIN_GATEWAY_ADDRESS: "0x1F7fE41C798cc7b1D34BdC8de2dDDA4a4bE744D9",
|
|
968
|
-
ARB_VAULT_CONTRACT_ADDRESS: "0x8155BdD48CD011e1118b51A1C82be020A3E5c2f2"
|
|
1001
|
+
ARB_VAULT_CONTRACT_ADDRESS: "0x8155BdD48CD011e1118b51A1C82be020A3E5c2f2",
|
|
1002
|
+
SOLUSDC_CONTRACT_ADDRESS: "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU"
|
|
969
1003
|
},
|
|
970
1004
|
[ChainflipNetworks.perseverance]: {
|
|
971
1005
|
FLIP_CONTRACT_ADDRESS: "0xdC27c60956cB065D19F08bb69a707E37b36d8086",
|
|
@@ -974,7 +1008,8 @@ var ADDRESSES = {
|
|
|
974
1008
|
ARBUSDC_CONTRACT_ADDRESS: "0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d",
|
|
975
1009
|
VAULT_CONTRACT_ADDRESS: "0x36eaD71325604DC15d35FAE584D7b50646D81753",
|
|
976
1010
|
STATE_CHAIN_GATEWAY_ADDRESS: "0xA34a967197Ee90BB7fb28e928388a573c5CFd099",
|
|
977
|
-
ARB_VAULT_CONTRACT_ADDRESS: "0x2bb150e6d4366A1BDBC4275D1F35892CD63F27e3"
|
|
1011
|
+
ARB_VAULT_CONTRACT_ADDRESS: "0x2bb150e6d4366A1BDBC4275D1F35892CD63F27e3",
|
|
1012
|
+
SOLUSDC_CONTRACT_ADDRESS: "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU"
|
|
978
1013
|
},
|
|
979
1014
|
[ChainflipNetworks.mainnet]: {
|
|
980
1015
|
FLIP_CONTRACT_ADDRESS: "0x826180541412D574cf1336d22c0C0a287822678A",
|
|
@@ -983,7 +1018,8 @@ var ADDRESSES = {
|
|
|
983
1018
|
ARBUSDC_CONTRACT_ADDRESS: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
|
|
984
1019
|
VAULT_CONTRACT_ADDRESS: "0xF5e10380213880111522dd0efD3dbb45b9f62Bcc",
|
|
985
1020
|
STATE_CHAIN_GATEWAY_ADDRESS: "0x6995Ab7c4D7F4B03f467Cf4c8E920427d9621DBd",
|
|
986
|
-
ARB_VAULT_CONTRACT_ADDRESS: "0x79001a5e762f3bEFC8e5871b42F6734e00498920"
|
|
1021
|
+
ARB_VAULT_CONTRACT_ADDRESS: "0x79001a5e762f3bEFC8e5871b42F6734e00498920",
|
|
1022
|
+
SOLUSDC_CONTRACT_ADDRESS: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
|
|
987
1023
|
}
|
|
988
1024
|
};
|
|
989
1025
|
|
|
@@ -997,6 +1033,7 @@ function getTokenContractAddress(asset, network) {
|
|
|
997
1033
|
if (asset === InternalAssets.Usdc) return ADDRESSES[network].USDC_CONTRACT_ADDRESS;
|
|
998
1034
|
if (asset === InternalAssets.Usdt) return ADDRESSES[network].USDT_CONTRACT_ADDRESS;
|
|
999
1035
|
if (asset === InternalAssets.ArbUsdc) return ADDRESSES[network].ARBUSDC_CONTRACT_ADDRESS;
|
|
1036
|
+
if (asset === InternalAssets.SolUsdc) return ADDRESSES[network].SOLUSDC_CONTRACT_ADDRESS;
|
|
1000
1037
|
throw new Error(`No contract address for ${asset} on ${network}`);
|
|
1001
1038
|
}
|
|
1002
1039
|
__name(getTokenContractAddress, "getTokenContractAddress");
|
package/dist/funding.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getFlipBalance, getFundingEnvironment, getStateChainGatewayContractAddress, approve, getTokenContractAddress, checkAllowance, extractOverrides, StateChainGateway__factory } from './chunk-
|
|
2
|
-
import { __name, __publicField, ChainflipNetworks, InternalAssets, assert } from './chunk-
|
|
1
|
+
import { getFlipBalance, getFundingEnvironment, getStateChainGatewayContractAddress, approve, getTokenContractAddress, checkAllowance, extractOverrides, StateChainGateway__factory } from './chunk-AXKJJ3VI.mjs';
|
|
2
|
+
import { __name, __publicField, ChainflipNetworks, InternalAssets, assert } from './chunk-EBZERIHA.mjs';
|
|
3
3
|
|
|
4
4
|
// ../shared/src/stateChainGateway/utils.ts
|
|
5
5
|
var getStateChainGateway = /* @__PURE__ */ __name((networkOpts) => {
|
package/dist/swap.d.mts
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import { Signer } from 'ethers';
|
|
2
|
-
import { A as AssetAndChain, C as Chain, a as Asset, I as InternalAsset, b as AssetOfChain, c as ChainflipNetwork, T as TransactionOptions, d as ChainAssetMap, e as ChainMap } from './contracts-
|
|
3
|
-
export { g as Assets, h as ChainflipIds, i as ChainflipNetworks, f as Chains, U as UncheckedAssetAndChain, j as getChainflipId } from './contracts-
|
|
2
|
+
import { A as AssetAndChain, C as Chain, a as Asset, I as InternalAsset, b as AssetOfChain, c as ChainflipNetwork, T as TransactionOptions, d as ChainAssetMap, e as ChainMap } from './contracts-DmShvHR7.mjs';
|
|
3
|
+
export { g as Assets, h as ChainflipIds, i as ChainflipNetworks, f as Chains, U as UncheckedAssetAndChain, j as getChainflipId } from './contracts-DmShvHR7.mjs';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
6
6
|
declare const ccmParamsSchema: z.ZodObject<{
|
|
7
|
-
gasBudget: z.ZodString
|
|
7
|
+
gasBudget: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `0x${string}`, string>]>, `0x${string}`, string>;
|
|
8
8
|
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
9
|
+
cfParameters: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>>;
|
|
9
10
|
}, "strip", z.ZodTypeAny, {
|
|
10
11
|
message: `0x${string}`;
|
|
11
|
-
gasBudget: string
|
|
12
|
+
gasBudget: `0x${string}`;
|
|
13
|
+
cfParameters?: `0x${string}` | undefined;
|
|
12
14
|
}, {
|
|
13
15
|
message: string;
|
|
14
16
|
gasBudget: string;
|
|
17
|
+
cfParameters?: string | undefined;
|
|
15
18
|
}>;
|
|
16
|
-
type CcmParams = z.
|
|
19
|
+
type CcmParams = z.input<typeof ccmParamsSchema>;
|
|
17
20
|
declare const affiliateBroker: z.ZodEffects<z.ZodObject<{
|
|
18
21
|
account: z.ZodEffects<z.ZodString, string, string>;
|
|
19
22
|
commissionBps: z.ZodNumber;
|
package/dist/swap.d.ts
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import { Signer } from 'ethers';
|
|
2
|
-
import { A as AssetAndChain, C as Chain, a as Asset, I as InternalAsset, b as AssetOfChain, c as ChainflipNetwork, T as TransactionOptions, d as ChainAssetMap, e as ChainMap } from './contracts-
|
|
3
|
-
export { g as Assets, h as ChainflipIds, i as ChainflipNetworks, f as Chains, U as UncheckedAssetAndChain, j as getChainflipId } from './contracts-
|
|
2
|
+
import { A as AssetAndChain, C as Chain, a as Asset, I as InternalAsset, b as AssetOfChain, c as ChainflipNetwork, T as TransactionOptions, d as ChainAssetMap, e as ChainMap } from './contracts-DmShvHR7.js';
|
|
3
|
+
export { g as Assets, h as ChainflipIds, i as ChainflipNetworks, f as Chains, U as UncheckedAssetAndChain, j as getChainflipId } from './contracts-DmShvHR7.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
6
6
|
declare const ccmParamsSchema: z.ZodObject<{
|
|
7
|
-
gasBudget: z.ZodString
|
|
7
|
+
gasBudget: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodString, `0x${string}`, string>]>, `0x${string}`, string>;
|
|
8
8
|
message: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
9
|
+
cfParameters: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>>;
|
|
9
10
|
}, "strip", z.ZodTypeAny, {
|
|
10
11
|
message: `0x${string}`;
|
|
11
|
-
gasBudget: string
|
|
12
|
+
gasBudget: `0x${string}`;
|
|
13
|
+
cfParameters?: `0x${string}` | undefined;
|
|
12
14
|
}, {
|
|
13
15
|
message: string;
|
|
14
16
|
gasBudget: string;
|
|
17
|
+
cfParameters?: string | undefined;
|
|
15
18
|
}>;
|
|
16
|
-
type CcmParams = z.
|
|
19
|
+
type CcmParams = z.input<typeof ccmParamsSchema>;
|
|
17
20
|
declare const affiliateBroker: z.ZodEffects<z.ZodObject<{
|
|
18
21
|
account: z.ZodEffects<z.ZodString, string, string>;
|
|
19
22
|
commissionBps: z.ZodNumber;
|