@cityofzion/bs-neo3 1.0.0 → 1.0.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/BSNeo3.d.ts +13 -13
- package/dist/BSNeo3.js +50 -45
- package/dist/BSNeo3Helper.d.ts +21 -0
- package/dist/BSNeo3Helper.js +74 -0
- package/dist/DoraBDSNeo3.d.ts +3 -2
- package/dist/DoraBDSNeo3.js +4 -7
- package/dist/DoraESNeo3.d.ts +2 -1
- package/dist/DoraESNeo3.js +10 -4
- package/dist/FlamingoEDSNeo3.d.ts +3 -3
- package/dist/FlamingoEDSNeo3.js +2 -3
- package/dist/GhostMarketNDSNeo3.d.ts +5 -4
- package/dist/GhostMarketNDSNeo3.js +51 -41
- package/dist/{LedgerServiceNeo3.d.ts → NeonDappKitLedgerServiceNeo3.d.ts} +1 -1
- package/dist/{LedgerServiceNeo3.js → NeonDappKitLedgerServiceNeo3.js} +3 -3
- package/dist/RpcBDSNeo3.d.ts +3 -2
- package/dist/RpcBDSNeo3.js +7 -4
- package/dist/RpcNDSNeo3.d.ts +2 -1
- package/dist/flamingo-swap/FlamingoSwapControllerService.d.ts +1 -37
- package/dist/flamingo-swap/FlamingoSwapControllerService.js +183 -225
- package/dist/flamingo-swap/FlamingoSwapHelper.d.ts +14 -1
- package/dist/flamingo-swap/FlamingoSwapHelper.js +57 -6
- package/dist/flamingo-swap/FlamingoSwapNeonDappKitInvocationBuilder.d.ts +1 -1
- package/dist/flamingo-swap/FlamingoSwapNeonDappKitInvocationBuilder.js +7 -9
- package/dist/index.d.ts +3 -4
- package/dist/index.js +3 -4
- package/package.json +2 -2
- package/dist/constants.d.ts +0 -21
- package/dist/constants.js +0 -74
- package/dist/flamingo-swap/FlamingoSwapError.d.ts +0 -12
- package/dist/flamingo-swap/FlamingoSwapError.js +0 -28
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
+
};
|
|
2
7
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
8
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
9
|
};
|
|
10
|
+
var _a, _FlamingoSwapHelper_SWAP_SCRIPT_HASHES_BY_NETWORK_ID, _FlamingoSwapHelper_BNEO_TOKEN_BY_NETWORK_ID;
|
|
5
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
12
|
exports.FlamingoSwapHelper = void 0;
|
|
7
13
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
8
|
-
const constants_1 = require("../constants");
|
|
9
14
|
class FlamingoSwapHelper {
|
|
15
|
+
static getSwapScriptHashes(network) {
|
|
16
|
+
const hashes = __classPrivateFieldGet(this, _a, "f", _FlamingoSwapHelper_SWAP_SCRIPT_HASHES_BY_NETWORK_ID)[network.id];
|
|
17
|
+
if (!hashes)
|
|
18
|
+
throw new Error('Unsupported network');
|
|
19
|
+
return hashes;
|
|
20
|
+
}
|
|
21
|
+
static getBneoToken(network) {
|
|
22
|
+
const token = __classPrivateFieldGet(this, _a, "f", _FlamingoSwapHelper_BNEO_TOKEN_BY_NETWORK_ID)[network.id];
|
|
23
|
+
if (!token)
|
|
24
|
+
throw new Error('Unsupported network');
|
|
25
|
+
return token;
|
|
26
|
+
}
|
|
10
27
|
static getSwapFields(params) {
|
|
11
28
|
const reservesToUseBn = new bignumber_js_1.default(params.reservesToUse);
|
|
12
29
|
const reservesToReceiveBn = new bignumber_js_1.default(params.reservesToReceive);
|
|
@@ -78,14 +95,12 @@ class FlamingoSwapHelper {
|
|
|
78
95
|
};
|
|
79
96
|
}
|
|
80
97
|
static overrideToken(network, token) {
|
|
81
|
-
const
|
|
82
|
-
const isNeoToken = this.normalizeHash(token.hash) === this.normalizeHash(
|
|
98
|
+
const scriptHashes = this.getSwapScriptHashes(network);
|
|
99
|
+
const isNeoToken = this.normalizeHash(token.hash) === this.normalizeHash(scriptHashes.neo);
|
|
83
100
|
if (!isNeoToken) {
|
|
84
101
|
return token;
|
|
85
102
|
}
|
|
86
|
-
const bneoToken =
|
|
87
|
-
if (!bneoToken)
|
|
88
|
-
throw new Error('Bneo token not found');
|
|
103
|
+
const bneoToken = this.getBneoToken(network);
|
|
89
104
|
return bneoToken;
|
|
90
105
|
}
|
|
91
106
|
static createTradeData({ amountToUse, amountToReceive, route }) {
|
|
@@ -113,8 +128,44 @@ class FlamingoSwapHelper {
|
|
|
113
128
|
}
|
|
114
129
|
}
|
|
115
130
|
exports.FlamingoSwapHelper = FlamingoSwapHelper;
|
|
131
|
+
_a = FlamingoSwapHelper;
|
|
116
132
|
FlamingoSwapHelper.BN_0 = new bignumber_js_1.default(0);
|
|
117
133
|
FlamingoSwapHelper.BN_1 = new bignumber_js_1.default(1);
|
|
118
134
|
FlamingoSwapHelper.BN_997 = new bignumber_js_1.default(997);
|
|
119
135
|
FlamingoSwapHelper.BN_1000 = new bignumber_js_1.default(1000);
|
|
120
136
|
FlamingoSwapHelper.FEE_RATE = new bignumber_js_1.default(0.003);
|
|
137
|
+
FlamingoSwapHelper.GAS_PER_NEO = 0.001;
|
|
138
|
+
_FlamingoSwapHelper_SWAP_SCRIPT_HASHES_BY_NETWORK_ID = { value: {
|
|
139
|
+
mainnet: {
|
|
140
|
+
flamingoSwapRouter: '0xf970f4ccecd765b63732b821775dc38c25d74f23',
|
|
141
|
+
flamingoPairWhiteList: '0xfb75a5314069b56e136713d38477f647a13991b4',
|
|
142
|
+
flamingoFactory: '0xca2d20610d7982ebe0bed124ee7e9b2d580a6efc',
|
|
143
|
+
gas: '0xd2a4cff31913016155e38e474a2c06d08be276cf',
|
|
144
|
+
neo: '0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5',
|
|
145
|
+
bneo: '0x48c40d4666f93408be1bef038b6722404d9a4c2a',
|
|
146
|
+
flpBneoGas: '0x3244fcadcccff190c329f7b3083e4da2af60fbce',
|
|
147
|
+
},
|
|
148
|
+
testnet: {
|
|
149
|
+
flamingoSwapRouter: '0x6f0910fa26290f4a423930c8f833395790c71705',
|
|
150
|
+
flamingoPairWhiteList: '0xfb75a5314069b56e136713d38477f647a13991b4',
|
|
151
|
+
flamingoFactory: '0xca2d20610d7982ebe0bed124ee7e9b2d580a6efc',
|
|
152
|
+
gas: '0xd2a4cff31913016155e38e474a2c06d08be276cf',
|
|
153
|
+
neo: '0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5',
|
|
154
|
+
bneo: '0x85deac50febfd93988d3f391dea54e8289e43e9e',
|
|
155
|
+
flpBneoGas: '0x3244fcadcccff190c329f7b3083e4da2af60fbce',
|
|
156
|
+
},
|
|
157
|
+
} };
|
|
158
|
+
_FlamingoSwapHelper_BNEO_TOKEN_BY_NETWORK_ID = { value: {
|
|
159
|
+
mainnet: {
|
|
160
|
+
symbol: 'bNEO',
|
|
161
|
+
hash: '0x48c40d4666f93408be1bef038b6722404d9a4c2a',
|
|
162
|
+
decimals: 8,
|
|
163
|
+
name: 'BurgerNEO',
|
|
164
|
+
},
|
|
165
|
+
testnet: {
|
|
166
|
+
symbol: 'bNEO',
|
|
167
|
+
hash: '0x85deac50febfd93988d3f391dea54e8289e43e9e',
|
|
168
|
+
decimals: 8,
|
|
169
|
+
name: 'BurgerNEO',
|
|
170
|
+
},
|
|
171
|
+
} };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ContractInvocationMulti } from '@cityofzion/neon-dappkit-types';
|
|
2
|
-
import { AvailableNetworkIds } from '../constants';
|
|
3
2
|
import { Network, SwapControllerServiceSwapToUseArgs, SwapControllerServiceSwapToReceiveArgs } from '@cityofzion/blockchain-service';
|
|
3
|
+
import { AvailableNetworkIds } from '../BSNeo3Helper';
|
|
4
4
|
type GetReservesArgs = {
|
|
5
5
|
network: Network<AvailableNetworkIds>;
|
|
6
6
|
tokenToReceiveScriptHash: string;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlamingoSwapNeonDappKitInvocationBuilder = void 0;
|
|
4
|
-
const constants_1 = require("../constants");
|
|
5
4
|
const neon_core_1 = require("@cityofzion/neon-core");
|
|
6
5
|
const FlamingoSwapHelper_1 = require("./FlamingoSwapHelper");
|
|
7
6
|
class FlamingoSwapNeonDappKitInvocationBuilder {
|
|
@@ -11,11 +10,11 @@ class FlamingoSwapNeonDappKitInvocationBuilder {
|
|
|
11
10
|
: this.swapTokenToUseForTokenToReceiveInvocation(data);
|
|
12
11
|
}
|
|
13
12
|
static getReservesInvocation({ network, tokenToReceiveScriptHash, tokenToUseScriptHash, }) {
|
|
14
|
-
const
|
|
13
|
+
const scriptHashes = FlamingoSwapHelper_1.FlamingoSwapHelper.getSwapScriptHashes(network);
|
|
15
14
|
return {
|
|
16
15
|
invocations: [
|
|
17
16
|
{
|
|
18
|
-
scriptHash: flamingoSwapRouter,
|
|
17
|
+
scriptHash: scriptHashes.flamingoSwapRouter,
|
|
19
18
|
operation: 'getReserves',
|
|
20
19
|
args: [
|
|
21
20
|
{
|
|
@@ -39,7 +38,7 @@ class FlamingoSwapNeonDappKitInvocationBuilder {
|
|
|
39
38
|
static swapTokenToReceiveForTokenToUseInvocation({ address, amountToReceive, maximumSelling, tokenToReceive, tokenToUse, deadline, network, }) {
|
|
40
39
|
const invocations = [];
|
|
41
40
|
const allowedContracts = [];
|
|
42
|
-
const scriptHashes =
|
|
41
|
+
const scriptHashes = FlamingoSwapHelper_1.FlamingoSwapHelper.getSwapScriptHashes(network);
|
|
43
42
|
const tokenToReceiveOverrode = FlamingoSwapHelper_1.FlamingoSwapHelper.overrideToken(network, tokenToReceive);
|
|
44
43
|
const amountToReceiveFormatted = neon_core_1.u.BigInteger.fromDecimal(Number(amountToReceive), tokenToReceiveOverrode.decimals).toString();
|
|
45
44
|
const maximumSellingFormatted = neon_core_1.u.BigInteger.fromDecimal(Number(maximumSelling), tokenToUse.decimals).toString();
|
|
@@ -80,7 +79,7 @@ class FlamingoSwapNeonDappKitInvocationBuilder {
|
|
|
80
79
|
});
|
|
81
80
|
const isNeoSwapped = tokenToReceive.hash === scriptHashes.neo;
|
|
82
81
|
if (isNeoSwapped) {
|
|
83
|
-
const amountToUseInTransferFormatted = neon_core_1.u.BigInteger.fromNumber(Number(amountToReceiveFormatted) *
|
|
82
|
+
const amountToUseInTransferFormatted = neon_core_1.u.BigInteger.fromNumber(Number(amountToReceiveFormatted) * FlamingoSwapHelper_1.FlamingoSwapHelper.GAS_PER_NEO).toString();
|
|
84
83
|
const transferContractInvocation = this.transferContractInvocation({
|
|
85
84
|
address,
|
|
86
85
|
amountToUse: amountToUseInTransferFormatted,
|
|
@@ -104,7 +103,7 @@ class FlamingoSwapNeonDappKitInvocationBuilder {
|
|
|
104
103
|
static swapTokenToUseForTokenToReceiveInvocation({ address, amountToUse, deadline, tokenToReceive, tokenToUse, minimumReceived, network, }) {
|
|
105
104
|
const invocations = [];
|
|
106
105
|
const allowedContracts = [];
|
|
107
|
-
const scriptHashes =
|
|
106
|
+
const scriptHashes = FlamingoSwapHelper_1.FlamingoSwapHelper.getSwapScriptHashes(network);
|
|
108
107
|
const isNeoSwapped = tokenToUse.hash === scriptHashes.neo;
|
|
109
108
|
if (isNeoSwapped) {
|
|
110
109
|
const transferContractInvocation = this.transferContractInvocation({
|
|
@@ -202,9 +201,8 @@ class FlamingoSwapNeonDappKitInvocationBuilder {
|
|
|
202
201
|
return [scriptHashes.gas, scriptHashes.flpBneoGas, scriptHashes.bneo];
|
|
203
202
|
}
|
|
204
203
|
static overrideScriptHash(network, scriptHash) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
: scriptHash;
|
|
204
|
+
const swapScriptHashes = FlamingoSwapHelper_1.FlamingoSwapHelper.getSwapScriptHashes(network);
|
|
205
|
+
return scriptHash === swapScriptHashes.neo ? swapScriptHashes.bneo : scriptHash;
|
|
208
206
|
}
|
|
209
207
|
}
|
|
210
208
|
exports.FlamingoSwapNeonDappKitInvocationBuilder = FlamingoSwapNeonDappKitInvocationBuilder;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
export * from './BSNeo3';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './BSNeo3Helper';
|
|
3
3
|
export * from './DoraBDSNeo3';
|
|
4
|
+
export * from './RpcBDSNeo3';
|
|
4
5
|
export * from './DoraESNeo3';
|
|
5
6
|
export * from './FlamingoEDSNeo3';
|
|
6
7
|
export * from './GhostMarketNDSNeo3';
|
|
7
|
-
export * from './LedgerServiceNeo3';
|
|
8
|
-
export * from './RpcBDSNeo3';
|
|
9
8
|
export * from './RpcNDSNeo3';
|
|
9
|
+
export * from './NeonDappKitLedgerServiceNeo3';
|
|
10
10
|
export * from './flamingo-swap/FlamingoSwapControllerService';
|
|
11
|
-
export * from './flamingo-swap/FlamingoSwapError';
|
|
12
11
|
export * from './flamingo-swap/FlamingoSwapHelper';
|
|
13
12
|
export * from './flamingo-swap/FlamingoSwapNeonDappKitInvocationBuilder';
|
package/dist/index.js
CHANGED
|
@@ -15,15 +15,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./BSNeo3"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./BSNeo3Helper"), exports);
|
|
19
19
|
__exportStar(require("./DoraBDSNeo3"), exports);
|
|
20
|
+
__exportStar(require("./RpcBDSNeo3"), exports);
|
|
20
21
|
__exportStar(require("./DoraESNeo3"), exports);
|
|
21
22
|
__exportStar(require("./FlamingoEDSNeo3"), exports);
|
|
22
23
|
__exportStar(require("./GhostMarketNDSNeo3"), exports);
|
|
23
|
-
__exportStar(require("./LedgerServiceNeo3"), exports);
|
|
24
|
-
__exportStar(require("./RpcBDSNeo3"), exports);
|
|
25
24
|
__exportStar(require("./RpcNDSNeo3"), exports);
|
|
25
|
+
__exportStar(require("./NeonDappKitLedgerServiceNeo3"), exports);
|
|
26
26
|
__exportStar(require("./flamingo-swap/FlamingoSwapControllerService"), exports);
|
|
27
|
-
__exportStar(require("./flamingo-swap/FlamingoSwapError"), exports);
|
|
28
27
|
__exportStar(require("./flamingo-swap/FlamingoSwapHelper"), exports);
|
|
29
28
|
__exportStar(require("./flamingo-swap/FlamingoSwapNeonDappKitInvocationBuilder"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cityofzion/bs-neo3",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"repository": "https://github.com/CityOfZion/blockchain-services",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@cityofzion/neon-dappkit": "0.4.1",
|
|
20
20
|
"bignumber.js": "~9.1.2",
|
|
21
21
|
"isomorphic-ws": "~5.0.0",
|
|
22
|
-
"@cityofzion/blockchain-service": "1.0.
|
|
22
|
+
"@cityofzion/blockchain-service": "1.0.1",
|
|
23
23
|
"@cityofzion/bs-asteroid-sdk": "0.9.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
package/dist/constants.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Token } from '@cityofzion/blockchain-service';
|
|
2
|
-
export type AvailableNetworkIds = 'mainnet' | 'testnet' | 'custom';
|
|
3
|
-
export declare const TOKENS: Record<AvailableNetworkIds, Token[]>;
|
|
4
|
-
export declare const BLOCKCHAIN_WSS_URL = "wss://rpc10.n3.nspcc.ru:10331/ws";
|
|
5
|
-
export declare const NEO_NS_HASH = "0x50ac1c37690cc2cfc594472833cf57505d5f46de";
|
|
6
|
-
export declare const GAS_PER_NEO = 0.001;
|
|
7
|
-
export declare const GHOSTMARKET_URL_BY_NETWORK_TYPE: Partial<Record<AvailableNetworkIds, string>>;
|
|
8
|
-
export declare const GHOSTMARKET_CHAIN_BY_NETWORK_TYPE: Partial<Record<AvailableNetworkIds, string>>;
|
|
9
|
-
export declare const DERIVATION_PATH = "m/44'/888'/0'/0/?";
|
|
10
|
-
export declare const RPC_LIST_BY_NETWORK_TYPE: Record<AvailableNetworkIds, string[]>;
|
|
11
|
-
export declare const DEFAULT_URL_BY_NETWORK_TYPE: Record<AvailableNetworkIds, string>;
|
|
12
|
-
export type SwapScriptHashes = {
|
|
13
|
-
flamingoSwapRouter: string;
|
|
14
|
-
flamingoPairWhiteList: string;
|
|
15
|
-
flamingoFactory: string;
|
|
16
|
-
neo: string;
|
|
17
|
-
gas: string;
|
|
18
|
-
bneo: string;
|
|
19
|
-
flpBneoGas: string;
|
|
20
|
-
};
|
|
21
|
-
export declare const SWAP_SCRIPT_HASHES_BY_NETWORK_TYPE: Partial<Record<AvailableNetworkIds, SwapScriptHashes>>;
|
package/dist/constants.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SWAP_SCRIPT_HASHES_BY_NETWORK_TYPE = exports.DEFAULT_URL_BY_NETWORK_TYPE = exports.RPC_LIST_BY_NETWORK_TYPE = exports.DERIVATION_PATH = exports.GHOSTMARKET_CHAIN_BY_NETWORK_TYPE = exports.GHOSTMARKET_URL_BY_NETWORK_TYPE = exports.GAS_PER_NEO = exports.NEO_NS_HASH = exports.BLOCKCHAIN_WSS_URL = exports.TOKENS = void 0;
|
|
7
|
-
const common_json_1 = __importDefault(require("./assets/tokens/common.json"));
|
|
8
|
-
const mainnet_json_1 = __importDefault(require("./assets/tokens/mainnet.json"));
|
|
9
|
-
exports.TOKENS = {
|
|
10
|
-
mainnet: [...common_json_1.default, ...mainnet_json_1.default],
|
|
11
|
-
testnet: common_json_1.default,
|
|
12
|
-
custom: common_json_1.default,
|
|
13
|
-
};
|
|
14
|
-
exports.BLOCKCHAIN_WSS_URL = 'wss://rpc10.n3.nspcc.ru:10331/ws';
|
|
15
|
-
exports.NEO_NS_HASH = '0x50ac1c37690cc2cfc594472833cf57505d5f46de';
|
|
16
|
-
exports.GAS_PER_NEO = 0.001;
|
|
17
|
-
exports.GHOSTMARKET_URL_BY_NETWORK_TYPE = {
|
|
18
|
-
mainnet: 'https://api.ghostmarket.io/api/v2',
|
|
19
|
-
testnet: 'https://api-testnet.ghostmarket.io/api/v2',
|
|
20
|
-
};
|
|
21
|
-
exports.GHOSTMARKET_CHAIN_BY_NETWORK_TYPE = {
|
|
22
|
-
mainnet: 'n3',
|
|
23
|
-
testnet: 'n3t',
|
|
24
|
-
};
|
|
25
|
-
exports.DERIVATION_PATH = "m/44'/888'/0'/0/?";
|
|
26
|
-
exports.RPC_LIST_BY_NETWORK_TYPE = {
|
|
27
|
-
mainnet: [
|
|
28
|
-
'https://mainnet1.neo.coz.io:443',
|
|
29
|
-
'https://mainnet4.neo.coz.io:443',
|
|
30
|
-
'http://seed1.neo.org:10332',
|
|
31
|
-
'http://seed2.neo.org:10332',
|
|
32
|
-
'https://mainnet2.neo.coz.io:443',
|
|
33
|
-
'https://mainnet5.neo.coz.io:443',
|
|
34
|
-
'https://mainnet3.neo.coz.io:443',
|
|
35
|
-
'https://rpc10.n3.nspcc.ru:10331',
|
|
36
|
-
'https://neo1-nodes.ghostmarket.io:443',
|
|
37
|
-
],
|
|
38
|
-
testnet: [
|
|
39
|
-
'https://testnet1.neo.coz.io:443',
|
|
40
|
-
'https://testnet2.neo.coz.io:443',
|
|
41
|
-
'https://rpc.t5.n3.nspcc.ru:20331',
|
|
42
|
-
'http://seed1t5.neo.org:20332',
|
|
43
|
-
'http://seed2t5.neo.org:20332',
|
|
44
|
-
'http://seed3t5.neo.org:20332',
|
|
45
|
-
'http://seed4t5.neo.org:20332',
|
|
46
|
-
'http://seed5t5.neo.org:20332',
|
|
47
|
-
],
|
|
48
|
-
custom: ['http://127.0.0.1:50012'],
|
|
49
|
-
};
|
|
50
|
-
exports.DEFAULT_URL_BY_NETWORK_TYPE = {
|
|
51
|
-
mainnet: exports.RPC_LIST_BY_NETWORK_TYPE.mainnet[0],
|
|
52
|
-
testnet: exports.RPC_LIST_BY_NETWORK_TYPE.testnet[0],
|
|
53
|
-
custom: exports.RPC_LIST_BY_NETWORK_TYPE.custom[0],
|
|
54
|
-
};
|
|
55
|
-
exports.SWAP_SCRIPT_HASHES_BY_NETWORK_TYPE = {
|
|
56
|
-
mainnet: {
|
|
57
|
-
flamingoSwapRouter: '0xf970f4ccecd765b63732b821775dc38c25d74f23',
|
|
58
|
-
flamingoPairWhiteList: '0xfb75a5314069b56e136713d38477f647a13991b4',
|
|
59
|
-
flamingoFactory: '0xca2d20610d7982ebe0bed124ee7e9b2d580a6efc',
|
|
60
|
-
gas: '0xd2a4cff31913016155e38e474a2c06d08be276cf',
|
|
61
|
-
neo: '0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5',
|
|
62
|
-
bneo: '0x48c40d4666f93408be1bef038b6722404d9a4c2a',
|
|
63
|
-
flpBneoGas: '0x3244fcadcccff190c329f7b3083e4da2af60fbce',
|
|
64
|
-
},
|
|
65
|
-
testnet: {
|
|
66
|
-
flamingoSwapRouter: '0x6f0910fa26290f4a423930c8f833395790c71705',
|
|
67
|
-
flamingoPairWhiteList: '0xfb75a5314069b56e136713d38477f647a13991b4',
|
|
68
|
-
flamingoFactory: '0xca2d20610d7982ebe0bed124ee7e9b2d580a6efc',
|
|
69
|
-
gas: '0xd2a4cff31913016155e38e474a2c06d08be276cf',
|
|
70
|
-
neo: '0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5',
|
|
71
|
-
bneo: '0x85deac50febfd93988d3f391dea54e8289e43e9e',
|
|
72
|
-
flpBneoGas: '0x3244fcadcccff190c329f7b3083e4da2af60fbce',
|
|
73
|
-
},
|
|
74
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare class FlamingoSwapError extends Error {
|
|
2
|
-
constructor(message: string);
|
|
3
|
-
}
|
|
4
|
-
export declare class FlamingoSwapMissingParametersError extends FlamingoSwapError {
|
|
5
|
-
constructor(parameter: string);
|
|
6
|
-
}
|
|
7
|
-
export declare class CustomNetworkNotSupportedError extends FlamingoSwapError {
|
|
8
|
-
constructor();
|
|
9
|
-
}
|
|
10
|
-
export declare class FlamingoInvalidReservesResponseError extends FlamingoSwapError {
|
|
11
|
-
constructor();
|
|
12
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FlamingoInvalidReservesResponseError = exports.CustomNetworkNotSupportedError = exports.FlamingoSwapMissingParametersError = exports.FlamingoSwapError = void 0;
|
|
4
|
-
class FlamingoSwapError extends Error {
|
|
5
|
-
constructor(message) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'FlamingoSwapError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.FlamingoSwapError = FlamingoSwapError;
|
|
11
|
-
class FlamingoSwapMissingParametersError extends FlamingoSwapError {
|
|
12
|
-
constructor(parameter) {
|
|
13
|
-
super(`Missing parameter: ${parameter} for swap invocation`);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.FlamingoSwapMissingParametersError = FlamingoSwapMissingParametersError;
|
|
17
|
-
class CustomNetworkNotSupportedError extends FlamingoSwapError {
|
|
18
|
-
constructor() {
|
|
19
|
-
super('Custom network is not supported');
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.CustomNetworkNotSupportedError = CustomNetworkNotSupportedError;
|
|
23
|
-
class FlamingoInvalidReservesResponseError extends FlamingoSwapError {
|
|
24
|
-
constructor() {
|
|
25
|
-
super('Invalid reserves response');
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.FlamingoInvalidReservesResponseError = FlamingoInvalidReservesResponseError;
|