@pioneer-platform/eth-network 8.1.63 → 8.1.65

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/lib/constant.d.ts CHANGED
@@ -7,10 +7,26 @@ export declare const PROXY_CONTRACT_SABLIER = "0xbd6a40bb904aea5a49c59050b5395f7
7
7
  export declare const FOX_ETH_TEST_FARMING_ADDRESS = "0x1F2BBC14BCEc7f06b996B6Ee920AB5cA5A56b77F";
8
8
  export declare const FOX_ETH_FARMING_ADDRESS = "0x1F2BBC14BCEc7f06b996B6Ee920AB5cA5A56b77F";
9
9
  export declare const FOX_AIRDROP_ADDRESS = "0x1F2BBC14BCEc7f06b996B6Ee920AB5cA5A56b77F";
10
+ export declare const PIONEER_METADATA_CONTRACT_ADDRESS = "0x0E1cDf34e15414C6AfDd4E75Bd2dBcAC5E8cc8E4";
10
11
  export declare const PIONEER_CONTRACT_ADDRESS = "0x25EF864904d67e912B9eC491598A7E5A066B102F";
11
12
  export declare const THORCHAIN_ROUTER_TESTNET: string;
12
13
  export declare const AIRDROP_CONTRACT = "0x4C20CDAdBcaE364Edc03E2B90F09eB97d08ce3C8";
13
14
  export declare let CLAIM_URL: string;
15
+ export declare let METADATA_ABI: {
16
+ inputs: {
17
+ internalType: string;
18
+ name: string;
19
+ type: string;
20
+ }[];
21
+ name: string;
22
+ outputs: {
23
+ internalType: string;
24
+ name: string;
25
+ type: string;
26
+ }[];
27
+ stateMutability: string;
28
+ type: string;
29
+ }[];
14
30
  export declare let SABLIER_ABI: ({
15
31
  constant: boolean;
16
32
  inputs: {
package/lib/constant.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ERC721_ABI = exports.AIRDROP_ABI = exports.ERC20ABI = exports.TCRopstenAbi = exports.SABLIER_ABI = exports.CLAIM_URL = exports.AIRDROP_CONTRACT = exports.THORCHAIN_ROUTER_TESTNET = exports.PIONEER_CONTRACT_ADDRESS = exports.FOX_AIRDROP_ADDRESS = exports.FOX_ETH_FARMING_ADDRESS = exports.FOX_ETH_TEST_FARMING_ADDRESS = exports.PROXY_CONTRACT_SABLIER = exports.WETH_TOKEN_CONTRACT_ADDRESS = exports.FOX_TOKEN_CONTRACT_ADDRESS = exports.UNISWAP_V2_ROUTER = exports.UNISWAP_V2_USDC_ETH_POOL_ADDRESS = exports.UNISWAP_V2_WETH_FOX_POOL_ADDRESS = void 0;
3
+ exports.ERC721_ABI = exports.AIRDROP_ABI = exports.ERC20ABI = exports.TCRopstenAbi = exports.SABLIER_ABI = exports.METADATA_ABI = exports.CLAIM_URL = exports.AIRDROP_CONTRACT = exports.THORCHAIN_ROUTER_TESTNET = exports.PIONEER_CONTRACT_ADDRESS = exports.PIONEER_METADATA_CONTRACT_ADDRESS = exports.FOX_AIRDROP_ADDRESS = exports.FOX_ETH_FARMING_ADDRESS = exports.FOX_ETH_TEST_FARMING_ADDRESS = exports.PROXY_CONTRACT_SABLIER = exports.WETH_TOKEN_CONTRACT_ADDRESS = exports.FOX_TOKEN_CONTRACT_ADDRESS = exports.UNISWAP_V2_ROUTER = exports.UNISWAP_V2_USDC_ETH_POOL_ADDRESS = exports.UNISWAP_V2_WETH_FOX_POOL_ADDRESS = void 0;
4
4
  exports.UNISWAP_V2_WETH_FOX_POOL_ADDRESS = '0x470e8de2ebaef52014a47cb5e6af86884947f08c';
5
5
  exports.UNISWAP_V2_USDC_ETH_POOL_ADDRESS = '0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc';
6
6
  exports.UNISWAP_V2_ROUTER = '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D';
@@ -10,11 +10,36 @@ exports.PROXY_CONTRACT_SABLIER = '0xbd6a40bb904aea5a49c59050b5395f7484a4203d';
10
10
  exports.FOX_ETH_TEST_FARMING_ADDRESS = '0x1F2BBC14BCEc7f06b996B6Ee920AB5cA5A56b77F';
11
11
  exports.FOX_ETH_FARMING_ADDRESS = '0x1F2BBC14BCEc7f06b996B6Ee920AB5cA5A56b77F';
12
12
  exports.FOX_AIRDROP_ADDRESS = '0x1F2BBC14BCEc7f06b996B6Ee920AB5cA5A56b77F';
13
+ exports.PIONEER_METADATA_CONTRACT_ADDRESS = '0x0E1cDf34e15414C6AfDd4E75Bd2dBcAC5E8cc8E4';
13
14
  exports.PIONEER_CONTRACT_ADDRESS = '0x25EF864904d67e912B9eC491598A7E5A066B102F';
14
15
  exports.THORCHAIN_ROUTER_TESTNET = process.env['THORCHAIN_ROUTER_TESTNET'] || "0x9d496De78837f5a2bA64Cb40E62c19FBcB67f55a";
15
16
  exports.AIRDROP_CONTRACT = "0x4C20CDAdBcaE364Edc03E2B90F09eB97d08ce3C8";
16
17
  exports.CLAIM_URL = "https://fox-api.shapeshift.com/claims";
17
18
  //TODO move to coins.js
19
+ exports.METADATA_ABI = [{
20
+ "inputs": [
21
+ {
22
+ "internalType": "uint256",
23
+ "name": "_tokenId",
24
+ "type": "uint256"
25
+ }
26
+ ],
27
+ "name": "getAttributes",
28
+ "outputs": [
29
+ {
30
+ "internalType": "string",
31
+ "name": "resultAttributes",
32
+ "type": "string"
33
+ },
34
+ {
35
+ "internalType": "string",
36
+ "name": "queryString",
37
+ "type": "string"
38
+ }
39
+ ],
40
+ "stateMutability": "view",
41
+ "type": "function"
42
+ }];
18
43
  exports.SABLIER_ABI = [{ "constant": true, "inputs": [{ "internalType": "address", "name": "", "type": "address" }, { "internalType": "uint256", "name": "", "type": "uint256" }], "name": "relayers", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "sablier", "outputs": [{ "internalType": "contract Sablier", "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "address", "name": "relayer", "type": "address" }, { "internalType": "uint256", "name": "salaryId", "type": "uint256" }], "name": "whitelistRelayer", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "address", "name": "relayer", "type": "address" }, { "internalType": "uint256", "name": "salaryId", "type": "uint256" }], "name": "discardRelayer", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "address", "name": "employee", "type": "address" }, { "internalType": "uint256", "name": "salary", "type": "uint256" }, { "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "uint256", "name": "startTime", "type": "uint256" }, { "internalType": "uint256", "name": "stopTime", "type": "uint256" }, { "internalType": "uint256", "name": "senderSharePercentage", "type": "uint256" }, { "internalType": "uint256", "name": "recipientSharePercentage", "type": "uint256" }], "name": "createCompoundingSalary", "outputs": [{ "internalType": "uint256", "name": "salaryId", "type": "uint256" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "getHubAddr", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "bytes", "name": "context", "type": "bytes" }], "name": "preRelayedCall", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [{ "internalType": "uint256", "name": "salaryId", "type": "uint256" }], "name": "getSalary", "outputs": [{ "internalType": "address", "name": "company", "type": "address" }, { "internalType": "address", "name": "employee", "type": "address" }, { "internalType": "uint256", "name": "salary", "type": "uint256" }, { "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "uint256", "name": "startTime", "type": "uint256" }, { "internalType": "uint256", "name": "stopTime", "type": "uint256" }, { "internalType": "uint256", "name": "remainingBalance", "type": "uint256" }, { "internalType": "uint256", "name": "rate", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [], "name": "initialize", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [{ "internalType": "address", "name": "relay", "type": "address" }, { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "bytes", "name": "encodedFunction", "type": "bytes" }, { "internalType": "uint256", "name": "transactionFee", "type": "uint256" }, { "internalType": "uint256", "name": "gasPrice", "type": "uint256" }, { "internalType": "uint256", "name": "gasLimit", "type": "uint256" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "bytes", "name": "approvalData", "type": "bytes" }, { "internalType": "uint256", "name": "", "type": "uint256" }], "name": "acceptRelayedCall", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "bytes", "name": "", "type": "bytes" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "isOwner", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "relayHubVersion", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "address", "name": "ownerAddress", "type": "address" }, { "internalType": "address", "name": "signerAddress", "type": "address" }, { "internalType": "address", "name": "sablierAddress", "type": "address" }], "name": "initialize", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "address", "name": "trustedSigner", "type": "address" }], "name": "initialize", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "uint256", "name": "salaryId", "type": "uint256" }], "name": "cancelSalary", "outputs": [{ "internalType": "bool", "name": "success", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "address", "name": "employee", "type": "address" }, { "internalType": "uint256", "name": "salary", "type": "uint256" }, { "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "uint256", "name": "startTime", "type": "uint256" }, { "internalType": "uint256", "name": "stopTime", "type": "uint256" }], "name": "createSalary", "outputs": [{ "internalType": "uint256", "name": "salaryId", "type": "uint256" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "nextSalaryId", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "bytes", "name": "context", "type": "bytes" }, { "internalType": "bool", "name": "success", "type": "bool" }, { "internalType": "uint256", "name": "actualCharge", "type": "uint256" }, { "internalType": "bytes32", "name": "preRetVal", "type": "bytes32" }], "name": "postRelayedCall", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], "name": "transferOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "internalType": "uint256", "name": "salaryId", "type": "uint256" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "withdrawFromSalary", "outputs": [{ "internalType": "bool", "name": "success", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "salaryId", "type": "uint256" }, { "indexed": true, "internalType": "uint256", "name": "streamId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "company", "type": "address" }], "name": "CreateSalary", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "salaryId", "type": "uint256" }, { "indexed": true, "internalType": "uint256", "name": "streamId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "company", "type": "address" }], "name": "WithdrawFromSalary", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "salaryId", "type": "uint256" }, { "indexed": true, "internalType": "uint256", "name": "streamId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "company", "type": "address" }], "name": "CancelSalary", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "oldRelayHub", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newRelayHub", "type": "address" }], "name": "RelayHubChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferred", "type": "event" }];
19
44
  exports.TCRopstenAbi = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "memo", "type": "string" }], "name": "Deposit", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "oldVault", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newVault", "type": "address" }, { "indexed": false, "internalType": "address", "name": "asset", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "memo", "type": "string" }], "name": "TransferAllowance", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "vault", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "address", "name": "asset", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "memo", "type": "string" }], "name": "TransferOut", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "oldVault", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newVault", "type": "address" }, { "components": [{ "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "indexed": false, "internalType": "struct Router.Coin[]", "name": "coins", "type": "tuple[]" }, { "indexed": false, "internalType": "string", "name": "memo", "type": "string" }], "name": "VaultTransfer", "type": "event" }, { "inputs": [], "name": "RUNE", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address[]", "name": "recipients", "type": "address[]" }, { "components": [{ "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "internalType": "struct Router.Coin[]", "name": "coins", "type": "tuple[]" }, { "internalType": "string[]", "name": "memos", "type": "string[]" }], "name": "batchTransferOut", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "address payable", "name": "vault", "type": "address" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "string", "name": "memo", "type": "string" }], "name": "deposit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "router", "type": "address" }, { "internalType": "address payable", "name": "asgard", "type": "address" }, { "components": [{ "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "internalType": "struct Router.Coin[]", "name": "coins", "type": "tuple[]" }, { "internalType": "string", "name": "memo", "type": "string" }], "name": "returnVaultAssets", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "router", "type": "address" }, { "internalType": "address", "name": "newVault", "type": "address" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "string", "name": "memo", "type": "string" }], "name": "transferAllowance", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address payable", "name": "to", "type": "address" }, { "internalType": "address", "name": "asset", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "string", "name": "memo", "type": "string" }], "name": "transferOut", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }, { "internalType": "address", "name": "", "type": "address" }], "name": "vaultAllowance", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }];
20
45
  exports.ERC20ABI = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "Transfer", "type": "event" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }, { "internalType": "address", "name": "", "type": "address" }], "name": "allowance", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "approve", "outputs": [{ "internalType": "bool", "name": "success", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "balanceOf", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "decimals", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "name", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "transfer", "outputs": [{ "internalType": "bool", "name": "success", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "transferFrom", "outputs": [{ "internalType": "bool", "name": "success", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }];
package/lib/index.js CHANGED
@@ -162,6 +162,9 @@ module.exports = {
162
162
  getSymbolFromContract: function (contract) {
163
163
  return get_symbol_from_contract(contract);
164
164
  },
165
+ getTransferData: function (toAddress, amount, prescision) {
166
+ return get_token_transfer_data(toAddress, amount, prescision);
167
+ },
165
168
  getPoolPositions: function (address) {
166
169
  return get_pool_positions(address);
167
170
  },
@@ -219,39 +222,49 @@ module.exports = {
219
222
  };
220
223
  var get_all_pioneers = function () {
221
224
  return __awaiter(this, void 0, void 0, function () {
222
- var tag, output, nftContract, totalSupply, i, owner, e_1;
225
+ var tag, output, nftContract, metadataContract, totalSupply, i, owner, imageInfo, imageName, baseImageUrl, fullImageUrl, e_1;
223
226
  return __generator(this, function (_a) {
224
227
  switch (_a.label) {
225
228
  case 0:
226
229
  tag = TAG + " | get_all_pioneers | ";
227
230
  _a.label = 1;
228
231
  case 1:
229
- _a.trys.push([1, 7, , 8]);
232
+ _a.trys.push([1, 8, , 9]);
230
233
  output = {};
231
234
  nftContract = new web3.eth.Contract(constant_1.ERC721_ABI, constant_1.PIONEER_CONTRACT_ADDRESS);
235
+ metadataContract = new web3.eth.Contract(constant_1.METADATA_ABI, constant_1.PIONEER_METADATA_CONTRACT_ADDRESS);
232
236
  return [4 /*yield*/, nftContract.methods.totalSupply().call()];
233
237
  case 2:
234
238
  totalSupply = _a.sent();
235
239
  output['totalSupply'] = totalSupply;
236
240
  output['owners'] = [];
241
+ output['images'] = []; // add an images array to output
237
242
  i = 0;
238
243
  _a.label = 3;
239
244
  case 3:
240
- if (!(i < totalSupply)) return [3 /*break*/, 6];
245
+ if (!(i < totalSupply)) return [3 /*break*/, 7];
241
246
  return [4 /*yield*/, nftContract.methods.ownerOf(i).call()];
242
247
  case 4:
243
248
  owner = _a.sent();
244
249
  output['owners'].push(owner.toLowerCase());
245
- _a.label = 5;
250
+ return [4 /*yield*/, metadataContract.methods.getAttributes(i).call()];
246
251
  case 5:
252
+ imageInfo = _a.sent();
253
+ imageName = JSON.parse(imageInfo['0'])["0-backgrounds"];
254
+ baseImageUrl = "https://ipfs.io/ipfs/bafybeiezdzjofkcpiwy5hlvxwzkgcztxc6xtodh3q7eddfjmqsguqs47aa/0-backgrounds/";
255
+ fullImageUrl = baseImageUrl + imageName + ".png";
256
+ // Add this image URL to the images array in output
257
+ output['images'].push({ address: owner.toLowerCase(), image: fullImageUrl });
258
+ _a.label = 6;
259
+ case 6:
247
260
  i++;
248
261
  return [3 /*break*/, 3];
249
- case 6: return [2 /*return*/, output];
250
- case 7:
262
+ case 7: return [2 /*return*/, output];
263
+ case 8:
251
264
  e_1 = _a.sent();
252
265
  console.error(tag, e_1);
253
- return [3 /*break*/, 8];
254
- case 8: return [2 /*return*/];
266
+ return [3 /*break*/, 9];
267
+ case 9: return [2 /*return*/];
255
268
  }
256
269
  });
257
270
  });
@@ -346,9 +359,49 @@ var check_airdrop_claim = function (address) {
346
359
  });
347
360
  });
348
361
  };
362
+ //get_token_transfer_data
363
+ var get_token_transfer_data = function (toAddress, amount, prescision) {
364
+ return __awaiter(this, void 0, void 0, function () {
365
+ var tag, value, tokenData, e_4;
366
+ return __generator(this, function (_a) {
367
+ switch (_a.label) {
368
+ case 0:
369
+ tag = TAG + " | get_token_transfer_data | ";
370
+ _a.label = 1;
371
+ case 1:
372
+ _a.trys.push([1, 3, , 4]);
373
+ if (!prescision)
374
+ prescision = 18;
375
+ value = parseInt(amount / Math.pow(10, prescision));
376
+ return [4 /*yield*/, web3.eth.abi.encodeFunctionCall({
377
+ name: 'transfer',
378
+ type: 'function',
379
+ inputs: [
380
+ {
381
+ type: 'address',
382
+ name: '_to'
383
+ },
384
+ {
385
+ type: 'uint256',
386
+ name: '_value'
387
+ }
388
+ ]
389
+ }, [toAddress, value])];
390
+ case 2:
391
+ tokenData = _a.sent();
392
+ return [2 /*return*/, tokenData];
393
+ case 3:
394
+ e_4 = _a.sent();
395
+ console.error(tag, e_4);
396
+ return [3 /*break*/, 4];
397
+ case 4: return [2 /*return*/];
398
+ }
399
+ });
400
+ });
401
+ };
349
402
  var get_symbol_from_contract = function (address) {
350
403
  return __awaiter(this, void 0, void 0, function () {
351
- var tag, contract, tokenName, e_4;
404
+ var tag, contract, tokenName, e_5;
352
405
  return __generator(this, function (_a) {
353
406
  switch (_a.label) {
354
407
  case 0:
@@ -365,8 +418,8 @@ var get_symbol_from_contract = function (address) {
365
418
  //log.debug(tag,"tokenName: ",tokenName)
366
419
  return [2 /*return*/, tokenName];
367
420
  case 3:
368
- e_4 = _a.sent();
369
- console.error(tag, e_4);
421
+ e_5 = _a.sent();
422
+ console.error(tag, e_5);
370
423
  return [3 /*break*/, 4];
371
424
  case 4: return [2 /*return*/];
372
425
  }
@@ -375,7 +428,7 @@ var get_symbol_from_contract = function (address) {
375
428
  };
376
429
  var get_stream = function (streamId) {
377
430
  return __awaiter(this, void 0, void 0, function () {
378
- var tag, sablierContract, totalFox, e_5;
431
+ var tag, sablierContract, totalFox, e_6;
379
432
  return __generator(this, function (_a) {
380
433
  switch (_a.label) {
381
434
  case 0:
@@ -395,8 +448,8 @@ var get_stream = function (streamId) {
395
448
  //log.debug(tag,"totalFox: ",totalFox)
396
449
  return [2 /*return*/, totalFox];
397
450
  case 3:
398
- e_5 = _a.sent();
399
- console.error(tag, e_5);
451
+ e_6 = _a.sent();
452
+ console.error(tag, e_6);
400
453
  return [3 /*break*/, 4];
401
454
  case 4: return [2 /*return*/];
402
455
  }
@@ -405,7 +458,7 @@ var get_stream = function (streamId) {
405
458
  };
406
459
  var get_tx_count = function (address, options) {
407
460
  return __awaiter(this, void 0, void 0, function () {
408
- var tag, txsConfirmed, txsWithPending, pending, e_6;
461
+ var tag, txsConfirmed, txsWithPending, pending, e_7;
409
462
  return __generator(this, function (_a) {
410
463
  switch (_a.label) {
411
464
  case 0:
@@ -433,8 +486,8 @@ var get_tx_count = function (address, options) {
433
486
  pending: pending
434
487
  }];
435
488
  case 4:
436
- e_6 = _a.sent();
437
- console.error(tag, e_6);
489
+ e_7 = _a.sent();
490
+ console.error(tag, e_7);
438
491
  return [3 /*break*/, 5];
439
492
  case 5: return [2 /*return*/];
440
493
  }
@@ -443,7 +496,7 @@ var get_tx_count = function (address, options) {
443
496
  };
444
497
  var get_pool_percent = function (amountFox, amountEth, poolAddress) {
445
498
  return __awaiter(this, void 0, void 0, function () {
446
- var tag, lpContract, foxContract, wethContract, totalSupply, totalFox, totalEth, result, lpTokens, percent, e_7;
499
+ var tag, lpContract, foxContract, wethContract, totalSupply, totalFox, totalEth, result, lpTokens, percent, e_8;
447
500
  return __generator(this, function (_a) {
448
501
  switch (_a.label) {
449
502
  case 0:
@@ -477,8 +530,8 @@ var get_pool_percent = function (amountFox, amountEth, poolAddress) {
477
530
  log.debug("percent: ", percent);
478
531
  return [2 /*return*/, percent];
479
532
  case 5:
480
- e_7 = _a.sent();
481
- console.error(tag, e_7);
533
+ e_8 = _a.sent();
534
+ console.error(tag, e_8);
482
535
  return [3 /*break*/, 6];
483
536
  case 6: return [2 /*return*/];
484
537
  }
@@ -487,7 +540,7 @@ var get_pool_percent = function (amountFox, amountEth, poolAddress) {
487
540
  };
488
541
  var get_balances = function (addresses) {
489
542
  return __awaiter(this, void 0, void 0, function () {
490
- var tag, actions, i, address, action, result, output, i, entry, balance, e_8;
543
+ var tag, actions, i, address, action, result, output, i, entry, balance, e_9;
491
544
  return __generator(this, function (_a) {
492
545
  switch (_a.label) {
493
546
  case 0:
@@ -519,8 +572,8 @@ var get_balances = function (addresses) {
519
572
  }
520
573
  return [2 /*return*/, output];
521
574
  case 3:
522
- e_8 = _a.sent();
523
- console.error(tag, e_8);
575
+ e_9 = _a.sent();
576
+ console.error(tag, e_9);
524
577
  return [3 /*break*/, 4];
525
578
  case 4: return [2 /*return*/];
526
579
  }
@@ -571,7 +624,7 @@ var rpcCallBatch = function (actions) { return __awaiter(void 0, void 0, void 0,
571
624
  //get_approval_status
572
625
  var get_allowance = function (tokenAddress, spender, sender) {
573
626
  return __awaiter(this, void 0, void 0, function () {
574
- var tag, contract, allowance, e_9;
627
+ var tag, contract, allowance, e_10;
575
628
  return __generator(this, function (_a) {
576
629
  switch (_a.label) {
577
630
  case 0:
@@ -585,8 +638,8 @@ var get_allowance = function (tokenAddress, spender, sender) {
585
638
  allowance = _a.sent();
586
639
  return [2 /*return*/, allowance];
587
640
  case 3:
588
- e_9 = _a.sent();
589
- console.error(tag, e_9);
641
+ e_10 = _a.sent();
642
+ console.error(tag, e_10);
590
643
  return [3 /*break*/, 4];
591
644
  case 4: return [2 /*return*/];
592
645
  }
@@ -595,7 +648,7 @@ var get_allowance = function (tokenAddress, spender, sender) {
595
648
  };
596
649
  var get_all_tokens_blockbook = function (address) {
597
650
  return __awaiter(this, void 0, void 0, function () {
598
- var tag, ethInto, e_10;
651
+ var tag, ethInto, e_11;
599
652
  return __generator(this, function (_a) {
600
653
  switch (_a.label) {
601
654
  case 0:
@@ -609,8 +662,8 @@ var get_all_tokens_blockbook = function (address) {
609
662
  log.debug(tag, "ethInto: ", ethInto);
610
663
  return [2 /*return*/, true];
611
664
  case 3:
612
- e_10 = _a.sent();
613
- console.error(tag, e_10);
665
+ e_11 = _a.sent();
666
+ console.error(tag, e_11);
614
667
  return [3 /*break*/, 4];
615
668
  case 4: return [2 /*return*/];
616
669
  }
@@ -619,7 +672,7 @@ var get_all_tokens_blockbook = function (address) {
619
672
  };
620
673
  var get_nfts = function (address) {
621
674
  return __awaiter(this, void 0, void 0, function () {
622
- var tag, ethInfo, e_11;
675
+ var tag, ethInfo, e_12;
623
676
  return __generator(this, function (_a) {
624
677
  switch (_a.label) {
625
678
  case 0:
@@ -636,8 +689,8 @@ var get_nfts = function (address) {
636
689
  log.debug(tag, "ethInfo: ", ethInfo);
637
690
  return [2 /*return*/, ethInfo];
638
691
  case 3:
639
- e_11 = _a.sent();
640
- console.error(tag, e_11);
692
+ e_12 = _a.sent();
693
+ console.error(tag, e_12);
641
694
  return [3 /*break*/, 4];
642
695
  case 4: return [2 /*return*/];
643
696
  }
@@ -646,7 +699,7 @@ var get_nfts = function (address) {
646
699
  };
647
700
  var get_pool_positions = function (address) {
648
701
  return __awaiter(this, void 0, void 0, function () {
649
- var tag, ethInfo, e_12;
702
+ var tag, ethInfo, e_13;
650
703
  return __generator(this, function (_a) {
651
704
  switch (_a.label) {
652
705
  case 0:
@@ -663,8 +716,8 @@ var get_pool_positions = function (address) {
663
716
  log.debug(tag, "ethInfo: ", ethInfo);
664
717
  return [2 /*return*/, ethInfo];
665
718
  case 3:
666
- e_12 = _a.sent();
667
- console.error(tag, e_12);
719
+ e_13 = _a.sent();
720
+ console.error(tag, e_13);
668
721
  return [3 /*break*/, 4];
669
722
  case 4: return [2 /*return*/];
670
723
  }
@@ -720,7 +773,7 @@ var get_memo_data = function (swap) {
720
773
  */
721
774
  var estimate_fee = function (sourceAsset, params) {
722
775
  return __awaiter(this, void 0, void 0, function () {
723
- var tag, checkSummedAddress, decimal, provider, contract, estimateGas, entry, fees, minimumWeiCost, e_13;
776
+ var tag, checkSummedAddress, decimal, provider, contract, estimateGas, entry, fees, minimumWeiCost, e_14;
724
777
  var _a;
725
778
  return __generator(this, function (_b) {
726
779
  switch (_b.label) {
@@ -769,9 +822,9 @@ var estimate_fee = function (sourceAsset, params) {
769
822
  minimumWeiCost = minimumWeiCost.mul(estimateGas.toNumber());
770
823
  return [2 /*return*/, minimumWeiCost];
771
824
  case 4:
772
- e_13 = _b.sent();
773
- log.error(tag, e_13);
774
- throw e_13;
825
+ e_14 = _b.sent();
826
+ log.error(tag, e_14);
827
+ throw e_14;
775
828
  case 5: return [2 /*return*/];
776
829
  }
777
830
  });
@@ -780,7 +833,7 @@ var estimate_fee = function (sourceAsset, params) {
780
833
  var get_gas_limit = function (_a) {
781
834
  var asset = _a.asset, recipient = _a.recipient, amount = _a.amount, memo = _a.memo;
782
835
  return __awaiter(this, void 0, void 0, function () {
783
- var tag, txAmount, assetAddress, estimate, contract, transactionRequest, e_14;
836
+ var tag, txAmount, assetAddress, estimate, contract, transactionRequest, e_15;
784
837
  return __generator(this, function (_b) {
785
838
  switch (_b.label) {
786
839
  case 0:
@@ -816,9 +869,9 @@ var get_gas_limit = function (_a) {
816
869
  _b.label = 5;
817
870
  case 5: return [2 /*return*/, estimate];
818
871
  case 6:
819
- e_14 = _b.sent();
820
- log.error(tag, e_14);
821
- throw e_14;
872
+ e_15 = _b.sent();
873
+ log.error(tag, e_15);
874
+ throw e_15;
822
875
  case 7: return [2 /*return*/];
823
876
  }
824
877
  });
@@ -827,7 +880,7 @@ var get_gas_limit = function (_a) {
827
880
  var get_fees = function (params) {
828
881
  var _a;
829
882
  return __awaiter(this, void 0, void 0, function () {
830
- var tag, response, averageWei, fastWei, fastestWei, gasPrices, fastGP, fastestGP, averageGP, gasLimit, output, e_15;
883
+ var tag, response, averageWei, fastWei, fastestWei, gasPrices, fastGP, fastestGP, averageGP, gasLimit, output, e_16;
831
884
  return __generator(this, function (_b) {
832
885
  switch (_b.label) {
833
886
  case 0:
@@ -882,9 +935,9 @@ var get_fees = function (params) {
882
935
  };
883
936
  return [2 /*return*/, output];
884
937
  case 4:
885
- e_15 = _b.sent();
886
- log.error(tag, e_15);
887
- throw e_15;
938
+ e_16 = _b.sent();
939
+ log.error(tag, e_16);
940
+ throw e_16;
888
941
  case 5: return [2 /*return*/];
889
942
  }
890
943
  });
@@ -892,7 +945,7 @@ var get_fees = function (params) {
892
945
  };
893
946
  var broadcast_transaction = function (tx) {
894
947
  return __awaiter(this, void 0, void 0, function () {
895
- var tag, output, resp, e_16;
948
+ var tag, output, resp, e_17;
896
949
  return __generator(this, function (_a) {
897
950
  switch (_a.label) {
898
951
  case 0:
@@ -935,9 +988,9 @@ var broadcast_transaction = function (tx) {
935
988
  output.txid = resp.result;
936
989
  return [2 /*return*/, output];
937
990
  case 3:
938
- e_16 = _a.sent();
939
- log.error(tag, e_16);
940
- throw e_16;
991
+ e_17 = _a.sent();
992
+ log.error(tag, e_17);
993
+ throw e_17;
941
994
  case 4: return [2 /*return*/];
942
995
  }
943
996
  });
@@ -945,7 +998,7 @@ var broadcast_transaction = function (tx) {
945
998
  };
946
999
  var get_balance_tokens = function (address) {
947
1000
  return __awaiter(this, void 0, void 0, function () {
948
- var tag, balances, valueUsds, coinInfo, resp, tokenInfo, i, info, symbol, rate, balance, e_17;
1001
+ var tag, balances, valueUsds, coinInfo, resp, tokenInfo, i, info, symbol, rate, balance, e_18;
949
1002
  return __generator(this, function (_a) {
950
1003
  switch (_a.label) {
951
1004
  case 0:
@@ -990,8 +1043,8 @@ var get_balance_tokens = function (address) {
990
1043
  }
991
1044
  return [2 /*return*/, { balances: balances, valueUsds: valueUsds, coinInfo: coinInfo }];
992
1045
  case 3:
993
- e_17 = _a.sent();
994
- console.error(tag, e_17);
1046
+ e_18 = _a.sent();
1047
+ console.error(tag, e_18);
995
1048
  return [3 /*break*/, 4];
996
1049
  case 4: return [2 /*return*/];
997
1050
  }
@@ -1000,7 +1053,7 @@ var get_balance_tokens = function (address) {
1000
1053
  };
1001
1054
  var get_balance_token = function (address, token) {
1002
1055
  return __awaiter(this, void 0, void 0, function () {
1003
- var tag, contract, decimals, balance, e_18;
1056
+ var tag, contract, decimals, balance, e_19;
1004
1057
  return __generator(this, function (_a) {
1005
1058
  switch (_a.label) {
1006
1059
  case 0:
@@ -1022,8 +1075,8 @@ var get_balance_token = function (address, token) {
1022
1075
  //log.debug(tag,"balance: ",balance)
1023
1076
  return [2 /*return*/, balance / Math.pow(10, decimals)];
1024
1077
  case 4:
1025
- e_18 = _a.sent();
1026
- console.error(tag, e_18);
1078
+ e_19 = _a.sent();
1079
+ console.error(tag, e_19);
1027
1080
  return [3 /*break*/, 5];
1028
1081
  case 5: return [2 /*return*/];
1029
1082
  }
@@ -1032,7 +1085,7 @@ var get_balance_token = function (address, token) {
1032
1085
  };
1033
1086
  var get_balance = function (address) {
1034
1087
  return __awaiter(this, void 0, void 0, function () {
1035
- var tag, output, e_19;
1088
+ var tag, output, e_20;
1036
1089
  return __generator(this, function (_a) {
1037
1090
  switch (_a.label) {
1038
1091
  case 0:
@@ -1047,8 +1100,8 @@ var get_balance = function (address) {
1047
1100
  output = (_a.sent()) / BASE;
1048
1101
  return [2 /*return*/, output];
1049
1102
  case 3:
1050
- e_19 = _a.sent();
1051
- console.error(tag, e_19);
1103
+ e_20 = _a.sent();
1104
+ console.error(tag, e_20);
1052
1105
  return [3 /*break*/, 4];
1053
1106
  case 4: return [2 /*return*/];
1054
1107
  }
@@ -1057,7 +1110,7 @@ var get_balance = function (address) {
1057
1110
  };
1058
1111
  var get_transactions = function (address, options) {
1059
1112
  return __awaiter(this, void 0, void 0, function () {
1060
- var tag, output, ethInfo, e_20;
1113
+ var tag, output, ethInfo, e_21;
1061
1114
  return __generator(this, function (_a) {
1062
1115
  switch (_a.label) {
1063
1116
  case 0:
@@ -1071,8 +1124,8 @@ var get_transactions = function (address, options) {
1071
1124
  ethInfo = _a.sent();
1072
1125
  return [2 /*return*/, ethInfo];
1073
1126
  case 3:
1074
- e_20 = _a.sent();
1075
- console.error(tag, e_20);
1127
+ e_21 = _a.sent();
1128
+ console.error(tag, e_21);
1076
1129
  return [3 /*break*/, 4];
1077
1130
  case 4: return [2 /*return*/];
1078
1131
  }
@@ -1081,7 +1134,7 @@ var get_transactions = function (address, options) {
1081
1134
  };
1082
1135
  var get_transaction = function (txid) {
1083
1136
  return __awaiter(this, void 0, void 0, function () {
1084
- var tag, output, _a, _b, e_21;
1137
+ var tag, output, _a, _b, e_22;
1085
1138
  return __generator(this, function (_c) {
1086
1139
  switch (_c.label) {
1087
1140
  case 0:
@@ -1106,8 +1159,8 @@ var get_transaction = function (txid) {
1106
1159
  _b.receipt = _c.sent();
1107
1160
  return [2 /*return*/, output];
1108
1161
  case 4:
1109
- e_21 = _c.sent();
1110
- console.error(tag, e_21);
1162
+ e_22 = _c.sent();
1163
+ console.error(tag, e_22);
1111
1164
  return [3 /*break*/, 5];
1112
1165
  case 5: return [2 /*return*/];
1113
1166
  }
@@ -1116,7 +1169,7 @@ var get_transaction = function (txid) {
1116
1169
  };
1117
1170
  var check_online_status = function () {
1118
1171
  return __awaiter(this, void 0, void 0, function () {
1119
- var tag, output, _a, _b, _c, _d, networkName, _e, _f, e_22;
1172
+ var tag, output, _a, _b, _c, _d, networkName, _e, _f, e_23;
1120
1173
  return __generator(this, function (_g) {
1121
1174
  switch (_g.label) {
1122
1175
  case 0:
@@ -1184,8 +1237,8 @@ var check_online_status = function () {
1184
1237
  _f.syncing = _g.sent();
1185
1238
  return [2 /*return*/, output];
1186
1239
  case 8:
1187
- e_22 = _g.sent();
1188
- console.error(tag, e_22);
1240
+ e_23 = _g.sent();
1241
+ console.error(tag, e_23);
1189
1242
  return [3 /*break*/, 9];
1190
1243
  case 9: return [2 /*return*/];
1191
1244
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/eth-network",
3
- "version": "8.1.63",
3
+ "version": "8.1.65",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "scripts": {