@bitgen/sdk 1.0.3 → 1.0.4

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.
@@ -1,11 +1,13 @@
1
1
  # Staking
2
2
 
3
- Staking places the crypto of a customer with a staking provider to earn rewards. A **provider** is a `CoreType.STAKING` connector of the platform, one per asset (`figment_sol`, `bitgen_eth`…), with its own rate, minimum deposit and lock-up periods. Staking is driven by **movements** — a request to stake, unstake, withdraw or claim rewards — each attached to a **position**, the capital placed with the provider. `client.staking` lists the providers, opens a position, follows the movements, claims rewards, unstakes, and reads the operations and the EUR portfolio of a customer.
3
+ Staking places the crypto of a customer with a staking provider to earn rewards. A **provider** is a `CoreType.STAKING` connector of the platform, one per asset (`figment_sol`, `bitgen_eth`…), with its own rate, minimum deposit and lock-up periods. Staking is driven by a **movement** — the request to stake, rewritten into the exit when the position is left entirely — attached to a **position**, the capital placed with the provider. `client.staking` lists the providers, opens a position, follows the movements, claims rewards, unstakes, and reads the operations and the EUR portfolio of a customer.
4
4
 
5
5
  Two distinct identifiers: `stake` returns the uuid of a **movement**, which `get`, `list` and `movements` handle; the **position** it opened is `movement.staking.uuid`, which `rewards` and `unstake` take.
6
6
 
7
7
  Examples use `client`, a configured `BitgenClient` ([Configuration](../configuration.md)). A customer is designated by a `UserRef`: their uuid, or a model carrying it, such as the `Created` returned by `client.customer.create` ([User references](../concepts.md#user-references)). A customer who is not an activated member of your organization is refused with `403 org_forbidden` ([Activation and identity](../concepts.md#activation-and-identity)).
8
8
 
9
+ ![Staking: the movement returned by Stake, its states, and the position it opens](../media/staking-position.svg)
10
+
9
11
  ## Methods
10
12
 
11
13
  | Method | What it does | Returns |
@@ -22,7 +24,7 @@ Examples use `client`, a configured `BitgenClient` ([Configuration](../configura
22
24
 
23
25
  TypeScript types of this resource, exported by the package: `StakingPosition`, `StakingMovement`, `StakingOperation`, `StakingPortfolio`, `StakeParams`, `StakingListParams`, `StakingAmountParams` — the constants `StakingMovementState`, `StakingMovementKind`, `StakingPositionState` (also types) — plus the shared `UserRef`, `UserSummary`, `OrganizationSummary`, `AssetRef`, `AssetInput`, `Created`, `Amount`, `PageParams`, `Core`, `CoreRef`.
24
26
 
25
- ## providers
27
+ ## Providers
26
28
 
27
29
  ```
28
30
  client.staking.providers(asset?: AssetInput): Promise<Page<Core>>
@@ -59,7 +61,7 @@ Returns the `CoreType.STAKING` connectors, not paginated. The `uuid` or the `nam
59
61
 
60
62
  Periods are written `<unit>@<n>` with the unit `H`, `D`, `W`, `M` or `Y` — `D@3` is 3 days.
61
63
 
62
- ## stake
64
+ ## Stake
63
65
 
64
66
  ```
65
67
  client.staking.stake(user: UserRef, params: StakeParams): Promise<Created>
@@ -89,7 +91,7 @@ console.log(movement.staking.uuid) // the position, for `rewards` and `
89
91
 
90
92
  The amount is moved from the customer's custody wallet to the deposit address of the provider through an internal transfer: the errors of a custody withdrawal can surface ([Custody wallets › Errors](custody.md#errors)), in particular `416 requested_amount_error` for an insufficient crypto balance. Returns a `Created` — the uuid of the **movement**.
91
93
 
92
- ## list
94
+ ## List
93
95
 
94
96
  ```
95
97
  client.staking.list(params?: StakingListParams): Promise<Page<StakingMovement>>
@@ -100,7 +102,7 @@ The movements of your organization, in every state.
100
102
  | Parameter | Type | Description |
101
103
  |---|---|---|
102
104
  | `params.user` | `UserRef` | Only the movements of this customer (uuid or model; unknown → `404 unknown_user`) |
103
- | `params.direction` | `StakingMovementKind` | Only this kind of movement: `StakingMovementKind.STAKE`, `UNSTAKE`, `WITHDRAW` or `REWARD` — absent, all |
105
+ | `params.direction` | `StakingMovementKind` | Only this kind of movement: `StakingMovementKind.STAKE`, `UNSTAKE`, `WITHDRAW` or `REWARD` — absent, all. A movement is `STAKE`, then `UNSTAKE` after a full exit; `WITHDRAW` and `REWARD` match no movement — a partial exit and a claim create none — and give an empty page |
104
106
  | `params.offset`, `params.limit` | `number` | [Pagination](../concepts.md#pagination) |
105
107
 
106
108
  ```ts
@@ -111,7 +113,7 @@ const { count, items } = await client.staking.list({ user: 'CUSTOMER_UUID', dire
111
113
 
112
114
  Returns a page of `StakingMovement` ([get](#get)).
113
115
 
114
- ## movements
116
+ ## Movements
115
117
 
116
118
  ```
117
119
  client.staking.movements(params?: StakingListParams): Promise<Page<StakingMovement>>
@@ -125,7 +127,7 @@ const pending = await client.staking.movements({ user: 'CUSTOMER_UUID' })
125
127
 
126
128
  Returns a page of `StakingMovement` ([get](#get)).
127
129
 
128
- ## get
130
+ ## Get
129
131
 
130
132
  ```
131
133
  client.staking.get(movement: string | StakingMovement): Promise<StakingMovement>
@@ -147,8 +149,8 @@ Returns a `StakingMovement`:
147
149
  | Field | Description |
148
150
  |---|---|
149
151
  | `uuid` | The movement |
150
- | `state` | `StakingMovementState.REQUESTED`, `PENDING`, `COMPLETED`, `FAILED` or `CANCELED` |
151
- | `kind` | `StakingMovementKind.STAKE`, `UNSTAKE`, `WITHDRAW` or `REWARD` |
152
+ | `state` | `StakingMovementState.REQUESTED`, `PENDING`, `COMPLETED`, `FAILED` or `CANCELED` — the cycle is below the table |
153
+ | `kind` | `StakingMovementKind.STAKE` from the request, `UNSTAKE` once a full exit is requested — the same movement, rewritten; `WITHDRAW` and `REWARD` are values of the `direction` filter and of the operations journal, carried by no movement |
152
154
  | `provider` | The `name` of the staking connector (`figment_sol`) |
153
155
  | `amount` | The quantity of the movement, as a string |
154
156
  | `createdAt`, `updatedAt` | Epoch seconds |
@@ -157,9 +159,11 @@ Returns a `StakingMovement`:
157
159
  | `asset` | `AssetRef`: `{ uuid, iso, label }` |
158
160
  | `organization` | `OrganizationSummary`: `{ uuid, state, name }`, or `null` |
159
161
 
162
+ A position has a single movement, whose uuid — the one returned by `stake` — never changes. The movement goes `STAKE` `REQUESTED` → `PENDING` (the deposit is on its way; the `amount` of the position becomes the net quantity received) → `COMPLETED` (the position is `ENABLED`); `REQUESTED` → `FAILED` when the transfer fails, `PENDING` → `CANCELED` when the platform cancels the request — the position is `FAILED` in both cases. A full exit (`unstake`) rewrites the same movement `UNSTAKE` `REQUESTED` (the position is `UNSTAKING`), then `COMPLETED` when the platform closes the position (`CLOSED`). A partial exit and a claim leave the movement untouched: the position stays `ENABLED`, its `amount` and `data.rewards` decrease.
163
+
160
164
  An unknown movement, or one outside your organization, answers `404 unknown_staking_movement`.
161
165
 
162
- ## rewards
166
+ ## Rewards
163
167
 
164
168
  ```
165
169
  client.staking.rewards(position: string | StakingPosition, params?: StakingAmountParams): Promise<void>
@@ -178,9 +182,9 @@ await client.staking.rewards(movement.staking) // all the r
178
182
  await client.staking.rewards('POSITION_UUID', { amount: '0.01' }) // part of them, by uuid
179
183
  ```
180
184
 
181
- The amount is deducted from the position immediately; the transfer is executed by compliance. Without rewards to claim the API answers `425 no_rewards`; a partial amount below the minimum of the provider, `422 amount_below_minimum`. The API answers with an empty body: the promise resolves with `undefined`.
185
+ The amount is deducted from the position immediately; the transfer is executed by compliance. No movement is created or changed: `data.rewards` of the position decreases, and the event `staking.claimed` reports the claim. Without rewards to claim the API answers `425 no_rewards`; a partial amount below the minimum of the provider, `422 amount_below_minimum`. The API answers with an empty body: the promise resolves with `undefined`.
182
186
 
183
- ## unstake
187
+ ## Unstake
184
188
 
185
189
  ```
186
190
  client.staking.unstake(position: string | StakingPosition, params?: StakingAmountParams): Promise<void>
@@ -199,9 +203,9 @@ await client.staking.unstake('POSITION_UUID', { amount: '1' }) // partial exit
199
203
  await client.staking.unstake(movement.staking) // full exit — the position, by model
200
204
  ```
201
205
 
202
- The amount is deducted from the position immediately; the transfer is executed by compliance. A full exit ignores the minimums; a partial amount below the minimum of the provider answers `422 amount_below_minimum`. The position must be past the lock-up period of the provider (`425 deposit_locked_period_not_elapsed`) and its staking movement completed (`412 staking_movement_not_completed`). The API answers with an empty body: the promise resolves with `undefined`.
206
+ The amount is deducted from the position immediately; the transfer is executed by compliance. A full exit — no `amount`, or the whole position — rewrites the movement of the position: `kind` `UNSTAKE`, `state` `REQUESTED`, and the position is `UNSTAKING`; follow it with `get` and the uuid returned by `stake`; the event `staking.status` reports `UNSTAKING`, then `CLOSED` once the platform closes the position. A partial exit touches no movement: the position stays `ENABLED` with a reduced `amount`, and `staking.status` reports `WITHDRAWAL`. A full exit ignores the minimums; a partial amount below the minimum of the provider answers `422 amount_below_minimum`. The position must be past the lock-up period of the provider (`425 deposit_locked_period_not_elapsed`) and its staking movement completed (`412 staking_movement_not_completed`). The API answers with an empty body: the promise resolves with `undefined`.
203
207
 
204
- ## operations
208
+ ## Operations
205
209
 
206
210
  ```
207
211
  client.staking.operations(user: UserRef, params?: PageParams): Promise<Page<StakingOperation>>
@@ -219,9 +223,9 @@ for (const operation of items) {
219
223
  }
220
224
  ```
221
225
 
222
- Returns a page of `StakingOperation`: `txId` (journal entry id), `movement` (uuid of the movement, `null` for a daily reward), `asset` (iso), `kind` (`StakingMovementKind.STAKE`, `UNSTAKE`, `WITHDRAW` or `REWARD`), `amount` (asset units, as a string), `price` (EUR price of the asset at that time), `value` (EUR value), `event` (`created`, `pending`, `validated`, `failed`, `reward`, `claimed`, `unstake`, `closed` — other values may appear), `provider` (connector name), `date` (epoch seconds). An unknown customer, or one outside your organization, answers `404 unknown_staking`.
226
+ Returns a page of `StakingOperation`: `txId` (journal entry id), `movement` (uuid of the movement of the position — `reward` and `claim` entries carry it too — or `null`), `asset` (iso), `kind` (`StakingMovementKind.STAKE`, `UNSTAKE`, `WITHDRAW` or `REWARD` — `REWARD` for the `reward` and `claim` entries), `amount` (asset units, as a string), `price` (EUR price of the asset at that time), `value` (EUR value), `event` (`validated`, `failed`, `canceled`, `reward`, `claim` or `closed` — other values may appear), `provider` (connector name), `date` (epoch seconds). An unknown customer, or one outside your organization, answers `404 unknown_staking`.
223
227
 
224
- ## portfolio
228
+ ## Portfolio
225
229
 
226
230
  ```
227
231
  client.staking.portfolio(user: UserRef): Promise<StakingPortfolio>
@@ -15,7 +15,7 @@ Examples use `client`, a configured `BitgenClient` ([Configuration](../configura
15
15
 
16
16
  TypeScript types of this resource, exported by the package: `Order`, `OrderUser`, `OrderOrganization`, `TradingOrderParams`, `TradingListParams` — the constants `OrderState`, `OrderSide`, `TradingDirection` (also types) — plus the shared `UserRef`, `AssetRef`, `AssetInput`, `Amount`, `Page`.
17
17
 
18
- ## buy
18
+ ## Buy
19
19
 
20
20
  ```
21
21
  client.trading.buy(user: UserRef, params: TradingOrderParams): Promise<{ tunnel: string, state: OrderState }>
@@ -42,7 +42,9 @@ console.log(order.state === OrderState.DONE, order.received, order.executedPrice
42
42
 
43
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.
44
44
 
45
- ## sell
45
+ ![A purchase: REGISTERED, EXECUTING, FILLED, DELIVERING, DONE — FAILED and PARKED](../media/order-buy.svg)
46
+
47
+ ## Sell
46
48
 
47
49
  ```
48
50
  client.trading.sell(user: UserRef, params: TradingOrderParams): Promise<{ tunnel: string, state: OrderState }>
@@ -68,7 +70,9 @@ console.log(order.received) // EUR credited to the bank account once the order
68
70
 
69
71
  The sale takes the crypto from the customer's custody wallet through an internal transfer to the exchange: the errors of a custody withdrawal can surface ([Custody wallets › Errors](custody.md#errors)), in particular `416 requested_amount_error` for an insufficient crypto balance and `503 custody_vault_unavailable`.
70
72
 
71
- ## get
73
+ ![A sale: REGISTERED, TRANSFERRING, DEPOSITED, EXECUTING, FILLED, DONE — FAILED and PARKED](../media/order-sell.svg)
74
+
75
+ ## Get
72
76
 
73
77
  ```
74
78
  client.trading.get(order: string | Order): Promise<Order>
@@ -89,7 +93,7 @@ Returns an `Order`:
89
93
  | Field | Description |
90
94
  |---|---|
91
95
  | `uuid` | The order — the `tunnel` of `buy` / `sell` |
92
- | `state` | A purchase goes `OrderState.REGISTERED` → `EXECUTING` → `FILLED` → `DELIVERING` → `DONE`; a sale `REGISTERED` → `TRANSFERRING` → `DEPOSITED` → `EXECUTING` → `FILLED` → `DONE`. `PARKED`: executed but nothing was received (terminal); `FAILED` |
96
+ | `state` | A purchase goes `OrderState.REGISTERED` → `EXECUTING` → `FILLED` → `DELIVERING` → `DONE`; a sale `REGISTERED` → `TRANSFERRING` → `DEPOSITED` → `EXECUTING` → `FILLED` → `DONE`. `FAILED` and `PARKED` are terminal, reached before anything of the target asset was received: `FAILED` from `REGISTERED` or `EXECUTING` for a purchase (the EUR reserve is released), from `REGISTERED`, `TRANSFERRING` or `EXECUTING` for a sale (the crypto goes back to the wallet); `PARKED` from `EXECUTING` only — executed, but nothing of the target asset was received; the BITGEN team takes over |
93
97
  | `side` | `OrderSide.BUY` or `OrderSide.SELL` |
94
98
  | `amount` | What was asked, as a string: EUR for a purchase (`"25.00"`), a crypto quantity for a sale |
95
99
  | `reference` | The idempotency key given, or `null` |
@@ -103,7 +107,7 @@ Returns an `Order`:
103
107
 
104
108
  An order outside your organization answers `404 unknown_order`.
105
109
 
106
- ## list
110
+ ## List
107
111
 
108
112
  ```
109
113
  client.trading.list(params?: TradingListParams): Promise<Page<Order>>
@@ -164,3 +168,4 @@ In addition to the [common errors](../errors.md#common-errors), and the custody
164
168
  - [Custody wallets](custody.md) — the wallets sales take crypto from
165
169
  - [Assets catalogue](asset.md) — which assets are `AVAILABLE`, their decimals
166
170
  - [Webhooks](webhooks.md) — `trading.buy`, `trading.sell`
171
+ - [Following a purchase and a sale](../concepts.md#following-a-purchase-and-a-sale) — where the EUR, the execution, the delivery and the credit show up, resource by resource
@@ -4,6 +4,8 @@ The transaction journal is the unified, read-only record of the fiat and crypto
4
4
 
5
5
  Examples use `client`, a configured `BitgenClient` ([Configuration](../configuration.md)).
6
6
 
7
+ ![The lifecycle of a transaction: the compliance analysis, the nominal path of an incoming and of an outgoing transaction, the hold, the freeze, the refusal and the seizure](../media/transaction-lifecycle.svg)
8
+
7
9
  ## Methods
8
10
 
9
11
  | Method | What it does | Returns |
@@ -13,7 +15,7 @@ Examples use `client`, a configured `BitgenClient` ([Configuration](../configura
13
15
 
14
16
  TypeScript types of this resource, exported by the package: `TransactionAlert`, `Transaction`, `TransactionListParams` — the constants `TransactionState`, `TransactionSource`, `TransactionDirection` (also types) — plus the shared `UserRef`, `UserSummary`, `OrganizationSummary`, `OrganizationHub`, `AssetInput`, `Page`.
15
17
 
16
- ## list
18
+ ## List
17
19
 
18
20
  ```
19
21
  client.transaction.list(params?: TransactionListParams): Promise<Page<Transaction>>
@@ -48,7 +50,7 @@ for (const transaction of items) {
48
50
 
49
51
  Returns a page of `Transaction`.
50
52
 
51
- ## get
53
+ ## Get
52
54
 
53
55
  ```
54
56
  client.transaction.get(transaction: string | Transaction): Promise<Transaction>
@@ -70,14 +72,14 @@ Returns a `Transaction`:
70
72
  | Field | Description |
71
73
  |---|---|
72
74
  | `uuid` | The transaction |
73
- | `state` | `TransactionState.ANALYZING`, `PENDING`, `COMPLETED`, `FROZEN`, `FAILED`, `TRANSFERING` or `SEIZED` |
75
+ | `state` | `TransactionState.ANALYZING`, `PENDING`, `COMPLETED`, `FROZEN`, `FAILED`, `TRANSFERING` or `SEIZED` — the cycle is below the table |
74
76
  | `source` | `TransactionSource.BANK` (EUR) or `TransactionSource.CUSTODY` (crypto) |
75
77
  | `direction` | `TransactionDirection.IN` or `TransactionDirection.OUT` |
76
78
  | `asset` | The asset iso — `EUR` for bank transactions |
77
79
  | `amount` | The amount, in that asset (a number — for crypto, the exact amount is the string held by the custody wallet) |
78
80
  | `eurValue` | EUR value when recorded, or `null` |
79
81
  | `reference` | The reference, or `null` |
80
- | `credited` | Whether the customer's balance (EUR account or wallet) has been credited |
82
+ | `credited` | For an incoming transaction: `true` once the EUR account or the wallet has actually been credited, right after `COMPLETED` |
81
83
  | `silent` | `true` for an internal leg (staking, sale) that is not an operation of the customer |
82
84
  | `data` | Additional context set by the platform (compliance details, internal flags) — varies with the transaction, not needed for an integration |
83
85
  | `createdAt`, `updatedAt` | Epoch seconds |
@@ -88,6 +90,8 @@ Returns a `Transaction`:
88
90
 
89
91
  An unknown uuid or reference, or a transaction outside your organization, answers `404 unknown_transaction`.
90
92
 
93
+ Every transaction is born `ANALYZING`, the compliance analysis — the internal legs too. A clean verdict sends an incoming transaction to `COMPLETED`, then the EUR account or the wallet is credited; an outgoing one to `TRANSFERING` — the wire or the on-chain send executes — then `COMPLETED` at its confirmation. An alert, or a crypto deposit on a frozen wallet, holds it in `PENDING`: an `alert` is attached and the compliance of your organization becomes the `assignee`. The compliance then freezes it (`PENDING` → `FROZEN`), validates it (`PENDING` or `FROZEN` → `COMPLETED` for an incoming transaction, `TRANSFERING` for an outgoing one; the alert is `RESOLVED`), refuses it (`PENDING` or `FROZEN` → `FAILED`) or seizes it (`FROZEN` → `SEIZED`); an execution that fails also ends `FAILED` (`TRANSFERING` → `FAILED`). `COMPLETED`, `FAILED` and `SEIZED` are terminal. A failed incoming transaction was never credited; a failed outgoing one releases its reserve or re-credits the wallet. Two exceptions appear in the list: a crypto deposit that failed on chain is recorded `FAILED` right away, and the return or the seizure of a refused or seized deposit is a separate outgoing transaction, born `TRANSFERING`. The internal legs (`silent`) go through the analysis like the others and send no event.
94
+
91
95
  ## Errors
92
96
 
93
97
  In addition to the [common errors](../errors.md#common-errors):
@@ -4,6 +4,8 @@ BITGEN pushes the events of your organization — a customer created, an identit
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
 
7
+ ![Receiving a delivery: the POST, its verification, the 2xx answer and the retries](../media/webhook-delivery.svg)
8
+
7
9
  ## Methods
8
10
 
9
11
  | Method | What it does | Returns |
@@ -22,7 +24,7 @@ Examples use `client`, a configured `BitgenClient` ([Configuration](../configura
22
24
 
23
25
  TypeScript types of this resource, exported by the package: `WebhookType`, `Subscriber`, `WebhookSubscriptions`, `DeliveryLog`, `WebhookEvent`, `VerifyInput` — the constants `WebhookEventName`, `SubscriberState` (also types) — plus the shared `Created`, `PageParams`.
24
26
 
25
- ## activate
27
+ ## Activate
26
28
 
27
29
  ```
28
30
  client.webhooks.activate(params: { endpoint: string }): Promise<void>
@@ -40,7 +42,7 @@ const { secret } = await client.webhooks.list() // the initial secret is read
40
42
 
41
43
  Activation generates the secret of your organization. `activate` does not return it: the API returns the current secret in `list()` (`secret` field, next to `endpoint` and the subscriptions). Once active, a second activation answers `429 webhook_security_already_enabled`. The API answers with an empty body: the promise resolves with `undefined`.
42
44
 
43
- ## updateEndpoint
45
+ ## UpdateEndpoint
44
46
 
45
47
  ```
46
48
  client.webhooks.updateEndpoint(params: { endpoint: string }): Promise<void>
@@ -56,7 +58,7 @@ await client.webhooks.updateEndpoint({ endpoint: 'https://example.com/bitgen/v2'
56
58
 
57
59
  Before activation, the API answers `404 unknown_webhook_security`. The promise resolves with `undefined`.
58
60
 
59
- ## regenerate
61
+ ## Regenerate
60
62
 
61
63
  ```
62
64
  client.webhooks.regenerate(): Promise<void>
@@ -70,7 +72,7 @@ const { secret } = await client.webhooks.list() // 2. the new secret — confi
70
72
 
71
73
  `regenerate()` creates a new secret but does not return it: the API returns the current secret in `list()` (`secret` field, next to `endpoint` and the subscriptions). The deliveries are signed with the new one from then on, the previous one stops validating immediately. Before activation, the API answers `404 unknown_webhook_security`. The promise resolves with `undefined`.
72
74
 
73
- ## list
75
+ ## List
74
76
 
75
77
  ```
76
78
  client.webhooks.list(params?: { includeArchived?: boolean }): Promise<WebhookSubscriptions>
@@ -100,7 +102,7 @@ Returns a `WebhookSubscriptions`:
100
102
 
101
103
  Before activation, the API answers `404 unknown_webhook_security`.
102
104
 
103
- ## subscribe
105
+ ## Subscribe
104
106
 
105
107
  ```
106
108
  client.webhooks.subscribe(event: string | WebhookType): Promise<Created>
@@ -130,7 +132,7 @@ Returns a `Created` — the uuid of the subscription, for `archive`, `reactivate
130
132
 
131
133
  The `WebhookEventName` constant carries these names — `WebhookEventName.CUSTODY_SENT` for `custody.sent`, `USER_IDENTITY_STEP_VALIDATED` for `user.identity.step.validated`… — and as a type it also accepts any other string, since the catalogue may grow ([Constants](../concepts.md#constants)).
132
134
 
133
- ## archive
135
+ ## Archive
134
136
 
135
137
  ```
136
138
  client.webhooks.archive(subscriber: string | Subscriber): Promise<void>
@@ -144,7 +146,7 @@ await client.webhooks.archive('SUBSCRIBER_UUID')
144
146
 
145
147
  The subscription becomes `SubscriberState.ARCHIVED`: the event is no longer delivered. An unknown subscription answers `404 unknown_webhook_subscriber`. The promise resolves with `undefined`.
146
148
 
147
- ## reactivate
149
+ ## Reactivate
148
150
 
149
151
  ```
150
152
  client.webhooks.reactivate(subscriber: string | Subscriber): Promise<void>
@@ -158,7 +160,7 @@ await client.webhooks.reactivate('SUBSCRIBER_UUID')
158
160
 
159
161
  The subscription becomes `SubscriberState.ENABLED` again. An unknown subscription answers `404 unknown_webhook_subscriber`. The promise resolves with `undefined`.
160
162
 
161
- ## logs
163
+ ## Logs
162
164
 
163
165
  ```
164
166
  client.webhooks.logs(subscriber: string | Subscriber, params?: PageParams): Promise<Page<DeliveryLog>>
@@ -180,7 +182,7 @@ for (const delivery of items) {
180
182
 
181
183
  Returns a page of `DeliveryLog`: `date` (epoch seconds), `webhook` (the event name), `url` (the endpoint called), `status` (`SENT` or `FAILED` for that attempt), `http_code` (the status your endpoint answered, or `null`), `duration_ms` (or `null`), `attempts` (attempt number), `payload` (the delivered body), `error` (failure reason, `null` on success).
182
184
 
183
- ## catalog
185
+ ## Catalog
184
186
 
185
187
  ```
186
188
  client.webhooks.catalog(): Promise<Page<WebhookType>>
@@ -198,7 +200,7 @@ for (const type of items) {
198
200
 
199
201
  Returns every event of the catalogue, `SubscriberState.ARCHIVED` ones included, as `WebhookType`: `uuid`, `state` (`SubscriberState.ENABLED` or `SubscriberState.ARCHIVED`), `name`, `label` (its display names, a raw JSON string `{"fr": "…", "en": "…"}`), `data` (internal, a raw JSON string).
200
202
 
201
- ## catalogItem
203
+ ## CatalogItem
202
204
 
203
205
  ```
204
206
  client.webhooks.catalogItem(webhook: string | WebhookType): Promise<WebhookType>
@@ -212,7 +214,7 @@ const type = await client.webhooks.catalogItem('WEBHOOK_UUID')
212
214
 
213
215
  Returns one `WebhookType`; an unknown uuid answers `404 unknown_webhook`.
214
216
 
215
- ## verify
217
+ ## Verify
216
218
 
217
219
  ```
218
220
  client.webhooks.verify(input: VerifyInput): Promise<WebhookEvent>
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.3"
2
+ export const VERSION = "1.0.4"