@naturalpay/sdk 0.10.0 → 0.12.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/package.json +1 -1
  3. package/resources/payment-requests.d.mts +63 -65
  4. package/resources/payment-requests.d.mts.map +1 -1
  5. package/resources/payment-requests.d.ts +63 -65
  6. package/resources/payment-requests.d.ts.map +1 -1
  7. package/resources/payment-requests.js +36 -47
  8. package/resources/payment-requests.js.map +1 -1
  9. package/resources/payment-requests.mjs +36 -47
  10. package/resources/payment-requests.mjs.map +1 -1
  11. package/resources/payments.d.mts +43 -34
  12. package/resources/payments.d.mts.map +1 -1
  13. package/resources/payments.d.ts +43 -34
  14. package/resources/payments.d.ts.map +1 -1
  15. package/resources/payments.js +23 -30
  16. package/resources/payments.js.map +1 -1
  17. package/resources/payments.mjs +23 -30
  18. package/resources/payments.mjs.map +1 -1
  19. package/resources/transactions.d.mts +16 -18
  20. package/resources/transactions.d.mts.map +1 -1
  21. package/resources/transactions.d.ts +16 -18
  22. package/resources/transactions.d.ts.map +1 -1
  23. package/resources/transactions.js +6 -18
  24. package/resources/transactions.js.map +1 -1
  25. package/resources/transactions.mjs +6 -18
  26. package/resources/transactions.mjs.map +1 -1
  27. package/resources/transfers.d.mts +44 -37
  28. package/resources/transfers.d.mts.map +1 -1
  29. package/resources/transfers.d.ts +44 -37
  30. package/resources/transfers.d.ts.map +1 -1
  31. package/resources/transfers.js +20 -29
  32. package/resources/transfers.js.map +1 -1
  33. package/resources/transfers.mjs +20 -29
  34. package/resources/transfers.mjs.map +1 -1
  35. package/resources/wallet.d.mts +8 -24
  36. package/resources/wallet.d.mts.map +1 -1
  37. package/resources/wallet.d.ts +8 -24
  38. package/resources/wallet.d.ts.map +1 -1
  39. package/resources/wallet.js +4 -4
  40. package/resources/wallet.mjs +4 -4
  41. package/src/resources/payment-requests.ts +74 -111
  42. package/src/resources/payments.ts +53 -71
  43. package/src/resources/transactions.ts +22 -39
  44. package/src/resources/transfers.ts +52 -68
  45. package/src/resources/wallet.ts +8 -28
  46. package/src/version.ts +1 -1
  47. package/version.d.mts +1 -1
  48. package/version.d.ts +1 -1
  49. package/version.js +1 -1
  50. package/version.mjs +1 -1
@@ -13,21 +13,12 @@ export class Transactions extends APIResource {
13
13
  /**
14
14
  * List transactions visible to your party.
15
15
  */
16
- list(
17
- params: TransactionListParams | null | undefined = {},
18
- options?: RequestOptions,
19
- ): APIPromise<TransactionListResponse> {
20
- const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
16
+ list(params: TransactionListParams, options?: RequestOptions): APIPromise<TransactionListResponse> {
17
+ const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params;
21
18
  return this._client.get('/transactions', {
22
19
  query,
23
20
  ...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
- ]),
21
+ headers: buildHeaders([{ 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID }, options?.headers]),
31
22
  });
32
23
  }
33
24
 
@@ -36,20 +27,14 @@ export class Transactions extends APIResource {
36
27
  */
37
28
  get(
38
29
  transactionID: string,
39
- params: TransactionGetParams | null | undefined = {},
30
+ params: TransactionGetParams,
40
31
  options?: RequestOptions,
41
32
  ): APIPromise<TransactionGetResponse> {
42
- const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
33
+ const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params;
43
34
  return this._client.get(path`/transactions/${transactionID}`, {
44
35
  query,
45
36
  ...options,
46
- headers: buildHeaders([
47
- {
48
- ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
49
- ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
50
- },
51
- options?.headers,
52
- ]),
37
+ headers: buildHeaders([{ 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID }, options?.headers]),
53
38
  });
54
39
  }
55
40
  }
@@ -480,48 +465,46 @@ export namespace TransactionGetResponse {
480
465
 
481
466
  export interface TransactionListParams {
482
467
  /**
483
- * Query param: Pagination cursor from previous response
468
+ * Header param: Agent ID (agt_xxx) used for attribution and audit.
484
469
  */
485
- cursor?: string;
470
+ 'X-Agent-ID': string;
486
471
 
487
472
  /**
488
- * Query param: Results per page
473
+ * Header param: Stable run, session, or conversation ID for agent observability.
489
474
  */
490
- limit?: number;
475
+ 'X-Instance-ID': string;
491
476
 
492
477
  /**
493
- * Query param
478
+ * Query param: Pagination cursor from previous response
494
479
  */
495
- type?: 'payment' | 'transfer' | 'all';
480
+ cursor?: string;
496
481
 
497
482
  /**
498
- * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
483
+ * Query param: Results per page
499
484
  */
500
- 'X-Agent-ID'?: string;
485
+ limit?: number;
501
486
 
502
487
  /**
503
- * Header param: Required when X-Agent-ID is present. Session or conversation ID
504
- * for agent observability.
488
+ * Query param
505
489
  */
506
- 'X-Instance-ID'?: string;
490
+ type?: 'payment' | 'transfer' | 'all';
507
491
  }
508
492
 
509
493
  export interface TransactionGetParams {
510
494
  /**
511
- * Query param: Party ID for delegated transaction lookup
495
+ * Header param: Agent ID (agt_xxx) used for attribution and audit.
512
496
  */
513
- partyId?: string;
497
+ 'X-Agent-ID': string;
514
498
 
515
499
  /**
516
- * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
500
+ * Header param: Stable run, session, or conversation ID for agent observability.
517
501
  */
518
- 'X-Agent-ID'?: string;
502
+ 'X-Instance-ID': string;
519
503
 
520
504
  /**
521
- * Header param: Required when X-Agent-ID is present. Session or conversation ID
522
- * for agent observability.
505
+ * Query param: Party ID for delegated transaction lookup
523
506
  */
524
- 'X-Instance-ID'?: string;
507
+ partyId?: string;
525
508
  }
526
509
 
527
510
  export declare namespace Transactions {
@@ -15,24 +15,18 @@ export class Transfers extends APIResource {
15
15
  *
16
16
  * @example
17
17
  * ```ts
18
- * const transfers = await client.transfers.list();
18
+ * const transfers = await client.transfers.list({
19
+ * 'X-Agent-ID': 'X-Agent-ID',
20
+ * 'X-Instance-ID': 'X-Instance-ID',
21
+ * });
19
22
  * ```
20
23
  */
21
- list(
22
- params: TransferListParams | null | undefined = {},
23
- options?: RequestOptions,
24
- ): APIPromise<TransferListResponse> {
25
- const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
24
+ list(params: TransferListParams, options?: RequestOptions): APIPromise<TransferListResponse> {
25
+ const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params;
26
26
  return this._client.get('/transfers', {
27
27
  query,
28
28
  ...options,
29
- headers: buildHeaders([
30
- {
31
- ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
32
- ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
33
- },
34
- options?.headers,
35
- ]),
29
+ headers: buildHeaders([{ 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID }, options?.headers]),
36
30
  });
37
31
  }
38
32
 
@@ -43,25 +37,23 @@ export class Transfers extends APIResource {
43
37
  * ```ts
44
38
  * const transfer = await client.transfers.get(
45
39
  * 'trf_ecc2efdd09bd231a9ad9bd2aada37aa7',
40
+ * {
41
+ * 'X-Agent-ID': 'X-Agent-ID',
42
+ * 'X-Instance-ID': 'X-Instance-ID',
43
+ * },
46
44
  * );
47
45
  * ```
48
46
  */
49
47
  get(
50
48
  transferID: string,
51
- params: TransferGetParams | null | undefined = {},
49
+ params: TransferGetParams,
52
50
  options?: RequestOptions,
53
51
  ): APIPromise<TransferGetResponse> {
54
- const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
52
+ const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params;
55
53
  return this._client.get(path`/transfers/${transferID}`, {
56
54
  query,
57
55
  ...options,
58
- headers: buildHeaders([
59
- {
60
- ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
61
- ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
62
- },
63
- options?.headers,
64
- ]),
56
+ headers: buildHeaders([{ 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID }, options?.headers]),
65
57
  });
66
58
  }
67
59
 
@@ -74,6 +66,8 @@ export class Transfers extends APIResource {
74
66
  * amount: 100,
75
67
  * externalAccountId: 'eac_ecc2efdd09bd231a9ad9bd2aada37aa7',
76
68
  * 'Idempotency-Key': 'Idempotency-Key',
69
+ * 'X-Agent-ID': 'X-Agent-ID',
70
+ * 'X-Instance-ID': 'X-Instance-ID',
77
71
  * });
78
72
  * ```
79
73
  */
@@ -91,11 +85,7 @@ export class Transfers extends APIResource {
91
85
  body,
92
86
  ...options,
93
87
  headers: buildHeaders([
94
- {
95
- 'Idempotency-Key': idempotencyKey,
96
- ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
97
- ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
98
- },
88
+ { 'Idempotency-Key': idempotencyKey, 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID },
99
89
  options?.headers,
100
90
  ]),
101
91
  });
@@ -110,6 +100,8 @@ export class Transfers extends APIResource {
110
100
  * amount: 1,
111
101
  * externalAccountId: 'eac_ecc2efdd09bd231a9ad9bd2aada37aa7',
112
102
  * 'Idempotency-Key': 'Idempotency-Key',
103
+ * 'X-Agent-ID': 'X-Agent-ID',
104
+ * 'X-Instance-ID': 'X-Instance-ID',
113
105
  * });
114
106
  * ```
115
107
  */
@@ -127,11 +119,7 @@ export class Transfers extends APIResource {
127
119
  body,
128
120
  ...options,
129
121
  headers: buildHeaders([
130
- {
131
- 'Idempotency-Key': idempotencyKey,
132
- ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
133
- ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
134
- },
122
+ { 'Idempotency-Key': idempotencyKey, 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID },
135
123
  options?.headers,
136
124
  ]),
137
125
  });
@@ -1202,48 +1190,46 @@ export namespace TransferInitiateWithdrawalResponse {
1202
1190
 
1203
1191
  export interface TransferListParams {
1204
1192
  /**
1205
- * Query param: Pagination cursor from previous response
1193
+ * Header param: Agent ID (agt_xxx) used for attribution and audit.
1206
1194
  */
1207
- cursor?: string;
1195
+ 'X-Agent-ID': string;
1208
1196
 
1209
1197
  /**
1210
- * Query param: Results per page
1198
+ * Header param: Stable run, session, or conversation ID for agent observability.
1211
1199
  */
1212
- limit?: number;
1200
+ 'X-Instance-ID': string;
1213
1201
 
1214
1202
  /**
1215
- * Query param: Party ID for delegated transfer lookup
1203
+ * Query param: Pagination cursor from previous response
1216
1204
  */
1217
- partyId?: string;
1205
+ cursor?: string;
1218
1206
 
1219
1207
  /**
1220
- * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1208
+ * Query param: Results per page
1221
1209
  */
1222
- 'X-Agent-ID'?: string;
1210
+ limit?: number;
1223
1211
 
1224
1212
  /**
1225
- * Header param: Required when X-Agent-ID is present. Session or conversation ID
1226
- * for agent observability.
1213
+ * Query param: Party ID for delegated transfer lookup
1227
1214
  */
1228
- 'X-Instance-ID'?: string;
1215
+ partyId?: string;
1229
1216
  }
1230
1217
 
1231
1218
  export interface TransferGetParams {
1232
1219
  /**
1233
- * Query param: Party ID for delegated transfer lookup
1220
+ * Header param: Agent ID (agt_xxx) used for attribution and audit.
1234
1221
  */
1235
- partyId?: string;
1222
+ 'X-Agent-ID': string;
1236
1223
 
1237
1224
  /**
1238
- * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1225
+ * Header param: Stable run, session, or conversation ID for agent observability.
1239
1226
  */
1240
- 'X-Agent-ID'?: string;
1227
+ 'X-Instance-ID': string;
1241
1228
 
1242
1229
  /**
1243
- * Header param: Required when X-Agent-ID is present. Session or conversation ID
1244
- * for agent observability.
1230
+ * Query param: Party ID for delegated transfer lookup
1245
1231
  */
1246
- 'X-Instance-ID'?: string;
1232
+ partyId?: string;
1247
1233
  }
1248
1234
 
1249
1235
  export interface TransferInitiateDepositParams {
@@ -1264,25 +1250,24 @@ export interface TransferInitiateDepositParams {
1264
1250
  'Idempotency-Key': string;
1265
1251
 
1266
1252
  /**
1267
- * Body param: Currency code
1253
+ * Header param: Agent ID (agt_xxx) used for attribution and audit.
1268
1254
  */
1269
- currency?: string;
1255
+ 'X-Agent-ID': string;
1270
1256
 
1271
1257
  /**
1272
- * Body param: Deposit description
1258
+ * Header param: Stable run, session, or conversation ID for agent observability.
1273
1259
  */
1274
- description?: string;
1260
+ 'X-Instance-ID': string;
1275
1261
 
1276
1262
  /**
1277
- * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1263
+ * Body param: Currency code
1278
1264
  */
1279
- 'X-Agent-ID'?: string;
1265
+ currency?: string;
1280
1266
 
1281
1267
  /**
1282
- * Header param: Required when X-Agent-ID is present. Session or conversation ID
1283
- * for agent observability.
1268
+ * Body param: Deposit description
1284
1269
  */
1285
- 'X-Instance-ID'?: string;
1270
+ description?: string;
1286
1271
  }
1287
1272
 
1288
1273
  export interface TransferInitiateWithdrawalParams {
@@ -1303,25 +1288,24 @@ export interface TransferInitiateWithdrawalParams {
1303
1288
  'Idempotency-Key': string;
1304
1289
 
1305
1290
  /**
1306
- * Body param: Currency code
1291
+ * Header param: Agent ID (agt_xxx) used for attribution and audit.
1307
1292
  */
1308
- currency?: string;
1293
+ 'X-Agent-ID': string;
1309
1294
 
1310
1295
  /**
1311
- * Body param: Withdrawal description
1296
+ * Header param: Stable run, session, or conversation ID for agent observability.
1312
1297
  */
1313
- description?: string;
1298
+ 'X-Instance-ID': string;
1314
1299
 
1315
1300
  /**
1316
- * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1301
+ * Body param: Currency code
1317
1302
  */
1318
- 'X-Agent-ID'?: string;
1303
+ currency?: string;
1319
1304
 
1320
1305
  /**
1321
- * Header param: Required when X-Agent-ID is present. Session or conversation ID
1322
- * for agent observability.
1306
+ * Body param: Withdrawal description
1323
1307
  */
1324
- 'X-Instance-ID'?: string;
1308
+ description?: string;
1325
1309
  }
1326
1310
 
1327
1311
  export declare namespace Transfers {
@@ -11,8 +11,8 @@ import { path } from '../internal/utils/path';
11
11
  */
12
12
  export class Wallet extends APIResource {
13
13
  /**
14
- * List wallets for the authenticated party, including balance and ACH deposit
15
- * instructions when available. Currently returns at most one wallet.
14
+ * List wallets for the authenticated party, including balance and receiving bank
15
+ * name when available. Currently returns at most one wallet.
16
16
  */
17
17
  list(
18
18
  params: WalletListParams | null | undefined = {},
@@ -32,8 +32,8 @@ export class Wallet extends APIResource {
32
32
  }
33
33
 
34
34
  /**
35
- * Get a wallet visible to the authenticated party, including balance and ACH
36
- * deposit instructions when available.
35
+ * Get a wallet visible to the authenticated party, including balance and receiving
36
+ * bank name when available.
37
37
  */
38
38
  get(
39
39
  walletID: string,
@@ -99,7 +99,7 @@ export namespace WalletListResponse {
99
99
  claims: Attributes.Claims;
100
100
 
101
101
  /**
102
- * ACH deposit instructions for this wallet, when available
102
+ * ACH deposit-instruction metadata for this wallet, when available
103
103
  */
104
104
  depositInstructions: Attributes.DepositInstructions | null;
105
105
 
@@ -146,23 +146,13 @@ export namespace WalletListResponse {
146
146
  }
147
147
 
148
148
  /**
149
- * ACH deposit instructions for this wallet, when available
149
+ * ACH deposit-instruction metadata for this wallet, when available
150
150
  */
151
151
  export interface DepositInstructions {
152
- /**
153
- * Account number for ACH deposits
154
- */
155
- accountNumber: string;
156
-
157
152
  /**
158
153
  * Name of the receiving bank
159
154
  */
160
155
  bankName: string;
161
-
162
- /**
163
- * Bank routing number for ACH deposits
164
- */
165
- routingNumber: string;
166
156
  }
167
157
  }
168
158
 
@@ -259,7 +249,7 @@ export namespace WalletGetResponse {
259
249
  claims: Attributes.Claims;
260
250
 
261
251
  /**
262
- * ACH deposit instructions for this wallet, when available
252
+ * ACH deposit-instruction metadata for this wallet, when available
263
253
  */
264
254
  depositInstructions: Attributes.DepositInstructions | null;
265
255
 
@@ -306,23 +296,13 @@ export namespace WalletGetResponse {
306
296
  }
307
297
 
308
298
  /**
309
- * ACH deposit instructions for this wallet, when available
299
+ * ACH deposit-instruction metadata for this wallet, when available
310
300
  */
311
301
  export interface DepositInstructions {
312
- /**
313
- * Account number for ACH deposits
314
- */
315
- accountNumber: string;
316
-
317
302
  /**
318
303
  * Name of the receiving bank
319
304
  */
320
305
  bankName: string;
321
-
322
- /**
323
- * Bank routing number for ACH deposits
324
- */
325
- routingNumber: string;
326
306
  }
327
307
  }
328
308
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.10.0'; // x-release-please-version
1
+ export const VERSION = '0.12.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.10.0";
1
+ export declare const VERSION = "0.12.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.10.0";
1
+ export declare const VERSION = "0.12.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.10.0'; // x-release-please-version
4
+ exports.VERSION = '0.12.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.10.0'; // x-release-please-version
1
+ export const VERSION = '0.12.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map