@quicknode/sdk 2.4.1 → 2.5.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/README.md +1 -1
- package/cjs/index.js +41 -2
- package/esm/core/chains.js +40 -1
- package/esm/lib/constants.js +1 -1
- package/esm/solana/solana.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -69,7 +69,7 @@ We recommend using the example application to develop
|
|
|
69
69
|
|
|
70
70
|
Run `nx test libs-sdk` to execute the tests via [Jest](https://jestjs.io).
|
|
71
71
|
|
|
72
|
-
API responses are recorded using [polly.js](https://github.com/Netflix/pollyjs). You can re-record live requests by passing in an API key, copy `.env.test.example` to `.env.test` and fill out with your API key
|
|
72
|
+
API responses are recorded using [polly.js](https://github.com/Netflix/pollyjs). You can re-record live requests by passing in an API key, copy `.env.test.example` to `.env.test` and fill out with your API key and re-record tests `nx test libs-sdk -- -u`
|
|
73
73
|
|
|
74
74
|
<br>
|
|
75
75
|
|
package/cjs/index.js
CHANGED
|
@@ -306,6 +306,45 @@ const qnChainToViemChain = {
|
|
|
306
306
|
'sei-arctic': chains.seiDevnet,
|
|
307
307
|
'ethereum-sepolia': chains.sepolia,
|
|
308
308
|
'ethereum-holesky': chains.holesky,
|
|
309
|
+
'0g-mainnet': chains.zeroGMainnet,
|
|
310
|
+
'0g-galileo': chains.zeroGTestnet,
|
|
311
|
+
'abstract-testnet': chains.abstractTestnet,
|
|
312
|
+
'abstract-mainnet': chains.abstract,
|
|
313
|
+
'b3-mainnet': chains.b3,
|
|
314
|
+
'b3-sepolia': chains.b3Sepolia,
|
|
315
|
+
'flare-mainnet': chains.flare,
|
|
316
|
+
'flare-coston2': chains.flareTestnet,
|
|
317
|
+
'gravity-alpham': chains.gravity,
|
|
318
|
+
'hemi-testnet': chains.hemiSepolia,
|
|
319
|
+
'hemi-mainnet': chains.hemi,
|
|
320
|
+
'hype-testnet': chains.hyperliquidEvmTestnet,
|
|
321
|
+
'imx-testnet': chains.immutableZkEvmTestnet,
|
|
322
|
+
'imx-mainnet': chains.immutableZkEvm,
|
|
323
|
+
'ink-mainnet': chains.ink,
|
|
324
|
+
'ink-sepolia': chains.inkSepolia,
|
|
325
|
+
'joc-mainnet': chains.jocMainnet,
|
|
326
|
+
'kaia-kairos': chains.kairos,
|
|
327
|
+
'kaia-mainnet': chains.kaia,
|
|
328
|
+
'linea-mainnet': chains.linea,
|
|
329
|
+
'monad-testnet': chains.monadTestnet,
|
|
330
|
+
'morph-mainnet': chains.morph,
|
|
331
|
+
'nomina-mainnet': chains.nomina,
|
|
332
|
+
'peaq-mainnet': chains.peaq,
|
|
333
|
+
'plasma-testnet': chains.plasmaTestnet,
|
|
334
|
+
'plasma-mainnet': chains.plasma,
|
|
335
|
+
'soneium-mainnet': chains.soneium,
|
|
336
|
+
'sonic-mainnet': chains.sonic,
|
|
337
|
+
'story-aeneid': chains.storyAeneid,
|
|
338
|
+
'story-mainnet': chains.story,
|
|
339
|
+
'unichain-mainnet': chains.unichain,
|
|
340
|
+
'unichain-sepolia': chains.unichainSepolia,
|
|
341
|
+
'vana-moksha': chains.vanaMoksha,
|
|
342
|
+
'vana-mainnet': chains.vana,
|
|
343
|
+
'worldchain-mainnet': chains.worldchain,
|
|
344
|
+
'worldchain-sepolia': chains.worldchainSepolia,
|
|
345
|
+
'xai-mainnet': chains.xai,
|
|
346
|
+
'xai-testnet': chains.xaiTestnet,
|
|
347
|
+
'xlayer-mainnet': chains.xLayer,
|
|
309
348
|
};
|
|
310
349
|
function chainNameFromEndpoint(endpointUrl) {
|
|
311
350
|
let hostnameParts;
|
|
@@ -348,7 +387,7 @@ function setupGlobalFetch() {
|
|
|
348
387
|
}
|
|
349
388
|
|
|
350
389
|
// Ideally we read directly from package.json, but ran into some packaging issues with that
|
|
351
|
-
const PACKAGE_VERSION = '2.
|
|
390
|
+
const PACKAGE_VERSION = '2.5.2';
|
|
352
391
|
|
|
353
392
|
// Headers to use in RPC clients
|
|
354
393
|
function getClientHeaders() {
|
|
@@ -481,7 +520,7 @@ class Solana {
|
|
|
481
520
|
});
|
|
482
521
|
if (simulation.value.err) {
|
|
483
522
|
console.error('Simulation error:', simulation.value.err);
|
|
484
|
-
throw new Error(`Failed to simulate transaction ${simulation.value.err}`);
|
|
523
|
+
throw new Error(`Failed to simulate transaction ${JSON.stringify(simulation.value.err)}`);
|
|
485
524
|
}
|
|
486
525
|
return simulation.value.unitsConsumed;
|
|
487
526
|
}
|
package/esm/core/chains.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QNInvalidEndpointUrl } from '../lib/errors/QNInvalidEnpointUrl.js';
|
|
2
2
|
import { QNChainNotSupported } from '../lib/errors/QNChainNotSupported.js';
|
|
3
|
-
import { arbitrum, arbitrumGoerli, arbitrumSepolia, arbitrumNova, avalanche, avalancheFuji, base, baseGoerli, baseSepolia, berachainTestnet, blast, blastSepolia, bsc, bscTestnet, celo, cyber, cyberTestnet, fantom, gnosis, goerli, harmonyOne, mainnet, mantle, mantleSepoliaTestnet, optimism, optimismGoerli, optimismSepolia, polygon, scroll, scrollSepolia, polygonMumbai, polygonAmoy, polygonZkEvm, polygonZkEvmTestnet, sei, seiDevnet, sepolia, holesky } from 'viem/chains';
|
|
3
|
+
import { arbitrum, arbitrumGoerli, arbitrumSepolia, arbitrumNova, avalanche, avalancheFuji, base, baseGoerli, baseSepolia, berachainTestnet, blast, blastSepolia, bsc, bscTestnet, celo, cyber, cyberTestnet, fantom, gnosis, goerli, harmonyOne, mainnet, mantle, mantleSepoliaTestnet, optimism, optimismGoerli, optimismSepolia, polygon, scroll, scrollSepolia, polygonMumbai, polygonAmoy, polygonZkEvm, polygonZkEvmTestnet, sei, seiDevnet, sepolia, holesky, zeroGMainnet, zeroGTestnet, abstractTestnet, abstract, b3, b3Sepolia, flare, flareTestnet, gravity, hemiSepolia, hemi, hyperliquidEvmTestnet, immutableZkEvmTestnet, immutableZkEvm, ink, inkSepolia, jocMainnet, kairos, kaia, linea, monadTestnet, morph, nomina, peaq, plasmaTestnet, plasma, soneium, sonic, storyAeneid, story, unichain, unichainSepolia, vanaMoksha, vana, worldchain, worldchainSepolia, xai, xaiTestnet, xLayer } from 'viem/chains';
|
|
4
4
|
|
|
5
5
|
const ETH_MAINNET_NETWORK = 'ethereum-mainnet';
|
|
6
6
|
const qnChainToViemChain = {
|
|
@@ -44,6 +44,45 @@ const qnChainToViemChain = {
|
|
|
44
44
|
'sei-arctic': seiDevnet,
|
|
45
45
|
'ethereum-sepolia': sepolia,
|
|
46
46
|
'ethereum-holesky': holesky,
|
|
47
|
+
'0g-mainnet': zeroGMainnet,
|
|
48
|
+
'0g-galileo': zeroGTestnet,
|
|
49
|
+
'abstract-testnet': abstractTestnet,
|
|
50
|
+
'abstract-mainnet': abstract,
|
|
51
|
+
'b3-mainnet': b3,
|
|
52
|
+
'b3-sepolia': b3Sepolia,
|
|
53
|
+
'flare-mainnet': flare,
|
|
54
|
+
'flare-coston2': flareTestnet,
|
|
55
|
+
'gravity-alpham': gravity,
|
|
56
|
+
'hemi-testnet': hemiSepolia,
|
|
57
|
+
'hemi-mainnet': hemi,
|
|
58
|
+
'hype-testnet': hyperliquidEvmTestnet,
|
|
59
|
+
'imx-testnet': immutableZkEvmTestnet,
|
|
60
|
+
'imx-mainnet': immutableZkEvm,
|
|
61
|
+
'ink-mainnet': ink,
|
|
62
|
+
'ink-sepolia': inkSepolia,
|
|
63
|
+
'joc-mainnet': jocMainnet,
|
|
64
|
+
'kaia-kairos': kairos,
|
|
65
|
+
'kaia-mainnet': kaia,
|
|
66
|
+
'linea-mainnet': linea,
|
|
67
|
+
'monad-testnet': monadTestnet,
|
|
68
|
+
'morph-mainnet': morph,
|
|
69
|
+
'nomina-mainnet': nomina,
|
|
70
|
+
'peaq-mainnet': peaq,
|
|
71
|
+
'plasma-testnet': plasmaTestnet,
|
|
72
|
+
'plasma-mainnet': plasma,
|
|
73
|
+
'soneium-mainnet': soneium,
|
|
74
|
+
'sonic-mainnet': sonic,
|
|
75
|
+
'story-aeneid': storyAeneid,
|
|
76
|
+
'story-mainnet': story,
|
|
77
|
+
'unichain-mainnet': unichain,
|
|
78
|
+
'unichain-sepolia': unichainSepolia,
|
|
79
|
+
'vana-moksha': vanaMoksha,
|
|
80
|
+
'vana-mainnet': vana,
|
|
81
|
+
'worldchain-mainnet': worldchain,
|
|
82
|
+
'worldchain-sepolia': worldchainSepolia,
|
|
83
|
+
'xai-mainnet': xai,
|
|
84
|
+
'xai-testnet': xaiTestnet,
|
|
85
|
+
'xlayer-mainnet': xLayer,
|
|
47
86
|
};
|
|
48
87
|
function chainNameFromEndpoint(endpointUrl) {
|
|
49
88
|
let hostnameParts;
|
package/esm/lib/constants.js
CHANGED
package/esm/solana/solana.js
CHANGED
|
@@ -102,7 +102,7 @@ class Solana {
|
|
|
102
102
|
});
|
|
103
103
|
if (simulation.value.err) {
|
|
104
104
|
console.error('Simulation error:', simulation.value.err);
|
|
105
|
-
throw new Error(`Failed to simulate transaction ${simulation.value.err}`);
|
|
105
|
+
throw new Error(`Failed to simulate transaction ${JSON.stringify(simulation.value.err)}`);
|
|
106
106
|
}
|
|
107
107
|
return simulation.value.unitsConsumed;
|
|
108
108
|
}
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"directory": "packages/libs/sdk"
|
|
7
7
|
},
|
|
8
8
|
"license": "MIT",
|
|
9
|
-
"version": "2.
|
|
9
|
+
"version": "2.5.2",
|
|
10
10
|
"main": "./cjs/index.js",
|
|
11
11
|
"module": "./esm/index.js",
|
|
12
12
|
"types": "./index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"@solana/web3.js": "^1.91",
|
|
16
16
|
"cross-fetch": "^3.1.6",
|
|
17
17
|
"tslib": "^2.5.3",
|
|
18
|
-
"viem": "^2.
|
|
18
|
+
"viem": "^2.38.6",
|
|
19
19
|
"zod": "^3.21.4"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|