@naturalpay/sdk 0.2.0 → 0.2.1
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 +119 -0
- package/LICENSE +7 -0
- package/README.md +340 -26
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +255 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +255 -0
- package/client.d.ts.map +1 -0
- package/client.js +548 -0
- package/client.js.map +1 -0
- package/client.mjs +544 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +6 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/index.js +30 -0
- package/index.js.map +1 -0
- package/index.mjs +7 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +40 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +37 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +87 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +81 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +10 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +8 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +8 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +12 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +9 -0
- package/internal/utils.mjs.map +1 -0
- package/lib/envelope.d.mts +4 -0
- package/lib/envelope.d.mts.map +1 -0
- package/lib/envelope.d.ts +4 -0
- package/lib/envelope.d.ts.map +1 -0
- package/lib/envelope.js +43 -0
- package/lib/envelope.js.map +1 -0
- package/lib/envelope.mjs +39 -0
- package/lib/envelope.mjs.map +1 -0
- package/package.json +142 -76
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/agents.d.mts +1392 -0
- package/resources/agents.d.mts.map +1 -0
- package/resources/agents.d.ts +1392 -0
- package/resources/agents.d.ts.map +1 -0
- package/resources/agents.js +192 -0
- package/resources/agents.js.map +1 -0
- package/resources/agents.mjs +188 -0
- package/resources/agents.mjs.map +1 -0
- package/resources/api-keys.d.mts +539 -0
- package/resources/api-keys.d.mts.map +1 -0
- package/resources/api-keys.d.ts +539 -0
- package/resources/api-keys.d.ts.map +1 -0
- package/resources/api-keys.js +100 -0
- package/resources/api-keys.js.map +1 -0
- package/resources/api-keys.mjs +96 -0
- package/resources/api-keys.mjs.map +1 -0
- package/resources/counterparties.d.mts +139 -0
- package/resources/counterparties.d.mts.map +1 -0
- package/resources/counterparties.d.ts +139 -0
- package/resources/counterparties.d.ts.map +1 -0
- package/resources/counterparties.js +32 -0
- package/resources/counterparties.js.map +1 -0
- package/resources/counterparties.mjs +28 -0
- package/resources/counterparties.mjs.map +1 -0
- package/resources/customers.d.mts +272 -0
- package/resources/customers.d.mts.map +1 -0
- package/resources/customers.d.ts +272 -0
- package/resources/customers.d.ts.map +1 -0
- package/resources/customers.js +48 -0
- package/resources/customers.js.map +1 -0
- package/resources/customers.mjs +44 -0
- package/resources/customers.mjs.map +1 -0
- package/resources/delegations.d.mts +458 -0
- package/resources/delegations.d.mts.map +1 -0
- package/resources/delegations.d.ts +458 -0
- package/resources/delegations.d.ts.map +1 -0
- package/resources/delegations.js +47 -0
- package/resources/delegations.js.map +1 -0
- package/resources/delegations.mjs +43 -0
- package/resources/delegations.mjs.map +1 -0
- package/resources/index.d.mts +12 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +12 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +27 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +13 -0
- package/resources/index.mjs.map +1 -0
- package/resources/invitations.d.mts +304 -0
- package/resources/invitations.d.mts.map +1 -0
- package/resources/invitations.d.ts +304 -0
- package/resources/invitations.d.ts.map +1 -0
- package/resources/invitations.js +85 -0
- package/resources/invitations.js.map +1 -0
- package/resources/invitations.mjs +81 -0
- package/resources/invitations.mjs.map +1 -0
- package/resources/parties.d.mts +364 -0
- package/resources/parties.d.mts.map +1 -0
- package/resources/parties.d.ts +364 -0
- package/resources/parties.d.ts.map +1 -0
- package/resources/parties.js +78 -0
- package/resources/parties.js.map +1 -0
- package/resources/parties.mjs +74 -0
- package/resources/parties.mjs.map +1 -0
- package/resources/payment-requests.d.mts +442 -0
- package/resources/payment-requests.d.mts.map +1 -0
- package/resources/payment-requests.d.ts +442 -0
- package/resources/payment-requests.d.ts.map +1 -0
- package/resources/payment-requests.js +87 -0
- package/resources/payment-requests.js.map +1 -0
- package/resources/payment-requests.mjs +83 -0
- package/resources/payment-requests.mjs.map +1 -0
- package/resources/payments.d.mts +174 -0
- package/resources/payments.d.mts.map +1 -0
- package/resources/payments.d.ts +174 -0
- package/resources/payments.d.ts.map +1 -0
- package/resources/payments.js +40 -0
- package/resources/payments.js.map +1 -0
- package/resources/payments.mjs +36 -0
- package/resources/payments.mjs.map +1 -0
- package/resources/transactions.d.mts +478 -0
- package/resources/transactions.d.mts.map +1 -0
- package/resources/transactions.d.ts +478 -0
- package/resources/transactions.d.ts.map +1 -0
- package/resources/transactions.js +48 -0
- package/resources/transactions.js.map +1 -0
- package/resources/transactions.mjs +44 -0
- package/resources/transactions.mjs.map +1 -0
- package/resources/wallet.d.mts +628 -0
- package/resources/wallet.d.mts.map +1 -0
- package/resources/wallet.d.ts +628 -0
- package/resources/wallet.d.ts.map +1 -0
- package/resources/wallet.js +161 -0
- package/resources/wallet.js.map +1 -0
- package/resources/wallet.mjs +157 -0
- package/resources/wallet.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +1020 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +22 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +56 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/internal/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +93 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +128 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/query.ts +7 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +9 -0
- package/src/lib/.keep +4 -0
- package/src/lib/envelope.ts +32 -0
- package/src/resource.ts +2 -0
- package/src/resources/agents.ts +1785 -0
- package/src/resources/api-keys.ts +743 -0
- package/src/resources/counterparties.ts +187 -0
- package/src/resources/customers.ts +365 -0
- package/src/resources/delegations.ts +580 -0
- package/src/resources/index.ts +95 -0
- package/src/resources/invitations.ts +414 -0
- package/src/resources/parties.ts +493 -0
- package/src/resources/payment-requests.ts +601 -0
- package/src/resources/payments.ts +228 -0
- package/src/resources/transactions.ts +610 -0
- package/src/resources/wallet.ts +864 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
- package/dist/index.cjs +0 -1737
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -929
- package/dist/index.d.ts +0 -929
- package/dist/index.js +0 -1705
- package/dist/index.js.map +0 -1
- package/dist/mcp/cli.cjs +0 -166
- package/dist/mcp/cli.cjs.map +0 -1
- package/dist/mcp/cli.d.cts +0 -1
- package/dist/mcp/cli.d.ts +0 -1
- package/dist/mcp/cli.js +0 -164
- package/dist/mcp/cli.js.map +0 -1
- package/dist/mcp/index.cjs +0 -8
- package/dist/mcp/index.cjs.map +0 -1
- package/dist/mcp/index.d.cts +0 -9
- package/dist/mcp/index.d.ts +0 -9
- package/dist/mcp/index.js +0 -6
- package/dist/mcp/index.js.map +0 -1
|
@@ -0,0 +1,610 @@
|
|
|
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
|
+
* Payment and transaction operations
|
|
11
|
+
*/
|
|
12
|
+
export class Transactions extends APIResource {
|
|
13
|
+
/**
|
|
14
|
+
* List transactions visible to the authenticated party and its delegated agents.
|
|
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 ?? {};
|
|
21
|
+
return this._client.get('/transactions', {
|
|
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
|
+
* Get a single transaction visible to the authenticated party.
|
|
36
|
+
*/
|
|
37
|
+
get(
|
|
38
|
+
transactionID: string,
|
|
39
|
+
params: TransactionGetParams | null | undefined = {},
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): APIPromise<TransactionGetResponse> {
|
|
42
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
|
|
43
|
+
return this._client.get(path`/transactions/${transactionID}`, {
|
|
44
|
+
query,
|
|
45
|
+
...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
|
+
]),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface TransactionListResponse {
|
|
58
|
+
data: Array<TransactionListResponse.Data>;
|
|
59
|
+
|
|
60
|
+
meta: TransactionListResponse.Meta;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export namespace TransactionListResponse {
|
|
64
|
+
export interface Data {
|
|
65
|
+
/**
|
|
66
|
+
* Transaction handle (txn_xxx)
|
|
67
|
+
*/
|
|
68
|
+
id: string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Resource attributes
|
|
72
|
+
*/
|
|
73
|
+
attributes: Data.Attributes;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Resource relationships
|
|
77
|
+
*/
|
|
78
|
+
relationships: Data.Relationships;
|
|
79
|
+
|
|
80
|
+
type: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export namespace Data {
|
|
84
|
+
/**
|
|
85
|
+
* Resource attributes
|
|
86
|
+
*/
|
|
87
|
+
export interface Attributes {
|
|
88
|
+
/**
|
|
89
|
+
* Agent that initiated this transaction. Null when initiated by a human user.
|
|
90
|
+
*/
|
|
91
|
+
agentId: string | null;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Amount in cents
|
|
95
|
+
*/
|
|
96
|
+
amount: number;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Classification from the authenticated party's perspective. Derived from
|
|
100
|
+
* transactionType + direction: "sent"/"received" for wallet-to-wallet payments
|
|
101
|
+
* (OUTBOUND/INBOUND), "deposit"/"withdrawal" for external transfers
|
|
102
|
+
* (INBOUND/OUTBOUND).
|
|
103
|
+
*/
|
|
104
|
+
category: 'sent' | 'received' | 'deposit' | 'withdrawal';
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* When this transaction was created
|
|
108
|
+
*/
|
|
109
|
+
createdAt: string;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Currency code
|
|
113
|
+
*/
|
|
114
|
+
currency: string;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Customer name if delegated
|
|
118
|
+
*/
|
|
119
|
+
customerName: string | null;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Payment description
|
|
123
|
+
*/
|
|
124
|
+
description: string | null;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Direction: INBOUND | OUTBOUND
|
|
128
|
+
*/
|
|
129
|
+
direction: 'INBOUND' | 'OUTBOUND';
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Active dispute ID when a dispute has been filed for this transaction
|
|
133
|
+
*/
|
|
134
|
+
disputeId: string | null;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Pending escalation ID when this transaction requires approval
|
|
138
|
+
*/
|
|
139
|
+
escalationId: string | null;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Display name of the user or agent that initiated this transaction
|
|
143
|
+
*/
|
|
144
|
+
initiatorName: string | null;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* True if this is a delegated customer payment
|
|
148
|
+
*/
|
|
149
|
+
isDelegated: boolean;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Recipient display name
|
|
153
|
+
*/
|
|
154
|
+
recipientName: string | null;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Sender display name
|
|
158
|
+
*/
|
|
159
|
+
senderName: string | null;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Transaction status
|
|
163
|
+
*/
|
|
164
|
+
status: string;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Transaction type: payment | transfer
|
|
168
|
+
*/
|
|
169
|
+
transactionType: 'payment' | 'transfer';
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* When this transaction was last updated
|
|
173
|
+
*/
|
|
174
|
+
updatedAt: string | null;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Resource relationships
|
|
179
|
+
*/
|
|
180
|
+
export interface Relationships {
|
|
181
|
+
/**
|
|
182
|
+
* Destination party
|
|
183
|
+
*/
|
|
184
|
+
destinationParty: Relationships.DestinationParty;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Destination wallet
|
|
188
|
+
*/
|
|
189
|
+
destinationWallet: Relationships.DestinationWallet;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Source party
|
|
193
|
+
*/
|
|
194
|
+
sourceParty: Relationships.SourceParty;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Source wallet
|
|
198
|
+
*/
|
|
199
|
+
sourceWallet: Relationships.SourceWallet;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export namespace Relationships {
|
|
203
|
+
/**
|
|
204
|
+
* Destination party
|
|
205
|
+
*/
|
|
206
|
+
export interface DestinationParty {
|
|
207
|
+
/**
|
|
208
|
+
* Related resource identifier
|
|
209
|
+
*/
|
|
210
|
+
data: DestinationParty.Data | null;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export namespace DestinationParty {
|
|
214
|
+
/**
|
|
215
|
+
* Related resource identifier
|
|
216
|
+
*/
|
|
217
|
+
export interface Data {
|
|
218
|
+
id: string;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Resource type
|
|
222
|
+
*/
|
|
223
|
+
type: string;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Destination wallet
|
|
229
|
+
*/
|
|
230
|
+
export interface DestinationWallet {
|
|
231
|
+
/**
|
|
232
|
+
* Related resource identifier
|
|
233
|
+
*/
|
|
234
|
+
data: DestinationWallet.Data | null;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export namespace DestinationWallet {
|
|
238
|
+
/**
|
|
239
|
+
* Related resource identifier
|
|
240
|
+
*/
|
|
241
|
+
export interface Data {
|
|
242
|
+
id: string;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Resource type
|
|
246
|
+
*/
|
|
247
|
+
type: string;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Source party
|
|
253
|
+
*/
|
|
254
|
+
export interface SourceParty {
|
|
255
|
+
/**
|
|
256
|
+
* Related resource identifier
|
|
257
|
+
*/
|
|
258
|
+
data: SourceParty.Data | null;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export namespace SourceParty {
|
|
262
|
+
/**
|
|
263
|
+
* Related resource identifier
|
|
264
|
+
*/
|
|
265
|
+
export interface Data {
|
|
266
|
+
id: string;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Resource type
|
|
270
|
+
*/
|
|
271
|
+
type: string;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Source wallet
|
|
277
|
+
*/
|
|
278
|
+
export interface SourceWallet {
|
|
279
|
+
/**
|
|
280
|
+
* Related resource identifier
|
|
281
|
+
*/
|
|
282
|
+
data: SourceWallet.Data | null;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export namespace SourceWallet {
|
|
286
|
+
/**
|
|
287
|
+
* Related resource identifier
|
|
288
|
+
*/
|
|
289
|
+
export interface Data {
|
|
290
|
+
id: string;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Resource type
|
|
294
|
+
*/
|
|
295
|
+
type: string;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export interface Meta {
|
|
302
|
+
pagination: Meta.Pagination;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export namespace Meta {
|
|
306
|
+
export interface Pagination {
|
|
307
|
+
hasMore: boolean;
|
|
308
|
+
|
|
309
|
+
nextCursor: string | null;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
export interface TransactionGetResponse {
|
|
315
|
+
data: TransactionGetResponse.Data;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export namespace TransactionGetResponse {
|
|
319
|
+
export interface Data {
|
|
320
|
+
/**
|
|
321
|
+
* Transaction handle (txn_xxx)
|
|
322
|
+
*/
|
|
323
|
+
id: string;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Resource attributes
|
|
327
|
+
*/
|
|
328
|
+
attributes: Data.Attributes;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Resource relationships
|
|
332
|
+
*/
|
|
333
|
+
relationships: Data.Relationships;
|
|
334
|
+
|
|
335
|
+
type: string;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export namespace Data {
|
|
339
|
+
/**
|
|
340
|
+
* Resource attributes
|
|
341
|
+
*/
|
|
342
|
+
export interface Attributes {
|
|
343
|
+
/**
|
|
344
|
+
* Agent that initiated this transaction. Null when initiated by a human user.
|
|
345
|
+
*/
|
|
346
|
+
agentId: string | null;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Amount in cents
|
|
350
|
+
*/
|
|
351
|
+
amount: number;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Classification from the authenticated party's perspective. Derived from
|
|
355
|
+
* transactionType + direction: "sent"/"received" for wallet-to-wallet payments
|
|
356
|
+
* (OUTBOUND/INBOUND), "deposit"/"withdrawal" for external transfers
|
|
357
|
+
* (INBOUND/OUTBOUND).
|
|
358
|
+
*/
|
|
359
|
+
category: 'sent' | 'received' | 'deposit' | 'withdrawal';
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* When this transaction was created
|
|
363
|
+
*/
|
|
364
|
+
createdAt: string;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Currency code
|
|
368
|
+
*/
|
|
369
|
+
currency: string;
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Customer name if delegated
|
|
373
|
+
*/
|
|
374
|
+
customerName: string | null;
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Payment description
|
|
378
|
+
*/
|
|
379
|
+
description: string | null;
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Direction: INBOUND | OUTBOUND
|
|
383
|
+
*/
|
|
384
|
+
direction: 'INBOUND' | 'OUTBOUND';
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Active dispute ID when a dispute has been filed for this transaction
|
|
388
|
+
*/
|
|
389
|
+
disputeId: string | null;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Pending escalation ID when this transaction requires approval
|
|
393
|
+
*/
|
|
394
|
+
escalationId: string | null;
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Display name of the user or agent that initiated this transaction
|
|
398
|
+
*/
|
|
399
|
+
initiatorName: string | null;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* True if this is a delegated customer payment
|
|
403
|
+
*/
|
|
404
|
+
isDelegated: boolean;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Recipient display name
|
|
408
|
+
*/
|
|
409
|
+
recipientName: string | null;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Sender display name
|
|
413
|
+
*/
|
|
414
|
+
senderName: string | null;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Transaction status
|
|
418
|
+
*/
|
|
419
|
+
status: string;
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Transaction type: payment | transfer
|
|
423
|
+
*/
|
|
424
|
+
transactionType: 'payment' | 'transfer';
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* When this transaction was last updated
|
|
428
|
+
*/
|
|
429
|
+
updatedAt: string | null;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Resource relationships
|
|
434
|
+
*/
|
|
435
|
+
export interface Relationships {
|
|
436
|
+
/**
|
|
437
|
+
* Destination party
|
|
438
|
+
*/
|
|
439
|
+
destinationParty: Relationships.DestinationParty;
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Destination wallet
|
|
443
|
+
*/
|
|
444
|
+
destinationWallet: Relationships.DestinationWallet;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Source party
|
|
448
|
+
*/
|
|
449
|
+
sourceParty: Relationships.SourceParty;
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Source wallet
|
|
453
|
+
*/
|
|
454
|
+
sourceWallet: Relationships.SourceWallet;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
export namespace Relationships {
|
|
458
|
+
/**
|
|
459
|
+
* Destination party
|
|
460
|
+
*/
|
|
461
|
+
export interface DestinationParty {
|
|
462
|
+
/**
|
|
463
|
+
* Related resource identifier
|
|
464
|
+
*/
|
|
465
|
+
data: DestinationParty.Data | null;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export namespace DestinationParty {
|
|
469
|
+
/**
|
|
470
|
+
* Related resource identifier
|
|
471
|
+
*/
|
|
472
|
+
export interface Data {
|
|
473
|
+
id: string;
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Resource type
|
|
477
|
+
*/
|
|
478
|
+
type: string;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Destination wallet
|
|
484
|
+
*/
|
|
485
|
+
export interface DestinationWallet {
|
|
486
|
+
/**
|
|
487
|
+
* Related resource identifier
|
|
488
|
+
*/
|
|
489
|
+
data: DestinationWallet.Data | null;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
export namespace DestinationWallet {
|
|
493
|
+
/**
|
|
494
|
+
* Related resource identifier
|
|
495
|
+
*/
|
|
496
|
+
export interface Data {
|
|
497
|
+
id: string;
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Resource type
|
|
501
|
+
*/
|
|
502
|
+
type: string;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Source party
|
|
508
|
+
*/
|
|
509
|
+
export interface SourceParty {
|
|
510
|
+
/**
|
|
511
|
+
* Related resource identifier
|
|
512
|
+
*/
|
|
513
|
+
data: SourceParty.Data | null;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
export namespace SourceParty {
|
|
517
|
+
/**
|
|
518
|
+
* Related resource identifier
|
|
519
|
+
*/
|
|
520
|
+
export interface Data {
|
|
521
|
+
id: string;
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* Resource type
|
|
525
|
+
*/
|
|
526
|
+
type: string;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Source wallet
|
|
532
|
+
*/
|
|
533
|
+
export interface SourceWallet {
|
|
534
|
+
/**
|
|
535
|
+
* Related resource identifier
|
|
536
|
+
*/
|
|
537
|
+
data: SourceWallet.Data | null;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
export namespace SourceWallet {
|
|
541
|
+
/**
|
|
542
|
+
* Related resource identifier
|
|
543
|
+
*/
|
|
544
|
+
export interface Data {
|
|
545
|
+
id: string;
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Resource type
|
|
549
|
+
*/
|
|
550
|
+
type: string;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
export interface TransactionListParams {
|
|
558
|
+
/**
|
|
559
|
+
* Query param: Pagination cursor from previous response
|
|
560
|
+
*/
|
|
561
|
+
cursor?: string;
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Query param: Results per page
|
|
565
|
+
*/
|
|
566
|
+
limit?: number;
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* Query param
|
|
570
|
+
*/
|
|
571
|
+
type?: 'payment' | 'transfer' | 'all';
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
575
|
+
*/
|
|
576
|
+
'X-Agent-ID'?: string;
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
580
|
+
* for agent observability.
|
|
581
|
+
*/
|
|
582
|
+
'X-Instance-ID'?: string;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
export interface TransactionGetParams {
|
|
586
|
+
/**
|
|
587
|
+
* Query param: Party ID for delegated transaction lookup
|
|
588
|
+
*/
|
|
589
|
+
partyId?: string;
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
593
|
+
*/
|
|
594
|
+
'X-Agent-ID'?: string;
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
598
|
+
* for agent observability.
|
|
599
|
+
*/
|
|
600
|
+
'X-Instance-ID'?: string;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
export declare namespace Transactions {
|
|
604
|
+
export {
|
|
605
|
+
type TransactionListResponse as TransactionListResponse,
|
|
606
|
+
type TransactionGetResponse as TransactionGetResponse,
|
|
607
|
+
type TransactionListParams as TransactionListParams,
|
|
608
|
+
type TransactionGetParams as TransactionGetParams,
|
|
609
|
+
};
|
|
610
|
+
}
|