@cityofzion/bs-ethereum 2.10.0 → 2.12.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/BSEthereum.d.ts +7 -5
- package/dist/BSEthereum.js +20 -27
- package/dist/assets/abis/{ERC271.d.ts → ERC721.d.ts} +1 -1
- package/dist/assets/abis/{ERC271.js → ERC721.js} +2 -2
- package/dist/constants/BSEthereumConstants.d.ts +5 -7
- package/dist/constants/BSEthereumConstants.js +21 -38
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/services/blockchain-data/DoraBDSEthereum.d.ts +11 -0
- package/dist/services/blockchain-data/DoraBDSEthereum.js +154 -0
- package/dist/services/blockchain-data/MoralisBDSEthereum.d.ts +6 -4
- package/dist/services/blockchain-data/MoralisBDSEthereum.js +55 -9
- package/dist/services/blockchain-data/RpcBDSEthereum.d.ts +6 -4
- package/dist/services/blockchain-data/RpcBDSEthereum.js +10 -0
- package/dist/services/explorer/BlockscoutESEthereum.d.ts +5 -5
- package/dist/services/explorer/BlockscoutESEthereum.js +55 -36
- package/dist/services/ledger/EthersLedgerServiceEthereum.js +1 -0
- package/dist/services/nft-data/GhostMarketNDSEthereum.d.ts +3 -5
- package/dist/services/nft-data/GhostMarketNDSEthereum.js +15 -14
- package/package.json +5 -3
- package/dist/services/blockchain-data/BlockscoutBDSEthereum.d.ts +0 -16
- package/dist/services/blockchain-data/BlockscoutBDSEthereum.js +0 -314
- package/dist/services/exchange-data/FlamingoForthewinEDSNeox.d.ts +0 -7
- package/dist/services/exchange-data/FlamingoForthewinEDSNeox.js +0 -67
package/dist/BSEthereum.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Account, BSCalculableFee, BSWithExplorerService, BSWithLedger, BSWithNameService, BSWithNft, BlockchainDataService, BlockchainService, ExchangeDataService, ExplorerService, Network, NftDataService, Token, TransferParam, GetLedgerTransport } from '@cityofzion/blockchain-service';
|
|
2
|
+
import { ethers } from 'ethers';
|
|
2
3
|
import { BSEthereumNetworkId } from './constants/BSEthereumConstants';
|
|
3
4
|
import { EthersLedgerServiceEthereum } from './services/ledger/EthersLedgerServiceEthereum';
|
|
4
|
-
export declare class BSEthereum<BSName extends string = string> implements BlockchainService<BSName,
|
|
5
|
+
export declare class BSEthereum<BSName extends string = string, NetworkId extends string = BSEthereumNetworkId> implements BlockchainService<BSName, NetworkId>, BSWithNft, BSWithNameService, BSCalculableFee<BSName>, BSWithLedger<BSName>, BSWithExplorerService {
|
|
5
6
|
#private;
|
|
6
7
|
readonly name: BSName;
|
|
7
8
|
readonly bip44DerivationPath: string;
|
|
@@ -12,11 +13,12 @@ export declare class BSEthereum<BSName extends string = string> implements Block
|
|
|
12
13
|
ledgerService: EthersLedgerServiceEthereum<BSName>;
|
|
13
14
|
tokens: Token[];
|
|
14
15
|
nftDataService: NftDataService;
|
|
15
|
-
network: Network<
|
|
16
|
+
network: Network<NetworkId>;
|
|
16
17
|
explorerService: ExplorerService;
|
|
17
|
-
constructor(name: BSName, network?: Network<
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
constructor(name: BSName, network?: Network<NetworkId>, getLedgerTransport?: GetLedgerTransport<BSName>);
|
|
19
|
+
generateSigner(account: Account<BSName>): Promise<ethers.Signer>;
|
|
20
|
+
testNetwork(network: Network<NetworkId>): Promise<void>;
|
|
21
|
+
setNetwork(network: Network<NetworkId>): void;
|
|
20
22
|
validateAddress(address: string): boolean;
|
|
21
23
|
validateEncrypted(json: string): boolean;
|
|
22
24
|
validateKey(key: string): boolean;
|
package/dist/BSEthereum.js
CHANGED
|
@@ -36,7 +36,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
36
36
|
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");
|
|
37
37
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
38
38
|
};
|
|
39
|
-
var _BSEthereum_instances,
|
|
39
|
+
var _BSEthereum_instances, _BSEthereum_buildTransferParams, _BSEthereum_setTokens;
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.BSEthereum = void 0;
|
|
42
42
|
const ethers_1 = require("ethers");
|
|
@@ -46,8 +46,6 @@ const ethersBigNumber = __importStar(require("@ethersproject/bignumber"));
|
|
|
46
46
|
const BSEthereumConstants_1 = require("./constants/BSEthereumConstants");
|
|
47
47
|
const EthersLedgerServiceEthereum_1 = require("./services/ledger/EthersLedgerServiceEthereum");
|
|
48
48
|
const BSEthereumHelper_1 = require("./helpers/BSEthereumHelper");
|
|
49
|
-
const BlockscoutBDSEthereum_1 = require("./services/blockchain-data/BlockscoutBDSEthereum");
|
|
50
|
-
const FlamingoForthewinEDSNeox_1 = require("./services/exchange-data/FlamingoForthewinEDSNeox");
|
|
51
49
|
const MoralisBDSEthereum_1 = require("./services/blockchain-data/MoralisBDSEthereum");
|
|
52
50
|
const MoralisEDSEthereum_1 = require("./services/exchange-data/MoralisEDSEthereum");
|
|
53
51
|
const GhostMarketNDSEthereum_1 = require("./services/nft-data/GhostMarketNDSEthereum");
|
|
@@ -62,6 +60,20 @@ class BSEthereum {
|
|
|
62
60
|
this.bip44DerivationPath = BSEthereumConstants_1.BSEthereumConstants.DEFAULT_BIP44_DERIVATION_PATH;
|
|
63
61
|
this.setNetwork(network);
|
|
64
62
|
}
|
|
63
|
+
generateSigner(account) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
const provider = new ethers_1.ethers.providers.JsonRpcProvider(this.network.url);
|
|
66
|
+
if (account.isHardware) {
|
|
67
|
+
if (!this.ledgerService.getLedgerTransport)
|
|
68
|
+
throw new Error('You must provide getLedgerTransport function to use Ledger');
|
|
69
|
+
if (typeof account.bip44Path !== 'string')
|
|
70
|
+
throw new Error('Your account must have bip44 path to use Ledger');
|
|
71
|
+
const ledgerTransport = yield this.ledgerService.getLedgerTransport(account);
|
|
72
|
+
return this.ledgerService.getSigner(ledgerTransport, account.bip44Path, provider);
|
|
73
|
+
}
|
|
74
|
+
return new ethers_1.ethers.Wallet(account.key, provider);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
65
77
|
testNetwork(network) {
|
|
66
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
67
79
|
const blockchainDataServiceClone = new RpcBDSEthereum_1.RpcBDSEthereum(network);
|
|
@@ -71,16 +83,10 @@ class BSEthereum {
|
|
|
71
83
|
setNetwork(network) {
|
|
72
84
|
__classPrivateFieldGet(this, _BSEthereum_instances, "m", _BSEthereum_setTokens).call(this, network);
|
|
73
85
|
this.network = network;
|
|
74
|
-
if (BlockscoutBDSEthereum_1.BlockscoutBDSEthereum.isNeoX(network)) {
|
|
75
|
-
this.exchangeDataService = new FlamingoForthewinEDSNeox_1.FlamingoForthewinEDSNeox(network);
|
|
76
|
-
this.blockchainDataService = new BlockscoutBDSEthereum_1.BlockscoutBDSEthereum(network);
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
this.exchangeDataService = new MoralisEDSEthereum_1.MoralisEDSEthereum(network, this.blockchainDataService);
|
|
80
|
-
this.blockchainDataService = new MoralisBDSEthereum_1.MoralisBDSEthereum(network);
|
|
81
|
-
}
|
|
82
86
|
this.nftDataService = new GhostMarketNDSEthereum_1.GhostMarketNDSEthereum(network);
|
|
83
87
|
this.explorerService = new BlockscoutESEthereum_1.BlockscoutESEthereum(network);
|
|
88
|
+
this.exchangeDataService = new MoralisEDSEthereum_1.MoralisEDSEthereum(network, this.blockchainDataService);
|
|
89
|
+
this.blockchainDataService = new MoralisBDSEthereum_1.MoralisBDSEthereum(network, this.nftDataService, this.explorerService);
|
|
84
90
|
}
|
|
85
91
|
validateAddress(address) {
|
|
86
92
|
return ethers_1.ethers.utils.isAddress(address);
|
|
@@ -150,7 +156,7 @@ class BSEthereum {
|
|
|
150
156
|
}
|
|
151
157
|
transfer(param) {
|
|
152
158
|
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
-
const signer = yield
|
|
159
|
+
const signer = yield this.generateSigner(param.senderAccount);
|
|
154
160
|
const sentTransactionHashes = [];
|
|
155
161
|
let error;
|
|
156
162
|
for (const intent of param.intents) {
|
|
@@ -180,7 +186,7 @@ class BSEthereum {
|
|
|
180
186
|
}
|
|
181
187
|
calculateTransferFee(param) {
|
|
182
188
|
return __awaiter(this, void 0, void 0, function* () {
|
|
183
|
-
const signer = yield
|
|
189
|
+
const signer = yield this.generateSigner(param.senderAccount);
|
|
184
190
|
let fee = ethers_1.ethers.utils.parseEther('0');
|
|
185
191
|
for (const intent of param.intents) {
|
|
186
192
|
const { gasPrice, transactionParams } = yield __classPrivateFieldGet(this, _BSEthereum_instances, "m", _BSEthereum_buildTransferParams).call(this, intent);
|
|
@@ -202,20 +208,7 @@ class BSEthereum {
|
|
|
202
208
|
}
|
|
203
209
|
}
|
|
204
210
|
exports.BSEthereum = BSEthereum;
|
|
205
|
-
_BSEthereum_instances = new WeakSet(),
|
|
206
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
207
|
-
const provider = new ethers_1.ethers.providers.JsonRpcProvider(this.network.url);
|
|
208
|
-
if (account.isHardware) {
|
|
209
|
-
if (!this.ledgerService.getLedgerTransport)
|
|
210
|
-
throw new Error('You must provide getLedgerTransport function to use Ledger');
|
|
211
|
-
if (typeof account.bip44Path !== 'string')
|
|
212
|
-
throw new Error('Your account must have bip44 path to use Ledger');
|
|
213
|
-
const ledgerTransport = yield this.ledgerService.getLedgerTransport(account);
|
|
214
|
-
return this.ledgerService.getSigner(ledgerTransport, account.bip44Path, provider);
|
|
215
|
-
}
|
|
216
|
-
return new ethers_1.ethers.Wallet(account.key, provider);
|
|
217
|
-
});
|
|
218
|
-
}, _BSEthereum_buildTransferParams = function _BSEthereum_buildTransferParams(intent) {
|
|
211
|
+
_BSEthereum_instances = new WeakSet(), _BSEthereum_buildTransferParams = function _BSEthereum_buildTransferParams(intent) {
|
|
219
212
|
return __awaiter(this, void 0, void 0, function* () {
|
|
220
213
|
const provider = new ethers_1.ethers.providers.JsonRpcProvider(this.network.url);
|
|
221
214
|
let decimals = intent.tokenDecimals;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { Network, NetworkId } from '@cityofzion/blockchain-service';
|
|
2
|
-
export type BSEthereumNetworkId = NetworkId<'1' | '10' | '25' | '56' | '137' | '250' | '1101' | '8453' | '80002' | '42161' | '42220' | '43114' | '59144' | '11155111'
|
|
2
|
+
export type BSEthereumNetworkId = NetworkId<'1' | '10' | '25' | '56' | '137' | '250' | '1101' | '8453' | '80002' | '42161' | '42220' | '43114' | '59144' | '11155111'>;
|
|
3
3
|
export declare class BSEthereumConstants {
|
|
4
4
|
static DEFAULT_DECIMALS: number;
|
|
5
5
|
static DEFAULT_GAS_LIMIT: number;
|
|
6
|
+
static readonly ETHEREUM_MAINNET_NETWORK_ID: BSEthereumNetworkId;
|
|
7
|
+
static readonly POLYGON_MAINNET_NETWORK_ID: BSEthereumNetworkId;
|
|
8
|
+
static readonly BASE_MAINNET_NETWORK_ID: BSEthereumNetworkId;
|
|
9
|
+
static readonly ARBITRUM_MAINNET_NETWORK_ID: BSEthereumNetworkId;
|
|
6
10
|
static NATIVE_SYMBOL_BY_NETWORK_ID: Record<BSEthereumNetworkId, string>;
|
|
7
11
|
static NATIVE_WRAPPED_HASH_BY_NETWORK_ID: Partial<Record<BSEthereumNetworkId, string>>;
|
|
8
12
|
static RPC_LIST_BY_NETWORK_ID: Record<BSEthereumNetworkId, string[]>;
|
|
9
13
|
static DEFAULT_BIP44_DERIVATION_PATH: string;
|
|
10
|
-
static NEOX_MAINNET_NETWORK_ID: BSEthereumNetworkId;
|
|
11
|
-
static NEOX_TESTNET_NETWORK_ID: BSEthereumNetworkId;
|
|
12
|
-
static NEOX_NETWORK_IDS: BSEthereumNetworkId[];
|
|
13
|
-
static NEOX_TESTNET_NETWORK: Network<BSEthereumNetworkId>;
|
|
14
|
-
static NEOX_MAINNET_NETWORK: Network<BSEthereumNetworkId>;
|
|
15
|
-
static NEOX_NETWORKS: Network<BSEthereumNetworkId>[];
|
|
16
14
|
static MAINNET_NETWORK_IDS: BSEthereumNetworkId[];
|
|
17
15
|
static TESTNET_NETWORK_IDS: BSEthereumNetworkId[];
|
|
18
16
|
static ALL_NETWORK_IDS: BSEthereumNetworkId[];
|
|
@@ -8,6 +8,10 @@ exports.BSEthereumConstants = BSEthereumConstants;
|
|
|
8
8
|
_a = BSEthereumConstants;
|
|
9
9
|
BSEthereumConstants.DEFAULT_DECIMALS = 18;
|
|
10
10
|
BSEthereumConstants.DEFAULT_GAS_LIMIT = 0x5208;
|
|
11
|
+
BSEthereumConstants.ETHEREUM_MAINNET_NETWORK_ID = '1';
|
|
12
|
+
BSEthereumConstants.POLYGON_MAINNET_NETWORK_ID = '137';
|
|
13
|
+
BSEthereumConstants.BASE_MAINNET_NETWORK_ID = '8453';
|
|
14
|
+
BSEthereumConstants.ARBITRUM_MAINNET_NETWORK_ID = '42161';
|
|
11
15
|
BSEthereumConstants.NATIVE_SYMBOL_BY_NETWORK_ID = {
|
|
12
16
|
'1': 'ETH',
|
|
13
17
|
'10': 'ETH',
|
|
@@ -23,18 +27,16 @@ BSEthereumConstants.NATIVE_SYMBOL_BY_NETWORK_ID = {
|
|
|
23
27
|
'43114': 'AVAX',
|
|
24
28
|
'59144': 'ETH',
|
|
25
29
|
'11155111': 'ETH',
|
|
26
|
-
'47763': 'GAS',
|
|
27
|
-
'12227332': 'GAS',
|
|
28
30
|
};
|
|
29
31
|
BSEthereumConstants.NATIVE_WRAPPED_HASH_BY_NETWORK_ID = {
|
|
30
|
-
|
|
32
|
+
[_a.ETHEREUM_MAINNET_NETWORK_ID]: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
|
|
31
33
|
'10': '0x4200000000000000000000000000000000000006',
|
|
32
34
|
'25': '0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23',
|
|
33
35
|
'56': '0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c',
|
|
34
|
-
|
|
36
|
+
[_a.POLYGON_MAINNET_NETWORK_ID]: '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270',
|
|
35
37
|
'250': '0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83',
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
[_a.BASE_MAINNET_NETWORK_ID]: '0x4200000000000000000000000000000000000006',
|
|
39
|
+
[_a.ARBITRUM_MAINNET_NETWORK_ID]: '0x82af49447d8a07e3bd95bd0d56f35241523fbab1',
|
|
38
40
|
'42220': '0x471EcE3750Da237f93B8E339c536989b8978a438',
|
|
39
41
|
'43114': '0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7',
|
|
40
42
|
'59144': '0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f',
|
|
@@ -123,45 +125,28 @@ BSEthereumConstants.RPC_LIST_BY_NETWORK_ID = {
|
|
|
123
125
|
'https://eth-sepolia-public.unifra.io',
|
|
124
126
|
'https://endpoints.omniatech.io/v1/eth/sepolia/public',
|
|
125
127
|
],
|
|
126
|
-
'47763': ['https://mainnet-1.rpc.banelabs.org'],
|
|
127
|
-
'12227332': ['https://neoxt4seed1.ngd.network'],
|
|
128
128
|
};
|
|
129
129
|
BSEthereumConstants.DEFAULT_BIP44_DERIVATION_PATH = "m/44'/60'/0'/0/?";
|
|
130
|
-
BSEthereumConstants.NEOX_MAINNET_NETWORK_ID = '47763';
|
|
131
|
-
BSEthereumConstants.NEOX_TESTNET_NETWORK_ID = '12227332';
|
|
132
|
-
BSEthereumConstants.NEOX_NETWORK_IDS = [_a.NEOX_TESTNET_NETWORK_ID, _a.NEOX_MAINNET_NETWORK_ID];
|
|
133
|
-
BSEthereumConstants.NEOX_TESTNET_NETWORK = {
|
|
134
|
-
id: _a.NEOX_TESTNET_NETWORK_ID,
|
|
135
|
-
name: 'NeoX Testnet',
|
|
136
|
-
url: _a.RPC_LIST_BY_NETWORK_ID[_a.NEOX_TESTNET_NETWORK_ID][0],
|
|
137
|
-
};
|
|
138
|
-
BSEthereumConstants.NEOX_MAINNET_NETWORK = {
|
|
139
|
-
id: _a.NEOX_MAINNET_NETWORK_ID,
|
|
140
|
-
name: 'NeoX Mainnet',
|
|
141
|
-
url: _a.RPC_LIST_BY_NETWORK_ID[_a.NEOX_MAINNET_NETWORK_ID][0],
|
|
142
|
-
};
|
|
143
|
-
BSEthereumConstants.NEOX_NETWORKS = [_a.NEOX_TESTNET_NETWORK, _a.NEOX_MAINNET_NETWORK];
|
|
144
130
|
BSEthereumConstants.MAINNET_NETWORK_IDS = [
|
|
145
|
-
|
|
131
|
+
_a.ETHEREUM_MAINNET_NETWORK_ID,
|
|
146
132
|
'10',
|
|
147
133
|
'25',
|
|
148
134
|
'56',
|
|
149
|
-
|
|
135
|
+
_a.POLYGON_MAINNET_NETWORK_ID,
|
|
150
136
|
'250',
|
|
151
|
-
|
|
152
|
-
|
|
137
|
+
_a.BASE_MAINNET_NETWORK_ID,
|
|
138
|
+
_a.ARBITRUM_MAINNET_NETWORK_ID,
|
|
153
139
|
'42220',
|
|
154
140
|
'43114',
|
|
155
141
|
'59144',
|
|
156
|
-
_a.NEOX_MAINNET_NETWORK_ID,
|
|
157
142
|
];
|
|
158
|
-
BSEthereumConstants.TESTNET_NETWORK_IDS = ['1101', '80002', '11155111'
|
|
143
|
+
BSEthereumConstants.TESTNET_NETWORK_IDS = ['1101', '80002', '11155111'];
|
|
159
144
|
BSEthereumConstants.ALL_NETWORK_IDS = [..._a.MAINNET_NETWORK_IDS, ..._a.TESTNET_NETWORK_IDS];
|
|
160
145
|
BSEthereumConstants.MAINNET_NETWORKS = [
|
|
161
146
|
{
|
|
162
|
-
id:
|
|
147
|
+
id: _a.ETHEREUM_MAINNET_NETWORK_ID,
|
|
163
148
|
name: 'Ethereum Mainnet',
|
|
164
|
-
url: _a.RPC_LIST_BY_NETWORK_ID[
|
|
149
|
+
url: _a.RPC_LIST_BY_NETWORK_ID[_a.ETHEREUM_MAINNET_NETWORK_ID][0],
|
|
165
150
|
},
|
|
166
151
|
{
|
|
167
152
|
id: '10',
|
|
@@ -179,9 +164,9 @@ BSEthereumConstants.MAINNET_NETWORKS = [
|
|
|
179
164
|
url: _a.RPC_LIST_BY_NETWORK_ID['56'][0],
|
|
180
165
|
},
|
|
181
166
|
{
|
|
182
|
-
id:
|
|
167
|
+
id: _a.POLYGON_MAINNET_NETWORK_ID,
|
|
183
168
|
name: 'Polygon Mainnet',
|
|
184
|
-
url: _a.RPC_LIST_BY_NETWORK_ID[
|
|
169
|
+
url: _a.RPC_LIST_BY_NETWORK_ID[_a.POLYGON_MAINNET_NETWORK_ID][0],
|
|
185
170
|
},
|
|
186
171
|
{
|
|
187
172
|
id: '250',
|
|
@@ -189,14 +174,14 @@ BSEthereumConstants.MAINNET_NETWORKS = [
|
|
|
189
174
|
url: _a.RPC_LIST_BY_NETWORK_ID['250'][0],
|
|
190
175
|
},
|
|
191
176
|
{
|
|
192
|
-
id:
|
|
177
|
+
id: _a.BASE_MAINNET_NETWORK_ID,
|
|
193
178
|
name: 'Base Protocol Mainnet',
|
|
194
|
-
url: _a.RPC_LIST_BY_NETWORK_ID[
|
|
179
|
+
url: _a.RPC_LIST_BY_NETWORK_ID[_a.BASE_MAINNET_NETWORK_ID][0],
|
|
195
180
|
},
|
|
196
181
|
{
|
|
197
|
-
id:
|
|
182
|
+
id: _a.ARBITRUM_MAINNET_NETWORK_ID,
|
|
198
183
|
name: 'Arbitrum Mainnet',
|
|
199
|
-
url: _a.RPC_LIST_BY_NETWORK_ID[
|
|
184
|
+
url: _a.RPC_LIST_BY_NETWORK_ID[_a.ARBITRUM_MAINNET_NETWORK_ID][0],
|
|
200
185
|
},
|
|
201
186
|
{
|
|
202
187
|
id: '42220',
|
|
@@ -213,7 +198,6 @@ BSEthereumConstants.MAINNET_NETWORKS = [
|
|
|
213
198
|
name: 'Linea Mainnet',
|
|
214
199
|
url: _a.RPC_LIST_BY_NETWORK_ID['59144'][0],
|
|
215
200
|
},
|
|
216
|
-
_a.NEOX_MAINNET_NETWORK,
|
|
217
201
|
];
|
|
218
202
|
BSEthereumConstants.TESTNET_NETWORKS = [
|
|
219
203
|
{
|
|
@@ -231,7 +215,6 @@ BSEthereumConstants.TESTNET_NETWORKS = [
|
|
|
231
215
|
name: 'Sepolia Testnet',
|
|
232
216
|
url: _a.RPC_LIST_BY_NETWORK_ID['11155111'][0],
|
|
233
217
|
},
|
|
234
|
-
_a.NEOX_TESTNET_NETWORK,
|
|
235
218
|
];
|
|
236
219
|
BSEthereumConstants.ALL_NETWORKS = [..._a.MAINNET_NETWORKS, ..._a.TESTNET_NETWORKS];
|
|
237
220
|
BSEthereumConstants.DEFAULT_NETWORK = _a.MAINNET_NETWORKS[0];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
export * from './BSEthereum';
|
|
2
2
|
export * from './helpers/BSEthereumHelper';
|
|
3
3
|
export * from './constants/BSEthereumConstants';
|
|
4
|
-
export * from './services/blockchain-data/BlockscoutBDSEthereum';
|
|
5
4
|
export * from './services/blockchain-data/MoralisBDSEthereum';
|
|
5
|
+
export * from './services/blockchain-data/DoraBDSEthereum';
|
|
6
6
|
export * from './services/blockchain-data/RpcBDSEthereum';
|
|
7
|
-
export * from './services/exchange-data/FlamingoForthewinEDSNeox';
|
|
8
7
|
export * from './services/exchange-data/MoralisEDSEthereum';
|
|
9
8
|
export * from './services/explorer/BlockscoutESEthereum';
|
|
10
9
|
export * from './services/ledger/EthersLedgerServiceEthereum';
|
|
11
10
|
export * from './services/nft-data/GhostMarketNDSEthereum';
|
|
12
11
|
export * from './services/nft-data/RpcNDSEthereum';
|
|
12
|
+
export * from './assets/abis/ERC20';
|
|
13
|
+
export * from './assets/abis/ERC721';
|
package/dist/index.js
CHANGED
|
@@ -17,12 +17,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./BSEthereum"), exports);
|
|
18
18
|
__exportStar(require("./helpers/BSEthereumHelper"), exports);
|
|
19
19
|
__exportStar(require("./constants/BSEthereumConstants"), exports);
|
|
20
|
-
__exportStar(require("./services/blockchain-data/BlockscoutBDSEthereum"), exports);
|
|
21
20
|
__exportStar(require("./services/blockchain-data/MoralisBDSEthereum"), exports);
|
|
21
|
+
__exportStar(require("./services/blockchain-data/DoraBDSEthereum"), exports);
|
|
22
22
|
__exportStar(require("./services/blockchain-data/RpcBDSEthereum"), exports);
|
|
23
|
-
__exportStar(require("./services/exchange-data/FlamingoForthewinEDSNeox"), exports);
|
|
24
23
|
__exportStar(require("./services/exchange-data/MoralisEDSEthereum"), exports);
|
|
25
24
|
__exportStar(require("./services/explorer/BlockscoutESEthereum"), exports);
|
|
26
25
|
__exportStar(require("./services/ledger/EthersLedgerServiceEthereum"), exports);
|
|
27
26
|
__exportStar(require("./services/nft-data/GhostMarketNDSEthereum"), exports);
|
|
28
27
|
__exportStar(require("./services/nft-data/RpcNDSEthereum"), exports);
|
|
28
|
+
__exportStar(require("./assets/abis/ERC20"), exports);
|
|
29
|
+
__exportStar(require("./assets/abis/ERC721"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RpcBDSEthereum } from './RpcBDSEthereum';
|
|
2
|
+
import { ExplorerService, FullTransactionsByAddressParams, FullTransactionsByAddressResponse, Network, NetworkId, NftDataService } from '@cityofzion/blockchain-service';
|
|
3
|
+
import { GetFullTransactionsByAddressResponse } from '@cityofzion/dora-ts/dist/interfaces/api/common';
|
|
4
|
+
import { BSEthereumNetworkId } from '../../constants/BSEthereumConstants';
|
|
5
|
+
export declare class DoraBDSEthereum<BSNetworkId extends NetworkId = BSEthereumNetworkId> extends RpcBDSEthereum {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(network: Network<BSNetworkId>, supportedFullTransactionsByAddressNetworks: BSNetworkId[], nftDataService: NftDataService, explorerService: ExplorerService);
|
|
8
|
+
_transformFullTransactionsByAddressResponse({ nextCursor, ...response }: GetFullTransactionsByAddressResponse): Promise<FullTransactionsByAddressResponse>;
|
|
9
|
+
_validateFullTransactionsByAddressParams(params: Pick<FullTransactionsByAddressParams, 'address' | 'dateFrom' | 'dateTo'>): void;
|
|
10
|
+
_validateGetFullTransactionsByAddressParams({ pageSize, ...params }: Pick<FullTransactionsByAddressParams, 'address' | 'dateFrom' | 'dateTo' | 'pageSize'>): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
13
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
14
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
15
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16
|
+
};
|
|
17
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
18
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
19
|
+
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");
|
|
20
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
21
|
+
};
|
|
22
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
23
|
+
var t = {};
|
|
24
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
25
|
+
t[p] = s[p];
|
|
26
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
27
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
28
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
29
|
+
t[p[i]] = s[p[i]];
|
|
30
|
+
}
|
|
31
|
+
return t;
|
|
32
|
+
};
|
|
33
|
+
var _DoraBDSEthereum_supportedErc721Standards, _DoraBDSEthereum_supportedErc1155Standards, _DoraBDSEthereum_supportedErc20Standards, _DoraBDSEthereum_supportedFullTransactionsByAddressNetworks, _DoraBDSEthereum_nftDataService, _DoraBDSEthereum_explorerService;
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
exports.DoraBDSEthereum = void 0;
|
|
36
|
+
const RpcBDSEthereum_1 = require("./RpcBDSEthereum");
|
|
37
|
+
const blockchain_service_1 = require("@cityofzion/blockchain-service");
|
|
38
|
+
const ethers_1 = require("ethers");
|
|
39
|
+
const BSEthereumHelper_1 = require("../../helpers/BSEthereumHelper");
|
|
40
|
+
class DoraBDSEthereum extends RpcBDSEthereum_1.RpcBDSEthereum {
|
|
41
|
+
constructor(network, supportedFullTransactionsByAddressNetworks, nftDataService, explorerService) {
|
|
42
|
+
super(network);
|
|
43
|
+
_DoraBDSEthereum_supportedErc721Standards.set(this, ['erc721', 'erc-721']);
|
|
44
|
+
_DoraBDSEthereum_supportedErc1155Standards.set(this, ['erc1155', 'erc-1155']);
|
|
45
|
+
_DoraBDSEthereum_supportedErc20Standards.set(this, ['erc20', 'erc-20']);
|
|
46
|
+
_DoraBDSEthereum_supportedFullTransactionsByAddressNetworks.set(this, void 0);
|
|
47
|
+
_DoraBDSEthereum_nftDataService.set(this, void 0);
|
|
48
|
+
_DoraBDSEthereum_explorerService.set(this, void 0);
|
|
49
|
+
__classPrivateFieldSet(this, _DoraBDSEthereum_supportedFullTransactionsByAddressNetworks, supportedFullTransactionsByAddressNetworks, "f");
|
|
50
|
+
__classPrivateFieldSet(this, _DoraBDSEthereum_nftDataService, nftDataService, "f");
|
|
51
|
+
__classPrivateFieldSet(this, _DoraBDSEthereum_explorerService, explorerService, "f");
|
|
52
|
+
}
|
|
53
|
+
_transformFullTransactionsByAddressResponse(_a) {
|
|
54
|
+
var _b;
|
|
55
|
+
var { nextCursor } = _a, response = __rest(_a, ["nextCursor"]);
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
const data = [];
|
|
58
|
+
const items = (_b = response.data) !== null && _b !== void 0 ? _b : [];
|
|
59
|
+
const nativeToken = BSEthereumHelper_1.BSEthereumHelper.getNativeAsset(this._network);
|
|
60
|
+
const addressTemplateUrl = __classPrivateFieldGet(this, _DoraBDSEthereum_explorerService, "f").getAddressTemplateUrl();
|
|
61
|
+
const txTemplateUrl = __classPrivateFieldGet(this, _DoraBDSEthereum_explorerService, "f").getTxTemplateUrl();
|
|
62
|
+
const nftTemplateUrl = __classPrivateFieldGet(this, _DoraBDSEthereum_explorerService, "f").getNftTemplateUrl();
|
|
63
|
+
const contractTemplateUrl = __classPrivateFieldGet(this, _DoraBDSEthereum_explorerService, "f").getContractTemplateUrl();
|
|
64
|
+
const itemPromises = items.map((item) => __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
const txId = item.transactionID;
|
|
66
|
+
const newItem = {
|
|
67
|
+
txId,
|
|
68
|
+
txIdUrl: txId ? txTemplateUrl === null || txTemplateUrl === void 0 ? void 0 : txTemplateUrl.replace('{txId}', txId) : undefined,
|
|
69
|
+
block: item.block,
|
|
70
|
+
date: item.date,
|
|
71
|
+
invocationCount: item.invocationCount,
|
|
72
|
+
notificationCount: item.notificationCount,
|
|
73
|
+
networkFeeAmount: (0, blockchain_service_1.formatNumber)(item.networkFeeAmount, nativeToken.decimals),
|
|
74
|
+
systemFeeAmount: (0, blockchain_service_1.formatNumber)(item.systemFeeAmount, nativeToken.decimals),
|
|
75
|
+
events: [],
|
|
76
|
+
};
|
|
77
|
+
const eventPromises = item.events.map((event) => __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
var _c, _d, _e, _f, _g, _h;
|
|
79
|
+
let nftEvent;
|
|
80
|
+
let assetEvent;
|
|
81
|
+
const { methodName, tokenID: tokenId, contractHash: hash } = event;
|
|
82
|
+
const from = (_c = event.from) !== null && _c !== void 0 ? _c : undefined;
|
|
83
|
+
const to = (_d = event.to) !== null && _d !== void 0 ? _d : undefined;
|
|
84
|
+
const standard = (_g = (_f = (_e = event.supportedStandards) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.toLowerCase()) !== null && _g !== void 0 ? _g : '';
|
|
85
|
+
const isErc1155 = __classPrivateFieldGet(this, _DoraBDSEthereum_supportedErc1155Standards, "f").includes(standard);
|
|
86
|
+
const isErc721 = __classPrivateFieldGet(this, _DoraBDSEthereum_supportedErc721Standards, "f").includes(standard);
|
|
87
|
+
const isErc20 = __classPrivateFieldGet(this, _DoraBDSEthereum_supportedErc20Standards, "f").includes(standard);
|
|
88
|
+
const isNft = (isErc1155 || isErc721) && !!tokenId;
|
|
89
|
+
const fromUrl = from ? addressTemplateUrl === null || addressTemplateUrl === void 0 ? void 0 : addressTemplateUrl.replace('{address}', from) : undefined;
|
|
90
|
+
const toUrl = to ? addressTemplateUrl === null || addressTemplateUrl === void 0 ? void 0 : addressTemplateUrl.replace('{address}', to) : undefined;
|
|
91
|
+
const hashUrl = hash ? contractTemplateUrl === null || contractTemplateUrl === void 0 ? void 0 : contractTemplateUrl.replace('{hash}', hash) : undefined;
|
|
92
|
+
if (isNft) {
|
|
93
|
+
const [nft] = yield blockchain_service_1.BSPromisesHelper.tryCatch(() => __classPrivateFieldGet(this, _DoraBDSEthereum_nftDataService, "f").getNft({ contractHash: hash, tokenId }));
|
|
94
|
+
const nftUrl = hash ? nftTemplateUrl === null || nftTemplateUrl === void 0 ? void 0 : nftTemplateUrl.replace('{hash}', hash).replace('{tokenId}', tokenId) : undefined;
|
|
95
|
+
nftEvent = {
|
|
96
|
+
eventType: 'nft',
|
|
97
|
+
amount: '0',
|
|
98
|
+
methodName,
|
|
99
|
+
from,
|
|
100
|
+
fromUrl,
|
|
101
|
+
to,
|
|
102
|
+
toUrl,
|
|
103
|
+
hash,
|
|
104
|
+
hashUrl,
|
|
105
|
+
tokenId,
|
|
106
|
+
tokenType: isErc1155 ? 'erc-1155' : 'erc-721',
|
|
107
|
+
nftImageUrl: nft === null || nft === void 0 ? void 0 : nft.image,
|
|
108
|
+
nftUrl,
|
|
109
|
+
name: nft === null || nft === void 0 ? void 0 : nft.name,
|
|
110
|
+
collectionName: nft === null || nft === void 0 ? void 0 : nft.collectionName,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
const [token] = yield blockchain_service_1.BSPromisesHelper.tryCatch(() => this.getTokenInfo(hash));
|
|
115
|
+
const amount = (0, blockchain_service_1.formatNumber)(event.amount, (_h = token === null || token === void 0 ? void 0 : token.decimals) !== null && _h !== void 0 ? _h : event.tokenDecimals);
|
|
116
|
+
assetEvent = {
|
|
117
|
+
eventType: 'token',
|
|
118
|
+
amount,
|
|
119
|
+
methodName,
|
|
120
|
+
from,
|
|
121
|
+
fromUrl,
|
|
122
|
+
to,
|
|
123
|
+
toUrl,
|
|
124
|
+
hash,
|
|
125
|
+
hashUrl,
|
|
126
|
+
token: token !== null && token !== void 0 ? token : undefined,
|
|
127
|
+
tokenType: isErc20 ? 'erc-20' : 'generic',
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
newItem.events.push(isNft ? nftEvent : assetEvent);
|
|
131
|
+
}));
|
|
132
|
+
yield Promise.allSettled(eventPromises);
|
|
133
|
+
data.push(newItem);
|
|
134
|
+
}));
|
|
135
|
+
yield Promise.allSettled(itemPromises);
|
|
136
|
+
return { nextCursor, data };
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
_validateFullTransactionsByAddressParams(params) {
|
|
140
|
+
if (!__classPrivateFieldGet(this, _DoraBDSEthereum_supportedFullTransactionsByAddressNetworks, "f").includes(this._network.id))
|
|
141
|
+
throw new Error('This network is not supported');
|
|
142
|
+
blockchain_service_1.BSFullTransactionsByAddressHelper.validateFullTransactionsByAddressParams(params);
|
|
143
|
+
if (!ethers_1.ethers.utils.isAddress(params.address))
|
|
144
|
+
throw new Error('Invalid address param');
|
|
145
|
+
}
|
|
146
|
+
_validateGetFullTransactionsByAddressParams(_a) {
|
|
147
|
+
var { pageSize } = _a, params = __rest(_a, ["pageSize"]);
|
|
148
|
+
if (typeof pageSize === 'number' && (isNaN(pageSize) || pageSize < 1 || pageSize > 500))
|
|
149
|
+
throw new Error('Page size should be between 1 and 500');
|
|
150
|
+
this._validateFullTransactionsByAddressParams(params);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
exports.DoraBDSEthereum = DoraBDSEthereum;
|
|
154
|
+
_DoraBDSEthereum_supportedErc721Standards = new WeakMap(), _DoraBDSEthereum_supportedErc1155Standards = new WeakMap(), _DoraBDSEthereum_supportedErc20Standards = new WeakMap(), _DoraBDSEthereum_supportedFullTransactionsByAddressNetworks = new WeakMap(), _DoraBDSEthereum_nftDataService = new WeakMap(), _DoraBDSEthereum_explorerService = new WeakMap();
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { BalanceResponse, ContractResponse, Network, Token, TransactionResponse, TransactionsByAddressParams, TransactionsByAddressResponse } from '@cityofzion/blockchain-service';
|
|
2
|
-
import { RpcBDSEthereum } from './RpcBDSEthereum';
|
|
1
|
+
import { BalanceResponse, ContractResponse, Network, Token, TransactionResponse, TransactionsByAddressParams, TransactionsByAddressResponse, FullTransactionsByAddressParams, FullTransactionsByAddressResponse, NftDataService, ExplorerService, ExportTransactionsByAddressParams } from '@cityofzion/blockchain-service';
|
|
3
2
|
import { BSEthereumNetworkId } from '../../constants/BSEthereumConstants';
|
|
4
|
-
|
|
3
|
+
import { DoraBDSEthereum } from './DoraBDSEthereum';
|
|
4
|
+
export declare class MoralisBDSEthereum extends DoraBDSEthereum {
|
|
5
5
|
static BASE_URL: string;
|
|
6
6
|
static SUPPORTED_CHAINS: string[];
|
|
7
7
|
static getClient(network: Network<BSEthereumNetworkId>): import("axios").AxiosInstance;
|
|
8
8
|
static isSupported(network: Network<BSEthereumNetworkId>): boolean;
|
|
9
|
-
constructor(network: Network<BSEthereumNetworkId
|
|
9
|
+
constructor(network: Network<BSEthereumNetworkId>, nftDataService: NftDataService, explorerService: ExplorerService);
|
|
10
10
|
getBalance(address: string): Promise<BalanceResponse[]>;
|
|
11
11
|
getTokenInfo(hash: string): Promise<Token>;
|
|
12
12
|
getTransaction(hash: string): Promise<TransactionResponse>;
|
|
13
13
|
getTransactionsByAddress(params: TransactionsByAddressParams): Promise<TransactionsByAddressResponse>;
|
|
14
|
+
getFullTransactionsByAddress({ nextCursor, ...params }: FullTransactionsByAddressParams): Promise<FullTransactionsByAddressResponse>;
|
|
15
|
+
exportFullTransactionsByAddress(params: ExportTransactionsByAddressParams): Promise<string>;
|
|
14
16
|
getContract(hash: string): Promise<ContractResponse>;
|
|
15
17
|
}
|
|
@@ -8,17 +8,31 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
11
22
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
24
|
};
|
|
14
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
26
|
exports.MoralisBDSEthereum = void 0;
|
|
16
|
-
const
|
|
27
|
+
const blockchain_service_1 = require("@cityofzion/blockchain-service");
|
|
17
28
|
const axios_1 = __importDefault(require("axios"));
|
|
18
29
|
const ethers_1 = require("ethers");
|
|
30
|
+
const BSEthereumConstants_1 = require("../../constants/BSEthereumConstants");
|
|
19
31
|
const BSEthereumHelper_1 = require("../../helpers/BSEthereumHelper");
|
|
20
32
|
const ERC20_1 = require("../../assets/abis/ERC20");
|
|
21
|
-
|
|
33
|
+
const dora_ts_1 = require("@cityofzion/dora-ts");
|
|
34
|
+
const DoraBDSEthereum_1 = require("./DoraBDSEthereum");
|
|
35
|
+
class MoralisBDSEthereum extends DoraBDSEthereum_1.DoraBDSEthereum {
|
|
22
36
|
static getClient(network) {
|
|
23
37
|
return axios_1.default.create({
|
|
24
38
|
baseURL: MoralisBDSEthereum.BASE_URL,
|
|
@@ -30,8 +44,13 @@ class MoralisBDSEthereum extends RpcBDSEthereum_1.RpcBDSEthereum {
|
|
|
30
44
|
static isSupported(network) {
|
|
31
45
|
return MoralisBDSEthereum.SUPPORTED_CHAINS.includes(network.id);
|
|
32
46
|
}
|
|
33
|
-
constructor(network) {
|
|
34
|
-
super(network
|
|
47
|
+
constructor(network, nftDataService, explorerService) {
|
|
48
|
+
super(network, [
|
|
49
|
+
BSEthereumConstants_1.BSEthereumConstants.ETHEREUM_MAINNET_NETWORK_ID,
|
|
50
|
+
BSEthereumConstants_1.BSEthereumConstants.POLYGON_MAINNET_NETWORK_ID,
|
|
51
|
+
BSEthereumConstants_1.BSEthereumConstants.BASE_MAINNET_NETWORK_ID,
|
|
52
|
+
BSEthereumConstants_1.BSEthereumConstants.ARBITRUM_MAINNET_NETWORK_ID,
|
|
53
|
+
], nftDataService, explorerService);
|
|
35
54
|
}
|
|
36
55
|
getBalance(address) {
|
|
37
56
|
const _super = Object.create(null, {
|
|
@@ -238,6 +257,33 @@ class MoralisBDSEthereum extends RpcBDSEthereum_1.RpcBDSEthereum {
|
|
|
238
257
|
};
|
|
239
258
|
});
|
|
240
259
|
}
|
|
260
|
+
getFullTransactionsByAddress(_a) {
|
|
261
|
+
var _b;
|
|
262
|
+
var { nextCursor } = _a, params = __rest(_a, ["nextCursor"]);
|
|
263
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
264
|
+
this._validateGetFullTransactionsByAddressParams(params);
|
|
265
|
+
const response = yield dora_ts_1.api.EthereumREST.getFullTransactionsByAddress({
|
|
266
|
+
address: params.address,
|
|
267
|
+
timestampFrom: params.dateFrom,
|
|
268
|
+
timestampTo: params.dateTo,
|
|
269
|
+
network: this._network.id,
|
|
270
|
+
cursor: nextCursor,
|
|
271
|
+
pageLimit: (_b = params.pageSize) !== null && _b !== void 0 ? _b : 50,
|
|
272
|
+
});
|
|
273
|
+
return yield this._transformFullTransactionsByAddressResponse(response);
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
exportFullTransactionsByAddress(params) {
|
|
277
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
278
|
+
this._validateFullTransactionsByAddressParams(params);
|
|
279
|
+
return yield dora_ts_1.api.EthereumREST.exportFullTransactionsByAddress({
|
|
280
|
+
address: params.address,
|
|
281
|
+
timestampFrom: params.dateFrom,
|
|
282
|
+
timestampTo: params.dateTo,
|
|
283
|
+
network: this._network.id,
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
}
|
|
241
287
|
getContract(hash) {
|
|
242
288
|
const _super = Object.create(null, {
|
|
243
289
|
getContract: { get: () => super.getContract }
|
|
@@ -280,18 +326,18 @@ class MoralisBDSEthereum extends RpcBDSEthereum_1.RpcBDSEthereum {
|
|
|
280
326
|
}
|
|
281
327
|
}
|
|
282
328
|
exports.MoralisBDSEthereum = MoralisBDSEthereum;
|
|
283
|
-
MoralisBDSEthereum.BASE_URL =
|
|
329
|
+
MoralisBDSEthereum.BASE_URL = `${blockchain_service_1.BSCommonConstants.DORA_URL}/api/v2/meta`;
|
|
284
330
|
MoralisBDSEthereum.SUPPORTED_CHAINS = [
|
|
285
|
-
|
|
331
|
+
BSEthereumConstants_1.BSEthereumConstants.ETHEREUM_MAINNET_NETWORK_ID,
|
|
286
332
|
'11155111',
|
|
287
333
|
'17000',
|
|
288
|
-
|
|
334
|
+
BSEthereumConstants_1.BSEthereumConstants.POLYGON_MAINNET_NETWORK_ID,
|
|
289
335
|
'80002',
|
|
290
336
|
'56',
|
|
291
337
|
'97',
|
|
292
|
-
|
|
338
|
+
BSEthereumConstants_1.BSEthereumConstants.ARBITRUM_MAINNET_NETWORK_ID,
|
|
293
339
|
'421614',
|
|
294
|
-
|
|
340
|
+
BSEthereumConstants_1.BSEthereumConstants.BASE_MAINNET_NETWORK_ID,
|
|
295
341
|
'84532',
|
|
296
342
|
'10',
|
|
297
343
|
'11155420',
|