@atomiqlabs/sdk 1.3.13 → 1.3.15
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/LICENSE +201 -201
- package/README.md +501 -501
- package/dist/MultichainSwapper.d.ts +46 -46
- package/dist/MultichainSwapper.js +83 -85
- package/dist/SmartChainAssets.d.ts +54 -54
- package/dist/SmartChainAssets.js +50 -50
- package/dist/chains/ChainInitializer.d.ts +13 -13
- package/dist/chains/ChainInitializer.js +2 -2
- package/dist/chains/solana/SolanaChainInitializer.d.ts +41 -41
- package/dist/chains/solana/SolanaChainInitializer.js +60 -60
- package/dist/chains/solana/SolanaChains.d.ts +14 -14
- package/dist/chains/solana/SolanaChains.js +18 -18
- package/dist/example/BrowserExample.d.ts +1 -1
- package/dist/example/BrowserExample.js +104 -104
- package/dist/example/NodeJSExample.d.ts +1 -1
- package/dist/example/NodeJSExample.js +104 -104
- package/dist/index.d.ts +4 -4
- package/dist/index.js +20 -20
- package/package.json +32 -32
- package/src/MultichainSwapper.ts +156 -158
- package/src/SmartChainAssets.ts +57 -57
- package/src/chains/ChainInitializer.ts +16 -16
- package/src/chains/solana/SolanaChainInitializer.ts +99 -99
- package/src/chains/solana/SolanaChains.ts +16 -16
- package/src/example/BrowserExample.ts +120 -120
- package/src/example/NodeJSExample.ts +120 -120
- package/src/index.ts +4 -4
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { BtcToken, MempoolApi, SCToken, Swapper, SwapperOptions } from "@atomiqlabs/sdk-lib";
|
|
2
|
-
import { SdkSolanaType } from "./chains/solana/SolanaChainInitializer";
|
|
3
|
-
import { SdkChain } from "./chains/ChainInitializer";
|
|
4
|
-
import * as BN from "bn.js";
|
|
5
|
-
import { IStorageManager, StorageObject } from "@atomiqlabs/base";
|
|
6
|
-
import { SwapperWithChain } from "@atomiqlabs/sdk-lib/dist/swaps/SwapperWithChain";
|
|
7
|
-
import { SwapperWithSigner } from "@atomiqlabs/sdk-lib/dist/swaps/SwapperWithSigner";
|
|
8
|
-
type Chains = {
|
|
9
|
-
"SOLANA": SdkSolanaType;
|
|
10
|
-
};
|
|
11
|
-
declare const Chains: {
|
|
12
|
-
[C in keyof Chains]: SdkChain<Chains[C]>;
|
|
13
|
-
};
|
|
14
|
-
export type SdkMultichain = {
|
|
15
|
-
[C in keyof Chains]: Chains[C]["ChainType"];
|
|
16
|
-
};
|
|
17
|
-
export type MultichainSwapperOptions = SwapperOptions & {
|
|
18
|
-
chains: {
|
|
19
|
-
[C in keyof Chains]: Chains[C]["Options"];
|
|
20
|
-
};
|
|
21
|
-
} & {
|
|
22
|
-
storageCtor?: <T extends StorageObject>(name: string) => IStorageManager<T>;
|
|
23
|
-
pricingFeeDifferencePPM?: BN;
|
|
24
|
-
mempoolApi?: MempoolApi;
|
|
25
|
-
};
|
|
26
|
-
export declare class MultichainSwapper extends Swapper<SdkMultichain> {
|
|
27
|
-
constructor(options: MultichainSwapperOptions);
|
|
28
|
-
}
|
|
29
|
-
export declare const Tokens: {
|
|
30
|
-
[C in keyof Chains]: {
|
|
31
|
-
[T in keyof Chains[C]["Assets"]]: SCToken<C>;
|
|
32
|
-
};
|
|
33
|
-
} & {
|
|
34
|
-
BITCOIN: {
|
|
35
|
-
BTC: BtcToken<false>;
|
|
36
|
-
BTCLN: BtcToken<true>;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
export declare const TokenResolver: {
|
|
40
|
-
[C in keyof Chains]: {
|
|
41
|
-
getToken(address: string): SCToken<C>;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
export type SolanaSwapper = SwapperWithChain<SdkMultichain, "SOLANA">;
|
|
45
|
-
export type SolanaSwapperWithSigner = SwapperWithSigner<SdkMultichain, "SOLANA">;
|
|
46
|
-
export {};
|
|
1
|
+
import { BtcToken, MempoolApi, SCToken, Swapper, SwapperOptions } from "@atomiqlabs/sdk-lib";
|
|
2
|
+
import { SdkSolanaType } from "./chains/solana/SolanaChainInitializer";
|
|
3
|
+
import { SdkChain } from "./chains/ChainInitializer";
|
|
4
|
+
import * as BN from "bn.js";
|
|
5
|
+
import { IStorageManager, StorageObject } from "@atomiqlabs/base";
|
|
6
|
+
import { SwapperWithChain } from "@atomiqlabs/sdk-lib/dist/swaps/SwapperWithChain";
|
|
7
|
+
import { SwapperWithSigner } from "@atomiqlabs/sdk-lib/dist/swaps/SwapperWithSigner";
|
|
8
|
+
type Chains = {
|
|
9
|
+
"SOLANA": SdkSolanaType;
|
|
10
|
+
};
|
|
11
|
+
declare const Chains: {
|
|
12
|
+
[C in keyof Chains]: SdkChain<Chains[C]>;
|
|
13
|
+
};
|
|
14
|
+
export type SdkMultichain = {
|
|
15
|
+
[C in keyof Chains]: Chains[C]["ChainType"];
|
|
16
|
+
};
|
|
17
|
+
export type MultichainSwapperOptions = SwapperOptions & {
|
|
18
|
+
chains: {
|
|
19
|
+
[C in keyof Chains]: Chains[C]["Options"];
|
|
20
|
+
};
|
|
21
|
+
} & {
|
|
22
|
+
storageCtor?: <T extends StorageObject>(name: string) => IStorageManager<T>;
|
|
23
|
+
pricingFeeDifferencePPM?: BN;
|
|
24
|
+
mempoolApi?: MempoolApi;
|
|
25
|
+
};
|
|
26
|
+
export declare class MultichainSwapper extends Swapper<SdkMultichain> {
|
|
27
|
+
constructor(options: MultichainSwapperOptions);
|
|
28
|
+
}
|
|
29
|
+
export declare const Tokens: {
|
|
30
|
+
[C in keyof Chains]: {
|
|
31
|
+
[T in keyof Chains[C]["Assets"]]: SCToken<C>;
|
|
32
|
+
};
|
|
33
|
+
} & {
|
|
34
|
+
BITCOIN: {
|
|
35
|
+
BTC: BtcToken<false>;
|
|
36
|
+
BTCLN: BtcToken<true>;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export declare const TokenResolver: {
|
|
40
|
+
[C in keyof Chains]: {
|
|
41
|
+
getToken(address: string): SCToken<C>;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export type SolanaSwapper = SwapperWithChain<SdkMultichain, "SOLANA">;
|
|
45
|
+
export type SolanaSwapperWithSigner = SwapperWithSigner<SdkMultichain, "SOLANA">;
|
|
46
|
+
export {};
|
|
@@ -1,85 +1,83 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TokenResolver = exports.Tokens = exports.MultichainSwapper = void 0;
|
|
4
|
-
const sdk_lib_1 = require("@atomiqlabs/sdk-lib");
|
|
5
|
-
const Utils_1 = require("@atomiqlabs/sdk-lib/dist/utils/Utils");
|
|
6
|
-
const SolanaChainInitializer_1 = require("./chains/solana/SolanaChainInitializer");
|
|
7
|
-
const BN = require("bn.js");
|
|
8
|
-
const SmartChainAssets_1 = require("./SmartChainAssets");
|
|
9
|
-
const Chains = {
|
|
10
|
-
"SOLANA": SolanaChainInitializer_1.SdkSolana
|
|
11
|
-
};
|
|
12
|
-
class MultichainSwapper extends sdk_lib_1.Swapper {
|
|
13
|
-
constructor(options) {
|
|
14
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
15
|
-
(_a = options.bitcoinNetwork) !== null && _a !== void 0 ? _a : (options.bitcoinNetwork = sdk_lib_1.BitcoinNetwork.MAINNET);
|
|
16
|
-
(_b = options.storagePrefix) !== null && _b !== void 0 ? _b : (options.storagePrefix = "atomiqsdk-" + options.bitcoinNetwork);
|
|
17
|
-
(_c = options.storageCtor) !== null && _c !== void 0 ? _c : (options.storageCtor = (name) => new sdk_lib_1.IndexedDBStorageManager(name));
|
|
18
|
-
(_d = options.defaultTrustedIntermediaryUrl) !== null && _d !== void 0 ? _d : (options.defaultTrustedIntermediaryUrl = options.bitcoinNetwork === sdk_lib_1.BitcoinNetwork.MAINNET ?
|
|
19
|
-
"https://node3.gethopa.com:34100" :
|
|
20
|
-
"https://node3.gethopa.com:24100");
|
|
21
|
-
(_e = options.registryUrl) !== null && _e !== void 0 ? _e : (options.registryUrl = options.bitcoinNetwork === sdk_lib_1.BitcoinNetwork.MAINNET ?
|
|
22
|
-
"https://api.github.com/repos/adambor/SolLightning-registry/contents/registry-mainnet.json?ref=main" :
|
|
23
|
-
"https://api.github.com/repos/adambor/SolLightning-registry/contents/registry.json?ref=main");
|
|
24
|
-
const mempoolApi = (_f = options.mempoolApi) !== null && _f !== void 0 ? _f : new sdk_lib_1.MempoolApi(options.bitcoinNetwork === sdk_lib_1.BitcoinNetwork.TESTNET ?
|
|
25
|
-
[
|
|
26
|
-
"https://mempool.space/testnet/api/",
|
|
27
|
-
"https://mempool.fra.mempool.space/testnet/api/",
|
|
28
|
-
"https://mempool.va1.mempool.space/testnet/api/",
|
|
29
|
-
"https://mempool.tk7.mempool.space/testnet/api/"
|
|
30
|
-
] :
|
|
31
|
-
[
|
|
32
|
-
"https://mempool.space/api/",
|
|
33
|
-
"https://mempool.fra.mempool.space/api/",
|
|
34
|
-
"https://mempool.va1.mempool.space/api/",
|
|
35
|
-
"https://mempool.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
ticker
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
};
|
|
85
|
-
}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TokenResolver = exports.Tokens = exports.MultichainSwapper = void 0;
|
|
4
|
+
const sdk_lib_1 = require("@atomiqlabs/sdk-lib");
|
|
5
|
+
const Utils_1 = require("@atomiqlabs/sdk-lib/dist/utils/Utils");
|
|
6
|
+
const SolanaChainInitializer_1 = require("./chains/solana/SolanaChainInitializer");
|
|
7
|
+
const BN = require("bn.js");
|
|
8
|
+
const SmartChainAssets_1 = require("./SmartChainAssets");
|
|
9
|
+
const Chains = {
|
|
10
|
+
"SOLANA": SolanaChainInitializer_1.SdkSolana
|
|
11
|
+
};
|
|
12
|
+
class MultichainSwapper extends sdk_lib_1.Swapper {
|
|
13
|
+
constructor(options) {
|
|
14
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
15
|
+
(_a = options.bitcoinNetwork) !== null && _a !== void 0 ? _a : (options.bitcoinNetwork = sdk_lib_1.BitcoinNetwork.MAINNET);
|
|
16
|
+
(_b = options.storagePrefix) !== null && _b !== void 0 ? _b : (options.storagePrefix = "atomiqsdk-" + options.bitcoinNetwork);
|
|
17
|
+
(_c = options.storageCtor) !== null && _c !== void 0 ? _c : (options.storageCtor = (name) => new sdk_lib_1.IndexedDBStorageManager(name));
|
|
18
|
+
(_d = options.defaultTrustedIntermediaryUrl) !== null && _d !== void 0 ? _d : (options.defaultTrustedIntermediaryUrl = options.bitcoinNetwork === sdk_lib_1.BitcoinNetwork.MAINNET ?
|
|
19
|
+
"https://node3.gethopa.com:34100" :
|
|
20
|
+
"https://node3.gethopa.com:24100");
|
|
21
|
+
(_e = options.registryUrl) !== null && _e !== void 0 ? _e : (options.registryUrl = options.bitcoinNetwork === sdk_lib_1.BitcoinNetwork.MAINNET ?
|
|
22
|
+
"https://api.github.com/repos/adambor/SolLightning-registry/contents/registry-mainnet.json?ref=main" :
|
|
23
|
+
"https://api.github.com/repos/adambor/SolLightning-registry/contents/registry.json?ref=main");
|
|
24
|
+
const mempoolApi = (_f = options.mempoolApi) !== null && _f !== void 0 ? _f : new sdk_lib_1.MempoolApi(options.bitcoinNetwork === sdk_lib_1.BitcoinNetwork.TESTNET ?
|
|
25
|
+
[
|
|
26
|
+
"https://mempool.space/testnet/api/",
|
|
27
|
+
"https://mempool.fra.mempool.space/testnet/api/",
|
|
28
|
+
"https://mempool.va1.mempool.space/testnet/api/",
|
|
29
|
+
"https://mempool.tk7.mempool.space/testnet/api/"
|
|
30
|
+
] :
|
|
31
|
+
[
|
|
32
|
+
"https://mempool.space/api/",
|
|
33
|
+
"https://mempool.fra.mempool.space/api/",
|
|
34
|
+
"https://mempool.va1.mempool.space/api/",
|
|
35
|
+
"https://mempool.tk7.mempool.space/api/"
|
|
36
|
+
]);
|
|
37
|
+
const bitcoinRpc = new sdk_lib_1.MempoolBitcoinRpc(mempoolApi);
|
|
38
|
+
const pricingAssets = [];
|
|
39
|
+
Object.keys(SmartChainAssets_1.SmartChainAssets).forEach((ticker) => {
|
|
40
|
+
const chains = {};
|
|
41
|
+
for (let chainId in Chains) {
|
|
42
|
+
if (Chains[chainId].assets[ticker] != null)
|
|
43
|
+
chains[chainId] = Chains[chainId].assets[ticker];
|
|
44
|
+
}
|
|
45
|
+
const assetData = SmartChainAssets_1.SmartChainAssets[ticker];
|
|
46
|
+
pricingAssets.push(Object.assign(Object.assign({}, assetData.pricing), { chains,
|
|
47
|
+
ticker, name: assetData.name }));
|
|
48
|
+
});
|
|
49
|
+
const ctorChainData = (0, Utils_1.objectMap)(Chains, (value, key) => {
|
|
50
|
+
return value.getCtorData(options, bitcoinRpc, options.bitcoinNetwork);
|
|
51
|
+
});
|
|
52
|
+
super(bitcoinRpc, ctorChainData, sdk_lib_1.RedundantSwapPrice.createFromTokenMap((_g = options.pricingFeeDifferencePPM) !== null && _g !== void 0 ? _g : new BN(10000), pricingAssets), pricingAssets, options);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.MultichainSwapper = MultichainSwapper;
|
|
56
|
+
exports.Tokens = Object.assign(Object.assign({}, (0, Utils_1.objectMap)(Chains, (value, key) => {
|
|
57
|
+
return (0, Utils_1.objectMap)(value.assets, (assetData, ticker) => {
|
|
58
|
+
return {
|
|
59
|
+
chain: "SC",
|
|
60
|
+
chainId: value.chainIdentifier,
|
|
61
|
+
address: assetData.address,
|
|
62
|
+
name: SmartChainAssets_1.SmartChainAssets[ticker].name,
|
|
63
|
+
decimals: assetData.decimals,
|
|
64
|
+
ticker
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
})), { BITCOIN: sdk_lib_1.BitcoinTokens });
|
|
68
|
+
exports.TokenResolver = Object.assign({}, (0, Utils_1.objectMap)(Chains, (value, key) => {
|
|
69
|
+
const addressMap = {};
|
|
70
|
+
for (let ticker in value.assets) {
|
|
71
|
+
addressMap[value.assets[ticker].address] = {
|
|
72
|
+
chain: "SC",
|
|
73
|
+
chainId: value.chainIdentifier,
|
|
74
|
+
address: value.assets[ticker].address,
|
|
75
|
+
ticker,
|
|
76
|
+
name: SmartChainAssets_1.SmartChainAssets[ticker].name,
|
|
77
|
+
decimals: value.assets[ticker].decimals
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
getToken: (address) => addressMap[address]
|
|
82
|
+
};
|
|
83
|
+
}));
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
export declare const SmartChainAssets: {
|
|
2
|
-
readonly WBTC: {
|
|
3
|
-
readonly pricing: {
|
|
4
|
-
readonly binancePair: "WBTCBTC";
|
|
5
|
-
readonly okxPair: any;
|
|
6
|
-
readonly coinGeckoCoinId: "wrapped-bitcoin";
|
|
7
|
-
readonly coinPaprikaCoinId: "wbtc-wrapped-bitcoin";
|
|
8
|
-
};
|
|
9
|
-
readonly name: "Wrapped BTC (Wormhole)";
|
|
10
|
-
};
|
|
11
|
-
readonly USDC: {
|
|
12
|
-
readonly pricing: {
|
|
13
|
-
readonly binancePair: "!BTCUSDC";
|
|
14
|
-
readonly okxPair: "!BTC-USDC";
|
|
15
|
-
readonly coinGeckoCoinId: "usd-coin";
|
|
16
|
-
readonly coinPaprikaCoinId: "usdc-usd-coin";
|
|
17
|
-
};
|
|
18
|
-
readonly name: "USD Circle";
|
|
19
|
-
};
|
|
20
|
-
readonly USDT: {
|
|
21
|
-
readonly pricing: {
|
|
22
|
-
readonly binancePair: "!BTCUSDT";
|
|
23
|
-
readonly okxPair: "!BTC-USDT";
|
|
24
|
-
readonly coinGeckoCoinId: "tether";
|
|
25
|
-
readonly coinPaprikaCoinId: "usdt-tether";
|
|
26
|
-
};
|
|
27
|
-
readonly name: "Tether USD";
|
|
28
|
-
};
|
|
29
|
-
readonly SOL: {
|
|
30
|
-
readonly pricing: {
|
|
31
|
-
readonly binancePair: "SOLBTC";
|
|
32
|
-
readonly okxPair: "SOL-BTC";
|
|
33
|
-
readonly coinGeckoCoinId: "solana";
|
|
34
|
-
readonly coinPaprikaCoinId: "sol-solana";
|
|
35
|
-
};
|
|
36
|
-
readonly name: "Solana";
|
|
37
|
-
};
|
|
38
|
-
readonly BONK: {
|
|
39
|
-
readonly pricing: {
|
|
40
|
-
readonly binancePair: "BONKUSDC;!BTCUSDC";
|
|
41
|
-
readonly okxPair: any;
|
|
42
|
-
readonly coinGeckoCoinId: "bonk";
|
|
43
|
-
readonly coinPaprikaCoinId: "bonk-bonk";
|
|
44
|
-
};
|
|
45
|
-
readonly name: "Bonk";
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
export type SmartChainAssetTickers = keyof typeof SmartChainAssets;
|
|
49
|
-
export type AssetData = {
|
|
50
|
-
[ticker in SmartChainAssetTickers]?: {
|
|
51
|
-
address: string;
|
|
52
|
-
decimals: number;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
1
|
+
export declare const SmartChainAssets: {
|
|
2
|
+
readonly WBTC: {
|
|
3
|
+
readonly pricing: {
|
|
4
|
+
readonly binancePair: "WBTCBTC";
|
|
5
|
+
readonly okxPair: any;
|
|
6
|
+
readonly coinGeckoCoinId: "wrapped-bitcoin";
|
|
7
|
+
readonly coinPaprikaCoinId: "wbtc-wrapped-bitcoin";
|
|
8
|
+
};
|
|
9
|
+
readonly name: "Wrapped BTC (Wormhole)";
|
|
10
|
+
};
|
|
11
|
+
readonly USDC: {
|
|
12
|
+
readonly pricing: {
|
|
13
|
+
readonly binancePair: "!BTCUSDC";
|
|
14
|
+
readonly okxPair: "!BTC-USDC";
|
|
15
|
+
readonly coinGeckoCoinId: "usd-coin";
|
|
16
|
+
readonly coinPaprikaCoinId: "usdc-usd-coin";
|
|
17
|
+
};
|
|
18
|
+
readonly name: "USD Circle";
|
|
19
|
+
};
|
|
20
|
+
readonly USDT: {
|
|
21
|
+
readonly pricing: {
|
|
22
|
+
readonly binancePair: "!BTCUSDT";
|
|
23
|
+
readonly okxPair: "!BTC-USDT";
|
|
24
|
+
readonly coinGeckoCoinId: "tether";
|
|
25
|
+
readonly coinPaprikaCoinId: "usdt-tether";
|
|
26
|
+
};
|
|
27
|
+
readonly name: "Tether USD";
|
|
28
|
+
};
|
|
29
|
+
readonly SOL: {
|
|
30
|
+
readonly pricing: {
|
|
31
|
+
readonly binancePair: "SOLBTC";
|
|
32
|
+
readonly okxPair: "SOL-BTC";
|
|
33
|
+
readonly coinGeckoCoinId: "solana";
|
|
34
|
+
readonly coinPaprikaCoinId: "sol-solana";
|
|
35
|
+
};
|
|
36
|
+
readonly name: "Solana";
|
|
37
|
+
};
|
|
38
|
+
readonly BONK: {
|
|
39
|
+
readonly pricing: {
|
|
40
|
+
readonly binancePair: "BONKUSDC;!BTCUSDC";
|
|
41
|
+
readonly okxPair: any;
|
|
42
|
+
readonly coinGeckoCoinId: "bonk";
|
|
43
|
+
readonly coinPaprikaCoinId: "bonk-bonk";
|
|
44
|
+
};
|
|
45
|
+
readonly name: "Bonk";
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export type SmartChainAssetTickers = keyof typeof SmartChainAssets;
|
|
49
|
+
export type AssetData = {
|
|
50
|
+
[ticker in SmartChainAssetTickers]?: {
|
|
51
|
+
address: string;
|
|
52
|
+
decimals: number;
|
|
53
|
+
};
|
|
54
|
+
};
|
package/dist/SmartChainAssets.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SmartChainAssets = void 0;
|
|
4
|
-
exports.SmartChainAssets = {
|
|
5
|
-
WBTC: {
|
|
6
|
-
pricing: {
|
|
7
|
-
binancePair: "WBTCBTC",
|
|
8
|
-
okxPair: null,
|
|
9
|
-
coinGeckoCoinId: "wrapped-bitcoin",
|
|
10
|
-
coinPaprikaCoinId: "wbtc-wrapped-bitcoin"
|
|
11
|
-
},
|
|
12
|
-
name: "Wrapped BTC (Wormhole)"
|
|
13
|
-
},
|
|
14
|
-
USDC: {
|
|
15
|
-
pricing: {
|
|
16
|
-
binancePair: "!BTCUSDC",
|
|
17
|
-
okxPair: "!BTC-USDC",
|
|
18
|
-
coinGeckoCoinId: "usd-coin",
|
|
19
|
-
coinPaprikaCoinId: "usdc-usd-coin"
|
|
20
|
-
},
|
|
21
|
-
name: "USD Circle"
|
|
22
|
-
},
|
|
23
|
-
USDT: {
|
|
24
|
-
pricing: {
|
|
25
|
-
binancePair: "!BTCUSDT",
|
|
26
|
-
okxPair: "!BTC-USDT",
|
|
27
|
-
coinGeckoCoinId: "tether",
|
|
28
|
-
coinPaprikaCoinId: "usdt-tether"
|
|
29
|
-
},
|
|
30
|
-
name: "Tether USD"
|
|
31
|
-
},
|
|
32
|
-
SOL: {
|
|
33
|
-
pricing: {
|
|
34
|
-
binancePair: "SOLBTC",
|
|
35
|
-
okxPair: "SOL-BTC",
|
|
36
|
-
coinGeckoCoinId: "solana",
|
|
37
|
-
coinPaprikaCoinId: "sol-solana"
|
|
38
|
-
},
|
|
39
|
-
name: "Solana"
|
|
40
|
-
},
|
|
41
|
-
BONK: {
|
|
42
|
-
pricing: {
|
|
43
|
-
binancePair: "BONKUSDC;!BTCUSDC",
|
|
44
|
-
okxPair: null,
|
|
45
|
-
coinGeckoCoinId: "bonk",
|
|
46
|
-
coinPaprikaCoinId: "bonk-bonk"
|
|
47
|
-
},
|
|
48
|
-
name: "Bonk"
|
|
49
|
-
}
|
|
50
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SmartChainAssets = void 0;
|
|
4
|
+
exports.SmartChainAssets = {
|
|
5
|
+
WBTC: {
|
|
6
|
+
pricing: {
|
|
7
|
+
binancePair: "WBTCBTC",
|
|
8
|
+
okxPair: null,
|
|
9
|
+
coinGeckoCoinId: "wrapped-bitcoin",
|
|
10
|
+
coinPaprikaCoinId: "wbtc-wrapped-bitcoin"
|
|
11
|
+
},
|
|
12
|
+
name: "Wrapped BTC (Wormhole)"
|
|
13
|
+
},
|
|
14
|
+
USDC: {
|
|
15
|
+
pricing: {
|
|
16
|
+
binancePair: "!BTCUSDC",
|
|
17
|
+
okxPair: "!BTC-USDC",
|
|
18
|
+
coinGeckoCoinId: "usd-coin",
|
|
19
|
+
coinPaprikaCoinId: "usdc-usd-coin"
|
|
20
|
+
},
|
|
21
|
+
name: "USD Circle"
|
|
22
|
+
},
|
|
23
|
+
USDT: {
|
|
24
|
+
pricing: {
|
|
25
|
+
binancePair: "!BTCUSDT",
|
|
26
|
+
okxPair: "!BTC-USDT",
|
|
27
|
+
coinGeckoCoinId: "tether",
|
|
28
|
+
coinPaprikaCoinId: "usdt-tether"
|
|
29
|
+
},
|
|
30
|
+
name: "Tether USD"
|
|
31
|
+
},
|
|
32
|
+
SOL: {
|
|
33
|
+
pricing: {
|
|
34
|
+
binancePair: "SOLBTC",
|
|
35
|
+
okxPair: "SOL-BTC",
|
|
36
|
+
coinGeckoCoinId: "solana",
|
|
37
|
+
coinPaprikaCoinId: "sol-solana"
|
|
38
|
+
},
|
|
39
|
+
name: "Solana"
|
|
40
|
+
},
|
|
41
|
+
BONK: {
|
|
42
|
+
pricing: {
|
|
43
|
+
binancePair: "BONKUSDC;!BTCUSDC",
|
|
44
|
+
okxPair: null,
|
|
45
|
+
coinGeckoCoinId: "bonk",
|
|
46
|
+
coinPaprikaCoinId: "bonk-bonk"
|
|
47
|
+
},
|
|
48
|
+
name: "Bonk"
|
|
49
|
+
}
|
|
50
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { BitcoinRpc, ChainType } from "@atomiqlabs/base";
|
|
2
|
-
import { BitcoinNetwork, CtorChainData, SwapperOptions } from "@atomiqlabs/sdk-lib";
|
|
3
|
-
import { AssetData } from "../SmartChainAssets";
|
|
4
|
-
export type SdkChainType = {
|
|
5
|
-
ChainType: ChainType;
|
|
6
|
-
Options: {};
|
|
7
|
-
Assets: AssetData;
|
|
8
|
-
};
|
|
9
|
-
export type SdkChain<T extends SdkChainType> = {
|
|
10
|
-
getCtorData: (options: SwapperOptions, bitcoinRpc: BitcoinRpc<any>, network: BitcoinNetwork) => CtorChainData<T["ChainType"]>;
|
|
11
|
-
assets: AssetData;
|
|
12
|
-
chainIdentifier: string;
|
|
13
|
-
};
|
|
1
|
+
import { BitcoinRpc, ChainType } from "@atomiqlabs/base";
|
|
2
|
+
import { BitcoinNetwork, CtorChainData, SwapperOptions } from "@atomiqlabs/sdk-lib";
|
|
3
|
+
import { AssetData } from "../SmartChainAssets";
|
|
4
|
+
export type SdkChainType = {
|
|
5
|
+
ChainType: ChainType;
|
|
6
|
+
Options: {};
|
|
7
|
+
Assets: AssetData;
|
|
8
|
+
};
|
|
9
|
+
export type SdkChain<T extends SdkChainType> = {
|
|
10
|
+
getCtorData: (options: SwapperOptions, bitcoinRpc: BitcoinRpc<any>, network: BitcoinNetwork) => CtorChainData<T["ChainType"]>;
|
|
11
|
+
assets: AssetData;
|
|
12
|
+
chainIdentifier: string;
|
|
13
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { SolanaChainType, SolanaFees, SolanaRetryPolicy, StoredDataAccount } from "@atomiqlabs/chain-solana";
|
|
2
|
-
import { IStorageManager } from "@atomiqlabs/base";
|
|
3
|
-
import { Connection } from "@solana/web3.js";
|
|
4
|
-
import { SdkChain } from "../ChainInitializer";
|
|
5
|
-
type SolanaSwapperOptions = {
|
|
6
|
-
rpcUrl: string | Connection;
|
|
7
|
-
dataAccountStorage?: IStorageManager<StoredDataAccount>;
|
|
8
|
-
retryPolicy?: SolanaRetryPolicy;
|
|
9
|
-
btcRelayContract?: string;
|
|
10
|
-
swapContract?: string;
|
|
11
|
-
fees?: SolanaFees;
|
|
12
|
-
};
|
|
13
|
-
declare const SolanaAssets: {
|
|
14
|
-
readonly WBTC: {
|
|
15
|
-
readonly address: "3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh";
|
|
16
|
-
readonly decimals: 8;
|
|
17
|
-
};
|
|
18
|
-
readonly USDC: {
|
|
19
|
-
readonly address: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
|
|
20
|
-
readonly decimals: 6;
|
|
21
|
-
};
|
|
22
|
-
readonly USDT: {
|
|
23
|
-
readonly address: "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB";
|
|
24
|
-
readonly decimals: 6;
|
|
25
|
-
};
|
|
26
|
-
readonly SOL: {
|
|
27
|
-
readonly address: "So11111111111111111111111111111111111111112";
|
|
28
|
-
readonly decimals: 9;
|
|
29
|
-
};
|
|
30
|
-
readonly BONK: {
|
|
31
|
-
readonly address: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263";
|
|
32
|
-
readonly decimals: 5;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export type SdkSolanaType = {
|
|
36
|
-
ChainType: SolanaChainType;
|
|
37
|
-
Options: SolanaSwapperOptions;
|
|
38
|
-
Assets: typeof SolanaAssets;
|
|
39
|
-
};
|
|
40
|
-
export declare const SdkSolana: SdkChain<SdkSolanaType>;
|
|
41
|
-
export {};
|
|
1
|
+
import { SolanaChainType, SolanaFees, SolanaRetryPolicy, StoredDataAccount } from "@atomiqlabs/chain-solana";
|
|
2
|
+
import { IStorageManager } from "@atomiqlabs/base";
|
|
3
|
+
import { Connection } from "@solana/web3.js";
|
|
4
|
+
import { SdkChain } from "../ChainInitializer";
|
|
5
|
+
type SolanaSwapperOptions = {
|
|
6
|
+
rpcUrl: string | Connection;
|
|
7
|
+
dataAccountStorage?: IStorageManager<StoredDataAccount>;
|
|
8
|
+
retryPolicy?: SolanaRetryPolicy;
|
|
9
|
+
btcRelayContract?: string;
|
|
10
|
+
swapContract?: string;
|
|
11
|
+
fees?: SolanaFees;
|
|
12
|
+
};
|
|
13
|
+
declare const SolanaAssets: {
|
|
14
|
+
readonly WBTC: {
|
|
15
|
+
readonly address: "3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh";
|
|
16
|
+
readonly decimals: 8;
|
|
17
|
+
};
|
|
18
|
+
readonly USDC: {
|
|
19
|
+
readonly address: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
|
|
20
|
+
readonly decimals: 6;
|
|
21
|
+
};
|
|
22
|
+
readonly USDT: {
|
|
23
|
+
readonly address: "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB";
|
|
24
|
+
readonly decimals: 6;
|
|
25
|
+
};
|
|
26
|
+
readonly SOL: {
|
|
27
|
+
readonly address: "So11111111111111111111111111111111111111112";
|
|
28
|
+
readonly decimals: 9;
|
|
29
|
+
};
|
|
30
|
+
readonly BONK: {
|
|
31
|
+
readonly address: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263";
|
|
32
|
+
readonly decimals: 5;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type SdkSolanaType = {
|
|
36
|
+
ChainType: SolanaChainType;
|
|
37
|
+
Options: SolanaSwapperOptions;
|
|
38
|
+
Assets: typeof SolanaAssets;
|
|
39
|
+
};
|
|
40
|
+
export declare const SdkSolana: SdkChain<SdkSolanaType>;
|
|
41
|
+
export {};
|