@bitgen/sdk 1.0.4 → 1.0.6

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 CHANGED
@@ -1,3 +1,9 @@
1
+ ## [1.0.6] - 2026-09-23
2
+
3
+ ### Changed
4
+ - Documentation only, no code change. `readme/resource/bank.md`: `credit` on a provider that reports the deposit itself answers `201` with an empty body and no `uuid` (it answered `202` before) — `uuid` is `undefined`, the movement appears in `pending.in` a second later
5
+ - `readme/resource/trading.md`: new `429 daily_buy_limit_exceeded` on `buy` — **sandbox only**, purchases are capped per customer and per calendar day because the sandbox buys with test tokens. No such cap exists in production
6
+
1
7
  ## [1.0.4] - 2026-09-18
2
8
 
3
9
  ### Changed
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @bitgen/sdk — v1.0.4
1
+ # @bitgen/sdk — v1.0.6
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).
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.0.4";
1
+ export declare const VERSION = "1.0.6";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // Generated by scripts/prebuild.js from package.json — do not edit
5
- exports.VERSION = "1.0.4";
5
+ exports.VERSION = "1.0.6";
6
6
  //# sourceMappingURL=version.js.map
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.0.4";
1
+ export declare const VERSION = "1.0.6";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,3 +1,3 @@
1
1
  // Generated by scripts/prebuild.js from package.json — do not edit
2
- export const VERSION = "1.0.4";
2
+ export const VERSION = "1.0.6";
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitgen/sdk",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "license": "UNLICENSED",
5
5
  "author": "BITGEN",
6
6
  "description": "Official Node.js SDK for the BITGEN API v4.0.x",
@@ -121,7 +121,7 @@ The EUR of a customer are held by the bank provider of your organization, on the
121
121
 
122
122
  ![An EUR deposit: the wire to the organization account at the bank provider, its report, the matching by reference, the compliance analysis, the credit of the ledger](media/deposit-flow.svg)
123
123
 
124
- A deposit: the customer wires EUR to the organization's account with the reference `BTGN` followed by the code of their account (`message`) → the provider reports the wire to BITGEN — with a manual bank, you declare it ([credit](resource/bank.md#credit)) → BITGEN matches the reference and the amount enters `pending.in` → compliance analysis: a `BANK` `IN` transaction, `bank.transaction` (`PENDING` if an alert holds it — [Transactions](resource/transaction.md)) → `balance` credited, operation `DEPOSIT`, `bank.credited`. The credit is never immediate; without a valid reference the wire is never credited, and the compliance of your organization is notified.
124
+ A deposit: the customer wires EUR to the organization's account with the reference `BTGN` followed by the code of their account (`message`) → the provider reports the wire to BITGEN — with a manual bank, you declare it ([credit](resource/bank.md#credit)) — on the sandbox test bank, that declaration is taken and reported back within seconds → BITGEN matches the reference and the amount enters `pending.in` → compliance analysis: a `BANK` `IN` transaction, `bank.transaction` (`PENDING` if an alert holds it — [Transactions](resource/transaction.md)) → `balance` credited, operation `DEPOSIT`, `bank.credited`. The credit is never immediate; without a valid reference the wire is never credited, and the compliance of your organization is notified.
125
125
 
126
126
  ![An EUR withdrawal: the reserve on the ledger, the compliance analysis, the wire from the organization account to the customer IBAN, the debit at confirmation](media/withdrawal-flow.svg)
127
127
 
@@ -18,7 +18,7 @@ const client = new BitgenClient({
18
18
  | Option | Description |
19
19
  |---|---|
20
20
  | `scope` | uuid of the organization that owns the key. Sent as the `BITGEN-Scope` header. It is also the organization the SDK uses wherever the API expects yours (webhooks, API keys, the organization of a new customer). |
21
- | `apiKey` | The raw key, shown once when it is created. Sent as the `Api-key` header. |
21
+ | `apiKey` | The raw key, shown once when it is created by an administrator of the organization, in the BITGEN interface — never through the API. Sent as the `Api-key` header. |
22
22
 
23
23
  A missing key, an unknown, revoked or expired key, or a `scope` that is not the key's organization, is refused with a `401` ([Common errors](errors.md#common-errors)).
24
24
 
@@ -1,6 +1,6 @@
1
1
  # API keys
2
2
 
3
- An API key belongs to your organization: it is valid until it expires or is revoked, and every call made with it is journaled. `client.apikeys` reads the keys of your organization and the journal of their calls — it is read-only: a key cannot be created through the API, and the SDK does not revoke.
3
+ An API key belongs to your organization: it is valid until it expires or is revoked, and every call made with it is journaled. `client.apikeys` reads the keys of your organization and the journal of their calls — it is read-only: a key is created, configured and revoked by an administrator of the organization, in the BITGEN interface — never through the API, and the SDK does not revoke.
4
4
 
5
5
  Examples use `client`, a configured `BitgenClient` ([Configuration](../configuration.md)). Wherever the API expects your organization, the SDK sends the `scope` of the client.
6
6
 
@@ -106,7 +106,7 @@ The withdrawal goes to the customer's IBAN: the amount is reserved in `pending.o
106
106
  client.bank.credit(params: BankCreditParams): Promise<Created>
107
107
  ```
108
108
 
109
- `credit` only applies when your organization's bank provider is **manual** — deposits are not reported to BITGEN automatically: you tell BITGEN a wire has arrived on the organization's account. The amount enters `pending.in`, goes through BITGEN's processing and the compliance analysis, and the account is credited then — `bank.credited` at that moment ([Following a deposit and a withdrawal](../concepts.md#following-a-deposit-and-a-withdrawal)). With an automated provider, deposits are detected and credited automatically and you are notified by the `bank.credited` webhook ([Webhooks](webhooks.md)) — do not call `credit`: the API refuses it (`412 deposit_reported_by_provider`). The account is designated either by the customer (`user`) or by the wire transfer reference of the account (`message`).
109
+ `credit` only applies when your organization's bank provider is **manual** — deposits are not reported to BITGEN automatically: you tell BITGEN a wire has arrived on the organization's account. The amount enters `pending.in`, goes through BITGEN's processing and the compliance analysis, and the account is credited then — `bank.credited` at that moment ([Following a deposit and a withdrawal](../concepts.md#following-a-deposit-and-a-withdrawal)). On a provider that **takes the declaration and reports the deposit itself** — the test bank of the sandbox environment — the call answers `201` with an empty body, no `uuid`: the incoming movement appears in `pending.in` a second later, once the provider has reported it, and the `bank.transaction` / `bank.credited` events follow as for any deposit. With an automated provider that refuses declarations, deposits are detected and credited automatically and you are notified by the `bank.credited` webhook ([Webhooks](webhooks.md)) — do not call `credit`: the API refuses it (`412 deposit_reported_by_provider`). The account is designated either by the customer (`user`) or by the wire transfer reference of the account (`message`).
110
110
 
111
111
  | Parameter | Type | Description |
112
112
  |---|---|---|
@@ -124,7 +124,7 @@ const { uuid } = await client.bank.credit({
124
124
  })
125
125
  ```
126
126
 
127
- Returns a `Created` — the `uuid` of the declared deposit: the incoming movement, not credited yet. Without `user` nor `message`, the API answers `400 bank_target_required`.
127
+ Returns a `Created` — the `uuid` of the declared deposit: the incoming movement, not credited yet. On a provider that reports the deposit itself (see above) `uuid` is `undefined`. Without `user` nor `message`, the API answers `400 bank_target_required`.
128
128
 
129
129
  ![An EUR deposit: the wire to the organization account at the bank provider, its report, the matching by reference, the compliance analysis, the credit of the ledger](../media/deposit-flow.svg)
130
130
 
@@ -143,7 +143,7 @@ In addition to the [common errors](../errors.md#common-errors):
143
143
  | `412` | `owner_identity_not_validated` | Your organization uses BITGEN's identity verification and the customer's identity is not validated: the account cannot be created |
144
144
  | `412` | `bank_rib_required` | `withdraw` without an IBAN or a bank on the account |
145
145
  | `412` | `ramp_not_enabled` | The `CoreType.RAMP` (bank) connector of your organization is not enabled |
146
- | `412` | `deposit_reported_by_provider` | `credit` on an automated bank provider: deposits are reported by the provider itself |
146
+ | `412` | `deposit_reported_by_provider` | `credit` on an automated bank provider that refuses declarations: deposits are reported by the provider itself |
147
147
  | `412` | `trading_not_enabled` | The `CoreType.TRADING` connector of your organization is not enabled |
148
148
  | `416` | `requested_amount_error` | Insufficient balance |
149
149
  | `416` | `amount_below_fee` | The amount does not cover the fee |
@@ -40,7 +40,7 @@ const order = await client.trading.get(tunnel)
40
40
  console.log(order.state === OrderState.DONE, order.received, order.executedPrice) // true 0.0123 2031.5
41
41
  ```
42
42
 
43
- The API reserves `amount` on the customer's EUR account (`423 insufficient_funds` if the balance is insufficient, `404 unknown_bank` without an EUR account) and creates the order. `tunnel` is its uuid, `state` its initial state.
43
+ The API reserves `amount` on the customer's EUR account (`423 insufficient_funds` if the balance is insufficient, `404 unknown_bank` without an EUR account) and creates the order. `tunnel` is its uuid, `state` its initial state. On the **sandbox** environment only, purchases are capped per customer and per calendar day — the sandbox buys with test tokens, whose supply is limited: beyond the cap the call answers `429 daily_buy_limit_exceeded`. No such cap exists in production.
44
44
 
45
45
  ![A purchase: REGISTERED, EXECUTING, FILLED, DELIVERING, DONE — FAILED and PARKED](../media/order-buy.svg)
46
46
 
@@ -160,6 +160,7 @@ In addition to the [common errors](../errors.md#common-errors), and the custody
160
160
  | `423` | `insufficient_funds` | `buy`: insufficient EUR balance |
161
161
  | `423` | `blocked_by_alert` | An active compliance alert blocks the customer |
162
162
  | `423` | `bank_lock_unavailable` | The EUR account is locked by a concurrent operation |
163
+ | `429` | `daily_buy_limit_exceeded` | **Sandbox only** — the daily purchase cap for this customer is reached. Never returned in production |
163
164
 
164
165
  ## Related
165
166
 
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.4"
2
+ export const VERSION = "1.0.6"