@bitgen/sdk 1.0.7 → 1.0.8
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/CHANGELOG.md +5 -0
- package/README.md +3 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +1 -1
- package/readme/configuration.md +2 -2
- package/readme/quick-start.md +2 -2
- package/readme/resource/custody.md +1 -1
- package/readme/resource/webhooks.md +1 -1
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @bitgen/sdk — v1.0.
|
|
1
|
+
# @bitgen/sdk — v1.0.8
|
|
2
2
|
|
|
3
3
|
Official Node.js SDK for the BITGEN API v4 — server-side, TypeScript, ESM and CommonJS, no runtime dependency.
|
|
4
4
|
Install it with `npm install @bitgen/sdk` (Node.js 20 or later).
|
|
@@ -7,9 +7,9 @@ Install it with `npm install @bitgen/sdk` (Node.js 20 or later).
|
|
|
7
7
|
import { BitgenClient, Env } from '@bitgen/sdk'
|
|
8
8
|
|
|
9
9
|
const client = new BitgenClient({
|
|
10
|
-
scope: '
|
|
10
|
+
scope: 'YOUR_ORGANIZATION_SCOPE', // uuid of the organization that owns the key
|
|
11
11
|
apiKey: 'YOUR_API_KEY',
|
|
12
|
-
env: Env.SANDBOX,
|
|
12
|
+
env: Env.SANDBOX, // Env.PRODUCTION by default
|
|
13
13
|
})
|
|
14
14
|
|
|
15
15
|
const account = await client.bank.get('CUSTOMER_UUID')
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.0.
|
|
1
|
+
export declare const VERSION = "1.0.8";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.0.
|
|
1
|
+
export declare const VERSION = "1.0.8";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/esm/version.js
CHANGED
package/package.json
CHANGED
package/readme/configuration.md
CHANGED
|
@@ -6,7 +6,7 @@ A `BitgenClient` is built once per API key and reused: it holds the credentials,
|
|
|
6
6
|
import { BitgenClient, Env } from '@bitgen/sdk'
|
|
7
7
|
|
|
8
8
|
const client = new BitgenClient({
|
|
9
|
-
scope: '
|
|
9
|
+
scope: 'YOUR_ORGANIZATION_SCOPE',
|
|
10
10
|
apiKey: 'YOUR_API_KEY',
|
|
11
11
|
env: Env.PRODUCTION, // default
|
|
12
12
|
timeout: 30, // seconds, default 30
|
|
@@ -39,7 +39,7 @@ To reach the API through another hostname — a container, a tunnel — give `ho
|
|
|
39
39
|
|
|
40
40
|
```ts
|
|
41
41
|
const client = new BitgenClient({
|
|
42
|
-
scope: '
|
|
42
|
+
scope: 'YOUR_ORGANIZATION_SCOPE',
|
|
43
43
|
apiKey: 'YOUR_API_KEY',
|
|
44
44
|
host: 'my-hostname', // bare hostname: no scheme, port or path
|
|
45
45
|
port: 8080, // default 80
|
package/readme/quick-start.md
CHANGED
|
@@ -8,9 +8,9 @@ Create the client once, then run a first journey: create a customer, read their
|
|
|
8
8
|
import { BitgenClient, Env } from '@bitgen/sdk'
|
|
9
9
|
|
|
10
10
|
const client = new BitgenClient({
|
|
11
|
-
scope: '
|
|
11
|
+
scope: 'YOUR_ORGANIZATION_SCOPE', // uuid of the organization that owns the key
|
|
12
12
|
apiKey: 'YOUR_API_KEY',
|
|
13
|
-
env: Env.SANDBOX,
|
|
13
|
+
env: Env.SANDBOX, // Env.PRODUCTION by default
|
|
14
14
|
})
|
|
15
15
|
```
|
|
16
16
|
|
|
@@ -28,7 +28,7 @@ for (const wallet of wallets) {
|
|
|
28
28
|
console.log(wallet.asset.iso, wallet.balance, wallet.address) // 'ETH' '0.5' '0xabc…'
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
const treasury = await client.custody.wallets('
|
|
31
|
+
const treasury = await client.custody.wallets('YOUR_ORGANIZATION_SCOPE') // the treasury wallets of your organization
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
Returns the wallets without their `history`:
|
|
@@ -242,7 +242,7 @@ Answer with a 2xx status: a delivery that does not get one is retried 4 times (a
|
|
|
242
242
|
import { createServer } from 'node:http'
|
|
243
243
|
import { BitgenClient, BitgenError, WebhookEventName } from '@bitgen/sdk'
|
|
244
244
|
|
|
245
|
-
const client = new BitgenClient({ scope: '
|
|
245
|
+
const client = new BitgenClient({ scope: 'YOUR_ORGANIZATION_SCOPE', apiKey: 'YOUR_API_KEY' })
|
|
246
246
|
const { secret } = await client.webhooks.list()
|
|
247
247
|
|
|
248
248
|
createServer((req, res) => {
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by scripts/prebuild.js from package.json — do not edit
|
|
2
|
-
export const VERSION = "1.0.
|
|
2
|
+
export const VERSION = "1.0.8"
|