@dakota-xyz/ts-sdk 3.0.0 → 3.2.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/README.md +140 -32
- package/dist/index.d.mts +4510 -1042
- package/dist/index.d.ts +4510 -1042
- package/dist/index.js +196 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +196 -26
- package/dist/index.mjs.map +1 -1
- package/dist/webhook/index.d.mts +176 -1
- package/dist/webhook/index.d.ts +176 -1
- package/dist/webhook/index.js +7 -0
- package/dist/webhook/index.js.map +1 -1
- package/dist/webhook/index.mjs +7 -0
- package/dist/webhook/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/webhook/index.d.mts
CHANGED
|
@@ -26,10 +26,40 @@ declare enum WebhookEventType {
|
|
|
26
26
|
* payload is {@link CustomerCapabilityStatusUpdatedData}.
|
|
27
27
|
*/
|
|
28
28
|
CustomerCapabilityStatusUpdated = "customer.capability_status.updated",
|
|
29
|
+
/**
|
|
30
|
+
* Emitted when a reviewer opens a request for information (RFI) against a
|
|
31
|
+
* customer's application. The payload is {@link CustomerRfiRequestedData}:
|
|
32
|
+
* what is still owed, but deliberately NOT the resubmission link.
|
|
33
|
+
*/
|
|
34
|
+
CustomerRfiRequested = "customer.rfi.requested",
|
|
35
|
+
/**
|
|
36
|
+
* Emitted when the requested information arrives and the application
|
|
37
|
+
* returns to review. The payload is {@link CustomerRfiRespondedData}.
|
|
38
|
+
*/
|
|
39
|
+
CustomerRfiResponded = "customer.rfi.responded",
|
|
40
|
+
/**
|
|
41
|
+
* Emitted when an onboarding application is withdrawn — by the applicant,
|
|
42
|
+
* or by the client on their behalf. Withdrawal is terminal. The payload is
|
|
43
|
+
* {@link CustomerApplicationWithdrawnData}.
|
|
44
|
+
*/
|
|
45
|
+
CustomerApplicationWithdrawn = "customer.application.withdrawn",
|
|
29
46
|
/** Payload is {@link FeePayoutDestinationUpdatedData}. */
|
|
30
47
|
FeePayoutDestinationUpdated = "fee_payout_destination.updated",
|
|
31
48
|
/** Payload is an empty object. */
|
|
32
49
|
FeePayoutDestinationDeleted = "fee_payout_destination.deleted",
|
|
50
|
+
/**
|
|
51
|
+
* Emitted when a client sets or replaces the wallet their RD marketing fee
|
|
52
|
+
* is sent to. The payload is {@link RdPayoutDestinationUpdatedData}.
|
|
53
|
+
*/
|
|
54
|
+
RdPayoutDestinationUpdated = "rd_payout_destination.updated",
|
|
55
|
+
/**
|
|
56
|
+
* Emitted when a client sets or replaces the wallet ONE non-RD deployment's
|
|
57
|
+
* payouts are sent to. The payload is
|
|
58
|
+
* {@link DeploymentPayoutDestinationUpdatedData}, which names the
|
|
59
|
+
* deployment — RD keeps its own event, so a subscriber to that one is never
|
|
60
|
+
* handed another deployment's wallet as RD's.
|
|
61
|
+
*/
|
|
62
|
+
DeploymentPayoutDestinationUpdated = "deployment_payout_destination.updated",
|
|
33
63
|
AutoAccountCreated = "auto_account.created",
|
|
34
64
|
AutoAccountUpdated = "auto_account.updated",
|
|
35
65
|
AutoAccountDeleted = "auto_account.deleted",
|
|
@@ -51,7 +81,17 @@ declare enum WebhookEventType {
|
|
|
51
81
|
TargetDeleted = "target.deleted",
|
|
52
82
|
ExceptionCreated = "exception.created",
|
|
53
83
|
ExceptionCleared = "exception.cleared",
|
|
84
|
+
/**
|
|
85
|
+
* @deprecated The platform no longer defines or emits this event, and it is
|
|
86
|
+
* gone from the public `EventType` enum. Kept only so existing handler
|
|
87
|
+
* registrations keep compiling; it will be removed in the next major.
|
|
88
|
+
*/
|
|
54
89
|
BvnkOnboardingCreated = "bvnk.onboarding.created",
|
|
90
|
+
/**
|
|
91
|
+
* @deprecated The platform no longer defines or emits this event, and it is
|
|
92
|
+
* gone from the public `EventType` enum. Kept only so existing handler
|
|
93
|
+
* registrations keep compiling; it will be removed in the next major.
|
|
94
|
+
*/
|
|
55
95
|
BvnkOnboardingUpdated = "bvnk.onboarding.updated",
|
|
56
96
|
WalletCreated = "wallet.created",
|
|
57
97
|
WalletUpdated = "wallet.updated",
|
|
@@ -68,6 +108,26 @@ declare enum WebhookEventType {
|
|
|
68
108
|
* {@link ScheduledPaymentFailedData}.
|
|
69
109
|
*/
|
|
70
110
|
ScheduledPaymentFailed = "scheduled_payment.failed",
|
|
111
|
+
/**
|
|
112
|
+
* Emitted each time a deposit enters held: Dakota kept funds it could not
|
|
113
|
+
* process (for example below the account's minimum deposit, or over its
|
|
114
|
+
* `max_transactions` cap) and created no transaction, so no `transaction.*`
|
|
115
|
+
* event reports it. The same `deposit_id` can get it more than once (a
|
|
116
|
+
* failed return, an undone manual resolution), so upsert on `deposit_id`.
|
|
117
|
+
* The payload carries the deposit, its `reason`, `fee_to_cover`,
|
|
118
|
+
* `minimum_deposit` and `held_at`.
|
|
119
|
+
*/
|
|
120
|
+
DepositHeld = "deposit.held",
|
|
121
|
+
/**
|
|
122
|
+
* Emitted each time a held deposit's funds are back with the sender,
|
|
123
|
+
* normally once. Every deposit that gets it also gets a
|
|
124
|
+
* {@link WebhookEventType.DepositHeld} queued no later than it, which can
|
|
125
|
+
* still arrive after it: delivery order is not guaranteed, so order a
|
|
126
|
+
* deposit's events by `held_at` and `returned_at`. The payload carries the deposit,
|
|
127
|
+
* `return_transaction_hash`, `return_fee`, `return_automatic` and
|
|
128
|
+
* `returned_at`.
|
|
129
|
+
*/
|
|
130
|
+
DepositReturned = "deposit.returned",
|
|
71
131
|
/** @deprecated Use TransactionAutoCreated or TransactionOneOffCreated */
|
|
72
132
|
TransactionCreated = "transaction.created",
|
|
73
133
|
/** @deprecated Use TransactionAutoUpdated or TransactionOneOffUpdated */
|
|
@@ -185,6 +245,102 @@ interface CustomerCapabilityStatusUpdatedData {
|
|
|
185
245
|
status: string;
|
|
186
246
|
requirements: CapabilityRequirement[];
|
|
187
247
|
}
|
|
248
|
+
/**
|
|
249
|
+
* Who a document in an RFI belongs to. `id` is set only for an individual;
|
|
250
|
+
* the business and EDD entities are unique per application, so the kind
|
|
251
|
+
* alone locates them.
|
|
252
|
+
*/
|
|
253
|
+
interface RfiRequirementEntity {
|
|
254
|
+
/** 'business' | 'individual' | 'edd' */
|
|
255
|
+
kind: string;
|
|
256
|
+
/** The associated individual's id. Present only when `kind` is 'individual'. */
|
|
257
|
+
id?: string;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* One thing a customer must supply to resolve a request for information.
|
|
261
|
+
*
|
|
262
|
+
* Switch on `type`:
|
|
263
|
+
* - `'document'` — exactly one of `document_type` (a specific kind of
|
|
264
|
+
* document) or `purpose` (a compliance requirement several document types
|
|
265
|
+
* could satisfy) is set. `status` says whether something is already on file
|
|
266
|
+
* (`'on_file'` means replace it; `'missing'` means send it for the first
|
|
267
|
+
* time).
|
|
268
|
+
* - `'field'` — `path` names the application field to correct.
|
|
269
|
+
* - `'question'` — `key` and `prompt` carry a reviewer's free-text question.
|
|
270
|
+
* When `require_document` is true the answer MUST come with an upload; a
|
|
271
|
+
* text-only answer leaves the RFI unresolved.
|
|
272
|
+
*/
|
|
273
|
+
interface RfiRequirement {
|
|
274
|
+
/** 'document' | 'field' | 'question' */
|
|
275
|
+
type: string;
|
|
276
|
+
/** Document requirement: a specific document type (mutually exclusive with `purpose`). */
|
|
277
|
+
document_type?: string;
|
|
278
|
+
/** Document requirement: a compliance purpose (mutually exclusive with `document_type`). */
|
|
279
|
+
purpose?: string;
|
|
280
|
+
/** Document requirement: whose document it is. Omitted when the party is not known. */
|
|
281
|
+
entity?: RfiRequirementEntity;
|
|
282
|
+
/** Document requirement: 'missing' | 'on_file'. */
|
|
283
|
+
status?: string;
|
|
284
|
+
/** Field requirement: the application field path, e.g. 'business.business_description'. */
|
|
285
|
+
path?: string;
|
|
286
|
+
/** Question requirement: the question's stable key. */
|
|
287
|
+
key?: string;
|
|
288
|
+
/** Question requirement: the reviewer's prompt. */
|
|
289
|
+
prompt?: string;
|
|
290
|
+
/** Question requirement: the answer must be accompanied by an upload. */
|
|
291
|
+
require_document?: boolean;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Event payload for {@link WebhookEventType.CustomerRfiRequested}
|
|
295
|
+
* ('customer.rfi.requested').
|
|
296
|
+
*
|
|
297
|
+
* The client that onboarded the customer owns the relationship, so this event
|
|
298
|
+
* is how it learns the customer is blocked and what is still owed.
|
|
299
|
+
*
|
|
300
|
+
* The resubmission link is intentionally ABSENT: it embeds an access token,
|
|
301
|
+
* and a webhook body comes to rest in logs, traces and retry buffers where a
|
|
302
|
+
* credential must not. Read the link from the customer resource over your own
|
|
303
|
+
* authenticated channel.
|
|
304
|
+
*
|
|
305
|
+
* `message_id` is the correlation handle: dedupe redeliveries on it, pair a
|
|
306
|
+
* later `customer.rfi.responded` with the request it answers, and tell a
|
|
307
|
+
* re-notification from a genuinely new request. Omitted when the platform
|
|
308
|
+
* did not record one.
|
|
309
|
+
*/
|
|
310
|
+
interface CustomerRfiRequestedData {
|
|
311
|
+
customer_id: string;
|
|
312
|
+
application_id: string;
|
|
313
|
+
/** The RFI thread message this request was sent as. */
|
|
314
|
+
message_id?: string;
|
|
315
|
+
/** Unix seconds. */
|
|
316
|
+
requested_at: number;
|
|
317
|
+
requirements: RfiRequirement[];
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Event payload for {@link WebhookEventType.CustomerRfiResponded}
|
|
321
|
+
* ('customer.rfi.responded'): the requested information arrived and the
|
|
322
|
+
* application is back in review. Use it to stop chasing your customer.
|
|
323
|
+
*
|
|
324
|
+
* There is no `rfi.resolved` event: an RFI ends in a decision, which
|
|
325
|
+
* `customer.kyb_status.updated` already reports.
|
|
326
|
+
*/
|
|
327
|
+
interface CustomerRfiRespondedData {
|
|
328
|
+
customer_id: string;
|
|
329
|
+
application_id: string;
|
|
330
|
+
/** Unix seconds. */
|
|
331
|
+
responded_at: number;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Event payload for {@link WebhookEventType.CustomerApplicationWithdrawn}
|
|
335
|
+
* ('customer.application.withdrawn'). Withdrawal is terminal: onboarding the
|
|
336
|
+
* customer again requires a new application.
|
|
337
|
+
*/
|
|
338
|
+
interface CustomerApplicationWithdrawnData {
|
|
339
|
+
customer_id: string;
|
|
340
|
+
application_id: string;
|
|
341
|
+
/** Why it was withdrawn. Omitted when no reason was recorded. */
|
|
342
|
+
reason?: string;
|
|
343
|
+
}
|
|
188
344
|
/**
|
|
189
345
|
* Fee Payout Destination Updated event data.
|
|
190
346
|
*/
|
|
@@ -192,6 +348,25 @@ interface FeePayoutDestinationUpdatedData {
|
|
|
192
348
|
/** The destination kind — 'usdc_wallet' (developer-fee payouts are crypto-only) */
|
|
193
349
|
type: string;
|
|
194
350
|
}
|
|
351
|
+
/**
|
|
352
|
+
* Event payload for {@link WebhookEventType.RdPayoutDestinationUpdated}
|
|
353
|
+
* ('rd_payout_destination.updated').
|
|
354
|
+
*
|
|
355
|
+
* A destination has no history of its own — a PUT replaces the row — so this
|
|
356
|
+
* event is the only record that it changed, which is why it carries the
|
|
357
|
+
* address, what it replaced, and who did it.
|
|
358
|
+
*/
|
|
359
|
+
interface RdPayoutDestinationUpdatedData {
|
|
360
|
+
/** The EVM address on Base the fee is now sent to. */
|
|
361
|
+
wallet_address: string;
|
|
362
|
+
/** The address it replaced. Empty string on a first registration. */
|
|
363
|
+
previous_address: string;
|
|
364
|
+
/**
|
|
365
|
+
* The EMAIL of the dashboard user who made the change — personal data, so
|
|
366
|
+
* treat a logged payload accordingly. Empty string when not attributable.
|
|
367
|
+
*/
|
|
368
|
+
updated_by: string;
|
|
369
|
+
}
|
|
195
370
|
/**
|
|
196
371
|
* Event payload for {@link WebhookEventType.ScheduledPaymentFailed}
|
|
197
372
|
* ('scheduled_payment.failed'), emitted when a scheduled payment flips to the
|
|
@@ -546,4 +721,4 @@ declare function verifySignature(payload: Uint8Array | string, signatureB64: str
|
|
|
546
721
|
*/
|
|
547
722
|
declare function verifySignatureSync(payload: Uint8Array | string, signatureB64: string, timestampStr: string, publicKeyHex: string, toleranceSeconds?: number): void;
|
|
548
723
|
|
|
549
|
-
export { type CapabilityRequirement, type CustomerCapabilityStatusUpdatedData, type CustomerDeletedData, DEFAULT_TIMESTAMP_TOLERANCE, type FeePayoutDestinationUpdatedData, type IdempotencyStore, type KybApplicationSubmittedData, type KybLinkData, MemoryIdempotencyStore, SIGNATURE_HEADER, type ScheduledPaymentFailedData, SignatureVerificationError, TIMESTAMP_HEADER, type WebhookEvent, type WebhookEventData, type WebhookEventHandler, type WebhookEventRequest, WebhookEventType, WebhookHandler, type WebhookHandlerConfig, type WebhookHeaders, matchesEventType, parseEvent, parsePublicKey, parseSignature, validateTimestamp, verifySignature, verifySignatureSync };
|
|
724
|
+
export { type CapabilityRequirement, type CustomerApplicationWithdrawnData, type CustomerCapabilityStatusUpdatedData, type CustomerDeletedData, type CustomerRfiRequestedData, type CustomerRfiRespondedData, DEFAULT_TIMESTAMP_TOLERANCE, type FeePayoutDestinationUpdatedData, type IdempotencyStore, type KybApplicationSubmittedData, type KybLinkData, MemoryIdempotencyStore, type RdPayoutDestinationUpdatedData, type RfiRequirement, type RfiRequirementEntity, SIGNATURE_HEADER, type ScheduledPaymentFailedData, SignatureVerificationError, TIMESTAMP_HEADER, type WebhookEvent, type WebhookEventData, type WebhookEventHandler, type WebhookEventRequest, WebhookEventType, WebhookHandler, type WebhookHandlerConfig, type WebhookHeaders, matchesEventType, parseEvent, parsePublicKey, parseSignature, validateTimestamp, verifySignature, verifySignatureSync };
|
package/dist/webhook/index.d.ts
CHANGED
|
@@ -26,10 +26,40 @@ declare enum WebhookEventType {
|
|
|
26
26
|
* payload is {@link CustomerCapabilityStatusUpdatedData}.
|
|
27
27
|
*/
|
|
28
28
|
CustomerCapabilityStatusUpdated = "customer.capability_status.updated",
|
|
29
|
+
/**
|
|
30
|
+
* Emitted when a reviewer opens a request for information (RFI) against a
|
|
31
|
+
* customer's application. The payload is {@link CustomerRfiRequestedData}:
|
|
32
|
+
* what is still owed, but deliberately NOT the resubmission link.
|
|
33
|
+
*/
|
|
34
|
+
CustomerRfiRequested = "customer.rfi.requested",
|
|
35
|
+
/**
|
|
36
|
+
* Emitted when the requested information arrives and the application
|
|
37
|
+
* returns to review. The payload is {@link CustomerRfiRespondedData}.
|
|
38
|
+
*/
|
|
39
|
+
CustomerRfiResponded = "customer.rfi.responded",
|
|
40
|
+
/**
|
|
41
|
+
* Emitted when an onboarding application is withdrawn — by the applicant,
|
|
42
|
+
* or by the client on their behalf. Withdrawal is terminal. The payload is
|
|
43
|
+
* {@link CustomerApplicationWithdrawnData}.
|
|
44
|
+
*/
|
|
45
|
+
CustomerApplicationWithdrawn = "customer.application.withdrawn",
|
|
29
46
|
/** Payload is {@link FeePayoutDestinationUpdatedData}. */
|
|
30
47
|
FeePayoutDestinationUpdated = "fee_payout_destination.updated",
|
|
31
48
|
/** Payload is an empty object. */
|
|
32
49
|
FeePayoutDestinationDeleted = "fee_payout_destination.deleted",
|
|
50
|
+
/**
|
|
51
|
+
* Emitted when a client sets or replaces the wallet their RD marketing fee
|
|
52
|
+
* is sent to. The payload is {@link RdPayoutDestinationUpdatedData}.
|
|
53
|
+
*/
|
|
54
|
+
RdPayoutDestinationUpdated = "rd_payout_destination.updated",
|
|
55
|
+
/**
|
|
56
|
+
* Emitted when a client sets or replaces the wallet ONE non-RD deployment's
|
|
57
|
+
* payouts are sent to. The payload is
|
|
58
|
+
* {@link DeploymentPayoutDestinationUpdatedData}, which names the
|
|
59
|
+
* deployment — RD keeps its own event, so a subscriber to that one is never
|
|
60
|
+
* handed another deployment's wallet as RD's.
|
|
61
|
+
*/
|
|
62
|
+
DeploymentPayoutDestinationUpdated = "deployment_payout_destination.updated",
|
|
33
63
|
AutoAccountCreated = "auto_account.created",
|
|
34
64
|
AutoAccountUpdated = "auto_account.updated",
|
|
35
65
|
AutoAccountDeleted = "auto_account.deleted",
|
|
@@ -51,7 +81,17 @@ declare enum WebhookEventType {
|
|
|
51
81
|
TargetDeleted = "target.deleted",
|
|
52
82
|
ExceptionCreated = "exception.created",
|
|
53
83
|
ExceptionCleared = "exception.cleared",
|
|
84
|
+
/**
|
|
85
|
+
* @deprecated The platform no longer defines or emits this event, and it is
|
|
86
|
+
* gone from the public `EventType` enum. Kept only so existing handler
|
|
87
|
+
* registrations keep compiling; it will be removed in the next major.
|
|
88
|
+
*/
|
|
54
89
|
BvnkOnboardingCreated = "bvnk.onboarding.created",
|
|
90
|
+
/**
|
|
91
|
+
* @deprecated The platform no longer defines or emits this event, and it is
|
|
92
|
+
* gone from the public `EventType` enum. Kept only so existing handler
|
|
93
|
+
* registrations keep compiling; it will be removed in the next major.
|
|
94
|
+
*/
|
|
55
95
|
BvnkOnboardingUpdated = "bvnk.onboarding.updated",
|
|
56
96
|
WalletCreated = "wallet.created",
|
|
57
97
|
WalletUpdated = "wallet.updated",
|
|
@@ -68,6 +108,26 @@ declare enum WebhookEventType {
|
|
|
68
108
|
* {@link ScheduledPaymentFailedData}.
|
|
69
109
|
*/
|
|
70
110
|
ScheduledPaymentFailed = "scheduled_payment.failed",
|
|
111
|
+
/**
|
|
112
|
+
* Emitted each time a deposit enters held: Dakota kept funds it could not
|
|
113
|
+
* process (for example below the account's minimum deposit, or over its
|
|
114
|
+
* `max_transactions` cap) and created no transaction, so no `transaction.*`
|
|
115
|
+
* event reports it. The same `deposit_id` can get it more than once (a
|
|
116
|
+
* failed return, an undone manual resolution), so upsert on `deposit_id`.
|
|
117
|
+
* The payload carries the deposit, its `reason`, `fee_to_cover`,
|
|
118
|
+
* `minimum_deposit` and `held_at`.
|
|
119
|
+
*/
|
|
120
|
+
DepositHeld = "deposit.held",
|
|
121
|
+
/**
|
|
122
|
+
* Emitted each time a held deposit's funds are back with the sender,
|
|
123
|
+
* normally once. Every deposit that gets it also gets a
|
|
124
|
+
* {@link WebhookEventType.DepositHeld} queued no later than it, which can
|
|
125
|
+
* still arrive after it: delivery order is not guaranteed, so order a
|
|
126
|
+
* deposit's events by `held_at` and `returned_at`. The payload carries the deposit,
|
|
127
|
+
* `return_transaction_hash`, `return_fee`, `return_automatic` and
|
|
128
|
+
* `returned_at`.
|
|
129
|
+
*/
|
|
130
|
+
DepositReturned = "deposit.returned",
|
|
71
131
|
/** @deprecated Use TransactionAutoCreated or TransactionOneOffCreated */
|
|
72
132
|
TransactionCreated = "transaction.created",
|
|
73
133
|
/** @deprecated Use TransactionAutoUpdated or TransactionOneOffUpdated */
|
|
@@ -185,6 +245,102 @@ interface CustomerCapabilityStatusUpdatedData {
|
|
|
185
245
|
status: string;
|
|
186
246
|
requirements: CapabilityRequirement[];
|
|
187
247
|
}
|
|
248
|
+
/**
|
|
249
|
+
* Who a document in an RFI belongs to. `id` is set only for an individual;
|
|
250
|
+
* the business and EDD entities are unique per application, so the kind
|
|
251
|
+
* alone locates them.
|
|
252
|
+
*/
|
|
253
|
+
interface RfiRequirementEntity {
|
|
254
|
+
/** 'business' | 'individual' | 'edd' */
|
|
255
|
+
kind: string;
|
|
256
|
+
/** The associated individual's id. Present only when `kind` is 'individual'. */
|
|
257
|
+
id?: string;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* One thing a customer must supply to resolve a request for information.
|
|
261
|
+
*
|
|
262
|
+
* Switch on `type`:
|
|
263
|
+
* - `'document'` — exactly one of `document_type` (a specific kind of
|
|
264
|
+
* document) or `purpose` (a compliance requirement several document types
|
|
265
|
+
* could satisfy) is set. `status` says whether something is already on file
|
|
266
|
+
* (`'on_file'` means replace it; `'missing'` means send it for the first
|
|
267
|
+
* time).
|
|
268
|
+
* - `'field'` — `path` names the application field to correct.
|
|
269
|
+
* - `'question'` — `key` and `prompt` carry a reviewer's free-text question.
|
|
270
|
+
* When `require_document` is true the answer MUST come with an upload; a
|
|
271
|
+
* text-only answer leaves the RFI unresolved.
|
|
272
|
+
*/
|
|
273
|
+
interface RfiRequirement {
|
|
274
|
+
/** 'document' | 'field' | 'question' */
|
|
275
|
+
type: string;
|
|
276
|
+
/** Document requirement: a specific document type (mutually exclusive with `purpose`). */
|
|
277
|
+
document_type?: string;
|
|
278
|
+
/** Document requirement: a compliance purpose (mutually exclusive with `document_type`). */
|
|
279
|
+
purpose?: string;
|
|
280
|
+
/** Document requirement: whose document it is. Omitted when the party is not known. */
|
|
281
|
+
entity?: RfiRequirementEntity;
|
|
282
|
+
/** Document requirement: 'missing' | 'on_file'. */
|
|
283
|
+
status?: string;
|
|
284
|
+
/** Field requirement: the application field path, e.g. 'business.business_description'. */
|
|
285
|
+
path?: string;
|
|
286
|
+
/** Question requirement: the question's stable key. */
|
|
287
|
+
key?: string;
|
|
288
|
+
/** Question requirement: the reviewer's prompt. */
|
|
289
|
+
prompt?: string;
|
|
290
|
+
/** Question requirement: the answer must be accompanied by an upload. */
|
|
291
|
+
require_document?: boolean;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Event payload for {@link WebhookEventType.CustomerRfiRequested}
|
|
295
|
+
* ('customer.rfi.requested').
|
|
296
|
+
*
|
|
297
|
+
* The client that onboarded the customer owns the relationship, so this event
|
|
298
|
+
* is how it learns the customer is blocked and what is still owed.
|
|
299
|
+
*
|
|
300
|
+
* The resubmission link is intentionally ABSENT: it embeds an access token,
|
|
301
|
+
* and a webhook body comes to rest in logs, traces and retry buffers where a
|
|
302
|
+
* credential must not. Read the link from the customer resource over your own
|
|
303
|
+
* authenticated channel.
|
|
304
|
+
*
|
|
305
|
+
* `message_id` is the correlation handle: dedupe redeliveries on it, pair a
|
|
306
|
+
* later `customer.rfi.responded` with the request it answers, and tell a
|
|
307
|
+
* re-notification from a genuinely new request. Omitted when the platform
|
|
308
|
+
* did not record one.
|
|
309
|
+
*/
|
|
310
|
+
interface CustomerRfiRequestedData {
|
|
311
|
+
customer_id: string;
|
|
312
|
+
application_id: string;
|
|
313
|
+
/** The RFI thread message this request was sent as. */
|
|
314
|
+
message_id?: string;
|
|
315
|
+
/** Unix seconds. */
|
|
316
|
+
requested_at: number;
|
|
317
|
+
requirements: RfiRequirement[];
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Event payload for {@link WebhookEventType.CustomerRfiResponded}
|
|
321
|
+
* ('customer.rfi.responded'): the requested information arrived and the
|
|
322
|
+
* application is back in review. Use it to stop chasing your customer.
|
|
323
|
+
*
|
|
324
|
+
* There is no `rfi.resolved` event: an RFI ends in a decision, which
|
|
325
|
+
* `customer.kyb_status.updated` already reports.
|
|
326
|
+
*/
|
|
327
|
+
interface CustomerRfiRespondedData {
|
|
328
|
+
customer_id: string;
|
|
329
|
+
application_id: string;
|
|
330
|
+
/** Unix seconds. */
|
|
331
|
+
responded_at: number;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Event payload for {@link WebhookEventType.CustomerApplicationWithdrawn}
|
|
335
|
+
* ('customer.application.withdrawn'). Withdrawal is terminal: onboarding the
|
|
336
|
+
* customer again requires a new application.
|
|
337
|
+
*/
|
|
338
|
+
interface CustomerApplicationWithdrawnData {
|
|
339
|
+
customer_id: string;
|
|
340
|
+
application_id: string;
|
|
341
|
+
/** Why it was withdrawn. Omitted when no reason was recorded. */
|
|
342
|
+
reason?: string;
|
|
343
|
+
}
|
|
188
344
|
/**
|
|
189
345
|
* Fee Payout Destination Updated event data.
|
|
190
346
|
*/
|
|
@@ -192,6 +348,25 @@ interface FeePayoutDestinationUpdatedData {
|
|
|
192
348
|
/** The destination kind — 'usdc_wallet' (developer-fee payouts are crypto-only) */
|
|
193
349
|
type: string;
|
|
194
350
|
}
|
|
351
|
+
/**
|
|
352
|
+
* Event payload for {@link WebhookEventType.RdPayoutDestinationUpdated}
|
|
353
|
+
* ('rd_payout_destination.updated').
|
|
354
|
+
*
|
|
355
|
+
* A destination has no history of its own — a PUT replaces the row — so this
|
|
356
|
+
* event is the only record that it changed, which is why it carries the
|
|
357
|
+
* address, what it replaced, and who did it.
|
|
358
|
+
*/
|
|
359
|
+
interface RdPayoutDestinationUpdatedData {
|
|
360
|
+
/** The EVM address on Base the fee is now sent to. */
|
|
361
|
+
wallet_address: string;
|
|
362
|
+
/** The address it replaced. Empty string on a first registration. */
|
|
363
|
+
previous_address: string;
|
|
364
|
+
/**
|
|
365
|
+
* The EMAIL of the dashboard user who made the change — personal data, so
|
|
366
|
+
* treat a logged payload accordingly. Empty string when not attributable.
|
|
367
|
+
*/
|
|
368
|
+
updated_by: string;
|
|
369
|
+
}
|
|
195
370
|
/**
|
|
196
371
|
* Event payload for {@link WebhookEventType.ScheduledPaymentFailed}
|
|
197
372
|
* ('scheduled_payment.failed'), emitted when a scheduled payment flips to the
|
|
@@ -546,4 +721,4 @@ declare function verifySignature(payload: Uint8Array | string, signatureB64: str
|
|
|
546
721
|
*/
|
|
547
722
|
declare function verifySignatureSync(payload: Uint8Array | string, signatureB64: string, timestampStr: string, publicKeyHex: string, toleranceSeconds?: number): void;
|
|
548
723
|
|
|
549
|
-
export { type CapabilityRequirement, type CustomerCapabilityStatusUpdatedData, type CustomerDeletedData, DEFAULT_TIMESTAMP_TOLERANCE, type FeePayoutDestinationUpdatedData, type IdempotencyStore, type KybApplicationSubmittedData, type KybLinkData, MemoryIdempotencyStore, SIGNATURE_HEADER, type ScheduledPaymentFailedData, SignatureVerificationError, TIMESTAMP_HEADER, type WebhookEvent, type WebhookEventData, type WebhookEventHandler, type WebhookEventRequest, WebhookEventType, WebhookHandler, type WebhookHandlerConfig, type WebhookHeaders, matchesEventType, parseEvent, parsePublicKey, parseSignature, validateTimestamp, verifySignature, verifySignatureSync };
|
|
724
|
+
export { type CapabilityRequirement, type CustomerApplicationWithdrawnData, type CustomerCapabilityStatusUpdatedData, type CustomerDeletedData, type CustomerRfiRequestedData, type CustomerRfiRespondedData, DEFAULT_TIMESTAMP_TOLERANCE, type FeePayoutDestinationUpdatedData, type IdempotencyStore, type KybApplicationSubmittedData, type KybLinkData, MemoryIdempotencyStore, type RdPayoutDestinationUpdatedData, type RfiRequirement, type RfiRequirementEntity, SIGNATURE_HEADER, type ScheduledPaymentFailedData, SignatureVerificationError, TIMESTAMP_HEADER, type WebhookEvent, type WebhookEventData, type WebhookEventHandler, type WebhookEventRequest, WebhookEventType, WebhookHandler, type WebhookHandlerConfig, type WebhookHeaders, matchesEventType, parseEvent, parsePublicKey, parseSignature, validateTimestamp, verifySignature, verifySignatureSync };
|
package/dist/webhook/index.js
CHANGED
|
@@ -558,8 +558,13 @@ var WebhookEventType = /* @__PURE__ */ ((WebhookEventType2) => {
|
|
|
558
558
|
WebhookEventType2["CustomerKybStatusUpdated"] = "customer.kyb_status.updated";
|
|
559
559
|
WebhookEventType2["CustomerKybApplicationSubmitted"] = "customer.kyb_application.submitted";
|
|
560
560
|
WebhookEventType2["CustomerCapabilityStatusUpdated"] = "customer.capability_status.updated";
|
|
561
|
+
WebhookEventType2["CustomerRfiRequested"] = "customer.rfi.requested";
|
|
562
|
+
WebhookEventType2["CustomerRfiResponded"] = "customer.rfi.responded";
|
|
563
|
+
WebhookEventType2["CustomerApplicationWithdrawn"] = "customer.application.withdrawn";
|
|
561
564
|
WebhookEventType2["FeePayoutDestinationUpdated"] = "fee_payout_destination.updated";
|
|
562
565
|
WebhookEventType2["FeePayoutDestinationDeleted"] = "fee_payout_destination.deleted";
|
|
566
|
+
WebhookEventType2["RdPayoutDestinationUpdated"] = "rd_payout_destination.updated";
|
|
567
|
+
WebhookEventType2["DeploymentPayoutDestinationUpdated"] = "deployment_payout_destination.updated";
|
|
563
568
|
WebhookEventType2["AutoAccountCreated"] = "auto_account.created";
|
|
564
569
|
WebhookEventType2["AutoAccountUpdated"] = "auto_account.updated";
|
|
565
570
|
WebhookEventType2["AutoAccountDeleted"] = "auto_account.deleted";
|
|
@@ -589,6 +594,8 @@ var WebhookEventType = /* @__PURE__ */ ((WebhookEventType2) => {
|
|
|
589
594
|
WebhookEventType2["WalletTransactionUpdated"] = "wallet.transaction.updated";
|
|
590
595
|
WebhookEventType2["WalletDeposit"] = "wallet.deposit";
|
|
591
596
|
WebhookEventType2["ScheduledPaymentFailed"] = "scheduled_payment.failed";
|
|
597
|
+
WebhookEventType2["DepositHeld"] = "deposit.held";
|
|
598
|
+
WebhookEventType2["DepositReturned"] = "deposit.returned";
|
|
592
599
|
WebhookEventType2["TransactionCreated"] = "transaction.created";
|
|
593
600
|
WebhookEventType2["TransactionUpdated"] = "transaction.updated";
|
|
594
601
|
WebhookEventType2["TransactionCompleted"] = "transaction.completed";
|