@naturalpay/sdk 0.2.1 → 0.3.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/CHANGELOG.md +29 -0
- package/README.md +2 -2
- package/api-promise.d.mts +1 -0
- package/api-promise.d.mts.map +1 -1
- package/api-promise.d.ts +1 -0
- package/api-promise.d.ts.map +1 -1
- package/api-promise.mjs +1 -0
- package/api-promise.mjs.map +1 -1
- package/client.d.mts +17 -5
- package/client.d.mts.map +1 -1
- package/client.d.ts +17 -5
- package/client.d.ts.map +1 -1
- package/client.js +16 -4
- package/client.js.map +1 -1
- package/client.mjs +16 -4
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.mjs.map +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/uploads.d.mts.map +1 -1
- package/core/uploads.d.ts.map +1 -1
- package/core/uploads.mjs.map +1 -1
- package/error.d.mts +1 -0
- package/error.d.mts.map +1 -1
- package/error.d.ts +1 -0
- package/error.d.ts.map +1 -1
- package/error.mjs +1 -0
- package/error.mjs.map +1 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.mjs.map +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/qs/formats.d.mts.map +1 -1
- package/internal/qs/formats.d.ts.map +1 -1
- package/internal/qs/index.d.mts +2 -2
- package/internal/qs/index.d.mts.map +1 -1
- package/internal/qs/index.d.ts +2 -2
- package/internal/qs/index.d.ts.map +1 -1
- package/internal/qs/index.mjs.map +1 -1
- package/internal/qs/stringify.d.mts.map +1 -1
- package/internal/qs/stringify.d.ts.map +1 -1
- package/internal/qs/stringify.mjs.map +1 -1
- package/internal/qs/utils.d.mts.map +1 -1
- package/internal/qs/utils.d.ts.map +1 -1
- package/internal/qs/utils.mjs.map +1 -1
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts.map +1 -1
- package/internal/shims.d.mts +6 -0
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts +6 -0
- package/internal/shims.d.ts.map +1 -1
- package/internal/to-file.d.mts.map +1 -1
- package/internal/to-file.d.ts.map +1 -1
- package/internal/to-file.mjs.map +1 -1
- package/internal/types.d.mts +4 -4
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +4 -4
- package/internal/types.d.ts.map +1 -1
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/query.mjs.map +1 -1
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.d.mts.map +1 -1
- package/internal/utils.d.ts.map +1 -1
- package/internal/utils.mjs.map +1 -1
- package/lib/envelope.d.mts.map +1 -1
- package/lib/envelope.d.ts.map +1 -1
- package/lib/envelope.mjs.map +1 -1
- package/package.json +1 -1
- package/resource.d.mts +1 -0
- package/resource.d.mts.map +1 -1
- package/resource.d.ts +1 -0
- package/resource.d.ts.map +1 -1
- package/resource.mjs +1 -0
- package/resource.mjs.map +1 -1
- package/resources/agents.d.mts +4 -153
- package/resources/agents.d.mts.map +1 -1
- package/resources/agents.d.ts +4 -153
- package/resources/agents.d.ts.map +1 -1
- package/resources/agents.js +5 -5
- package/resources/agents.js.map +1 -1
- package/resources/agents.mjs +5 -5
- package/resources/agents.mjs.map +1 -1
- package/resources/api-keys.d.mts.map +1 -1
- package/resources/api-keys.d.ts.map +1 -1
- package/resources/api-keys.js +1 -1
- package/resources/api-keys.js.map +1 -1
- package/resources/api-keys.mjs +1 -1
- package/resources/api-keys.mjs.map +1 -1
- package/resources/counterparties.d.mts +5 -55
- package/resources/counterparties.d.mts.map +1 -1
- package/resources/counterparties.d.ts +5 -55
- package/resources/counterparties.d.ts.map +1 -1
- package/resources/counterparties.js +1 -3
- package/resources/counterparties.js.map +1 -1
- package/resources/counterparties.mjs +1 -3
- package/resources/counterparties.mjs.map +1 -1
- package/resources/customers.d.mts.map +1 -1
- package/resources/customers.d.ts.map +1 -1
- package/resources/customers.mjs.map +1 -1
- package/resources/delegations.d.mts.map +1 -1
- package/resources/delegations.d.ts.map +1 -1
- package/resources/delegations.mjs.map +1 -1
- package/resources/external-accounts.d.mts +239 -0
- package/resources/external-accounts.d.mts.map +1 -0
- package/resources/external-accounts.d.ts +239 -0
- package/resources/external-accounts.d.ts.map +1 -0
- package/resources/external-accounts.js +47 -0
- package/resources/external-accounts.js.map +1 -0
- package/resources/external-accounts.mjs +43 -0
- package/resources/external-accounts.mjs.map +1 -0
- package/resources/index.d.mts +3 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/invitations.d.mts +1 -1
- package/resources/invitations.d.mts.map +1 -1
- package/resources/invitations.d.ts +1 -1
- package/resources/invitations.d.ts.map +1 -1
- package/resources/invitations.js +1 -1
- package/resources/invitations.mjs +1 -1
- package/resources/invitations.mjs.map +1 -1
- package/resources/parties.d.mts +2 -2
- package/resources/parties.d.mts.map +1 -1
- package/resources/parties.d.ts +2 -2
- package/resources/parties.d.ts.map +1 -1
- package/resources/parties.js +3 -3
- package/resources/parties.js.map +1 -1
- package/resources/parties.mjs +3 -3
- package/resources/parties.mjs.map +1 -1
- package/resources/payment-requests.d.mts +24 -17
- package/resources/payment-requests.d.mts.map +1 -1
- package/resources/payment-requests.d.ts +24 -17
- package/resources/payment-requests.d.ts.map +1 -1
- package/resources/payment-requests.js +0 -1
- package/resources/payment-requests.js.map +1 -1
- package/resources/payment-requests.mjs +0 -1
- package/resources/payment-requests.mjs.map +1 -1
- package/resources/payments.d.mts +1 -1
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +1 -1
- package/resources/payments.d.ts.map +1 -1
- package/resources/payments.mjs.map +1 -1
- package/resources/transactions.d.mts +18 -10
- package/resources/transactions.d.mts.map +1 -1
- package/resources/transactions.d.ts +18 -10
- package/resources/transactions.d.ts.map +1 -1
- package/resources/transactions.js +2 -2
- package/resources/transactions.mjs +2 -2
- package/resources/transactions.mjs.map +1 -1
- package/resources/wallet.d.mts +196 -328
- package/resources/wallet.d.mts.map +1 -1
- package/resources/wallet.d.ts +196 -328
- package/resources/wallet.d.ts.map +1 -1
- package/resources/wallet.js +16 -63
- package/resources/wallet.js.map +1 -1
- package/resources/wallet.mjs +16 -63
- package/resources/wallet.mjs.map +1 -1
- package/resources/webhooks.d.mts +775 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +775 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +163 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +159 -0
- package/resources/webhooks.mjs.map +1 -0
- package/resources.d.mts.map +1 -1
- package/resources.d.ts.map +1 -1
- package/resources.mjs.map +1 -1
- package/src/client.ts +69 -21
- package/src/resources/agents.ts +5 -185
- package/src/resources/api-keys.ts +1 -1
- package/src/resources/counterparties.ts +5 -64
- package/src/resources/external-accounts.ts +324 -0
- package/src/resources/index.ts +26 -8
- package/src/resources/invitations.ts +1 -1
- package/src/resources/parties.ts +3 -3
- package/src/resources/payment-requests.ts +28 -18
- package/src/resources/payments.ts +1 -1
- package/src/resources/transactions.ts +20 -10
- package/src/resources/wallet.ts +223 -419
- package/src/resources/webhooks.ts +1225 -0
- package/src/version.ts +1 -1
- package/uploads.d.mts +1 -0
- package/uploads.d.mts.map +1 -1
- package/uploads.d.ts +1 -0
- package/uploads.d.ts.map +1 -1
- package/uploads.mjs +1 -0
- package/uploads.mjs.map +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
import { path } from '../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Linked external bank accounts
|
|
11
|
+
*/
|
|
12
|
+
export class ExternalAccounts extends APIResource {
|
|
13
|
+
/**
|
|
14
|
+
* List linked external accounts with cursor pagination.
|
|
15
|
+
*/
|
|
16
|
+
list(
|
|
17
|
+
params: ExternalAccountListParams | null | undefined = {},
|
|
18
|
+
options?: RequestOptions,
|
|
19
|
+
): APIPromise<ExternalAccountListResponse> {
|
|
20
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
|
|
21
|
+
return this._client.get('/external-accounts', {
|
|
22
|
+
query,
|
|
23
|
+
...options,
|
|
24
|
+
headers: buildHeaders([
|
|
25
|
+
{
|
|
26
|
+
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
27
|
+
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
28
|
+
},
|
|
29
|
+
options?.headers,
|
|
30
|
+
]),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Remove (unlink) a bank account.
|
|
36
|
+
*/
|
|
37
|
+
remove(
|
|
38
|
+
externalAccountID: string,
|
|
39
|
+
params: ExternalAccountRemoveParams | null | undefined = {},
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): APIPromise<ExternalAccountRemoveResponse> {
|
|
42
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID } = params ?? {};
|
|
43
|
+
return this._client.delete(path`/external-accounts/${externalAccountID}`, {
|
|
44
|
+
...options,
|
|
45
|
+
headers: buildHeaders([
|
|
46
|
+
{
|
|
47
|
+
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
48
|
+
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
49
|
+
},
|
|
50
|
+
options?.headers,
|
|
51
|
+
]),
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface ExternalAccountListResponse {
|
|
57
|
+
data: Array<ExternalAccountListResponse.Data>;
|
|
58
|
+
|
|
59
|
+
meta: ExternalAccountListResponse.Meta;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export namespace ExternalAccountListResponse {
|
|
63
|
+
export interface Data {
|
|
64
|
+
/**
|
|
65
|
+
* Resource ID
|
|
66
|
+
*/
|
|
67
|
+
id: string;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Resource attributes
|
|
71
|
+
*/
|
|
72
|
+
attributes: Data.Attributes;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Resource relationships
|
|
76
|
+
*/
|
|
77
|
+
relationships: Data.Relationships;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Resource type
|
|
81
|
+
*/
|
|
82
|
+
type: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export namespace Data {
|
|
86
|
+
/**
|
|
87
|
+
* Resource attributes
|
|
88
|
+
*/
|
|
89
|
+
export interface Attributes {
|
|
90
|
+
/**
|
|
91
|
+
* Account display name
|
|
92
|
+
*/
|
|
93
|
+
accountName: string | null;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Account type (checking, savings)
|
|
97
|
+
*/
|
|
98
|
+
accountType: 'checking' | 'savings' | 'unknown' | null;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Bank institution name
|
|
102
|
+
*/
|
|
103
|
+
bankName: string | null;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* When the external account was linked
|
|
107
|
+
*/
|
|
108
|
+
createdAt: string;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Last 4 digits of account
|
|
112
|
+
*/
|
|
113
|
+
lastFour: string;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Status (pending, active, disabled)
|
|
117
|
+
*/
|
|
118
|
+
status: 'pending' | 'new' | 'active' | 'disabled' | 'deleted' | 'unknown';
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Resource relationships
|
|
123
|
+
*/
|
|
124
|
+
export interface Relationships {
|
|
125
|
+
/**
|
|
126
|
+
* Party that owns the external account
|
|
127
|
+
*/
|
|
128
|
+
party: Relationships.Party;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export namespace Relationships {
|
|
132
|
+
/**
|
|
133
|
+
* Party that owns the external account
|
|
134
|
+
*/
|
|
135
|
+
export interface Party {
|
|
136
|
+
/**
|
|
137
|
+
* Related resource identifier
|
|
138
|
+
*/
|
|
139
|
+
data: Party.Data;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export namespace Party {
|
|
143
|
+
/**
|
|
144
|
+
* Related resource identifier
|
|
145
|
+
*/
|
|
146
|
+
export interface Data {
|
|
147
|
+
id: string;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Resource type
|
|
151
|
+
*/
|
|
152
|
+
type: string;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface Meta {
|
|
159
|
+
pagination: Meta.Pagination;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export namespace Meta {
|
|
163
|
+
export interface Pagination {
|
|
164
|
+
hasMore: boolean;
|
|
165
|
+
|
|
166
|
+
nextCursor: string | null;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export interface ExternalAccountRemoveResponse {
|
|
172
|
+
data: ExternalAccountRemoveResponse.Data;
|
|
173
|
+
|
|
174
|
+
meta: ExternalAccountRemoveResponse.Meta;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export namespace ExternalAccountRemoveResponse {
|
|
178
|
+
export interface Data {
|
|
179
|
+
/**
|
|
180
|
+
* Resource ID
|
|
181
|
+
*/
|
|
182
|
+
id: string;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Resource attributes
|
|
186
|
+
*/
|
|
187
|
+
attributes: Data.Attributes;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Resource relationships
|
|
191
|
+
*/
|
|
192
|
+
relationships: Data.Relationships;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Resource type
|
|
196
|
+
*/
|
|
197
|
+
type: string;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export namespace Data {
|
|
201
|
+
/**
|
|
202
|
+
* Resource attributes
|
|
203
|
+
*/
|
|
204
|
+
export interface Attributes {
|
|
205
|
+
/**
|
|
206
|
+
* Account display name
|
|
207
|
+
*/
|
|
208
|
+
accountName: string | null;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Account type (checking, savings)
|
|
212
|
+
*/
|
|
213
|
+
accountType: 'checking' | 'savings' | 'unknown' | null;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Bank institution name
|
|
217
|
+
*/
|
|
218
|
+
bankName: string | null;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* When the external account was linked
|
|
222
|
+
*/
|
|
223
|
+
createdAt: string;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Last 4 digits of account
|
|
227
|
+
*/
|
|
228
|
+
lastFour: string;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Status (pending, active, disabled)
|
|
232
|
+
*/
|
|
233
|
+
status: 'pending' | 'new' | 'active' | 'disabled' | 'deleted' | 'unknown';
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Resource relationships
|
|
238
|
+
*/
|
|
239
|
+
export interface Relationships {
|
|
240
|
+
/**
|
|
241
|
+
* Party that owns the external account
|
|
242
|
+
*/
|
|
243
|
+
party: Relationships.Party;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export namespace Relationships {
|
|
247
|
+
/**
|
|
248
|
+
* Party that owns the external account
|
|
249
|
+
*/
|
|
250
|
+
export interface Party {
|
|
251
|
+
/**
|
|
252
|
+
* Related resource identifier
|
|
253
|
+
*/
|
|
254
|
+
data: Party.Data;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export namespace Party {
|
|
258
|
+
/**
|
|
259
|
+
* Related resource identifier
|
|
260
|
+
*/
|
|
261
|
+
export interface Data {
|
|
262
|
+
id: string;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Resource type
|
|
266
|
+
*/
|
|
267
|
+
type: string;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export interface Meta {
|
|
274
|
+
/**
|
|
275
|
+
* Indicates the resource was deleted
|
|
276
|
+
*/
|
|
277
|
+
deleted: true;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export interface ExternalAccountListParams {
|
|
282
|
+
/**
|
|
283
|
+
* Query param
|
|
284
|
+
*/
|
|
285
|
+
cursor?: string;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Query param
|
|
289
|
+
*/
|
|
290
|
+
limit?: number;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
294
|
+
*/
|
|
295
|
+
'X-Agent-ID'?: string;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
299
|
+
* for agent observability.
|
|
300
|
+
*/
|
|
301
|
+
'X-Instance-ID'?: string;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export interface ExternalAccountRemoveParams {
|
|
305
|
+
/**
|
|
306
|
+
* Agent ID (agt_xxx) identifying which agent is making the request.
|
|
307
|
+
*/
|
|
308
|
+
'X-Agent-ID'?: string;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Required when X-Agent-ID is present. Session or conversation ID for agent
|
|
312
|
+
* observability.
|
|
313
|
+
*/
|
|
314
|
+
'X-Instance-ID'?: string;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export declare namespace ExternalAccounts {
|
|
318
|
+
export {
|
|
319
|
+
type ExternalAccountListResponse as ExternalAccountListResponse,
|
|
320
|
+
type ExternalAccountRemoveResponse as ExternalAccountRemoveResponse,
|
|
321
|
+
type ExternalAccountListParams as ExternalAccountListParams,
|
|
322
|
+
type ExternalAccountRemoveParams as ExternalAccountRemoveParams,
|
|
323
|
+
};
|
|
324
|
+
}
|
package/src/resources/index.ts
CHANGED
|
@@ -43,6 +43,13 @@ export {
|
|
|
43
43
|
type DelegationGetAgentDelegationParams,
|
|
44
44
|
type DelegationListAgentDelegationsParams,
|
|
45
45
|
} from './delegations';
|
|
46
|
+
export {
|
|
47
|
+
ExternalAccounts,
|
|
48
|
+
type ExternalAccountListResponse,
|
|
49
|
+
type ExternalAccountRemoveResponse,
|
|
50
|
+
type ExternalAccountListParams,
|
|
51
|
+
type ExternalAccountRemoveParams,
|
|
52
|
+
} from './external-accounts';
|
|
46
53
|
export {
|
|
47
54
|
Invitations,
|
|
48
55
|
type InvitationCreateResponse,
|
|
@@ -80,16 +87,27 @@ export {
|
|
|
80
87
|
} from './transactions';
|
|
81
88
|
export {
|
|
82
89
|
Wallet,
|
|
83
|
-
type
|
|
84
|
-
type
|
|
90
|
+
type WalletListResponse,
|
|
91
|
+
type WalletGetResponse,
|
|
85
92
|
type WalletInitiateDepositResponse,
|
|
86
93
|
type WalletInitiateWithdrawalResponse,
|
|
87
|
-
type
|
|
88
|
-
type
|
|
89
|
-
type WalletGetBalanceParams,
|
|
90
|
-
type WalletGetDepositInstructionsParams,
|
|
94
|
+
type WalletListParams,
|
|
95
|
+
type WalletGetParams,
|
|
91
96
|
type WalletInitiateDepositParams,
|
|
92
97
|
type WalletInitiateWithdrawalParams,
|
|
93
|
-
type WalletListPaymentInstrumentsParams,
|
|
94
|
-
type WalletRemovePaymentInstrumentParams,
|
|
95
98
|
} from './wallet';
|
|
99
|
+
export {
|
|
100
|
+
Webhooks,
|
|
101
|
+
type WebhookCreateResponse,
|
|
102
|
+
type WebhookUpdateResponse,
|
|
103
|
+
type WebhookListResponse,
|
|
104
|
+
type WebhookGetResponse,
|
|
105
|
+
type WebhookRemoveResponse,
|
|
106
|
+
type WebhookRotateSecretResponse,
|
|
107
|
+
type WebhookCreateParams,
|
|
108
|
+
type WebhookUpdateParams,
|
|
109
|
+
type WebhookListParams,
|
|
110
|
+
type WebhookGetParams,
|
|
111
|
+
type WebhookRemoveParams,
|
|
112
|
+
type WebhookRotateSecretParams,
|
|
113
|
+
} from './webhooks';
|
package/src/resources/parties.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
10
10
|
*/
|
|
11
11
|
export class Parties extends APIResource {
|
|
12
12
|
/**
|
|
13
|
-
* Update
|
|
13
|
+
* Update your party.
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```ts
|
|
@@ -19,7 +19,7 @@ export class Parties extends APIResource {
|
|
|
19
19
|
*/
|
|
20
20
|
update(params: PartyUpdateParams, options?: RequestOptions): APIPromise<PartyUpdateResponse> {
|
|
21
21
|
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...body } = params;
|
|
22
|
-
return this._client.
|
|
22
|
+
return this._client.patch('/parties/me', {
|
|
23
23
|
body,
|
|
24
24
|
...options,
|
|
25
25
|
headers: buildHeaders([
|
|
@@ -33,7 +33,7 @@ export class Parties extends APIResource {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Get your party.
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
39
|
* ```ts
|
|
@@ -18,7 +18,6 @@ export class PaymentRequests extends APIResource {
|
|
|
18
18
|
* const paymentRequest = await client.paymentRequests.create({
|
|
19
19
|
* amount: 1,
|
|
20
20
|
* payer: { kind: 'email', value: 'dev@stainless.com' },
|
|
21
|
-
* walletId: 'wal_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
22
21
|
* 'Idempotency-Key': 'Idempotency-Key',
|
|
23
22
|
* });
|
|
24
23
|
* ```
|
|
@@ -130,7 +129,7 @@ export namespace PaymentRequestCreateResponse {
|
|
|
130
129
|
*/
|
|
131
130
|
export interface Attributes {
|
|
132
131
|
/**
|
|
133
|
-
* Amount in
|
|
132
|
+
* Amount in cents
|
|
134
133
|
*/
|
|
135
134
|
amount: number;
|
|
136
135
|
|
|
@@ -162,7 +161,7 @@ export namespace PaymentRequestCreateResponse {
|
|
|
162
161
|
/**
|
|
163
162
|
* Which identifier type was used to address the payer
|
|
164
163
|
*/
|
|
165
|
-
payerIdentifierType: 'email' | 'phone' | 'party_id';
|
|
164
|
+
payerIdentifierType: 'email' | 'phone' | 'party_id' | 'agent_id';
|
|
166
165
|
|
|
167
166
|
/**
|
|
168
167
|
* Display name of the payer
|
|
@@ -170,7 +169,7 @@ export namespace PaymentRequestCreateResponse {
|
|
|
170
169
|
payerName: string | null;
|
|
171
170
|
|
|
172
171
|
/**
|
|
173
|
-
* Natural party ID (pty\_\*)
|
|
172
|
+
* Natural party ID (pty\_\*) resolved for the payer, including agent owner parties
|
|
174
173
|
*/
|
|
175
174
|
payerPartyId: string | null;
|
|
176
175
|
|
|
@@ -243,7 +242,7 @@ export namespace PaymentRequestListResponse {
|
|
|
243
242
|
*/
|
|
244
243
|
export interface Attributes {
|
|
245
244
|
/**
|
|
246
|
-
* Amount in
|
|
245
|
+
* Amount in cents
|
|
247
246
|
*/
|
|
248
247
|
amount: number;
|
|
249
248
|
|
|
@@ -275,7 +274,7 @@ export namespace PaymentRequestListResponse {
|
|
|
275
274
|
/**
|
|
276
275
|
* Which identifier type was used to address the payer
|
|
277
276
|
*/
|
|
278
|
-
payerIdentifierType: 'email' | 'phone' | 'party_id';
|
|
277
|
+
payerIdentifierType: 'email' | 'phone' | 'party_id' | 'agent_id';
|
|
279
278
|
|
|
280
279
|
/**
|
|
281
280
|
* Display name of the payer
|
|
@@ -283,7 +282,7 @@ export namespace PaymentRequestListResponse {
|
|
|
283
282
|
payerName: string | null;
|
|
284
283
|
|
|
285
284
|
/**
|
|
286
|
-
* Natural party ID (pty\_\*)
|
|
285
|
+
* Natural party ID (pty\_\*) resolved for the payer, including agent owner parties
|
|
287
286
|
*/
|
|
288
287
|
payerPartyId: string | null;
|
|
289
288
|
|
|
@@ -366,7 +365,7 @@ export namespace PaymentRequestGetResponse {
|
|
|
366
365
|
*/
|
|
367
366
|
export interface Attributes {
|
|
368
367
|
/**
|
|
369
|
-
* Amount in
|
|
368
|
+
* Amount in cents
|
|
370
369
|
*/
|
|
371
370
|
amount: number;
|
|
372
371
|
|
|
@@ -398,7 +397,7 @@ export namespace PaymentRequestGetResponse {
|
|
|
398
397
|
/**
|
|
399
398
|
* Which identifier type was used to address the payer
|
|
400
399
|
*/
|
|
401
|
-
payerIdentifierType: 'email' | 'phone' | 'party_id';
|
|
400
|
+
payerIdentifierType: 'email' | 'phone' | 'party_id' | 'agent_id';
|
|
402
401
|
|
|
403
402
|
/**
|
|
404
403
|
* Display name of the payer
|
|
@@ -406,7 +405,7 @@ export namespace PaymentRequestGetResponse {
|
|
|
406
405
|
payerName: string | null;
|
|
407
406
|
|
|
408
407
|
/**
|
|
409
|
-
* Natural party ID (pty\_\*)
|
|
408
|
+
* Natural party ID (pty\_\*) resolved for the payer, including agent owner parties
|
|
410
409
|
*/
|
|
411
410
|
payerPartyId: string | null;
|
|
412
411
|
|
|
@@ -451,22 +450,18 @@ export namespace PaymentRequestGetResponse {
|
|
|
451
450
|
|
|
452
451
|
export interface PaymentRequestCreateParams {
|
|
453
452
|
/**
|
|
454
|
-
* Body param: Amount in
|
|
453
|
+
* Body param: Amount in cents
|
|
455
454
|
*/
|
|
456
455
|
amount: number;
|
|
457
456
|
|
|
458
457
|
/**
|
|
459
|
-
* Body param: Who pays — exactly one of email, phone, or
|
|
458
|
+
* Body param: Who pays — exactly one of email, phone, party, or agent.
|
|
460
459
|
*/
|
|
461
460
|
payer:
|
|
462
461
|
| PaymentRequestCreateParams.UnionMember0
|
|
463
462
|
| PaymentRequestCreateParams.UnionMember1
|
|
464
|
-
| PaymentRequestCreateParams.UnionMember2
|
|
465
|
-
|
|
466
|
-
/**
|
|
467
|
-
* Body param: Wallet that should receive the funds
|
|
468
|
-
*/
|
|
469
|
-
walletId: string;
|
|
463
|
+
| PaymentRequestCreateParams.UnionMember2
|
|
464
|
+
| PaymentRequestCreateParams.UnionMember3;
|
|
470
465
|
|
|
471
466
|
/**
|
|
472
467
|
* Header param: Unique key for idempotent request handling. If a request with the
|
|
@@ -501,6 +496,12 @@ export interface PaymentRequestCreateParams {
|
|
|
501
496
|
*/
|
|
502
497
|
sendLink?: PaymentRequestCreateParams.SendLink;
|
|
503
498
|
|
|
499
|
+
/**
|
|
500
|
+
* Body param: Wallet that should receive the funds. Omit to use the requester
|
|
501
|
+
* party's default wallet.
|
|
502
|
+
*/
|
|
503
|
+
walletId?: string;
|
|
504
|
+
|
|
504
505
|
/**
|
|
505
506
|
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
506
507
|
*/
|
|
@@ -541,6 +542,15 @@ export namespace PaymentRequestCreateParams {
|
|
|
541
542
|
value: string;
|
|
542
543
|
}
|
|
543
544
|
|
|
545
|
+
export interface UnionMember3 {
|
|
546
|
+
kind: 'agent_id';
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Natural agent ID (agt\_\*) of the payer
|
|
550
|
+
*/
|
|
551
|
+
value: string;
|
|
552
|
+
}
|
|
553
|
+
|
|
544
554
|
/**
|
|
545
555
|
* If provided, immediately deliver the payment link to the payer via the named
|
|
546
556
|
* channel
|
|
@@ -182,7 +182,7 @@ export interface PaymentCreateParams {
|
|
|
182
182
|
amount: number;
|
|
183
183
|
|
|
184
184
|
/**
|
|
185
|
-
* Body param: Recipient: party ID (pty
|
|
185
|
+
* Body param: Recipient: party ID (pty*\*), agent ID (agt*\*), email, or phone
|
|
186
186
|
*/
|
|
187
187
|
counterparty: string;
|
|
188
188
|
|
|
@@ -11,7 +11,7 @@ import { path } from '../internal/utils/path';
|
|
|
11
11
|
*/
|
|
12
12
|
export class Transactions extends APIResource {
|
|
13
13
|
/**
|
|
14
|
-
* List transactions visible to
|
|
14
|
+
* List transactions visible to your party and its delegated agents.
|
|
15
15
|
*/
|
|
16
16
|
list(
|
|
17
17
|
params: TransactionListParams | null | undefined = {},
|
|
@@ -32,7 +32,7 @@ export class Transactions extends APIResource {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* Get a single transaction visible to
|
|
35
|
+
* Get a single transaction visible to your party.
|
|
36
36
|
*/
|
|
37
37
|
get(
|
|
38
38
|
transactionID: string,
|
|
@@ -96,10 +96,9 @@ export namespace TransactionListResponse {
|
|
|
96
96
|
amount: number;
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
|
-
* Classification from
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
* (INBOUND/OUTBOUND).
|
|
99
|
+
* Classification from your party's perspective. Derived from transactionType +
|
|
100
|
+
* direction: "sent"/"received" for wallet-to-wallet payments (OUTBOUND/INBOUND),
|
|
101
|
+
* "deposit"/"withdrawal" for external transfers (INBOUND/OUTBOUND).
|
|
103
102
|
*/
|
|
104
103
|
category: 'sent' | 'received' | 'deposit' | 'withdrawal';
|
|
105
104
|
|
|
@@ -138,6 +137,12 @@ export namespace TransactionListResponse {
|
|
|
138
137
|
*/
|
|
139
138
|
escalationId: string | null;
|
|
140
139
|
|
|
140
|
+
/**
|
|
141
|
+
* Projected funds-available time for transfers (deposits/withdrawals). Null when
|
|
142
|
+
* no MMR settlement projection has arrived yet, and null for payments.
|
|
143
|
+
*/
|
|
144
|
+
expectedAvailableAt: string | null;
|
|
145
|
+
|
|
141
146
|
/**
|
|
142
147
|
* Display name of the user or agent that initiated this transaction
|
|
143
148
|
*/
|
|
@@ -351,10 +356,9 @@ export namespace TransactionGetResponse {
|
|
|
351
356
|
amount: number;
|
|
352
357
|
|
|
353
358
|
/**
|
|
354
|
-
* Classification from
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
* (INBOUND/OUTBOUND).
|
|
359
|
+
* Classification from your party's perspective. Derived from transactionType +
|
|
360
|
+
* direction: "sent"/"received" for wallet-to-wallet payments (OUTBOUND/INBOUND),
|
|
361
|
+
* "deposit"/"withdrawal" for external transfers (INBOUND/OUTBOUND).
|
|
358
362
|
*/
|
|
359
363
|
category: 'sent' | 'received' | 'deposit' | 'withdrawal';
|
|
360
364
|
|
|
@@ -393,6 +397,12 @@ export namespace TransactionGetResponse {
|
|
|
393
397
|
*/
|
|
394
398
|
escalationId: string | null;
|
|
395
399
|
|
|
400
|
+
/**
|
|
401
|
+
* Projected funds-available time for transfers (deposits/withdrawals). Null when
|
|
402
|
+
* no MMR settlement projection has arrived yet, and null for payments.
|
|
403
|
+
*/
|
|
404
|
+
expectedAvailableAt: string | null;
|
|
405
|
+
|
|
396
406
|
/**
|
|
397
407
|
* Display name of the user or agent that initiated this transaction
|
|
398
408
|
*/
|