@circle-fin/daa-react-native-sdk 0.0.0-stage → 0.5.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/DaaReactNativeSdk.podspec +69 -0
- package/LICENSE +176 -0
- package/README.md +691 -2
- package/android/build.gradle +102 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/com/circle/daa/reactnative/DaaRegistrationExceptions.kt +47 -0
- package/android/src/main/java/com/circle/daa/reactnative/DaaRegistrationModule.kt +104 -0
- package/android/src/main/java/com/circle/daa/reactnative/DaaScaExceptions.kt +60 -0
- package/android/src/main/java/com/circle/daa/reactnative/DaaScaModule.kt +179 -0
- package/android/src/main/java/com/circle/daa/reactnative/DaaSecureKeyExceptions.kt +107 -0
- package/android/src/main/java/com/circle/daa/reactnative/DaaSecureKeyModule.kt +318 -0
- package/android/src/main/java/com/circle/daa/reactnative/InstallationIdentityStore.kt +122 -0
- package/android/src/main/java/com/circle/daa/reactnative/UnpaddedBase64Url.kt +45 -0
- package/build/DaaClient.d.ts +237 -0
- package/build/DaaClient.js +442 -0
- package/build/api/AccountLimitsClient.d.ts +79 -0
- package/build/api/AccountLimitsClient.js +142 -0
- package/build/api/AccountsClient.d.ts +98 -0
- package/build/api/AccountsClient.js +279 -0
- package/build/api/AchFiatAccountsClient.d.ts +92 -0
- package/build/api/AchFiatAccountsClient.js +142 -0
- package/build/api/AuthClient.d.ts +95 -0
- package/build/api/AuthClient.js +221 -0
- package/build/api/ContractExecutionsClient.d.ts +114 -0
- package/build/api/ContractExecutionsClient.js +462 -0
- package/build/api/DaaUserClient.d.ts +187 -0
- package/build/api/DaaUserClient.js +312 -0
- package/build/api/DepositAddressesClient.d.ts +112 -0
- package/build/api/DepositAddressesClient.js +222 -0
- package/build/api/DepositsClient.d.ts +106 -0
- package/build/api/DepositsClient.js +183 -0
- package/build/api/FiatAccountsClient.d.ts +43 -0
- package/build/api/FiatAccountsClient.js +46 -0
- package/build/api/TransactionsClient.d.ts +64 -0
- package/build/api/TransactionsClient.js +121 -0
- package/build/api/TransfersClient.d.ts +107 -0
- package/build/api/TransfersClient.js +324 -0
- package/build/api/WireFiatAccountsClient.d.ts +99 -0
- package/build/api/WireFiatAccountsClient.js +156 -0
- package/build/api/WithdrawalsClient.d.ts +97 -0
- package/build/api/WithdrawalsClient.js +308 -0
- package/build/api/deviceApproval.d.ts +48 -0
- package/build/api/deviceApproval.js +247 -0
- package/build/api/deviceStatus.d.ts +61 -0
- package/build/api/deviceStatus.js +216 -0
- package/build/api/loginFailure.d.ts +51 -0
- package/build/api/loginFailure.js +95 -0
- package/build/api/pagination.d.ts +29 -0
- package/build/api/pagination.js +50 -0
- package/build/api/queryParameters.d.ts +23 -0
- package/build/api/queryParameters.js +77 -0
- package/build/api/resourceRequest.d.ts +60 -0
- package/build/api/resourceRequest.js +79 -0
- package/build/api/signedResource.d.ts +124 -0
- package/build/api/signedResource.js +267 -0
- package/build/auth/RegistrationFlowKey.d.ts +93 -0
- package/build/auth/RegistrationFlowKey.js +203 -0
- package/build/auth/daaRegistrationNative.d.ts +58 -0
- package/build/auth/daaRegistrationNative.js +158 -0
- package/build/auth/deviceAuthorization.d.ts +87 -0
- package/build/auth/deviceAuthorization.js +295 -0
- package/build/auth/ownerGrant.d.ts +29 -0
- package/build/auth/ownerGrant.js +90 -0
- package/build/auth/registrationAuthorization.d.ts +48 -0
- package/build/auth/registrationAuthorization.js +246 -0
- package/build/auth/registrationCodeVerifier.d.ts +31 -0
- package/build/auth/registrationCodeVerifier.js +75 -0
- package/build/config.d.ts +106 -0
- package/build/config.js +131 -0
- package/build/crypto/base64url.d.ts +26 -0
- package/build/crypto/base64url.js +87 -0
- package/build/crypto/bytes.d.ts +27 -0
- package/build/crypto/bytes.js +32 -0
- package/build/crypto/jwkThumbprint.d.ts +32 -0
- package/build/crypto/jwkThumbprint.js +49 -0
- package/build/crypto/matchingCode.d.ts +47 -0
- package/build/crypto/matchingCode.js +93 -0
- package/build/crypto/random.d.ts +35 -0
- package/build/crypto/random.js +106 -0
- package/build/crypto/serialization.d.ts +26 -0
- package/build/crypto/serialization.js +43 -0
- package/build/crypto/sha256.d.ts +18 -0
- package/build/crypto/sha256.js +100 -0
- package/build/errors.d.ts +307 -0
- package/build/errors.js +413 -0
- package/build/index.d.ts +69 -0
- package/build/index.js +67 -0
- package/build/models/Account.d.ts +201 -0
- package/build/models/Account.js +147 -0
- package/build/models/AccountLimitsUsage.d.ts +169 -0
- package/build/models/AccountLimitsUsage.js +86 -0
- package/build/models/Ach.d.ts +135 -0
- package/build/models/Ach.js +184 -0
- package/build/models/AddressObject.d.ts +128 -0
- package/build/models/AddressObject.js +141 -0
- package/build/models/BusinessPii.d.ts +84 -0
- package/build/models/BusinessPii.js +142 -0
- package/build/models/ContractExecution.d.ts +197 -0
- package/build/models/ContractExecution.js +130 -0
- package/build/models/CreateAccountRequest.d.ts +74 -0
- package/build/models/CreateAccountRequest.js +19 -0
- package/build/models/CreateContractExecutionRequest.d.ts +81 -0
- package/build/models/CreateContractExecutionRequest.js +19 -0
- package/build/models/CreateTransferRequest.d.ts +91 -0
- package/build/models/CreateTransferRequest.js +19 -0
- package/build/models/CreateWithdrawalRequest.d.ts +99 -0
- package/build/models/CreateWithdrawalRequest.js +19 -0
- package/build/models/DaaUserContext.d.ts +146 -0
- package/build/models/DaaUserContext.js +164 -0
- package/build/models/Deposit.d.ts +241 -0
- package/build/models/Deposit.js +149 -0
- package/build/models/DepositSummary.d.ts +91 -0
- package/build/models/DepositSummary.js +114 -0
- package/build/models/DeviceStatus.d.ts +69 -0
- package/build/models/DeviceStatus.js +19 -0
- package/build/models/FiatAccount.d.ts +99 -0
- package/build/models/FiatAccount.js +151 -0
- package/build/models/GenerateAddressRequest.d.ts +67 -0
- package/build/models/GenerateAddressRequest.js +68 -0
- package/build/models/Money.d.ts +76 -0
- package/build/models/Money.js +99 -0
- package/build/models/Page.d.ts +33 -0
- package/build/models/Page.js +57 -0
- package/build/models/PendingDeviceApproval.d.ts +121 -0
- package/build/models/PendingDeviceApproval.js +208 -0
- package/build/models/PendingDeviceRegistration.d.ts +229 -0
- package/build/models/PendingDeviceRegistration.js +636 -0
- package/build/models/PreparedContractExecution.d.ts +70 -0
- package/build/models/PreparedContractExecution.js +77 -0
- package/build/models/PreparedSocialLogin.d.ts +148 -0
- package/build/models/PreparedSocialLogin.js +252 -0
- package/build/models/Transaction.d.ts +233 -0
- package/build/models/Transaction.js +182 -0
- package/build/models/Transfer.d.ts +335 -0
- package/build/models/Transfer.js +240 -0
- package/build/models/Wire.d.ts +213 -0
- package/build/models/Wire.js +264 -0
- package/build/models/Withdrawal.d.ts +201 -0
- package/build/models/Withdrawal.js +156 -0
- package/build/models/codeSecrets.d.ts +100 -0
- package/build/models/codeSecrets.js +321 -0
- package/build/models/redaction.d.ts +18 -0
- package/build/models/redaction.js +23 -0
- package/build/sca/ScaClient.d.ts +105 -0
- package/build/sca/ScaClient.js +193 -0
- package/build/securekey/InMemorySecureKey.d.ts +25 -0
- package/build/securekey/InMemorySecureKey.js +168 -0
- package/build/securekey/NativeSecureKey.d.ts +26 -0
- package/build/securekey/NativeSecureKey.js +355 -0
- package/build/securekey/NativeSecureKeyBridge.d.ts +151 -0
- package/build/securekey/NativeSecureKeyBridge.js +19 -0
- package/build/securekey/SecureKey.d.ts +257 -0
- package/build/securekey/SecureKey.js +19 -0
- package/build/securekey/alias.d.ts +97 -0
- package/build/securekey/alias.js +184 -0
- package/build/securekey/ownerAuthKeyResolver.d.ts +73 -0
- package/build/securekey/ownerAuthKeyResolver.js +78 -0
- package/build/securekey/registration.d.ts +19 -0
- package/build/securekey/registration.js +38 -0
- package/build/securekey/resolveNativeBridge.d.ts +33 -0
- package/build/securekey/resolveNativeBridge.js +201 -0
- package/build/testing.d.ts +18 -0
- package/build/testing.js +34 -0
- package/build/transport/DaaTransport.d.ts +35 -0
- package/build/transport/DaaTransport.js +19 -0
- package/build/transport/headers.d.ts +41 -0
- package/build/transport/headers.js +81 -0
- package/build/validation/requestBody.d.ts +27 -0
- package/build/validation/requestBody.js +56 -0
- package/build/validation/uuid.d.ts +25 -0
- package/build/validation/uuid.js +33 -0
- package/build/wire/accountLimitsUsagePayload.d.ts +30 -0
- package/build/wire/accountLimitsUsagePayload.js +130 -0
- package/build/wire/accountPayload.d.ts +36 -0
- package/build/wire/accountPayload.js +100 -0
- package/build/wire/achPayload.d.ts +24 -0
- package/build/wire/achPayload.js +82 -0
- package/build/wire/addressObjectPayload.d.ts +44 -0
- package/build/wire/addressObjectPayload.js +64 -0
- package/build/wire/contractExecutionPayload.d.ts +24 -0
- package/build/wire/contractExecutionPayload.js +130 -0
- package/build/wire/daaStatusCodes.d.ts +81 -0
- package/build/wire/daaStatusCodes.js +86 -0
- package/build/wire/dataEnvelope.d.ts +40 -0
- package/build/wire/dataEnvelope.js +79 -0
- package/build/wire/depositPayload.d.ts +42 -0
- package/build/wire/depositPayload.js +159 -0
- package/build/wire/deviceContextPayload.d.ts +35 -0
- package/build/wire/deviceContextPayload.js +59 -0
- package/build/wire/deviceRegistrationResultPayload.d.ts +77 -0
- package/build/wire/deviceRegistrationResultPayload.js +162 -0
- package/build/wire/deviceStatusPayload.d.ts +20 -0
- package/build/wire/deviceStatusPayload.js +66 -0
- package/build/wire/errorEnvelope.d.ts +43 -0
- package/build/wire/errorEnvelope.js +85 -0
- package/build/wire/fiatAccountPayload.d.ts +37 -0
- package/build/wire/fiatAccountPayload.js +93 -0
- package/build/wire/instant.d.ts +27 -0
- package/build/wire/instant.js +94 -0
- package/build/wire/jsonNumber.d.ts +30 -0
- package/build/wire/jsonNumber.js +34 -0
- package/build/wire/moneyPayload.d.ts +30 -0
- package/build/wire/moneyPayload.js +56 -0
- package/build/wire/paginationLinks.d.ts +28 -0
- package/build/wire/paginationLinks.js +167 -0
- package/build/wire/payload.d.ts +60 -0
- package/build/wire/payload.js +121 -0
- package/build/wire/pendingRegistrationPayload.d.ts +48 -0
- package/build/wire/pendingRegistrationPayload.js +72 -0
- package/build/wire/socialLoginRequestPayload.d.ts +26 -0
- package/build/wire/socialLoginRequestPayload.js +55 -0
- package/build/wire/transactionPayload.d.ts +31 -0
- package/build/wire/transactionPayload.js +149 -0
- package/build/wire/transferPayload.d.ts +43 -0
- package/build/wire/transferPayload.js +218 -0
- package/build/wire/wireEnums.d.ts +22 -0
- package/build/wire/wireEnums.js +69 -0
- package/build/wire/wirePayload.d.ts +29 -0
- package/build/wire/wirePayload.js +138 -0
- package/build/wire/withdrawalPayload.d.ts +27 -0
- package/build/wire/withdrawalPayload.js +179 -0
- package/expo-module.config.json +14 -0
- package/ios/DaaRegistrationExceptions.swift +58 -0
- package/ios/DaaRegistrationModule.swift +125 -0
- package/ios/DaaScaExceptions.swift +96 -0
- package/ios/DaaScaModule.swift +125 -0
- package/ios/DaaSecureKeyExceptions.swift +125 -0
- package/ios/DaaSecureKeyModule.swift +306 -0
- package/ios/InstallationIdentityStore.swift +162 -0
- package/ios/UnpaddedBase64URL.swift +42 -0
- package/package.json +114 -4
- package/src/DaaClient.ts +509 -0
- package/src/api/AccountLimitsClient.ts +146 -0
- package/src/api/AccountsClient.ts +308 -0
- package/src/api/AchFiatAccountsClient.ts +147 -0
- package/src/api/AuthClient.ts +266 -0
- package/src/api/ContractExecutionsClient.ts +527 -0
- package/src/api/DaaUserClient.ts +345 -0
- package/src/api/DepositAddressesClient.ts +239 -0
- package/src/api/DepositsClient.ts +208 -0
- package/src/api/FiatAccountsClient.ts +50 -0
- package/src/api/TransactionsClient.ts +138 -0
- package/src/api/TransfersClient.ts +364 -0
- package/src/api/WireFiatAccountsClient.ts +172 -0
- package/src/api/WithdrawalsClient.ts +342 -0
- package/src/api/deviceApproval.ts +306 -0
- package/src/api/deviceStatus.ts +238 -0
- package/src/api/loginFailure.ts +112 -0
- package/src/api/pagination.ts +63 -0
- package/src/api/queryParameters.ts +82 -0
- package/src/api/resourceRequest.ts +135 -0
- package/src/api/signedResource.ts +427 -0
- package/src/auth/RegistrationFlowKey.ts +274 -0
- package/src/auth/daaRegistrationNative.ts +191 -0
- package/src/auth/deviceAuthorization.ts +365 -0
- package/src/auth/ownerGrant.ts +102 -0
- package/src/auth/registrationAuthorization.ts +309 -0
- package/src/auth/registrationCodeVerifier.ts +76 -0
- package/src/config.ts +192 -0
- package/src/crypto/base64url.ts +88 -0
- package/src/crypto/bytes.ts +30 -0
- package/src/crypto/jwkThumbprint.ts +65 -0
- package/src/crypto/matchingCode.ts +100 -0
- package/src/crypto/random.ts +113 -0
- package/src/crypto/serialization.ts +42 -0
- package/src/crypto/sha256.ts +105 -0
- package/src/errors.ts +576 -0
- package/src/index.ts +258 -0
- package/src/models/Account.ts +264 -0
- package/src/models/AccountLimitsUsage.ts +192 -0
- package/src/models/Ach.ts +269 -0
- package/src/models/AddressObject.ts +169 -0
- package/src/models/BusinessPii.ts +154 -0
- package/src/models/ContractExecution.ts +250 -0
- package/src/models/CreateAccountRequest.ts +109 -0
- package/src/models/CreateContractExecutionRequest.ts +100 -0
- package/src/models/CreateTransferRequest.ts +114 -0
- package/src/models/CreateWithdrawalRequest.ts +120 -0
- package/src/models/DaaUserContext.ts +228 -0
- package/src/models/Deposit.ts +307 -0
- package/src/models/DepositSummary.ts +142 -0
- package/src/models/DeviceStatus.ts +50 -0
- package/src/models/FiatAccount.ts +195 -0
- package/src/models/GenerateAddressRequest.ts +101 -0
- package/src/models/Money.ts +91 -0
- package/src/models/Page.ts +48 -0
- package/src/models/PendingDeviceApproval.ts +229 -0
- package/src/models/PendingDeviceRegistration.ts +791 -0
- package/src/models/PreparedContractExecution.ts +128 -0
- package/src/models/PreparedSocialLogin.ts +297 -0
- package/src/models/Transaction.ts +322 -0
- package/src/models/Transfer.ts +459 -0
- package/src/models/Wire.ts +405 -0
- package/src/models/Withdrawal.ts +283 -0
- package/src/models/codeSecrets.ts +360 -0
- package/src/models/redaction.ts +22 -0
- package/src/sca/ScaClient.ts +289 -0
- package/src/securekey/InMemorySecureKey.ts +192 -0
- package/src/securekey/NativeSecureKey.ts +388 -0
- package/src/securekey/NativeSecureKeyBridge.ts +189 -0
- package/src/securekey/SecureKey.ts +279 -0
- package/src/securekey/alias.ts +212 -0
- package/src/securekey/ownerAuthKeyResolver.ts +135 -0
- package/src/securekey/registration.ts +40 -0
- package/src/securekey/resolveNativeBridge.ts +343 -0
- package/src/testing.ts +32 -0
- package/src/transport/DaaTransport.ts +42 -0
- package/src/transport/headers.ts +93 -0
- package/src/validation/requestBody.ts +60 -0
- package/src/validation/uuid.ts +31 -0
- package/src/wire/accountLimitsUsagePayload.ts +182 -0
- package/src/wire/accountPayload.ts +108 -0
- package/src/wire/achPayload.ts +98 -0
- package/src/wire/addressObjectPayload.ts +64 -0
- package/src/wire/contractExecutionPayload.ts +152 -0
- package/src/wire/daaStatusCodes.ts +86 -0
- package/src/wire/dataEnvelope.ts +80 -0
- package/src/wire/depositPayload.ts +186 -0
- package/src/wire/deviceContextPayload.ts +60 -0
- package/src/wire/deviceRegistrationResultPayload.ts +211 -0
- package/src/wire/deviceStatusPayload.ts +68 -0
- package/src/wire/errorEnvelope.ts +87 -0
- package/src/wire/fiatAccountPayload.ts +112 -0
- package/src/wire/instant.ts +96 -0
- package/src/wire/jsonNumber.ts +33 -0
- package/src/wire/moneyPayload.ts +55 -0
- package/src/wire/paginationLinks.ts +204 -0
- package/src/wire/payload.ts +146 -0
- package/src/wire/pendingRegistrationPayload.ts +118 -0
- package/src/wire/socialLoginRequestPayload.ts +66 -0
- package/src/wire/transactionPayload.ts +181 -0
- package/src/wire/transferPayload.ts +249 -0
- package/src/wire/wireEnums.ts +74 -0
- package/src/wire/wirePayload.ts +160 -0
- package/src/wire/withdrawalPayload.ts +219 -0
- package/testing.d.ts +19 -0
- package/testing.js +25 -0
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Circle Internet Group, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { BankAddress, BillingDetails } from './FiatAccount'
|
|
20
|
+
import type { FiatAccountStatus } from './FiatAccount'
|
|
21
|
+
import { REDACTED } from './redaction'
|
|
22
|
+
|
|
23
|
+
// `WireSummary`, `Wire`, and `WireInstruction` are the exact component names
|
|
24
|
+
// the canonical public Accounts OpenAPI uses, not DAA-owned aliases.
|
|
25
|
+
// `WireInstructionBeneficiary` and `WireInstructionBeneficiaryBank` are that
|
|
26
|
+
// same schema's own nested type names for `WireInstruction`'s
|
|
27
|
+
// `beneficiary`/`beneficiaryBank` properties.
|
|
28
|
+
|
|
29
|
+
/** One `transferTypesInfo` entry: the currencies a supported transfer type accepts. */
|
|
30
|
+
export type TransferTypeInfo = Readonly<{
|
|
31
|
+
currencies: readonly string[]
|
|
32
|
+
}>
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Circle's own receiving identity on a wire instruction — who the wire is
|
|
36
|
+
* addressed to, not the fiat-account holder. Not redacted: this is Circle's
|
|
37
|
+
* published receiving name and address, the same information the wire
|
|
38
|
+
* reference text itself carries, not the restricted PII this SDK redacts
|
|
39
|
+
* (`billingDetails`, `bankAddress`, `routingNumber`).
|
|
40
|
+
*/
|
|
41
|
+
export type WireInstructionBeneficiary = Readonly<{
|
|
42
|
+
name: string | null
|
|
43
|
+
address1: string | null
|
|
44
|
+
address2: string | null
|
|
45
|
+
}>
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The receiving bank's own account details for a wire instruction —
|
|
49
|
+
* `routingNumber` and `accountNumber` among them, which are restricted PII.
|
|
50
|
+
* Redacted the same way
|
|
51
|
+
* `models/FiatAccount.ts`'s `BillingDetails`/`BankAddress` are.
|
|
52
|
+
*/
|
|
53
|
+
export class WireInstructionBeneficiaryBank {
|
|
54
|
+
readonly #name: string | null
|
|
55
|
+
readonly #swiftCode: string | null
|
|
56
|
+
readonly #routingNumber: string | null
|
|
57
|
+
readonly #accountNumber: string | null
|
|
58
|
+
readonly #currency: string | null
|
|
59
|
+
readonly #address: string | null
|
|
60
|
+
readonly #city: string | null
|
|
61
|
+
readonly #postalCode: string | null
|
|
62
|
+
readonly #country: string | null
|
|
63
|
+
|
|
64
|
+
/** @internal Constructed only by the SDK's response decoder. */
|
|
65
|
+
constructor(fields: {
|
|
66
|
+
readonly name: string | null
|
|
67
|
+
readonly swiftCode: string | null
|
|
68
|
+
readonly routingNumber: string | null
|
|
69
|
+
readonly accountNumber: string | null
|
|
70
|
+
readonly currency: string | null
|
|
71
|
+
readonly address: string | null
|
|
72
|
+
readonly city: string | null
|
|
73
|
+
readonly postalCode: string | null
|
|
74
|
+
readonly country: string | null
|
|
75
|
+
}) {
|
|
76
|
+
this.#name = fields.name
|
|
77
|
+
this.#swiftCode = fields.swiftCode
|
|
78
|
+
this.#routingNumber = fields.routingNumber
|
|
79
|
+
this.#accountNumber = fields.accountNumber
|
|
80
|
+
this.#currency = fields.currency
|
|
81
|
+
this.#address = fields.address
|
|
82
|
+
this.#city = fields.city
|
|
83
|
+
this.#postalCode = fields.postalCode
|
|
84
|
+
this.#country = fields.country
|
|
85
|
+
Object.freeze(this)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
get name(): string | null {
|
|
89
|
+
return this.#name
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
get swiftCode(): string | null {
|
|
93
|
+
return this.#swiftCode
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
get routingNumber(): string | null {
|
|
97
|
+
return this.#routingNumber
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
get accountNumber(): string | null {
|
|
101
|
+
return this.#accountNumber
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
get currency(): string | null {
|
|
105
|
+
return this.#currency
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
get address(): string | null {
|
|
109
|
+
return this.#address
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
get city(): string | null {
|
|
113
|
+
return this.#city
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
get postalCode(): string | null {
|
|
117
|
+
return this.#postalCode
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
get country(): string | null {
|
|
121
|
+
return this.#country
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
toJSON(): string {
|
|
125
|
+
return this.toString()
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
toString(): string {
|
|
129
|
+
return `WireInstructionBeneficiaryBank(${REDACTED})`
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Circle receiving instructions for a wire fiat account (`GET
|
|
135
|
+
* /v1/banks/wires/{id}/instructions`).
|
|
136
|
+
*
|
|
137
|
+
* Deliberately a separate SDK method and response type from {@link Wire}: the
|
|
138
|
+
* account resource and its funding instructions are separate. This is a plain
|
|
139
|
+
* typed read of the public instruction route, which returns Circle's receiving
|
|
140
|
+
* instructions; it does not resolve a self-custody pass-through account.
|
|
141
|
+
*/
|
|
142
|
+
export class WireInstruction {
|
|
143
|
+
readonly trackingRef: string | null
|
|
144
|
+
readonly beneficiary: WireInstructionBeneficiary | null
|
|
145
|
+
readonly virtualAccountEnabled: boolean | null
|
|
146
|
+
|
|
147
|
+
readonly #beneficiaryBank: WireInstructionBeneficiaryBank | null
|
|
148
|
+
|
|
149
|
+
/** @internal Constructed only by the SDK's response decoder. */
|
|
150
|
+
constructor(fields: {
|
|
151
|
+
trackingRef: string | null
|
|
152
|
+
beneficiary: WireInstructionBeneficiary | null
|
|
153
|
+
beneficiaryBank: WireInstructionBeneficiaryBank | null
|
|
154
|
+
virtualAccountEnabled: boolean | null
|
|
155
|
+
}) {
|
|
156
|
+
this.trackingRef = fields.trackingRef
|
|
157
|
+
this.beneficiary = fields.beneficiary
|
|
158
|
+
this.virtualAccountEnabled = fields.virtualAccountEnabled
|
|
159
|
+
this.#beneficiaryBank = fields.beneficiaryBank
|
|
160
|
+
Object.freeze(this)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
get beneficiaryBank(): WireInstructionBeneficiaryBank | null {
|
|
164
|
+
return this.#beneficiaryBank
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
toJSON(): {
|
|
168
|
+
trackingRef: string | null
|
|
169
|
+
beneficiary: WireInstructionBeneficiary | null
|
|
170
|
+
beneficiaryBank: string | null
|
|
171
|
+
virtualAccountEnabled: boolean | null
|
|
172
|
+
} {
|
|
173
|
+
return {
|
|
174
|
+
trackingRef: this.trackingRef,
|
|
175
|
+
beneficiary: this.beneficiary,
|
|
176
|
+
beneficiaryBank: this.#beneficiaryBank === null ? null : REDACTED,
|
|
177
|
+
virtualAccountEnabled: this.virtualAccountEnabled,
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
toString(): string {
|
|
182
|
+
return (
|
|
183
|
+
`WireInstruction(trackingRef=${this.trackingRef ?? 'null'}, ` +
|
|
184
|
+
`beneficiaryBank=${this.#beneficiaryBank === null ? 'null' : REDACTED})`
|
|
185
|
+
)
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* A wire bank account summary (`GET /v1/banks/wires` collection entry).
|
|
191
|
+
*
|
|
192
|
+
* `billingDetails` and `bankAddress` are private, redacted fields — see
|
|
193
|
+
* `models/FiatAccount.ts`. `ffcMemo` is private and redacted the same way: it
|
|
194
|
+
* is not one of the named restricted fields, but a for-further-credit memo can
|
|
195
|
+
* carry the end beneficiary's name, which is the same personal data
|
|
196
|
+
* `billingDetails.name` holds. Every other field is public:
|
|
197
|
+
* `id`/`status`/`description` (bank name plus last four
|
|
198
|
+
* digits)/`trackingRef`/`fingerprint` are what a caller needs to identify and
|
|
199
|
+
* select a fiat account without exposing the underlying bank details.
|
|
200
|
+
*/
|
|
201
|
+
export class WireSummary {
|
|
202
|
+
readonly id: string
|
|
203
|
+
readonly type: string | null
|
|
204
|
+
readonly status: FiatAccountStatus
|
|
205
|
+
readonly description: string
|
|
206
|
+
readonly trackingRef: string
|
|
207
|
+
readonly fingerprint: string
|
|
208
|
+
readonly virtualAccountEnabled: boolean | null
|
|
209
|
+
readonly createDate: string
|
|
210
|
+
readonly updateDate: string
|
|
211
|
+
|
|
212
|
+
readonly #billingDetails: BillingDetails
|
|
213
|
+
readonly #bankAddress: BankAddress | null
|
|
214
|
+
readonly #ffcMemo: string | null
|
|
215
|
+
|
|
216
|
+
/** @internal Constructed only by the SDK's response decoder. */
|
|
217
|
+
constructor(fields: {
|
|
218
|
+
id: string
|
|
219
|
+
type: string | null
|
|
220
|
+
status: FiatAccountStatus
|
|
221
|
+
description: string
|
|
222
|
+
trackingRef: string
|
|
223
|
+
fingerprint: string
|
|
224
|
+
billingDetails: BillingDetails
|
|
225
|
+
bankAddress: BankAddress | null
|
|
226
|
+
virtualAccountEnabled: boolean | null
|
|
227
|
+
ffcMemo: string | null
|
|
228
|
+
createDate: string
|
|
229
|
+
updateDate: string
|
|
230
|
+
}) {
|
|
231
|
+
this.id = fields.id
|
|
232
|
+
this.type = fields.type
|
|
233
|
+
this.status = fields.status
|
|
234
|
+
this.description = fields.description
|
|
235
|
+
this.trackingRef = fields.trackingRef
|
|
236
|
+
this.fingerprint = fields.fingerprint
|
|
237
|
+
this.virtualAccountEnabled = fields.virtualAccountEnabled
|
|
238
|
+
this.createDate = fields.createDate
|
|
239
|
+
this.updateDate = fields.updateDate
|
|
240
|
+
this.#billingDetails = fields.billingDetails
|
|
241
|
+
this.#bankAddress = fields.bankAddress
|
|
242
|
+
this.#ffcMemo = fields.ffcMemo
|
|
243
|
+
Object.freeze(this)
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
get billingDetails(): BillingDetails {
|
|
247
|
+
return this.#billingDetails
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
get bankAddress(): BankAddress | null {
|
|
251
|
+
return this.#bankAddress
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
get ffcMemo(): string | null {
|
|
255
|
+
return this.#ffcMemo
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
toJSON(): {
|
|
259
|
+
id: string
|
|
260
|
+
type: string | null
|
|
261
|
+
status: FiatAccountStatus
|
|
262
|
+
description: string
|
|
263
|
+
trackingRef: string
|
|
264
|
+
fingerprint: string
|
|
265
|
+
billingDetails: string
|
|
266
|
+
bankAddress: string | null
|
|
267
|
+
virtualAccountEnabled: boolean | null
|
|
268
|
+
ffcMemo: string | null
|
|
269
|
+
createDate: string
|
|
270
|
+
updateDate: string
|
|
271
|
+
} {
|
|
272
|
+
return {
|
|
273
|
+
id: this.id,
|
|
274
|
+
type: this.type,
|
|
275
|
+
status: this.status,
|
|
276
|
+
description: this.description,
|
|
277
|
+
trackingRef: this.trackingRef,
|
|
278
|
+
fingerprint: this.fingerprint,
|
|
279
|
+
billingDetails: REDACTED,
|
|
280
|
+
bankAddress: this.#bankAddress === null ? null : REDACTED,
|
|
281
|
+
virtualAccountEnabled: this.virtualAccountEnabled,
|
|
282
|
+
ffcMemo: this.#ffcMemo === null ? null : REDACTED,
|
|
283
|
+
createDate: this.createDate,
|
|
284
|
+
updateDate: this.updateDate,
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
toString(): string {
|
|
289
|
+
return (
|
|
290
|
+
`WireSummary(id=${this.id}, status=${this.status.kind}, ` +
|
|
291
|
+
`billingDetails=${REDACTED}, bankAddress=${this.#bankAddress === null ? 'null' : REDACTED})`
|
|
292
|
+
)
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* A wire bank account (`GET /v1/banks/wires/{id}`).
|
|
298
|
+
*
|
|
299
|
+
* Carries every {@link WireSummary} field plus `transferTypesInfo`, which the
|
|
300
|
+
* list projection omits, and redacts `billingDetails`, `bankAddress`, and
|
|
301
|
+
* `ffcMemo` the same way. Deliberately a distinct SDK type from `WireSummary`
|
|
302
|
+
* rather than a subtype — fiat-account resources are distinct SDK methods and
|
|
303
|
+
* response types, and the two
|
|
304
|
+
* projections diverge only in this one additional field, not in a
|
|
305
|
+
* specialization relationship.
|
|
306
|
+
*/
|
|
307
|
+
export class Wire {
|
|
308
|
+
readonly id: string
|
|
309
|
+
readonly type: string | null
|
|
310
|
+
readonly status: FiatAccountStatus
|
|
311
|
+
readonly description: string
|
|
312
|
+
readonly trackingRef: string
|
|
313
|
+
readonly fingerprint: string
|
|
314
|
+
readonly virtualAccountEnabled: boolean | null
|
|
315
|
+
readonly transferTypesInfo: Readonly<Record<string, TransferTypeInfo>> | null
|
|
316
|
+
readonly createDate: string
|
|
317
|
+
readonly updateDate: string
|
|
318
|
+
|
|
319
|
+
readonly #billingDetails: BillingDetails
|
|
320
|
+
readonly #bankAddress: BankAddress | null
|
|
321
|
+
readonly #ffcMemo: string | null
|
|
322
|
+
|
|
323
|
+
/** @internal Constructed only by the SDK's response decoder. */
|
|
324
|
+
constructor(fields: {
|
|
325
|
+
id: string
|
|
326
|
+
type: string | null
|
|
327
|
+
status: FiatAccountStatus
|
|
328
|
+
description: string
|
|
329
|
+
trackingRef: string
|
|
330
|
+
fingerprint: string
|
|
331
|
+
billingDetails: BillingDetails
|
|
332
|
+
bankAddress: BankAddress | null
|
|
333
|
+
virtualAccountEnabled: boolean | null
|
|
334
|
+
ffcMemo: string | null
|
|
335
|
+
transferTypesInfo: Readonly<Record<string, TransferTypeInfo>> | null
|
|
336
|
+
createDate: string
|
|
337
|
+
updateDate: string
|
|
338
|
+
}) {
|
|
339
|
+
this.id = fields.id
|
|
340
|
+
this.type = fields.type
|
|
341
|
+
this.status = fields.status
|
|
342
|
+
this.description = fields.description
|
|
343
|
+
this.trackingRef = fields.trackingRef
|
|
344
|
+
this.fingerprint = fields.fingerprint
|
|
345
|
+
this.virtualAccountEnabled = fields.virtualAccountEnabled
|
|
346
|
+
this.transferTypesInfo = fields.transferTypesInfo
|
|
347
|
+
this.createDate = fields.createDate
|
|
348
|
+
this.updateDate = fields.updateDate
|
|
349
|
+
this.#billingDetails = fields.billingDetails
|
|
350
|
+
this.#bankAddress = fields.bankAddress
|
|
351
|
+
this.#ffcMemo = fields.ffcMemo
|
|
352
|
+
Object.freeze(this)
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
get billingDetails(): BillingDetails {
|
|
356
|
+
return this.#billingDetails
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
get bankAddress(): BankAddress | null {
|
|
360
|
+
return this.#bankAddress
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
get ffcMemo(): string | null {
|
|
364
|
+
return this.#ffcMemo
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
toJSON(): {
|
|
368
|
+
id: string
|
|
369
|
+
type: string | null
|
|
370
|
+
status: FiatAccountStatus
|
|
371
|
+
description: string
|
|
372
|
+
trackingRef: string
|
|
373
|
+
fingerprint: string
|
|
374
|
+
billingDetails: string
|
|
375
|
+
bankAddress: string | null
|
|
376
|
+
virtualAccountEnabled: boolean | null
|
|
377
|
+
ffcMemo: string | null
|
|
378
|
+
transferTypesInfo: Readonly<Record<string, TransferTypeInfo>> | null
|
|
379
|
+
createDate: string
|
|
380
|
+
updateDate: string
|
|
381
|
+
} {
|
|
382
|
+
return {
|
|
383
|
+
id: this.id,
|
|
384
|
+
type: this.type,
|
|
385
|
+
status: this.status,
|
|
386
|
+
description: this.description,
|
|
387
|
+
trackingRef: this.trackingRef,
|
|
388
|
+
fingerprint: this.fingerprint,
|
|
389
|
+
billingDetails: REDACTED,
|
|
390
|
+
bankAddress: this.#bankAddress === null ? null : REDACTED,
|
|
391
|
+
virtualAccountEnabled: this.virtualAccountEnabled,
|
|
392
|
+
ffcMemo: this.#ffcMemo === null ? null : REDACTED,
|
|
393
|
+
transferTypesInfo: this.transferTypesInfo,
|
|
394
|
+
createDate: this.createDate,
|
|
395
|
+
updateDate: this.updateDate,
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
toString(): string {
|
|
400
|
+
return (
|
|
401
|
+
`Wire(id=${this.id}, status=${this.status.kind}, ` +
|
|
402
|
+
`billingDetails=${REDACTED}, bankAddress=${this.#bankAddress === null ? 'null' : REDACTED})`
|
|
403
|
+
)
|
|
404
|
+
}
|
|
405
|
+
}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Circle Internet Group, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import type { Money } from './Money'
|
|
20
|
+
import { REDACTED } from './redaction'
|
|
21
|
+
|
|
22
|
+
export type WithdrawalStatus =
|
|
23
|
+
| { readonly kind: 'pending' }
|
|
24
|
+
| { readonly kind: 'complete' }
|
|
25
|
+
| { readonly kind: 'failed' }
|
|
26
|
+
| { readonly kind: 'unrecognized'; readonly rawValue: string | null }
|
|
27
|
+
|
|
28
|
+
export type WithdrawalErrorCode =
|
|
29
|
+
| { readonly kind: 'insufficient_funds' }
|
|
30
|
+
| { readonly kind: 'transaction_denied' }
|
|
31
|
+
| { readonly kind: 'transaction_failed' }
|
|
32
|
+
| { readonly kind: 'transaction_returned' }
|
|
33
|
+
| { readonly kind: 'bank_transaction_error' }
|
|
34
|
+
| { readonly kind: 'fiat_account_limit_exceeded' }
|
|
35
|
+
| { readonly kind: 'invalid_bank_account_number' }
|
|
36
|
+
| { readonly kind: 'invalid_ach_rtn' }
|
|
37
|
+
| { readonly kind: 'invalid_wire_rtn' }
|
|
38
|
+
| { readonly kind: 'vendor_inactive' }
|
|
39
|
+
| { readonly kind: 'payout_canceled' }
|
|
40
|
+
| { readonly kind: 'invalid_travel_rule_identity' }
|
|
41
|
+
| { readonly kind: 'intermediary_bank_required' }
|
|
42
|
+
| { readonly kind: 'sen_not_supported' }
|
|
43
|
+
| { readonly kind: 'unrecognized'; readonly rawValue: string | null }
|
|
44
|
+
|
|
45
|
+
export type WithdrawalDestinationType =
|
|
46
|
+
| { readonly kind: 'wire' }
|
|
47
|
+
| { readonly kind: 'ach' }
|
|
48
|
+
| { readonly kind: 'unrecognized'; readonly rawValue: string | null }
|
|
49
|
+
|
|
50
|
+
export type WithdrawalDestination = Readonly<{
|
|
51
|
+
type: WithdrawalDestinationType
|
|
52
|
+
id: string
|
|
53
|
+
name: string | null
|
|
54
|
+
}>
|
|
55
|
+
|
|
56
|
+
export type WithdrawalRiskEvaluation = Readonly<{
|
|
57
|
+
decision: string | null
|
|
58
|
+
reason: string | null
|
|
59
|
+
}>
|
|
60
|
+
|
|
61
|
+
export type WithdrawalPolicyEvaluation = Readonly<{ status: string }>
|
|
62
|
+
|
|
63
|
+
/** Target fiat amount. Unlike `Money`, its service-side amount is deliberately optional. */
|
|
64
|
+
export class WithdrawalToAmount {
|
|
65
|
+
readonly currency: string | null
|
|
66
|
+
readonly #amount: string | null
|
|
67
|
+
|
|
68
|
+
/** @internal Constructed only by the response decoder. */
|
|
69
|
+
constructor(amount: string | null, currency: string | null) {
|
|
70
|
+
this.#amount = amount
|
|
71
|
+
this.currency = currency
|
|
72
|
+
Object.freeze(this)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
get amount(): string | null {
|
|
76
|
+
return this.#amount
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
toJSON(): { readonly amount: string | null; readonly currency: string | null } {
|
|
80
|
+
return { amount: this.#amount === null ? null : REDACTED, currency: this.currency }
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
toString(): string {
|
|
84
|
+
return `WithdrawalToAmount(amount=${this.#amount === null ? 'null' : REDACTED}, currency=${this.currency})`
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export type WithdrawalAdjustments = Readonly<{
|
|
89
|
+
fxCredit: Money | null
|
|
90
|
+
fxDebit: Money | null
|
|
91
|
+
}>
|
|
92
|
+
|
|
93
|
+
export type WithdrawalReturn = Readonly<{
|
|
94
|
+
id: string | null
|
|
95
|
+
payoutId: string | null
|
|
96
|
+
amount: Money | null
|
|
97
|
+
fees: Money | null
|
|
98
|
+
reason: string | null
|
|
99
|
+
status: WithdrawalStatus | null
|
|
100
|
+
createDate: string | null
|
|
101
|
+
updateDate: string | null
|
|
102
|
+
}>
|
|
103
|
+
|
|
104
|
+
export type WithdrawalSweepStatus =
|
|
105
|
+
| { readonly kind: 'pending' }
|
|
106
|
+
| { readonly kind: 'complete' }
|
|
107
|
+
| { readonly kind: 'failed' }
|
|
108
|
+
| { readonly kind: 'skipped' }
|
|
109
|
+
| { readonly kind: 'unrecognized'; readonly rawValue: string | null }
|
|
110
|
+
|
|
111
|
+
export type WithdrawalSubAccountSweep = Readonly<{
|
|
112
|
+
subAccountId: string | null
|
|
113
|
+
amount: Money | null
|
|
114
|
+
status: WithdrawalSweepStatus | null
|
|
115
|
+
}>
|
|
116
|
+
|
|
117
|
+
export type WithdrawalDetailRendering = Readonly<{
|
|
118
|
+
id: string
|
|
119
|
+
sourceAccountId: string
|
|
120
|
+
destination: WithdrawalDestination
|
|
121
|
+
amount: ReturnType<Money['toJSON']>
|
|
122
|
+
toAmount: WithdrawalToAmount | null
|
|
123
|
+
fees: ReturnType<Money['toJSON']> | null
|
|
124
|
+
status: WithdrawalStatus
|
|
125
|
+
trackingRef: string | null
|
|
126
|
+
errorCode: WithdrawalErrorCode | null
|
|
127
|
+
externalRef: string | null
|
|
128
|
+
riskEvaluation: WithdrawalRiskEvaluation | null
|
|
129
|
+
adjustments: string
|
|
130
|
+
return: string
|
|
131
|
+
customerExternalRef: string | null
|
|
132
|
+
burnAll: boolean | null
|
|
133
|
+
subAccountSweeps: string
|
|
134
|
+
createDate: string
|
|
135
|
+
updateDate: string | null
|
|
136
|
+
policyEvaluation: WithdrawalPolicyEvaluation | null
|
|
137
|
+
}>
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* GET-only DAA withdrawal projection.
|
|
141
|
+
*
|
|
142
|
+
* The guaranteed core follows the service's two read paths, not the generated
|
|
143
|
+
* schema: `id`, `sourceAccountId`, `destination`, `amount`, `status`, and
|
|
144
|
+
* `createDate` are produced by both payout-backed and stored-withdrawal reads.
|
|
145
|
+
* Enrichment is omitted from the response whenever unavailable. Amounts plus
|
|
146
|
+
* bank/customer references are private so object inspection, spread, and
|
|
147
|
+
* enumeration cannot disclose them.
|
|
148
|
+
*/
|
|
149
|
+
export class WithdrawalDetail {
|
|
150
|
+
readonly id: string
|
|
151
|
+
readonly sourceAccountId: string
|
|
152
|
+
readonly destination: WithdrawalDestination
|
|
153
|
+
readonly status: WithdrawalStatus
|
|
154
|
+
readonly trackingRef: string | null
|
|
155
|
+
readonly errorCode: WithdrawalErrorCode | null
|
|
156
|
+
readonly riskEvaluation: WithdrawalRiskEvaluation | null
|
|
157
|
+
readonly burnAll: boolean | null
|
|
158
|
+
readonly createDate: string
|
|
159
|
+
readonly updateDate: string | null
|
|
160
|
+
readonly policyEvaluation: WithdrawalPolicyEvaluation | null
|
|
161
|
+
|
|
162
|
+
readonly #amount: Money
|
|
163
|
+
readonly #toAmount: WithdrawalToAmount | null
|
|
164
|
+
readonly #fees: Money | null
|
|
165
|
+
readonly #externalRef: string | null
|
|
166
|
+
readonly #adjustments: WithdrawalAdjustments | null
|
|
167
|
+
readonly #returnObject: WithdrawalReturn | null
|
|
168
|
+
readonly #customerExternalRef: string | null
|
|
169
|
+
readonly #subAccountSweeps: readonly WithdrawalSubAccountSweep[]
|
|
170
|
+
|
|
171
|
+
/** @internal Constructed only by the response decoder. */
|
|
172
|
+
constructor(fields: {
|
|
173
|
+
id: string
|
|
174
|
+
sourceAccountId: string
|
|
175
|
+
destination: WithdrawalDestination
|
|
176
|
+
amount: Money
|
|
177
|
+
toAmount: WithdrawalToAmount | null
|
|
178
|
+
fees: Money | null
|
|
179
|
+
status: WithdrawalStatus
|
|
180
|
+
trackingRef: string | null
|
|
181
|
+
errorCode: WithdrawalErrorCode | null
|
|
182
|
+
externalRef: string | null
|
|
183
|
+
riskEvaluation: WithdrawalRiskEvaluation | null
|
|
184
|
+
adjustments: WithdrawalAdjustments | null
|
|
185
|
+
returnObject: WithdrawalReturn | null
|
|
186
|
+
customerExternalRef: string | null
|
|
187
|
+
burnAll: boolean | null
|
|
188
|
+
subAccountSweeps: readonly WithdrawalSubAccountSweep[]
|
|
189
|
+
createDate: string
|
|
190
|
+
updateDate: string | null
|
|
191
|
+
policyEvaluation: WithdrawalPolicyEvaluation | null
|
|
192
|
+
}) {
|
|
193
|
+
this.id = fields.id
|
|
194
|
+
this.sourceAccountId = fields.sourceAccountId
|
|
195
|
+
this.destination = fields.destination
|
|
196
|
+
this.status = fields.status
|
|
197
|
+
this.trackingRef = fields.trackingRef
|
|
198
|
+
this.errorCode = fields.errorCode
|
|
199
|
+
this.riskEvaluation = fields.riskEvaluation
|
|
200
|
+
this.burnAll = fields.burnAll
|
|
201
|
+
this.createDate = fields.createDate
|
|
202
|
+
this.updateDate = fields.updateDate
|
|
203
|
+
this.policyEvaluation = fields.policyEvaluation
|
|
204
|
+
this.#amount = fields.amount
|
|
205
|
+
this.#toAmount = fields.toAmount
|
|
206
|
+
this.#fees = fields.fees
|
|
207
|
+
this.#externalRef = fields.externalRef
|
|
208
|
+
this.#adjustments = fields.adjustments
|
|
209
|
+
this.#returnObject = fields.returnObject
|
|
210
|
+
this.#customerExternalRef = fields.customerExternalRef
|
|
211
|
+
this.#subAccountSweeps = Object.freeze(fields.subAccountSweeps.slice())
|
|
212
|
+
Object.freeze(this)
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
get amount(): Money {
|
|
216
|
+
return this.#amount
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
get toAmount(): WithdrawalToAmount | null {
|
|
220
|
+
return this.#toAmount
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
get fees(): Money | null {
|
|
224
|
+
return this.#fees
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
get externalRef(): string | null {
|
|
228
|
+
return this.#externalRef
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
get adjustments(): WithdrawalAdjustments | null {
|
|
232
|
+
return this.#adjustments
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
get returnObject(): WithdrawalReturn | null {
|
|
236
|
+
return this.#returnObject
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
get customerExternalRef(): string | null {
|
|
240
|
+
return this.#customerExternalRef
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
get subAccountSweeps(): readonly WithdrawalSubAccountSweep[] {
|
|
244
|
+
return this.#subAccountSweeps
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
toJSON(): WithdrawalDetailRendering {
|
|
248
|
+
return {
|
|
249
|
+
id: this.id,
|
|
250
|
+
sourceAccountId: this.sourceAccountId,
|
|
251
|
+
destination: this.destination,
|
|
252
|
+
amount: this.#amount.toJSON(),
|
|
253
|
+
toAmount: this.#toAmount,
|
|
254
|
+
fees: this.#fees?.toJSON() ?? null,
|
|
255
|
+
status: this.status,
|
|
256
|
+
trackingRef: this.trackingRef,
|
|
257
|
+
errorCode: this.errorCode,
|
|
258
|
+
externalRef: this.#externalRef === null ? null : REDACTED,
|
|
259
|
+
riskEvaluation: this.riskEvaluation,
|
|
260
|
+
adjustments: `${this.#adjustments === null ? 0 : 1} entry`,
|
|
261
|
+
return: `${this.#returnObject === null ? 0 : 1} entry`,
|
|
262
|
+
customerExternalRef: this.#customerExternalRef === null ? null : REDACTED,
|
|
263
|
+
burnAll: this.burnAll,
|
|
264
|
+
subAccountSweeps: `${this.#subAccountSweeps.length} entries`,
|
|
265
|
+
createDate: this.createDate,
|
|
266
|
+
updateDate: this.updateDate,
|
|
267
|
+
policyEvaluation: this.policyEvaluation,
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
toString(): string {
|
|
272
|
+
return (
|
|
273
|
+
`WithdrawalDetail(id=${this.id}, sourceAccountId=${this.sourceAccountId}, ` +
|
|
274
|
+
`status=${this.status.kind}, amount=${this.#amount.toString()}, ` +
|
|
275
|
+
`fees=${this.#fees === null ? 'null' : this.#fees.toString()}, ` +
|
|
276
|
+
`externalRef=${this.#externalRef === null ? 'null' : REDACTED}, ` +
|
|
277
|
+
`customerExternalRef=${this.#customerExternalRef === null ? 'null' : REDACTED}, ` +
|
|
278
|
+
`adjustments=${this.#adjustments === null ? 0 : 1} entry, ` +
|
|
279
|
+
`return=${this.#returnObject === null ? 0 : 1} entry, ` +
|
|
280
|
+
`subAccountSweeps=${this.#subAccountSweeps.length} entries)`
|
|
281
|
+
)
|
|
282
|
+
}
|
|
283
|
+
}
|