@zebec-network/zebec-stream-sdk 3.1.0-dev.1 → 3.1.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/artifacts/zebec_stream.json +24 -16
- package/dist/providers.js +3 -1
- package/dist/utils.js +5 -2
- package/package.json +43 -43
|
@@ -173,8 +173,9 @@
|
|
|
173
173
|
"program": {
|
|
174
174
|
"kind": "const",
|
|
175
175
|
"value": [
|
|
176
|
-
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
177
|
-
|
|
176
|
+
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
177
|
+
13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
|
|
178
|
+
219, 233, 248, 89
|
|
178
179
|
]
|
|
179
180
|
},
|
|
180
181
|
"seeds": [
|
|
@@ -185,8 +186,9 @@
|
|
|
185
186
|
{
|
|
186
187
|
"kind": "const",
|
|
187
188
|
"value": [
|
|
188
|
-
6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206,
|
|
189
|
-
|
|
189
|
+
6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206,
|
|
190
|
+
235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140,
|
|
191
|
+
245, 133, 126, 255, 0, 169
|
|
190
192
|
]
|
|
191
193
|
},
|
|
192
194
|
{
|
|
@@ -289,8 +291,9 @@
|
|
|
289
291
|
"program": {
|
|
290
292
|
"kind": "const",
|
|
291
293
|
"value": [
|
|
292
|
-
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
293
|
-
|
|
294
|
+
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
295
|
+
13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
|
|
296
|
+
219, 233, 248, 89
|
|
294
297
|
]
|
|
295
298
|
},
|
|
296
299
|
"seeds": [
|
|
@@ -301,8 +304,9 @@
|
|
|
301
304
|
{
|
|
302
305
|
"kind": "const",
|
|
303
306
|
"value": [
|
|
304
|
-
6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206,
|
|
305
|
-
|
|
307
|
+
6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206,
|
|
308
|
+
235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140,
|
|
309
|
+
245, 133, 126, 255, 0, 169
|
|
306
310
|
]
|
|
307
311
|
},
|
|
308
312
|
{
|
|
@@ -336,8 +340,9 @@
|
|
|
336
340
|
"program": {
|
|
337
341
|
"kind": "const",
|
|
338
342
|
"value": [
|
|
339
|
-
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
340
|
-
|
|
343
|
+
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
344
|
+
13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
|
|
345
|
+
219, 233, 248, 89
|
|
341
346
|
]
|
|
342
347
|
},
|
|
343
348
|
"seeds": [
|
|
@@ -348,8 +353,9 @@
|
|
|
348
353
|
{
|
|
349
354
|
"kind": "const",
|
|
350
355
|
"value": [
|
|
351
|
-
6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206,
|
|
352
|
-
|
|
356
|
+
6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206,
|
|
357
|
+
235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140,
|
|
358
|
+
245, 133, 126, 255, 0, 169
|
|
353
359
|
]
|
|
354
360
|
},
|
|
355
361
|
{
|
|
@@ -571,8 +577,9 @@
|
|
|
571
577
|
"program": {
|
|
572
578
|
"kind": "const",
|
|
573
579
|
"value": [
|
|
574
|
-
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
575
|
-
|
|
580
|
+
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
581
|
+
13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
|
|
582
|
+
219, 233, 248, 89
|
|
576
583
|
]
|
|
577
584
|
},
|
|
578
585
|
"seeds": [
|
|
@@ -583,8 +590,9 @@
|
|
|
583
590
|
{
|
|
584
591
|
"kind": "const",
|
|
585
592
|
"value": [
|
|
586
|
-
6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206,
|
|
587
|
-
|
|
593
|
+
6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206,
|
|
594
|
+
235, 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140,
|
|
595
|
+
245, 133, 126, 255, 0, 169
|
|
588
596
|
]
|
|
589
597
|
},
|
|
590
598
|
{
|
package/dist/providers.js
CHANGED
|
@@ -9,7 +9,9 @@ class ReadonlyProvider {
|
|
|
9
9
|
walletAddress;
|
|
10
10
|
constructor(connection, walletAddress) {
|
|
11
11
|
this.connection = connection;
|
|
12
|
-
this.walletAddress = walletAddress
|
|
12
|
+
this.walletAddress = walletAddress
|
|
13
|
+
? (0, anchor_1.translateAddress)(walletAddress)
|
|
14
|
+
: undefined;
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
17
|
exports.ReadonlyProvider = ReadonlyProvider;
|
package/dist/utils.js
CHANGED
|
@@ -7,7 +7,7 @@ const bignumber_js_1 = require("bignumber.js");
|
|
|
7
7
|
const constants_1 = require("./constants");
|
|
8
8
|
async function getFeeInfoForStream(streamToken, parsedStreamTokenAmount, streamTokenDecimals, network) {
|
|
9
9
|
const urlsParams = new URLSearchParams({
|
|
10
|
-
|
|
10
|
+
mintAddress: streamToken.toBase58(),
|
|
11
11
|
chain: "SOLANA",
|
|
12
12
|
amount: (0, bignumber_js_1.BigNumber)(parsedStreamTokenAmount).toFixed(0),
|
|
13
13
|
decimals: streamTokenDecimals.toString(),
|
|
@@ -16,7 +16,10 @@ async function getFeeInfoForStream(streamToken, parsedStreamTokenAmount, streamT
|
|
|
16
16
|
console.debug("fetching fee token amount from url:", url);
|
|
17
17
|
const response = await fetch(url);
|
|
18
18
|
if (!response.ok) {
|
|
19
|
-
const body = await response.
|
|
19
|
+
const body = await response.json().catch(() => null);
|
|
20
|
+
if (body && "message" in body) {
|
|
21
|
+
throw new Error(`Failed to fetch fee token amount: ${body.message}`);
|
|
22
|
+
}
|
|
20
23
|
throw new Error(`Failed to fetch fee token amount: ${response.status} ${response.statusText} ${body}`.trim());
|
|
21
24
|
}
|
|
22
25
|
const data = await response.json();
|
package/package.json
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
{
|
|
2
|
-
"author": "Ashish Sapkota",
|
|
3
|
-
"dependencies": {
|
|
4
|
-
"@coral-xyz/anchor": "^0.31.1",
|
|
5
|
-
"@metaplex-foundation/mpl-token-metadata": "^3.4.0",
|
|
6
|
-
"@metaplex-foundation/umi": "^1.4.1",
|
|
7
|
-
"@metaplex-foundation/umi-bundle-defaults": "^1.4.1",
|
|
8
|
-
"@metaplex-foundation/umi-web3js-adapters": "^1.4.1",
|
|
9
|
-
"@solana/spl-token": "^0.4.14",
|
|
10
|
-
"@solana/web3.js": "^1.98.2",
|
|
11
|
-
"@zebec-network/core-utils": "^1.1.1",
|
|
12
|
-
"@zebec-network/solana-common": "^2.3.1",
|
|
13
|
-
"bignumber.js": "^9.3.1"
|
|
14
|
-
},
|
|
15
|
-
"description": "This is an SDK for interacting with ZEBEC Stream Program in solana",
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@types/bn.js": "^5.2.0",
|
|
18
|
-
"@types/mocha": "^10.0.10",
|
|
19
|
-
"@types/node": "^24.3.1",
|
|
20
|
-
"dotenv": "^17.2.3",
|
|
21
|
-
"mocha": "^11.7.5",
|
|
22
|
-
"prettier": "^3.7.4",
|
|
23
|
-
"rimraf": "^6.1.2",
|
|
24
|
-
"ts-mocha": "^11.1.0",
|
|
25
|
-
"ts-node": "^10.9.2",
|
|
26
|
-
"typescript": "^5.9.2"
|
|
27
|
-
},
|
|
28
|
-
"files": [
|
|
29
|
-
"dist"
|
|
30
|
-
],
|
|
31
|
-
"license": "MIT",
|
|
32
|
-
"main": "dist/index.js",
|
|
33
|
-
"name": "@zebec-network/zebec-stream-sdk",
|
|
34
|
-
"scripts": {
|
|
35
|
-
"build": "npm run clean && tsc",
|
|
36
|
-
"clean": "rimraf ./dist",
|
|
37
|
-
"format": "
|
|
38
|
-
"start": "ts-node src/index.ts",
|
|
39
|
-
"test": "ts-mocha -p ./tsconfig.json -t 1000000000 test/**/*.test.ts",
|
|
40
|
-
"test:single": "ts-mocha -p ./tsconfig.json -t 1000000000"
|
|
41
|
-
},
|
|
42
|
-
"types": "dist/index.d.ts",
|
|
43
|
-
"version": "3.1.0
|
|
1
|
+
{
|
|
2
|
+
"author": "Ashish Sapkota",
|
|
3
|
+
"dependencies": {
|
|
4
|
+
"@coral-xyz/anchor": "^0.31.1",
|
|
5
|
+
"@metaplex-foundation/mpl-token-metadata": "^3.4.0",
|
|
6
|
+
"@metaplex-foundation/umi": "^1.4.1",
|
|
7
|
+
"@metaplex-foundation/umi-bundle-defaults": "^1.4.1",
|
|
8
|
+
"@metaplex-foundation/umi-web3js-adapters": "^1.4.1",
|
|
9
|
+
"@solana/spl-token": "^0.4.14",
|
|
10
|
+
"@solana/web3.js": "^1.98.2",
|
|
11
|
+
"@zebec-network/core-utils": "^1.1.1",
|
|
12
|
+
"@zebec-network/solana-common": "^2.3.1",
|
|
13
|
+
"bignumber.js": "^9.3.1"
|
|
14
|
+
},
|
|
15
|
+
"description": "This is an SDK for interacting with ZEBEC Stream Program in solana",
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/bn.js": "^5.2.0",
|
|
18
|
+
"@types/mocha": "^10.0.10",
|
|
19
|
+
"@types/node": "^24.3.1",
|
|
20
|
+
"dotenv": "^17.2.3",
|
|
21
|
+
"mocha": "^11.7.5",
|
|
22
|
+
"prettier": "^3.7.4",
|
|
23
|
+
"rimraf": "^6.1.2",
|
|
24
|
+
"ts-mocha": "^11.1.0",
|
|
25
|
+
"ts-node": "^10.9.2",
|
|
26
|
+
"typescript": "^5.9.2"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"main": "dist/index.js",
|
|
33
|
+
"name": "@zebec-network/zebec-stream-sdk",
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "npm run clean && tsc",
|
|
36
|
+
"clean": "rimraf ./dist",
|
|
37
|
+
"format": "npx @biomejs/biome format --write",
|
|
38
|
+
"start": "ts-node src/index.ts",
|
|
39
|
+
"test": "ts-mocha -p ./tsconfig.json -t 1000000000 test/**/*.test.ts",
|
|
40
|
+
"test:single": "ts-mocha -p ./tsconfig.json -t 1000000000"
|
|
41
|
+
},
|
|
42
|
+
"types": "dist/index.d.ts",
|
|
43
|
+
"version": "3.1.0"
|
|
44
44
|
}
|