@shapeshiftoss/unchained-client 10.14.6 → 10.14.7-alpha.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/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/cosmossdk/mayachain/parser/__tests__/mockData/mayachainStreamingSwapOutbound.d.ts +1 -1
- package/dist/cjs/cosmossdk/mayachain/parser/__tests__/mockData/mayachainSwapOutbound.d.ts +1 -1
- package/dist/cjs/cosmossdk/mayachain/parser/__tests__/mockData/mayachainSwapRefund.d.ts +1 -1
- package/dist/cjs/evm/bnbsmartchain/parser/__tests__/bnbsmartchain.test.js +32 -32
- package/dist/cjs/evm/bnbsmartchain/parser/__tests__/mockData/{bep1155.js → erc1155.js} +4 -4
- package/dist/cjs/evm/bnbsmartchain/parser/__tests__/mockData/{bep20Approve.js → erc20Approve.js} +3 -3
- package/dist/cjs/evm/bnbsmartchain/parser/__tests__/mockData/{bep721.js → erc721.js} +4 -4
- package/dist/cjs/evm/bnbsmartchain/parser/__tests__/mockData/tokenSelfSend.js +1 -1
- package/dist/cjs/evm/bnbsmartchain/parser/__tests__/mockData/tokenStandard.js +1 -1
- package/dist/cjs/evm/bnbsmartchain/parser/__tests__/mockData/zrxTradeBnbToBusd.js +3 -3
- package/dist/cjs/evm/bnbsmartchain/parser/__tests__/mockData/zrxTradeBusdToBnb.js +2 -2
- package/dist/cjs/evm/bnbsmartchain/parser/__tests__/mockData/zrxTradeUsdtToBusd.js +4 -4
- package/dist/cjs/evm/bnbsmartchain/parser/index.js +2 -2
- package/dist/cjs/evm/parser/index.js +0 -6
- package/dist/cjs/evm/parser/types.d.ts +1 -2
- package/dist/cjs/generated/arbitrum/apis/V1Api.d.ts +15 -0
- package/dist/cjs/generated/arbitrum/apis/V1Api.js +24 -0
- package/dist/cjs/generated/solana/apis/V1Api.d.ts +3 -3
- package/dist/cjs/generated/solana/apis/V1Api.js +1 -1
- package/dist/cjs/generated/solana/models/Token.d.ts +5 -22
- package/dist/cjs/generated/solana/models/Token.js +7 -15
- package/dist/cjs/generated/solana/models/TokenDetails.d.ts +55 -0
- package/dist/cjs/generated/solana/models/TokenDetails.js +63 -0
- package/dist/cjs/generated/solana/models/index.d.ts +1 -0
- package/dist/cjs/generated/solana/models/index.js +1 -0
- package/dist/cjs/generated/thorchain/apis/ProxyApi.d.ts +8 -0
- package/dist/cjs/generated/thorchain/apis/ProxyApi.js +20 -0
- package/dist/cjs/solana/parser/__tests__/mockData/tokens.d.ts +1 -1
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/cosmossdk/mayachain/parser/__tests__/mockData/mayachainStreamingSwapOutbound.d.ts +1 -1
- package/dist/esm/cosmossdk/mayachain/parser/__tests__/mockData/mayachainSwapOutbound.d.ts +1 -1
- package/dist/esm/cosmossdk/mayachain/parser/__tests__/mockData/mayachainSwapRefund.d.ts +1 -1
- package/dist/esm/evm/bnbsmartchain/parser/__tests__/bnbsmartchain.test.js +32 -32
- package/dist/esm/evm/bnbsmartchain/parser/__tests__/mockData/{bep1155.js → erc1155.js} +4 -4
- package/dist/esm/evm/bnbsmartchain/parser/__tests__/mockData/{bep20Approve.js → erc20Approve.js} +3 -3
- package/dist/esm/evm/bnbsmartchain/parser/__tests__/mockData/{bep721.js → erc721.js} +4 -4
- package/dist/esm/evm/bnbsmartchain/parser/__tests__/mockData/tokenSelfSend.js +1 -1
- package/dist/esm/evm/bnbsmartchain/parser/__tests__/mockData/tokenStandard.js +1 -1
- package/dist/esm/evm/bnbsmartchain/parser/__tests__/mockData/zrxTradeBnbToBusd.js +3 -3
- package/dist/esm/evm/bnbsmartchain/parser/__tests__/mockData/zrxTradeBusdToBnb.js +2 -2
- package/dist/esm/evm/bnbsmartchain/parser/__tests__/mockData/zrxTradeUsdtToBusd.js +4 -4
- package/dist/esm/evm/bnbsmartchain/parser/index.js +2 -2
- package/dist/esm/evm/parser/index.js +0 -6
- package/dist/esm/evm/parser/types.d.ts +1 -2
- package/dist/esm/generated/arbitrum/apis/V1Api.d.ts +15 -0
- package/dist/esm/generated/arbitrum/apis/V1Api.js +24 -0
- package/dist/esm/generated/solana/apis/V1Api.d.ts +3 -3
- package/dist/esm/generated/solana/apis/V1Api.js +2 -2
- package/dist/esm/generated/solana/models/Token.d.ts +5 -22
- package/dist/esm/generated/solana/models/Token.js +7 -15
- package/dist/esm/generated/solana/models/TokenDetails.d.ts +55 -0
- package/dist/esm/generated/solana/models/TokenDetails.js +56 -0
- package/dist/esm/generated/solana/models/index.d.ts +1 -0
- package/dist/esm/generated/solana/models/index.js +1 -0
- package/dist/esm/generated/thorchain/apis/ProxyApi.d.ts +8 -0
- package/dist/esm/generated/thorchain/apis/ProxyApi.js +20 -0
- package/dist/esm/solana/parser/__tests__/mockData/tokens.d.ts +1 -1
- package/package.json +9 -6
- package/CHANGELOG.md +0 -409
- package/dist/cjs/evm/bnbsmartchain/parser/bep20.d.ts +0 -22
- package/dist/cjs/evm/bnbsmartchain/parser/bep20.js +0 -56
- package/dist/esm/evm/bnbsmartchain/parser/bep20.d.ts +0 -22
- package/dist/esm/evm/bnbsmartchain/parser/bep20.js +0 -52
- /package/dist/cjs/evm/bnbsmartchain/parser/__tests__/mockData/{bep1155.d.ts → erc1155.d.ts} +0 -0
- /package/dist/cjs/evm/bnbsmartchain/parser/__tests__/mockData/{bep20Approve.d.ts → erc20Approve.d.ts} +0 -0
- /package/dist/cjs/evm/bnbsmartchain/parser/__tests__/mockData/{bep721.d.ts → erc721.d.ts} +0 -0
- /package/dist/esm/evm/bnbsmartchain/parser/__tests__/mockData/{bep1155.d.ts → erc1155.d.ts} +0 -0
- /package/dist/esm/evm/bnbsmartchain/parser/__tests__/mockData/{bep20Approve.d.ts → erc20Approve.d.ts} +0 -0
- /package/dist/esm/evm/bnbsmartchain/parser/__tests__/mockData/{bep721.d.ts → erc721.d.ts} +0 -0
|
@@ -4,11 +4,11 @@ import { describe, expect, it, vi } from 'vitest';
|
|
|
4
4
|
import { Dex, TradeType, TransferType, TxStatus } from '../../../../types.js';
|
|
5
5
|
import { V1Api } from '../../index.js';
|
|
6
6
|
import { TransactionParser } from '../index.js';
|
|
7
|
-
import bep20Approve from './mockData/bep20Approve.js';
|
|
8
|
-
import bep721 from './mockData/bep721.js';
|
|
9
|
-
import bep1155 from './mockData/bep1155.js';
|
|
10
7
|
import bnbSelfSend from './mockData/bnbSelfSend.js';
|
|
11
8
|
import bnbStandard from './mockData/bnbStandard.js';
|
|
9
|
+
import erc20Approve from './mockData/erc20Approve.js';
|
|
10
|
+
import erc721 from './mockData/erc721.js';
|
|
11
|
+
import erc1155 from './mockData/erc1155.js';
|
|
12
12
|
import { busdToken, usdtToken } from './mockData/tokens.js';
|
|
13
13
|
import tokenSelfSend from './mockData/tokenSelfSend.js';
|
|
14
14
|
import tokenStandard from './mockData/tokenStandard.js';
|
|
@@ -171,7 +171,7 @@ describe('parseTx', () => {
|
|
|
171
171
|
type: TransferType.Send,
|
|
172
172
|
from: address,
|
|
173
173
|
to: '0xC66bfff5C2ec26F60542bD3C862d7846F0783fdf',
|
|
174
|
-
assetId: 'eip155:56/
|
|
174
|
+
assetId: 'eip155:56/erc20:0x55d398326f99059ff775485246999027b3197955',
|
|
175
175
|
totalValue: '200000000000000000000',
|
|
176
176
|
components: [{ value: '200000000000000000000' }],
|
|
177
177
|
token: usdtToken,
|
|
@@ -214,7 +214,7 @@ describe('parseTx', () => {
|
|
|
214
214
|
type: TransferType.Receive,
|
|
215
215
|
from: '0xc4178B5673633c15c3a2077A1D7f0fF1Be8a4a44',
|
|
216
216
|
to: address,
|
|
217
|
-
assetId: 'eip155:56/
|
|
217
|
+
assetId: 'eip155:56/erc20:0x55d398326f99059ff775485246999027b3197955',
|
|
218
218
|
totalValue: '200000000000000000000',
|
|
219
219
|
components: [{ value: '200000000000000000000' }],
|
|
220
220
|
token: usdtToken,
|
|
@@ -225,9 +225,9 @@ describe('parseTx', () => {
|
|
|
225
225
|
expect(expected).toEqual(actual);
|
|
226
226
|
});
|
|
227
227
|
});
|
|
228
|
-
describe('
|
|
228
|
+
describe('erc721', () => {
|
|
229
229
|
it('should be able to parse mempool send', async () => {
|
|
230
|
-
const { txMempool } =
|
|
230
|
+
const { txMempool } = erc721;
|
|
231
231
|
const address = '0xc86d6a700B82C62A14458858d17d0e6a3942f424';
|
|
232
232
|
const expected = {
|
|
233
233
|
txid: txMempool.txid,
|
|
@@ -243,7 +243,7 @@ describe('parseTx', () => {
|
|
|
243
243
|
expect(actual).toEqual(expected);
|
|
244
244
|
});
|
|
245
245
|
it('should be able to parse send', async () => {
|
|
246
|
-
const { tx } =
|
|
246
|
+
const { tx } = erc721;
|
|
247
247
|
const address = '0xc86d6a700B82C62A14458858d17d0e6a3942f424';
|
|
248
248
|
const expected = {
|
|
249
249
|
txid: tx.txid,
|
|
@@ -263,7 +263,7 @@ describe('parseTx', () => {
|
|
|
263
263
|
type: TransferType.Send,
|
|
264
264
|
to: '0x26bCA820c78DDe0349960457960e7b80548E37e3',
|
|
265
265
|
from: address,
|
|
266
|
-
assetId: 'eip155:56/
|
|
266
|
+
assetId: 'eip155:56/erc721:0xd7c79abeb8d8b21e7638a8aadfdcc1438d24b483/6201612',
|
|
267
267
|
totalValue: '1',
|
|
268
268
|
components: [{ value: '1' }],
|
|
269
269
|
id: '6201612',
|
|
@@ -280,7 +280,7 @@ describe('parseTx', () => {
|
|
|
280
280
|
expect(actual).toEqual(expected);
|
|
281
281
|
});
|
|
282
282
|
it('should be able to parse mempool receive', async () => {
|
|
283
|
-
const { txMempool } =
|
|
283
|
+
const { txMempool } = erc721;
|
|
284
284
|
const address = '0x26bCA820c78DDe0349960457960e7b80548E37e3';
|
|
285
285
|
const expected = {
|
|
286
286
|
txid: txMempool.txid,
|
|
@@ -296,7 +296,7 @@ describe('parseTx', () => {
|
|
|
296
296
|
expect(actual).toEqual(expected);
|
|
297
297
|
});
|
|
298
298
|
it('should be able to parse receive', async () => {
|
|
299
|
-
const { tx } =
|
|
299
|
+
const { tx } = erc721;
|
|
300
300
|
const address = '0x26bCA820c78DDe0349960457960e7b80548E37e3';
|
|
301
301
|
const expected = {
|
|
302
302
|
txid: tx.txid,
|
|
@@ -312,7 +312,7 @@ describe('parseTx', () => {
|
|
|
312
312
|
type: TransferType.Receive,
|
|
313
313
|
to: address,
|
|
314
314
|
from: '0xc86d6a700B82C62A14458858d17d0e6a3942f424',
|
|
315
|
-
assetId: 'eip155:56/
|
|
315
|
+
assetId: 'eip155:56/erc721:0xd7c79abeb8d8b21e7638a8aadfdcc1438d24b483/6201612',
|
|
316
316
|
totalValue: '1',
|
|
317
317
|
components: [{ value: '1' }],
|
|
318
318
|
id: '6201612',
|
|
@@ -329,9 +329,9 @@ describe('parseTx', () => {
|
|
|
329
329
|
expect(actual).toEqual(expected);
|
|
330
330
|
});
|
|
331
331
|
});
|
|
332
|
-
describe('
|
|
332
|
+
describe('erc1155', () => {
|
|
333
333
|
it('should be able to parse mempool send', async () => {
|
|
334
|
-
const { txMempool } =
|
|
334
|
+
const { txMempool } = erc1155;
|
|
335
335
|
const address = '0x606a712666DD5EeF29d2F0360874C8ED1E72A007';
|
|
336
336
|
const expected = {
|
|
337
337
|
txid: txMempool.txid,
|
|
@@ -347,7 +347,7 @@ describe('parseTx', () => {
|
|
|
347
347
|
expect(actual).toEqual(expected);
|
|
348
348
|
});
|
|
349
349
|
it('should be able to parse send', async () => {
|
|
350
|
-
const { tx } =
|
|
350
|
+
const { tx } = erc1155;
|
|
351
351
|
const address = '0x606a712666DD5EeF29d2F0360874C8ED1E72A007';
|
|
352
352
|
const expected = {
|
|
353
353
|
txid: tx.txid,
|
|
@@ -367,7 +367,7 @@ describe('parseTx', () => {
|
|
|
367
367
|
type: TransferType.Send,
|
|
368
368
|
to: '0xD3106B990148CFED6D36eaC4E2066B9356dB423b',
|
|
369
369
|
from: address,
|
|
370
|
-
assetId: 'eip155:56/
|
|
370
|
+
assetId: 'eip155:56/erc1155:0xe4395bd1dae0687dcf6bfbafdaa8edb5a2065eef/550',
|
|
371
371
|
totalValue: '1',
|
|
372
372
|
components: [{ value: '1' }],
|
|
373
373
|
id: '550',
|
|
@@ -384,7 +384,7 @@ describe('parseTx', () => {
|
|
|
384
384
|
expect(actual).toEqual(expected);
|
|
385
385
|
});
|
|
386
386
|
it('should be able to parse mempool receive', async () => {
|
|
387
|
-
const { txMempool } =
|
|
387
|
+
const { txMempool } = erc1155;
|
|
388
388
|
const address = '0xD3106B990148CFED6D36eaC4E2066B9356dB423b';
|
|
389
389
|
const expected = {
|
|
390
390
|
txid: txMempool.txid,
|
|
@@ -400,7 +400,7 @@ describe('parseTx', () => {
|
|
|
400
400
|
expect(actual).toEqual(expected);
|
|
401
401
|
});
|
|
402
402
|
it('should be able to parse receive', async () => {
|
|
403
|
-
const { tx } =
|
|
403
|
+
const { tx } = erc1155;
|
|
404
404
|
const address = '0xD3106B990148CFED6D36eaC4E2066B9356dB423b';
|
|
405
405
|
const expected = {
|
|
406
406
|
txid: tx.txid,
|
|
@@ -416,7 +416,7 @@ describe('parseTx', () => {
|
|
|
416
416
|
type: TransferType.Receive,
|
|
417
417
|
to: address,
|
|
418
418
|
from: '0x606a712666DD5EeF29d2F0360874C8ED1E72A007',
|
|
419
|
-
assetId: 'eip155:56/
|
|
419
|
+
assetId: 'eip155:56/erc1155:0xe4395bd1dae0687dcf6bfbafdaa8edb5a2065eef/550',
|
|
420
420
|
totalValue: '1',
|
|
421
421
|
components: [{ value: '1' }],
|
|
422
422
|
id: '550',
|
|
@@ -543,7 +543,7 @@ describe('parseTx', () => {
|
|
|
543
543
|
type: TransferType.Send,
|
|
544
544
|
from: address,
|
|
545
545
|
to: address,
|
|
546
|
-
assetId: 'eip155:56/
|
|
546
|
+
assetId: 'eip155:56/erc20:0x55d398326f99059ff775485246999027b3197955',
|
|
547
547
|
totalValue: '200000000000000000000',
|
|
548
548
|
components: [{ value: '200000000000000000000' }],
|
|
549
549
|
token: usdtToken,
|
|
@@ -552,7 +552,7 @@ describe('parseTx', () => {
|
|
|
552
552
|
type: TransferType.Receive,
|
|
553
553
|
from: address,
|
|
554
554
|
to: address,
|
|
555
|
-
assetId: 'eip155:56/
|
|
555
|
+
assetId: 'eip155:56/erc20:0x55d398326f99059ff775485246999027b3197955',
|
|
556
556
|
totalValue: '200000000000000000000',
|
|
557
557
|
components: [{ value: '200000000000000000000' }],
|
|
558
558
|
token: usdtToken,
|
|
@@ -563,9 +563,9 @@ describe('parseTx', () => {
|
|
|
563
563
|
expect(expected).toEqual(actual);
|
|
564
564
|
});
|
|
565
565
|
});
|
|
566
|
-
describe('
|
|
566
|
+
describe('erc20', () => {
|
|
567
567
|
it('should be able to parse approve mempool', async () => {
|
|
568
|
-
const { txMempool } =
|
|
568
|
+
const { txMempool } = erc20Approve;
|
|
569
569
|
const address = '0xeFcdFc962cf71Da4D147aA42A72C106d557Ae7Fe';
|
|
570
570
|
const expected = {
|
|
571
571
|
txid: txMempool.txid,
|
|
@@ -577,9 +577,9 @@ describe('parseTx', () => {
|
|
|
577
577
|
status: TxStatus.Pending,
|
|
578
578
|
transfers: [],
|
|
579
579
|
data: {
|
|
580
|
-
assetId: 'eip155:56/
|
|
580
|
+
assetId: 'eip155:56/erc20:0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c',
|
|
581
581
|
method: 'approve',
|
|
582
|
-
parser: '
|
|
582
|
+
parser: 'erc20',
|
|
583
583
|
value: '115792089237316195423570985008687907853269984665640564039457584007913129639935',
|
|
584
584
|
},
|
|
585
585
|
};
|
|
@@ -587,7 +587,7 @@ describe('parseTx', () => {
|
|
|
587
587
|
expect(expected).toEqual(actual);
|
|
588
588
|
});
|
|
589
589
|
it('should be able to parse approve', async () => {
|
|
590
|
-
const { tx } =
|
|
590
|
+
const { tx } = erc20Approve;
|
|
591
591
|
const address = '0xeFcdFc962cf71Da4D147aA42A72C106d557Ae7Fe';
|
|
592
592
|
const expected = {
|
|
593
593
|
txid: tx.txid,
|
|
@@ -604,9 +604,9 @@ describe('parseTx', () => {
|
|
|
604
604
|
},
|
|
605
605
|
transfers: [],
|
|
606
606
|
data: {
|
|
607
|
-
assetId: 'eip155:56/
|
|
607
|
+
assetId: 'eip155:56/erc20:0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c',
|
|
608
608
|
method: 'approve',
|
|
609
|
-
parser: '
|
|
609
|
+
parser: 'erc20',
|
|
610
610
|
value: '115792089237316195423570985008687907853269984665640564039457584007913129639935',
|
|
611
611
|
},
|
|
612
612
|
};
|
|
@@ -628,7 +628,7 @@ describe('parseTx', () => {
|
|
|
628
628
|
type: TransferType.Receive,
|
|
629
629
|
};
|
|
630
630
|
const sellTransfer = {
|
|
631
|
-
assetId: 'eip155:56/
|
|
631
|
+
assetId: 'eip155:56/erc20:0xe9e7cea3dedca5984780bafc599bd69add087d56',
|
|
632
632
|
components: [{ value: '1489033385864185057' }],
|
|
633
633
|
from: address,
|
|
634
634
|
to: '0x51e6D27FA57373d8d4C256231241053a70Cb1d93',
|
|
@@ -661,7 +661,7 @@ describe('parseTx', () => {
|
|
|
661
661
|
const address = '0xb8687c5f88399b0E70DD69F2fBd2200957cDaf38';
|
|
662
662
|
const trade = { dexName: Dex.Zrx, type: TradeType.Trade };
|
|
663
663
|
const buyTransfer = {
|
|
664
|
-
assetId: 'eip155:56/
|
|
664
|
+
assetId: 'eip155:56/erc20:0xe9e7cea3dedca5984780bafc599bd69add087d56',
|
|
665
665
|
components: [{ value: '326087208829856917029' }],
|
|
666
666
|
from: '0xdB6f1920A889355780aF7570773609Bd8Cb1f498',
|
|
667
667
|
to: address,
|
|
@@ -702,7 +702,7 @@ describe('parseTx', () => {
|
|
|
702
702
|
const address = '0xba599D1526952c14779e6A9D31D912C6A02f5B9C';
|
|
703
703
|
const trade = { dexName: Dex.Zrx, type: TradeType.Trade };
|
|
704
704
|
const buyTransfer = {
|
|
705
|
-
assetId: 'eip155:56/
|
|
705
|
+
assetId: 'eip155:56/erc20:0xe9e7cea3dedca5984780bafc599bd69add087d56',
|
|
706
706
|
components: [{ value: '1918012446944444331677' }],
|
|
707
707
|
from: '0xdB6f1920A889355780aF7570773609Bd8Cb1f498',
|
|
708
708
|
to: address,
|
|
@@ -711,7 +711,7 @@ describe('parseTx', () => {
|
|
|
711
711
|
type: TransferType.Receive,
|
|
712
712
|
};
|
|
713
713
|
const sellTransfer = {
|
|
714
|
-
assetId: 'eip155:56/
|
|
714
|
+
assetId: 'eip155:56/erc20:0x55d398326f99059ff775485246999027b3197955',
|
|
715
715
|
components: [{ value: '1917821751000000000000' }],
|
|
716
716
|
from: address,
|
|
717
717
|
to: '0xdB6f1920A889355780aF7570773609Bd8Cb1f498',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mempoolMock } from './mempoolMock.js';
|
|
2
|
-
const
|
|
2
|
+
const erc1155 = {
|
|
3
3
|
txid: '0x2b63ef5aaf9292023be8936646de66bc389c1c984928a79c93a632e391e8c00e',
|
|
4
4
|
blockHash: '0x3e0a62ba74234949370c2f7d85c15397fb2c61e34de6375227de9dff162e9e48',
|
|
5
5
|
blockHeight: 28094651,
|
|
@@ -20,7 +20,7 @@ const bep1155 = {
|
|
|
20
20
|
decimals: 18,
|
|
21
21
|
name: 'Nfterrium Nomad',
|
|
22
22
|
symbol: 'NTMN',
|
|
23
|
-
type: '
|
|
23
|
+
type: 'ERC1155',
|
|
24
24
|
from: '0x606a712666DD5EeF29d2F0360874C8ED1E72A007',
|
|
25
25
|
to: '0xD3106B990148CFED6D36eaC4E2066B9356dB423b',
|
|
26
26
|
value: '1',
|
|
@@ -30,6 +30,6 @@ const bep1155 = {
|
|
|
30
30
|
internalTxs: [],
|
|
31
31
|
};
|
|
32
32
|
export default {
|
|
33
|
-
tx:
|
|
34
|
-
txMempool: mempoolMock(
|
|
33
|
+
tx: erc1155,
|
|
34
|
+
txMempool: mempoolMock(erc1155),
|
|
35
35
|
};
|
package/dist/esm/evm/bnbsmartchain/parser/__tests__/mockData/{bep20Approve.js → erc20Approve.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mempoolMock } from './mempoolMock.js';
|
|
2
|
-
const
|
|
2
|
+
const erc20Approve = {
|
|
3
3
|
txid: '0x75df3a69247731e8e4596ff7f03a3e0ec2cdbc0623eeceb165c3ffad3f3ec839',
|
|
4
4
|
blockHash: '0x091b34962754244418133697658b48bcf8036a6e440af358a951f8dba00a6a16',
|
|
5
5
|
blockHeight: 25865860,
|
|
@@ -17,6 +17,6 @@ const bep20Approve = {
|
|
|
17
17
|
internalTxs: [],
|
|
18
18
|
};
|
|
19
19
|
export default {
|
|
20
|
-
tx:
|
|
21
|
-
txMempool: mempoolMock(
|
|
20
|
+
tx: erc20Approve,
|
|
21
|
+
txMempool: mempoolMock(erc20Approve),
|
|
22
22
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mempoolMock } from './mempoolMock.js';
|
|
2
|
-
const
|
|
2
|
+
const erc721 = {
|
|
3
3
|
txid: '0x807e3c2dca5c00e0e33a1765ac6c78d5ffe4973ef74522902edda4d1d705a38d',
|
|
4
4
|
blockHash: '0xeae71d46c74f4088f0ac47463d82bd00b23fef0150e086248701a6c46c40211f',
|
|
5
5
|
blockHeight: 28094889,
|
|
@@ -20,7 +20,7 @@ const bep721 = {
|
|
|
20
20
|
decimals: 18,
|
|
21
21
|
name: 'TAP FANTASY SKIN',
|
|
22
22
|
symbol: 'TFSKIN',
|
|
23
|
-
type: '
|
|
23
|
+
type: 'ERC721',
|
|
24
24
|
from: '0xc86d6a700B82C62A14458858d17d0e6a3942f424',
|
|
25
25
|
to: '0x26bCA820c78DDe0349960457960e7b80548E37e3',
|
|
26
26
|
value: '1',
|
|
@@ -30,6 +30,6 @@ const bep721 = {
|
|
|
30
30
|
internalTxs: [],
|
|
31
31
|
};
|
|
32
32
|
export default {
|
|
33
|
-
tx:
|
|
34
|
-
txMempool: mempoolMock(
|
|
33
|
+
tx: erc721,
|
|
34
|
+
txMempool: mempoolMock(erc721),
|
|
35
35
|
};
|
|
@@ -20,7 +20,7 @@ export const tokenSelfSend = {
|
|
|
20
20
|
decimals: 18,
|
|
21
21
|
name: 'Tether USD',
|
|
22
22
|
symbol: 'USDT',
|
|
23
|
-
type: '
|
|
23
|
+
type: 'ERC20',
|
|
24
24
|
from: '0xc4178B5673633c15c3a2077A1D7f0fF1Be8a4a44',
|
|
25
25
|
to: '0xc4178B5673633c15c3a2077A1D7f0fF1Be8a4a44',
|
|
26
26
|
value: '200000000000000000000',
|
|
@@ -20,7 +20,7 @@ export const tokenStandard = {
|
|
|
20
20
|
decimals: 18,
|
|
21
21
|
name: 'Tether USD',
|
|
22
22
|
symbol: 'USDT',
|
|
23
|
-
type: '
|
|
23
|
+
type: 'ERC20',
|
|
24
24
|
from: '0xc4178B5673633c15c3a2077A1D7f0fF1Be8a4a44',
|
|
25
25
|
to: '0xC66bfff5C2ec26F60542bD3C862d7846F0783fdf',
|
|
26
26
|
value: '200000000000000000000',
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
decimals: 18,
|
|
21
21
|
name: 'Wrapped BNB',
|
|
22
22
|
symbol: 'WBNB',
|
|
23
|
-
type: '
|
|
23
|
+
type: 'ERC20',
|
|
24
24
|
from: '0xdB6f1920A889355780aF7570773609Bd8Cb1f498',
|
|
25
25
|
to: '0x0fe261aeE0d1C4DFdDee4102E82Dd425999065F4',
|
|
26
26
|
value: '1077638000000000000',
|
|
@@ -30,7 +30,7 @@ export default {
|
|
|
30
30
|
decimals: 18,
|
|
31
31
|
name: 'BUSD Token',
|
|
32
32
|
symbol: 'BUSD',
|
|
33
|
-
type: '
|
|
33
|
+
type: 'ERC20',
|
|
34
34
|
from: '0x0fe261aeE0d1C4DFdDee4102E82Dd425999065F4',
|
|
35
35
|
to: '0xdB6f1920A889355780aF7570773609Bd8Cb1f498',
|
|
36
36
|
value: '326087208829856917029',
|
|
@@ -40,7 +40,7 @@ export default {
|
|
|
40
40
|
decimals: 18,
|
|
41
41
|
name: 'BUSD Token',
|
|
42
42
|
symbol: 'BUSD',
|
|
43
|
-
type: '
|
|
43
|
+
type: 'ERC20',
|
|
44
44
|
from: '0xdB6f1920A889355780aF7570773609Bd8Cb1f498',
|
|
45
45
|
to: '0xb8687c5f88399b0E70DD69F2fBd2200957cDaf38',
|
|
46
46
|
value: '326087208829856917029',
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
decimals: 18,
|
|
21
21
|
name: 'BUSD Token',
|
|
22
22
|
symbol: 'BUSD',
|
|
23
|
-
type: '
|
|
23
|
+
type: 'ERC20',
|
|
24
24
|
from: '0x1bE0Db7727c53b16a22af5Cb12F4680e784cf7eF',
|
|
25
25
|
to: '0x51e6D27FA57373d8d4C256231241053a70Cb1d93',
|
|
26
26
|
value: '1489033385864185057',
|
|
@@ -30,7 +30,7 @@ export default {
|
|
|
30
30
|
decimals: 18,
|
|
31
31
|
name: 'Wrapped BNB',
|
|
32
32
|
symbol: 'WBNB',
|
|
33
|
-
type: '
|
|
33
|
+
type: 'ERC20',
|
|
34
34
|
from: '0x51e6D27FA57373d8d4C256231241053a70Cb1d93',
|
|
35
35
|
to: '0xDef1C0ded9bec7F1a1670819833240f027b25EfF',
|
|
36
36
|
value: '4904343838640863',
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
decimals: 18,
|
|
21
21
|
name: 'Tether USD',
|
|
22
22
|
symbol: 'USDT',
|
|
23
|
-
type: '
|
|
23
|
+
type: 'ERC20',
|
|
24
24
|
from: '0xba599D1526952c14779e6A9D31D912C6A02f5B9C',
|
|
25
25
|
to: '0xdB6f1920A889355780aF7570773609Bd8Cb1f498',
|
|
26
26
|
value: '1917821751000000000000',
|
|
@@ -30,7 +30,7 @@ export default {
|
|
|
30
30
|
decimals: 18,
|
|
31
31
|
name: 'Tether USD',
|
|
32
32
|
symbol: 'USDT',
|
|
33
|
-
type: '
|
|
33
|
+
type: 'ERC20',
|
|
34
34
|
from: '0xdB6f1920A889355780aF7570773609Bd8Cb1f498',
|
|
35
35
|
to: '0x28ec0B36F0819ecB5005cAB836F4ED5a2eCa4D13',
|
|
36
36
|
value: '1917821751000000000000',
|
|
@@ -40,7 +40,7 @@ export default {
|
|
|
40
40
|
decimals: 18,
|
|
41
41
|
name: 'BUSD Token',
|
|
42
42
|
symbol: 'BUSD',
|
|
43
|
-
type: '
|
|
43
|
+
type: 'ERC20',
|
|
44
44
|
from: '0x28ec0B36F0819ecB5005cAB836F4ED5a2eCa4D13',
|
|
45
45
|
to: '0xdB6f1920A889355780aF7570773609Bd8Cb1f498',
|
|
46
46
|
value: '1918012446944444331677',
|
|
@@ -50,7 +50,7 @@ export default {
|
|
|
50
50
|
decimals: 18,
|
|
51
51
|
name: 'BUSD Token',
|
|
52
52
|
symbol: 'BUSD',
|
|
53
|
-
type: '
|
|
53
|
+
type: 'ERC20',
|
|
54
54
|
from: '0xdB6f1920A889355780aF7570773609Bd8Cb1f498',
|
|
55
55
|
to: '0xba599D1526952c14779e6A9D31D912C6A02f5B9C',
|
|
56
56
|
value: '1918012446944444331677',
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ZRX_ETHEREUM_PROXY_CONTRACT } from '@shapeshiftoss/contracts';
|
|
2
2
|
import { BaseTransactionParser } from '../../parser/index.js';
|
|
3
|
+
import * as erc20 from '../../parser/erc20.js';
|
|
3
4
|
import * as thorchain from '../../parser/thorchain.js';
|
|
4
5
|
import * as zrx from '../../parser/zrx.js';
|
|
5
|
-
import * as bep20 from './bep20.js';
|
|
6
6
|
export class TransactionParser extends BaseTransactionParser {
|
|
7
7
|
constructor(args) {
|
|
8
8
|
super(args);
|
|
9
9
|
this.registerParsers([
|
|
10
|
-
new
|
|
10
|
+
new erc20.Parser({ chainId: this.chainId, provider: this.provider }),
|
|
11
11
|
new thorchain.Parser({
|
|
12
12
|
chainId: this.chainId,
|
|
13
13
|
midgardUrl: args.midgardUrl,
|
|
@@ -125,12 +125,6 @@ export class BaseTransactionParser {
|
|
|
125
125
|
return ASSET_NAMESPACE.erc721;
|
|
126
126
|
case 'ERC1155':
|
|
127
127
|
return ASSET_NAMESPACE.erc1155;
|
|
128
|
-
case 'BEP20':
|
|
129
|
-
return ASSET_NAMESPACE.bep20;
|
|
130
|
-
case 'BEP721':
|
|
131
|
-
return ASSET_NAMESPACE.bep721;
|
|
132
|
-
case 'BEP1155':
|
|
133
|
-
return ASSET_NAMESPACE.bep1155;
|
|
134
128
|
default:
|
|
135
129
|
return;
|
|
136
130
|
}
|
|
@@ -2,7 +2,6 @@ import type { evm } from '@shapeshiftoss/common-api';
|
|
|
2
2
|
import type * as mayachain from '../../parser/mayachain.js';
|
|
3
3
|
import type * as thorchain from '../../parser/thorchain.js';
|
|
4
4
|
import type { StandardTx } from '../../types.js';
|
|
5
|
-
import type * as bep20 from '../bnbsmartchain/parser/bep20.js';
|
|
6
5
|
import type * as cowswap from '../ethereum/parser/cowswap.js';
|
|
7
6
|
import type * as foxy from '../ethereum/parser/foxy.js';
|
|
8
7
|
import type * as uniV2 from '../ethereum/parser/uniV2.js';
|
|
@@ -12,7 +11,7 @@ import type * as erc20 from '../parser/erc20.js';
|
|
|
12
11
|
import type * as rfox from '../parser/rfox.js';
|
|
13
12
|
import type * as zrx from '../parser/zrx.js';
|
|
14
13
|
export type Tx = evm.Tx;
|
|
15
|
-
export type TxMetadata =
|
|
14
|
+
export type TxMetadata = cowswap.TxMetadata | erc20.TxMetadata | foxy.TxMetadata | thorchain.TxMetadata | mayachain.TxMetadata | uniV2.TxMetadata | weth.TxMetadata | zrx.TxMetadata | rfox.TxMetadata | arbitrumBridge.TxMetadata;
|
|
16
15
|
export interface ParsedTx extends StandardTx {
|
|
17
16
|
data?: TxMetadata;
|
|
18
17
|
}
|
|
@@ -20,6 +20,9 @@ export interface EstimateGasRequest {
|
|
|
20
20
|
export interface GetAccountRequest {
|
|
21
21
|
pubkey: string;
|
|
22
22
|
}
|
|
23
|
+
export interface GetRfoxStakingDurationRequest {
|
|
24
|
+
address: string;
|
|
25
|
+
}
|
|
23
26
|
export interface GetTokenMetadataRequest {
|
|
24
27
|
contract: string;
|
|
25
28
|
id: string;
|
|
@@ -82,6 +85,18 @@ export declare class V1Api extends runtime.BaseAPI {
|
|
|
82
85
|
* Get information about the running coinstack
|
|
83
86
|
*/
|
|
84
87
|
getInfo(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BaseInfo>;
|
|
88
|
+
/**
|
|
89
|
+
* Get rFOX staking duration by contract address
|
|
90
|
+
*/
|
|
91
|
+
getRfoxStakingDurationRaw(requestParameters: GetRfoxStakingDurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{
|
|
92
|
+
[key: string]: number;
|
|
93
|
+
}>>;
|
|
94
|
+
/**
|
|
95
|
+
* Get rFOX staking duration by contract address
|
|
96
|
+
*/
|
|
97
|
+
getRfoxStakingDuration(requestParameters: GetRfoxStakingDurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{
|
|
98
|
+
[key: string]: number;
|
|
99
|
+
}>;
|
|
85
100
|
/**
|
|
86
101
|
* Get token metadata
|
|
87
102
|
*/
|
|
@@ -136,6 +136,30 @@ export class V1Api extends runtime.BaseAPI {
|
|
|
136
136
|
const response = await this.getInfoRaw(initOverrides);
|
|
137
137
|
return await response.value();
|
|
138
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Get rFOX staking duration by contract address
|
|
141
|
+
*/
|
|
142
|
+
async getRfoxStakingDurationRaw(requestParameters, initOverrides) {
|
|
143
|
+
if (requestParameters.address === null || requestParameters.address === undefined) {
|
|
144
|
+
throw new runtime.RequiredError('address', 'Required parameter requestParameters.address was null or undefined when calling getRfoxStakingDuration.');
|
|
145
|
+
}
|
|
146
|
+
const queryParameters = {};
|
|
147
|
+
const headerParameters = {};
|
|
148
|
+
const response = await this.request({
|
|
149
|
+
path: `/api/v1/rfox/staking-duration/{address}`.replace(`{${"address"}}`, encodeURIComponent(String(requestParameters.address))),
|
|
150
|
+
method: 'GET',
|
|
151
|
+
headers: headerParameters,
|
|
152
|
+
query: queryParameters,
|
|
153
|
+
}, initOverrides);
|
|
154
|
+
return new runtime.JSONApiResponse(response);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Get rFOX staking duration by contract address
|
|
158
|
+
*/
|
|
159
|
+
async getRfoxStakingDuration(requestParameters, initOverrides) {
|
|
160
|
+
const response = await this.getRfoxStakingDurationRaw(requestParameters, initOverrides);
|
|
161
|
+
return await response.value();
|
|
162
|
+
}
|
|
139
163
|
/**
|
|
140
164
|
* Get token metadata
|
|
141
165
|
*/
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime.js';
|
|
13
|
-
import type { Account, BaseInfo, BaseTxHistoryTx, DoRpcRequest200Response, DoRpcRequestRequest, EstimateFeesBody, PriorityFees, SendTxBody,
|
|
13
|
+
import type { Account, BaseInfo, BaseTxHistoryTx, DoRpcRequest200Response, DoRpcRequestRequest, EstimateFeesBody, PriorityFees, SendTxBody, TokenDetails, Tx } from '../models/index.js';
|
|
14
14
|
export interface DoRpcRequestOperationRequest {
|
|
15
15
|
doRpcRequestRequest: DoRpcRequestRequest;
|
|
16
16
|
}
|
|
@@ -81,11 +81,11 @@ export declare class V1Api extends runtime.BaseAPI {
|
|
|
81
81
|
/**
|
|
82
82
|
* Get token details
|
|
83
83
|
*/
|
|
84
|
-
getTokenRaw(requestParameters: GetTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
84
|
+
getTokenRaw(requestParameters: GetTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TokenDetails>>;
|
|
85
85
|
/**
|
|
86
86
|
* Get token details
|
|
87
87
|
*/
|
|
88
|
-
getToken(requestParameters: GetTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
88
|
+
getToken(requestParameters: GetTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TokenDetails>;
|
|
89
89
|
/**
|
|
90
90
|
* Get transaction details
|
|
91
91
|
*/
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* Do not edit the class manually.
|
|
14
14
|
*/
|
|
15
15
|
import * as runtime from '../runtime.js';
|
|
16
|
-
import { AccountFromJSON, BaseInfoFromJSON, BaseTxHistoryTxFromJSON, DoRpcRequest200ResponseFromJSON, DoRpcRequestRequestToJSON, EstimateFeesBodyToJSON, PriorityFeesFromJSON, SendTxBodyToJSON,
|
|
16
|
+
import { AccountFromJSON, BaseInfoFromJSON, BaseTxHistoryTxFromJSON, DoRpcRequest200ResponseFromJSON, DoRpcRequestRequestToJSON, EstimateFeesBodyToJSON, PriorityFeesFromJSON, SendTxBodyToJSON, TokenDetailsFromJSON, TxFromJSON, } from '../models/index.js';
|
|
17
17
|
/**
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
@@ -151,7 +151,7 @@ export class V1Api extends runtime.BaseAPI {
|
|
|
151
151
|
headers: headerParameters,
|
|
152
152
|
query: queryParameters,
|
|
153
153
|
}, initOverrides);
|
|
154
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
154
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => TokenDetailsFromJSON(jsonValue));
|
|
155
155
|
}
|
|
156
156
|
/**
|
|
157
157
|
* Get token details
|
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
+
import type { TokenStandard } from './TokenStandard.js';
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
+
*
|
|
14
15
|
* @export
|
|
15
16
|
* @interface Token
|
|
16
17
|
*/
|
|
@@ -20,31 +21,13 @@ export interface Token {
|
|
|
20
21
|
* @type {string}
|
|
21
22
|
* @memberof Token
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
* @type {number}
|
|
27
|
-
* @memberof Token
|
|
28
|
-
*/
|
|
29
|
-
decimals: number;
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* @type {string}
|
|
33
|
-
* @memberof Token
|
|
34
|
-
*/
|
|
35
|
-
name: string;
|
|
36
|
-
/**
|
|
37
|
-
*
|
|
38
|
-
* @type {string}
|
|
39
|
-
* @memberof Token
|
|
40
|
-
*/
|
|
41
|
-
symbol: string;
|
|
24
|
+
mint: string;
|
|
42
25
|
/**
|
|
43
26
|
*
|
|
44
|
-
* @type {
|
|
27
|
+
* @type {TokenStandard}
|
|
45
28
|
* @memberof Token
|
|
46
29
|
*/
|
|
47
|
-
|
|
30
|
+
tokenStandard: TokenStandard;
|
|
48
31
|
}
|
|
49
32
|
/**
|
|
50
33
|
* Check if a given object implements the Token interface.
|