@cityofzion/bs-neo3 1.3.0 → 1.3.1
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/constants/FlamingoSwapConstants.js +0 -150
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/services/swap/FlamingoSwapServiceNeo3.d.ts +2 -2
- package/dist/services/swap/FlamingoSwapServiceNeo3.js +2 -2
- package/dist/services/swap/handlers/FlamingoSwapRouteHandler.js +9 -9
- package/package.json +2 -2
|
@@ -25,12 +25,6 @@ FlamingoSwapConstants.TESTNET_FLAMINGO_SWAP_TOKENS = {
|
|
|
25
25
|
hash: '0x5b53998b399d10cd25727269e865acc785ef5c1a',
|
|
26
26
|
name: 'FLM',
|
|
27
27
|
},
|
|
28
|
-
FLUND: {
|
|
29
|
-
symbol: 'FLUND',
|
|
30
|
-
decimals: 8,
|
|
31
|
-
hash: '0x3d0085f442ead25ff3a7507c8eaa27cc8623a6be',
|
|
32
|
-
name: 'FLUND',
|
|
33
|
-
},
|
|
34
28
|
TIPS: {
|
|
35
29
|
symbol: 'TIPS',
|
|
36
30
|
decimals: 8,
|
|
@@ -139,81 +133,6 @@ FlamingoSwapConstants.TESTNET_FLAMINGO_SWAP_TOKENS = {
|
|
|
139
133
|
hash: '0x1883231a31dc912805cc08a281d4c268c4cac345',
|
|
140
134
|
name: 'fBNB',
|
|
141
135
|
},
|
|
142
|
-
// ============ Ethereum Assets ============ //
|
|
143
|
-
WETH: {
|
|
144
|
-
symbol: 'WETH',
|
|
145
|
-
decimals: 18,
|
|
146
|
-
hash: '0xb603cea165119701b58d56d10d2060fbfb3efad8',
|
|
147
|
-
name: 'WETH',
|
|
148
|
-
},
|
|
149
|
-
WBTC: {
|
|
150
|
-
symbol: 'WBTC',
|
|
151
|
-
decimals: 8,
|
|
152
|
-
hash: '0x557563dc4ed3fd256eba55b9622f53331ab97c2f',
|
|
153
|
-
name: 'WBTC',
|
|
154
|
-
},
|
|
155
|
-
USDT: {
|
|
156
|
-
symbol: 'USDT',
|
|
157
|
-
decimals: 6,
|
|
158
|
-
hash: '0xad3f96ae966ad60347f31845b7e4b333104c52fb',
|
|
159
|
-
name: 'USDT',
|
|
160
|
-
},
|
|
161
|
-
xWETH: {
|
|
162
|
-
symbol: 'xWETH',
|
|
163
|
-
decimals: 18,
|
|
164
|
-
hash: '0xd38fc89febb12e5d32faa72e07d486a268b9c63a',
|
|
165
|
-
name: 'xWETH',
|
|
166
|
-
},
|
|
167
|
-
xWBTC: {
|
|
168
|
-
symbol: 'xWBTC',
|
|
169
|
-
decimals: 8,
|
|
170
|
-
hash: '0x447b931cc604a30dc16c49002f35a7aab7888b78',
|
|
171
|
-
name: 'xWBTC',
|
|
172
|
-
},
|
|
173
|
-
xUSDT: {
|
|
174
|
-
symbol: 'xUSDT',
|
|
175
|
-
decimals: 6,
|
|
176
|
-
hash: '0xf15b5430321f4e51f5f534cedada7fbb78fa6680',
|
|
177
|
-
name: 'xUSDT',
|
|
178
|
-
},
|
|
179
|
-
// ============ Ontology Assets ============ //
|
|
180
|
-
ONTd: {
|
|
181
|
-
symbol: 'ONTd',
|
|
182
|
-
decimals: 9,
|
|
183
|
-
hash: '0x869951e3397550e800d5faf579857cdb637a0051',
|
|
184
|
-
name: 'ONTd',
|
|
185
|
-
},
|
|
186
|
-
// ============ BSC Assets ============ //
|
|
187
|
-
CAKE: {
|
|
188
|
-
symbol: 'CAKE',
|
|
189
|
-
decimals: 18,
|
|
190
|
-
hash: '0x778140d3A1e0024Be11e723a8af2C4d521feBA4f',
|
|
191
|
-
name: 'CAKE',
|
|
192
|
-
},
|
|
193
|
-
BNB: {
|
|
194
|
-
symbol: 'BNB',
|
|
195
|
-
decimals: 18,
|
|
196
|
-
hash: '0x0000000000000000000000000000000000000000',
|
|
197
|
-
name: 'BNB',
|
|
198
|
-
},
|
|
199
|
-
xfCAKE: {
|
|
200
|
-
symbol: 'xfCAKE',
|
|
201
|
-
decimals: 18,
|
|
202
|
-
hash: '0x64A647dC1634d164896D7146f7Ad314665DFeB18',
|
|
203
|
-
name: 'xfCAKE',
|
|
204
|
-
},
|
|
205
|
-
bNUDES: {
|
|
206
|
-
symbol: 'bNUDES',
|
|
207
|
-
decimals: 8,
|
|
208
|
-
hash: '0xeA5143686D0edb60dcE657CeDA8367a92a2Bff58',
|
|
209
|
-
name: 'bNUDES',
|
|
210
|
-
},
|
|
211
|
-
FUSD: {
|
|
212
|
-
symbol: 'FUSD',
|
|
213
|
-
decimals: 8,
|
|
214
|
-
hash: '0xcdaddd3e196bb1c1978364dd78b8cec5d4753f58',
|
|
215
|
-
name: 'FUSD',
|
|
216
|
-
},
|
|
217
136
|
};
|
|
218
137
|
FlamingoSwapConstants.MAINNET_FLAMINGO_SWAP_TOKENS = {
|
|
219
138
|
// ============ Neo Assets ============ //
|
|
@@ -223,12 +142,6 @@ FlamingoSwapConstants.MAINNET_FLAMINGO_SWAP_TOKENS = {
|
|
|
223
142
|
hash: '0xf0151f528127558851b39c2cd8aa47da7418ab28',
|
|
224
143
|
name: 'FLM',
|
|
225
144
|
},
|
|
226
|
-
FLUND: {
|
|
227
|
-
symbol: 'FLUND',
|
|
228
|
-
decimals: 8,
|
|
229
|
-
hash: '0xa9603a59e21d29e37ac39cf1b5f5abf5006b22a3',
|
|
230
|
-
name: 'FLUND',
|
|
231
|
-
},
|
|
232
145
|
TIPS: {
|
|
233
146
|
symbol: 'TIPS',
|
|
234
147
|
decimals: 8,
|
|
@@ -355,69 +268,6 @@ FlamingoSwapConstants.MAINNET_FLAMINGO_SWAP_TOKENS = {
|
|
|
355
268
|
hash: '0xb56f0fba45cc57a948b342186274dfd863996bb3',
|
|
356
269
|
name: 'fBNB',
|
|
357
270
|
},
|
|
358
|
-
// ============ Ethereum Assets ============ //
|
|
359
|
-
WETH: {
|
|
360
|
-
symbol: 'WETH',
|
|
361
|
-
decimals: 18,
|
|
362
|
-
hash: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
|
|
363
|
-
name: 'WETH',
|
|
364
|
-
},
|
|
365
|
-
WBTC: {
|
|
366
|
-
symbol: 'WBTC',
|
|
367
|
-
decimals: 8,
|
|
368
|
-
hash: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599',
|
|
369
|
-
name: 'WBTC',
|
|
370
|
-
},
|
|
371
|
-
USDT: {
|
|
372
|
-
symbol: 'USDT',
|
|
373
|
-
decimals: 6,
|
|
374
|
-
hash: '0xdac17f958d2ee523a2206206994597c13d831ec7',
|
|
375
|
-
name: 'USDT',
|
|
376
|
-
},
|
|
377
|
-
xWETH: {
|
|
378
|
-
symbol: 'xWETH',
|
|
379
|
-
decimals: 18,
|
|
380
|
-
hash: '0x46b2E0224efb03D43eba88AB5A1995480e6A76b6',
|
|
381
|
-
name: 'xWETH',
|
|
382
|
-
},
|
|
383
|
-
xWBTC: {
|
|
384
|
-
symbol: 'xWBTC',
|
|
385
|
-
decimals: 8,
|
|
386
|
-
hash: '0xebd0e8988ac25a793dc27368f96a5a72e34efcd7',
|
|
387
|
-
name: 'xWBTC',
|
|
388
|
-
},
|
|
389
|
-
xUSDT: {
|
|
390
|
-
symbol: 'xUSDT',
|
|
391
|
-
decimals: 6,
|
|
392
|
-
hash: '0xa93727e8661d4f82cfd50f7d8fd3f38ec8493b84',
|
|
393
|
-
name: 'xUSDT',
|
|
394
|
-
},
|
|
395
|
-
// ============ Ontology Assets ============ //
|
|
396
|
-
ONTd: {
|
|
397
|
-
symbol: 'ONTd',
|
|
398
|
-
decimals: 9,
|
|
399
|
-
hash: '33ae7eae016193ba0fe238b223623bc78faac158',
|
|
400
|
-
name: 'ONTd',
|
|
401
|
-
},
|
|
402
|
-
WING: {
|
|
403
|
-
symbol: 'WING',
|
|
404
|
-
decimals: 9,
|
|
405
|
-
hash: '00c59fcd27a562d6397883eab1f2fff56e58ef80',
|
|
406
|
-
name: 'WING',
|
|
407
|
-
},
|
|
408
|
-
// ============ BSC Assets ============ //
|
|
409
|
-
CAKE: {
|
|
410
|
-
symbol: 'CAKE',
|
|
411
|
-
decimals: 18,
|
|
412
|
-
hash: '0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82',
|
|
413
|
-
name: 'CAKE',
|
|
414
|
-
},
|
|
415
|
-
xfCAKE: {
|
|
416
|
-
symbol: 'xfCAKE',
|
|
417
|
-
decimals: 18,
|
|
418
|
-
hash: '0xD05923B7E0c86f31A4a6dFA4d5bbF191AbEe6Ab2',
|
|
419
|
-
name: 'xfCAKE',
|
|
420
|
-
},
|
|
421
271
|
};
|
|
422
272
|
FlamingoSwapConstants.FLAMINGO_SWAP_TOKENS = {
|
|
423
273
|
testnet: _a.TESTNET_FLAMINGO_SWAP_TOKENS,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export * from './BSNeo3';
|
|
2
2
|
export * from './builder/invocation/FlamingoSwapInvocationBuilderNeo3';
|
|
3
3
|
export * from './builder/invocation/NeonDappKitInvocationBuilderNeo3';
|
|
4
|
-
export * from './constants/FlamingoSwapConstants';
|
|
5
4
|
export * from './helpers/BSNeo3Helper';
|
|
6
5
|
export * from './helpers/FlamingoSwapHelper';
|
|
6
|
+
export * from './constants/FlamingoSwapConstants';
|
|
7
7
|
export * from './services/blockchain-data/DoraBDSNeo3';
|
|
8
8
|
export * from './services/blockchain-data/RpcBDSNeo3';
|
|
9
9
|
export * from './services/exchange-data/FlamingoEDSNeo3';
|
package/dist/index.js
CHANGED
|
@@ -17,9 +17,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./BSNeo3"), exports);
|
|
18
18
|
__exportStar(require("./builder/invocation/FlamingoSwapInvocationBuilderNeo3"), exports);
|
|
19
19
|
__exportStar(require("./builder/invocation/NeonDappKitInvocationBuilderNeo3"), exports);
|
|
20
|
-
__exportStar(require("./constants/FlamingoSwapConstants"), exports);
|
|
21
20
|
__exportStar(require("./helpers/BSNeo3Helper"), exports);
|
|
22
21
|
__exportStar(require("./helpers/FlamingoSwapHelper"), exports);
|
|
22
|
+
__exportStar(require("./constants/FlamingoSwapConstants"), exports);
|
|
23
23
|
__exportStar(require("./services/blockchain-data/DoraBDSNeo3"), exports);
|
|
24
24
|
__exportStar(require("./services/blockchain-data/RpcBDSNeo3"), exports);
|
|
25
25
|
__exportStar(require("./services/exchange-data/FlamingoEDSNeo3"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Account, Network,
|
|
1
|
+
import { Account, Network, SwapService, SwapServiceEvents, SwapServiceSwapToReceiveArgs, SwapServiceSwapToUseArgs, Token } from '@cityofzion/blockchain-service';
|
|
2
2
|
import TypedEmitter from 'typed-emitter';
|
|
3
3
|
import { BSNeo3NetworkId } from '../../helpers/BSNeo3Helper';
|
|
4
4
|
import { NeonDappKitLedgerServiceNeo3 } from '../ledger/NeonDappKitLedgerServiceNeo3';
|
|
@@ -8,7 +8,7 @@ export declare class FlamingoSwapServiceNeo3 implements SwapService<BSNeo3Networ
|
|
|
8
8
|
eventEmitter: TypedEmitter<SwapServiceEvents>;
|
|
9
9
|
constructor(network: Network<BSNeo3NetworkId>, ledgerService: NeonDappKitLedgerServiceNeo3);
|
|
10
10
|
buildSwapInvocationArgs(): BuildSwapInvocationArgs;
|
|
11
|
-
|
|
11
|
+
listSwappableTokensSymbol(network: Network<BSNeo3NetworkId>): string[];
|
|
12
12
|
swap(isLedger?: boolean): Promise<void>;
|
|
13
13
|
startListeningBlockGeneration(): void;
|
|
14
14
|
stopListeningBlockGeneration(): void;
|
|
@@ -81,8 +81,8 @@ class FlamingoSwapServiceNeo3 {
|
|
|
81
81
|
throw new Error("minimumReceived is required for 'amountToUse' swap type");
|
|
82
82
|
return Object.assign(Object.assign({}, baseSwapArgs), { amountToUse: __classPrivateFieldGet(this, _FlamingoSwapServiceNeo3_instances, "a", _FlamingoSwapServiceNeo3_amountToUse_get), minimumReceived: __classPrivateFieldGet(this, _FlamingoSwapServiceNeo3_instances, "a", _FlamingoSwapServiceNeo3_minimumReceived_get), type: 'swapTokenToUse' });
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
return handlers_1.FlamingoSwapRouteHandler.createPoolGraph(network);
|
|
84
|
+
listSwappableTokensSymbol(network) {
|
|
85
|
+
return Object.keys(handlers_1.FlamingoSwapRouteHandler.createPoolGraph(network));
|
|
86
86
|
}
|
|
87
87
|
swap(isLedger) {
|
|
88
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -35,24 +35,24 @@ class FlamingoSwapRouteHandler {
|
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
static createPoolGraph(network) {
|
|
38
|
+
const poolGraph = {};
|
|
38
39
|
const pools = FlamingoSwapHelper_1.FlamingoSwapHelper.getFlamingoSwapPools(network);
|
|
39
40
|
const tokens = FlamingoSwapHelper_1.FlamingoSwapHelper.getFlamingoSwapTokens(network);
|
|
40
41
|
const { NEO, bNEO } = tokens;
|
|
41
|
-
const poolGraph = {};
|
|
42
42
|
// Initialize poolGraph with empty arrays
|
|
43
|
-
Object.
|
|
44
|
-
poolGraph[
|
|
43
|
+
Object.keys(tokens).forEach(tokenSymbol => {
|
|
44
|
+
poolGraph[tokenSymbol] = [];
|
|
45
45
|
});
|
|
46
46
|
// Add edges to poolGraph
|
|
47
47
|
Object.values(pools).forEach(pool => {
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
poolGraph[
|
|
51
|
-
poolGraph[
|
|
48
|
+
const tokenASymbol = pool.tokens[0].symbol;
|
|
49
|
+
const tokenBSymbol = pool.tokens[1].symbol;
|
|
50
|
+
poolGraph[tokenASymbol].push(tokenBSymbol);
|
|
51
|
+
poolGraph[tokenBSymbol].push(tokenASymbol);
|
|
52
52
|
});
|
|
53
53
|
// Remove duplicates from poolGraph
|
|
54
|
-
Object.keys(
|
|
55
|
-
poolGraph[tokenSymbol] =
|
|
54
|
+
Object.keys(tokens).forEach(tokenSymbol => {
|
|
55
|
+
poolGraph[tokenSymbol] = Array.from(new Set(poolGraph[tokenSymbol]));
|
|
56
56
|
});
|
|
57
57
|
// Include NEO to the poolGraph
|
|
58
58
|
poolGraph[NEO.symbol] = Object.keys(tokens).filter(tokenSymbol => tokenSymbol === bNEO.symbol);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cityofzion/bs-neo3",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"repository": "https://github.com/CityOfZion/blockchain-services",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"bignumber.js": "^9.1.2",
|
|
21
21
|
"isomorphic-ws": "^5.0.0",
|
|
22
22
|
"lodash.clonedeep": "^4.5.0",
|
|
23
|
-
"@cityofzion/blockchain-service": "1.3.
|
|
23
|
+
"@cityofzion/blockchain-service": "1.3.1",
|
|
24
24
|
"@cityofzion/bs-asteroid-sdk": "0.9.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|