@cryptorubic/web3 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,21 +1,24 @@
1
1
  {
2
2
  "name": "@cryptorubic/web3",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
+ "scripts": {
5
+ "build": "tsc --project tsconfig.lib.json --outDir ../../dist && cp package.json ../../dist/packages/web3"
6
+ },
4
7
  "dependencies": {
5
- "tslib": "^2.3.0",
6
- "bignumber.js": "9.1.2",
7
- "@cryptorubic/core": "0.4.0",
8
- "viem": "^2.19.1",
9
- "web3-utils": "^4.3.1",
10
- "@ton/ton": "^15.1.0",
8
+ "@cryptorubic/core": "0.0.1",
9
+ "@cryptorubic/tron-types": "0.0.1",
10
+ "@ethersproject/bignumber": "^5.7.0",
11
11
  "@solana/web3.js": "1.95.3",
12
12
  "@solflare-wallet/utl-sdk": "^1.4.0",
13
- "@ethersproject/bignumber": "^5.7.0",
14
- "@cryptorubic/tron-types": "0.4.0",
15
- "bitcoin-address-validation": "^2.2.3",
13
+ "@ton/ton": "^15.1.0",
16
14
  "axios": "0.27.2",
15
+ "bignumber.js": "9.1.2",
16
+ "bitcoin-address-validation": "^2.2.3",
17
17
  "crc-32": "^1.2.2",
18
- "tronweb": "^6.0.0-beta.4"
18
+ "tronweb": "^6.0.0-beta.4",
19
+ "tslib": "^2.3.0",
20
+ "viem": "^2.19.1",
21
+ "web3-utils": "^4.3.1"
19
22
  },
20
23
  "type": "commonjs",
21
24
  "main": "./src/index.js",
@@ -25,6 +28,5 @@
25
28
  },
26
29
  "author": {
27
30
  "name": "Sleta Dmitrii"
28
- },
29
- "types": "./src/index.d.ts"
31
+ }
30
32
  }
@@ -34,8 +34,13 @@ class SolanaAdapter extends abstract_adapter_1.AbstractAdapter {
34
34
  }
35
35
  async simulateTransaction(_config, _from) { }
36
36
  async callForTokensInfo(tokenAddresses) {
37
+ const nativeToken = core_1.nativeTokensList[core_1.BLOCKCHAIN_NAME.SOLANA];
37
38
  const nativeTokenIndex = tokenAddresses.findIndex((address) => web3_pure_1.Web3Pure.isNativeAddress(core_1.CHAIN_TYPE.SOLANA, address));
38
39
  const filteredTokenAddresses = tokenAddresses.filter((_, index) => index !== nativeTokenIndex);
40
+ // only native token in tokenAddresses
41
+ if (!filteredTokenAddresses.length) {
42
+ return [nativeToken];
43
+ }
39
44
  const mints = filteredTokenAddresses.map((address) => new web3_js_1.PublicKey(address));
40
45
  const tokenSdk = new utl_sdk_1.Client();
41
46
  const tokensMint = await tokenSdk.fetchMints(mints);
@@ -51,8 +56,7 @@ class SolanaAdapter extends abstract_adapter_1.AbstractAdapter {
51
56
  if (nativeTokenIndex === -1) {
52
57
  return tokens;
53
58
  }
54
- const blockchainNativeToken = core_1.nativeTokensList[core_1.BLOCKCHAIN_NAME.SOLANA];
55
- tokens.splice(nativeTokenIndex, 0, blockchainNativeToken);
59
+ tokens.splice(nativeTokenIndex, 0, nativeToken);
56
60
  return tokens;
57
61
  }
58
62
  }
@@ -1242,7 +1242,6 @@ exports.viemConfig = {
1242
1242
  },
1243
1243
  },
1244
1244
  }),
1245
- // unknown Multicall3
1246
1245
  ZK_LINK: (0, viem_1.defineChain)({
1247
1246
  blockExplorers: {
1248
1247
  default: {
@@ -1256,6 +1255,11 @@ exports.viemConfig = {
1256
1255
  nativeCurrency: { decimals: 18, name: 'ETH', symbol: 'ETH' },
1257
1256
  rpcUrls: { default: { http: ['https://rpc.zklink.io'] } },
1258
1257
  testnet: false,
1258
+ contracts: {
1259
+ multicall3: {
1260
+ address: '0x825267E0fA5CAe92F98540828a54198dcB3Eaeb5'
1261
+ }
1262
+ }
1259
1263
  }),
1260
1264
  THETA: (0, viem_1.defineChain)({
1261
1265
  blockExplorers: {
@@ -65,7 +65,7 @@ exports.viemBlockchainMapping = {
65
65
  [core_1.BLOCKCHAIN_NAME.ROOTSTOCK]: chain_configs_1.viemConfig[core_1.BLOCKCHAIN_NAME.ROOTSTOCK],
66
66
  [core_1.BLOCKCHAIN_NAME.MODE]: chains_1.mode,
67
67
  [core_1.BLOCKCHAIN_NAME.ZK_FAIR]: chains_1.zkFair,
68
- [core_1.BLOCKCHAIN_NAME.ZK_LINK]: chain_configs_1.viemConfig[core_1.BLOCKCHAIN_NAME.ZK_LINK],
68
+ [core_1.BLOCKCHAIN_NAME.ZK_LINK]: chains_1.zkLinkNova,
69
69
  [core_1.BLOCKCHAIN_NAME.XLAYER]: chain_configs_1.viemConfig[core_1.BLOCKCHAIN_NAME.XLAYER], // viem xLayer config without multicall address
70
70
  [core_1.BLOCKCHAIN_NAME.BAHAMUT]: chain_configs_1.viemConfig[core_1.BLOCKCHAIN_NAME.BAHAMUT],
71
71
  [core_1.BLOCKCHAIN_NAME.BITLAYER]: chain_configs_1.viemConfig[core_1.BLOCKCHAIN_NAME.BITLAYER],
package/README.md DELETED
@@ -1 +0,0 @@
1
- # web3