@beam-network/sdk 0.5.0 → 0.5.1
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 +5 -1
- package/dist/client.d.ts +14 -2
- package/dist/client.js +316 -169
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/models.d.ts +10 -58
- package/dist/nats-control.d.ts +33 -16
- package/dist/nats-control.js +186 -59
- package/dist/provider-signing.js +1 -2
- package/package.json +35 -35
- package/dist/errors.d.ts +0 -17
- package/dist/errors.js +0 -26
package/package.json
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
"name": "@beam-network/sdk",
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"description": "TypeScript SDK for BEAM transfer creation and management.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.json",
|
|
22
|
+
"test": "tsc -p tsconfig.json --noEmit && npm run test:functional",
|
|
23
|
+
"test:functional": "npm run build && node --test test/client.functional.test.mjs",
|
|
24
|
+
"lint": "tsc -p tsconfig.json --noEmit"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@aws-sdk/client-s3": "^3.806.0",
|
|
31
|
+
"@aws-sdk/s3-request-presigner": "^3.806.0",
|
|
32
|
+
"@msgpack/msgpack": "^3.0.0",
|
|
33
|
+
"nats": "^2.29.3"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"typescript": "^5.5.0"
|
|
14
37
|
}
|
|
15
|
-
},
|
|
16
|
-
"files": [
|
|
17
|
-
"dist",
|
|
18
|
-
"README.md"
|
|
19
|
-
],
|
|
20
|
-
"scripts": {
|
|
21
|
-
"build": "tsc -p tsconfig.json",
|
|
22
|
-
"test": "tsc -p tsconfig.json --noEmit && npm run test:functional",
|
|
23
|
-
"test:functional": "npm run build && node --test test/client.functional.test.mjs",
|
|
24
|
-
"lint": "tsc -p tsconfig.json --noEmit"
|
|
25
|
-
},
|
|
26
|
-
"publishConfig": {
|
|
27
|
-
"access": "public"
|
|
28
|
-
},
|
|
29
|
-
"dependencies": {
|
|
30
|
-
"@aws-sdk/client-s3": "^3.806.0",
|
|
31
|
-
"@aws-sdk/s3-request-presigner": "^3.806.0",
|
|
32
|
-
"@msgpack/msgpack": "^3.0.0",
|
|
33
|
-
"nats": "^2.29.3"
|
|
34
|
-
},
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"typescript": "^5.5.0"
|
|
37
|
-
}
|
|
38
38
|
}
|
package/dist/errors.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { CreditStatus } from "./models.js";
|
|
2
|
-
export declare class BeamApiError extends Error {
|
|
3
|
-
readonly status: number;
|
|
4
|
-
readonly body: string;
|
|
5
|
-
constructor(message: string, status: number, body: string);
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Raised when Beam refuses a request because the organization is out of credits.
|
|
9
|
-
*
|
|
10
|
-
* Always terminal: 402 is outside the retryable status set, so the SDK fails fast
|
|
11
|
-
* rather than retrying a request that cannot succeed until the balance is topped up.
|
|
12
|
-
*/
|
|
13
|
-
export declare class BeamInsufficientCreditsError extends BeamApiError {
|
|
14
|
-
readonly code: string;
|
|
15
|
-
readonly credits: CreditStatus | null;
|
|
16
|
-
constructor(message: string, code: string, credits: CreditStatus | null, body: string);
|
|
17
|
-
}
|
package/dist/errors.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export class BeamApiError extends Error {
|
|
2
|
-
status;
|
|
3
|
-
body;
|
|
4
|
-
constructor(message, status, body) {
|
|
5
|
-
super(message);
|
|
6
|
-
this.status = status;
|
|
7
|
-
this.body = body;
|
|
8
|
-
this.name = "BeamApiError";
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Raised when Beam refuses a request because the organization is out of credits.
|
|
13
|
-
*
|
|
14
|
-
* Always terminal: 402 is outside the retryable status set, so the SDK fails fast
|
|
15
|
-
* rather than retrying a request that cannot succeed until the balance is topped up.
|
|
16
|
-
*/
|
|
17
|
-
export class BeamInsufficientCreditsError extends BeamApiError {
|
|
18
|
-
code;
|
|
19
|
-
credits;
|
|
20
|
-
constructor(message, code, credits, body) {
|
|
21
|
-
super(message, 402, body);
|
|
22
|
-
this.code = code;
|
|
23
|
-
this.credits = credits;
|
|
24
|
-
this.name = "BeamInsufficientCreditsError";
|
|
25
|
-
}
|
|
26
|
-
}
|