@dakota-xyz/ts-sdk 1.3.1 → 1.4.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/dist/index.d.mts +55 -6
- package/dist/index.d.ts +55 -6
- package/dist/index.js +57 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +57 -18
- package/dist/index.mjs.map +1 -1
- package/dist/webhook/index.d.mts +8 -2
- package/dist/webhook/index.d.ts +8 -2
- package/dist/webhook/index.js +1 -1
- package/dist/webhook/index.js.map +1 -1
- package/dist/webhook/index.mjs +1 -1
- package/dist/webhook/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4652,6 +4652,14 @@ type WalletBalance = components['schemas']['AssetBalance'];
|
|
|
4652
4652
|
type WalletBalances = components['schemas']['WalletBalances'];
|
|
4653
4653
|
/** Wallet transaction request */
|
|
4654
4654
|
type WalletTransactionRequest = components['schemas']['SendTransactionIntent'];
|
|
4655
|
+
/**
|
|
4656
|
+
* Endorsed request envelope: `{ signatures: string[], intent: <one of the
|
|
4657
|
+
* endorsed intent types> }`. Required by every mutating policy / signer-group
|
|
4658
|
+
* / wallet-transaction endpoint. Build the canonical intent, sign it with
|
|
4659
|
+
* each required signer's private key, and pass the resulting envelope as
|
|
4660
|
+
* the `endorsement` option on the relevant resource method.
|
|
4661
|
+
*/
|
|
4662
|
+
type EndorsedRequest = components['schemas']['EndorsedRequest'];
|
|
4655
4663
|
/** Wallet transaction response */
|
|
4656
4664
|
type WalletTransaction = components['schemas']['WalletTransaction'];
|
|
4657
4665
|
/** Slim reference to a policy attached to a wallet (id + name) */
|
|
@@ -5131,6 +5139,17 @@ interface RequestOptions {
|
|
|
5131
5139
|
* - Not reused across different business intents
|
|
5132
5140
|
*/
|
|
5133
5141
|
idempotencyKey?: string;
|
|
5142
|
+
/**
|
|
5143
|
+
* Endorsed-request envelope (`{ signatures, intent }`) for mutating
|
|
5144
|
+
* policy, signer-group, and wallet-transaction endpoints. Required by the
|
|
5145
|
+
* server on all endorsed routes — passing this is the only way the
|
|
5146
|
+
* signature ever reaches the wire. On methods that already accept a
|
|
5147
|
+
* typed `data` argument (e.g. `policies.addRule`, `policies.updateRule`),
|
|
5148
|
+
* `endorsement` takes precedence over `data` when both are provided so
|
|
5149
|
+
* you can swap a bare data shape for an endorsed envelope at the call
|
|
5150
|
+
* site without breaking the typed signature.
|
|
5151
|
+
*/
|
|
5152
|
+
endorsement?: EndorsedRequest;
|
|
5134
5153
|
}
|
|
5135
5154
|
/** Pagination metadata */
|
|
5136
5155
|
type Meta = components['schemas']['Meta'];
|
|
@@ -6023,9 +6042,14 @@ declare class PoliciesResource extends BaseResource {
|
|
|
6023
6042
|
/**
|
|
6024
6043
|
* Delete a policy.
|
|
6025
6044
|
*
|
|
6045
|
+
* Endorsed endpoint — `options.endorsement` must contain a signed
|
|
6046
|
+
* `DeletePolicyIntent`. The server rejects requests without a valid
|
|
6047
|
+
* endorsement body.
|
|
6048
|
+
*
|
|
6026
6049
|
* @param policyId - Policy ID
|
|
6050
|
+
* @param options - Request options (must include `endorsement`)
|
|
6027
6051
|
*/
|
|
6028
|
-
delete(policyId: string): Promise<void>;
|
|
6052
|
+
delete(policyId: string, options?: RequestOptions): Promise<void>;
|
|
6029
6053
|
/**
|
|
6030
6054
|
* Add a rule to a policy.
|
|
6031
6055
|
*
|
|
@@ -6046,10 +6070,15 @@ declare class PoliciesResource extends BaseResource {
|
|
|
6046
6070
|
/**
|
|
6047
6071
|
* Delete a policy rule.
|
|
6048
6072
|
*
|
|
6073
|
+
* Endorsed endpoint — `options.endorsement` must contain a signed
|
|
6074
|
+
* `RemovePolicyRuleIntent`. The server rejects requests without a valid
|
|
6075
|
+
* endorsement body.
|
|
6076
|
+
*
|
|
6049
6077
|
* @param policyId - Policy ID
|
|
6050
6078
|
* @param ruleId - Rule ID
|
|
6079
|
+
* @param options - Request options (must include `endorsement`)
|
|
6051
6080
|
*/
|
|
6052
|
-
deleteRule(policyId: string, ruleId: string): Promise<void>;
|
|
6081
|
+
deleteRule(policyId: string, ruleId: string, options?: RequestOptions): Promise<void>;
|
|
6053
6082
|
/**
|
|
6054
6083
|
* Get wallets attached to a policy.
|
|
6055
6084
|
*
|
|
@@ -6062,17 +6091,27 @@ declare class PoliciesResource extends BaseResource {
|
|
|
6062
6091
|
/**
|
|
6063
6092
|
* Attach a policy to a wallet.
|
|
6064
6093
|
*
|
|
6094
|
+
* Endorsed endpoint — `options.endorsement` must contain a signed
|
|
6095
|
+
* `AttachPolicyToWalletIntent`. The server rejects requests without a
|
|
6096
|
+
* valid endorsement body.
|
|
6097
|
+
*
|
|
6065
6098
|
* @param policyId - Policy ID
|
|
6066
6099
|
* @param walletId - Wallet ID
|
|
6100
|
+
* @param options - Request options (must include `endorsement`)
|
|
6067
6101
|
*/
|
|
6068
6102
|
attachToWallet(policyId: string, walletId: string, options?: RequestOptions): Promise<void>;
|
|
6069
6103
|
/**
|
|
6070
6104
|
* Detach a policy from a wallet.
|
|
6071
6105
|
*
|
|
6106
|
+
* Endorsed endpoint — `options.endorsement` must contain a signed
|
|
6107
|
+
* `DetachPolicyFromWalletIntent`. The server rejects requests without a
|
|
6108
|
+
* valid endorsement body.
|
|
6109
|
+
*
|
|
6072
6110
|
* @param policyId - Policy ID
|
|
6073
6111
|
* @param walletId - Wallet ID
|
|
6112
|
+
* @param options - Request options (must include `endorsement`)
|
|
6074
6113
|
*/
|
|
6075
|
-
detachFromWallet(policyId: string, walletId: string): Promise<void>;
|
|
6114
|
+
detachFromWallet(policyId: string, walletId: string, options?: RequestOptions): Promise<void>;
|
|
6076
6115
|
}
|
|
6077
6116
|
|
|
6078
6117
|
/**
|
|
@@ -6131,17 +6170,27 @@ declare class SignerGroupsResource extends BaseResource {
|
|
|
6131
6170
|
/**
|
|
6132
6171
|
* Attach a signer group to a wallet.
|
|
6133
6172
|
*
|
|
6173
|
+
* Endorsed endpoint — `options.endorsement` must contain a signed
|
|
6174
|
+
* `AttachGroupToWalletIntent`. The server rejects requests without a
|
|
6175
|
+
* valid endorsement body.
|
|
6176
|
+
*
|
|
6134
6177
|
* @param walletId - Wallet ID
|
|
6135
6178
|
* @param signerGroupId - Signer group ID
|
|
6179
|
+
* @param options - Request options (must include `endorsement`)
|
|
6136
6180
|
*/
|
|
6137
6181
|
attachToWallet(walletId: string, signerGroupId: string, options?: RequestOptions): Promise<void>;
|
|
6138
6182
|
/**
|
|
6139
6183
|
* Detach a signer group from a wallet.
|
|
6140
6184
|
*
|
|
6185
|
+
* Endorsed endpoint — `options.endorsement` must contain a signed
|
|
6186
|
+
* `DetachGroupFromWalletIntent`. The server rejects requests without a
|
|
6187
|
+
* valid endorsement body.
|
|
6188
|
+
*
|
|
6141
6189
|
* @param walletId - Wallet ID
|
|
6142
6190
|
* @param signerGroupId - Signer group ID
|
|
6191
|
+
* @param options - Request options (must include `endorsement`)
|
|
6143
6192
|
*/
|
|
6144
|
-
detachFromWallet(walletId: string, signerGroupId: string): Promise<void>;
|
|
6193
|
+
detachFromWallet(walletId: string, signerGroupId: string, options?: RequestOptions): Promise<void>;
|
|
6145
6194
|
/**
|
|
6146
6195
|
* List signer groups attached to a wallet.
|
|
6147
6196
|
*
|
|
@@ -6374,7 +6423,7 @@ declare class InfoResource extends BaseResource {
|
|
|
6374
6423
|
* }
|
|
6375
6424
|
* ```
|
|
6376
6425
|
*/
|
|
6377
|
-
getNetworks(): Promise<
|
|
6426
|
+
getNetworks(): Promise<string[]>;
|
|
6378
6427
|
}
|
|
6379
6428
|
|
|
6380
6429
|
/**
|
|
@@ -6829,4 +6878,4 @@ declare class ConfigurationError extends Error {
|
|
|
6829
6878
|
constructor(message: string);
|
|
6830
6879
|
}
|
|
6831
6880
|
|
|
6832
|
-
export { APIError, type Account, type AccountCreateRequest, type AccountListParams, type AccountUpdateRequest, AccountsResource, type Address, type AdvanceSimulationRequest, type AdvanceSimulationResult, type ApiKey, type ApiKeyCreateRequest, type ApiKeyResponse, ApiKeysResource, type Application, type ApplicationDocumentType, type ApplicationDocumentUploadRequest, type ApplicationDocumentUploadUrlRequest, type ApplicationListItem, type ApplicationStatus, type ApplicationSubmissionRequest, ApplicationsResource, type AssociatedIndividual, type AssociatedIndividualRequest, type AttachedPolicy, type AttachedWallet, type AttestationSubmitRequest, type AttestationType, AuthMode, type AutoTransaction, AutoTransactionsResource, type AverageMonthlyRevenue, type BulkImportSumsubTokensRequest, type BulkImportSumsubTokensResponse, type BulkImportSumsubTokensResult, type BusinessApplicationCreateRequest, type BusinessDetailsResponse, type BusinessPurposeOfAccount, type BusinessSourceOfFunds, type ClientPricingConfig, ConfigurationError, type Country, type CreateApiKeyForClientRequest, type CryptoDestination, type CryptoDestinationRequest, type CursorExtractor, type Customer, type CustomerCreateRequest, type CustomerCreateResponse, type CustomerListParams, CustomersResource, DEFAULT_RETRY_POLICY, DakotaClient, type DakotaClientConfig, type Destination, type DestinationRequest, DestinationsResource, type DocumentUploadResponse, type DocumentUploadUrlResponse, type EDDRequest, type EDDWithApplicationID, type EmploymentStatus, Environment, type Event, type EventListParams, type EventType, EventsResource, type ExpectedMonthlyDeposit, type Family, type FiatUSDestination, type FiatUSDestinationRequest, type IndividualDetailsResponse, type IndividualDocumentType, type IndividualDocumentUploadRequest, type IndividualDocumentUploadUrlRequest, type IndividualRequest, type IndividualRole, type IndividualTitle, InfoResource, type KSUID, type KybStatus, type LegalStructure, type ListParams, type Logger, type Meta, type Network, type NetworkId, type OfframpAccount, type OfframpAccountCreateRequest, type OneOffTransaction, type OneOffTransactionRequest, type OnrampAccount, type OnrampAccountCreateRequest, type PageFetcher, PaginatedIterator, type PaginatedResponse, type PaginationMeta, type PaginationParams, type PaymentCapability, type PersonName, PoliciesResource, type Policy, type PolicyCreateRequest, type PolicyRule, type PolicyRuleCreateRequest, type Recipient, type RecipientRequest, type RecipientUpdateRequest, RecipientsResource, type RequestOptions, type ResolvedConfig, type RetryPolicy, SandboxResource, type SandboxScenario, type SelfServeCreditTier, type SelfServeCreditTiersResponse, type SelfServeCreditsBalanceResponse, type SelfServeCreditsLedgerEntry, type SelfServeCreditsLedgerEntryType, type SelfServeCreditsLedgerParams, type SelfServeCreditsLedgerResponse, type SelfServeCreditsPricingResponse, type SelfServeCreditsPurchaseRequest, type SelfServeCreditsPurchaseResponse, SelfServeResource, type Signer, type SignerCreateRequest, type SignerGroup, type SignerGroupCreateRequest, SignerGroupsResource, SignersResource, type SimulateInboundRequest, type SimulateInboundType, type SimulateOnboardingRequest, type SimulateOnboardingResponse, type SimulateOnboardingType, type SimulationCallbackRecord, type SimulationInspection, type SimulationResponse, type SubClientSummary, type SwapAccount, type SwapAccountCreateRequest, type TransactionListParams, type TransactionStatus, TransactionsResource, TransportError, type UpdateCustomerSubClientRequest, type UploadedDocumentMetadata, type User, type UserCreateRequest, type UserUpdateRequest, UsersResource, type Wallet, type WalletBalance, type WalletBalances, type WalletCreateRequest, type WalletTransaction, type WalletTransactionRequest, WalletsResource, type WebhookEvent, type WebhookHistoryList, type WebhookHistoryListParams, type WebhookHistoryResponse, type WebhookReplayResponse, type WebhookTarget, type WebhookTargetCreateRequest, type WebhookTargetUpdateRequest, WebhooksResource, consoleLogger, getEnvironmentURL, noopLogger, paginate };
|
|
6881
|
+
export { APIError, type Account, type AccountCreateRequest, type AccountListParams, type AccountUpdateRequest, AccountsResource, type Address, type AdvanceSimulationRequest, type AdvanceSimulationResult, type ApiKey, type ApiKeyCreateRequest, type ApiKeyResponse, ApiKeysResource, type Application, type ApplicationDocumentType, type ApplicationDocumentUploadRequest, type ApplicationDocumentUploadUrlRequest, type ApplicationListItem, type ApplicationStatus, type ApplicationSubmissionRequest, ApplicationsResource, type AssociatedIndividual, type AssociatedIndividualRequest, type AttachedPolicy, type AttachedWallet, type AttestationSubmitRequest, type AttestationType, AuthMode, type AutoTransaction, AutoTransactionsResource, type AverageMonthlyRevenue, type BulkImportSumsubTokensRequest, type BulkImportSumsubTokensResponse, type BulkImportSumsubTokensResult, type BusinessApplicationCreateRequest, type BusinessDetailsResponse, type BusinessPurposeOfAccount, type BusinessSourceOfFunds, type ClientPricingConfig, ConfigurationError, type Country, type CreateApiKeyForClientRequest, type CryptoDestination, type CryptoDestinationRequest, type CursorExtractor, type Customer, type CustomerCreateRequest, type CustomerCreateResponse, type CustomerListParams, CustomersResource, DEFAULT_RETRY_POLICY, DakotaClient, type DakotaClientConfig, type Destination, type DestinationRequest, DestinationsResource, type DocumentUploadResponse, type DocumentUploadUrlResponse, type EDDRequest, type EDDWithApplicationID, type EmploymentStatus, type EndorsedRequest, Environment, type Event, type EventListParams, type EventType, EventsResource, type ExpectedMonthlyDeposit, type Family, type FiatUSDestination, type FiatUSDestinationRequest, type IndividualDetailsResponse, type IndividualDocumentType, type IndividualDocumentUploadRequest, type IndividualDocumentUploadUrlRequest, type IndividualRequest, type IndividualRole, type IndividualTitle, InfoResource, type KSUID, type KybStatus, type LegalStructure, type ListParams, type Logger, type Meta, type Network, type NetworkId, type OfframpAccount, type OfframpAccountCreateRequest, type OneOffTransaction, type OneOffTransactionRequest, type OnrampAccount, type OnrampAccountCreateRequest, type PageFetcher, PaginatedIterator, type PaginatedResponse, type PaginationMeta, type PaginationParams, type PaymentCapability, type PersonName, PoliciesResource, type Policy, type PolicyCreateRequest, type PolicyRule, type PolicyRuleCreateRequest, type Recipient, type RecipientRequest, type RecipientUpdateRequest, RecipientsResource, type RequestOptions, type ResolvedConfig, type RetryPolicy, SandboxResource, type SandboxScenario, type SelfServeCreditTier, type SelfServeCreditTiersResponse, type SelfServeCreditsBalanceResponse, type SelfServeCreditsLedgerEntry, type SelfServeCreditsLedgerEntryType, type SelfServeCreditsLedgerParams, type SelfServeCreditsLedgerResponse, type SelfServeCreditsPricingResponse, type SelfServeCreditsPurchaseRequest, type SelfServeCreditsPurchaseResponse, SelfServeResource, type Signer, type SignerCreateRequest, type SignerGroup, type SignerGroupCreateRequest, SignerGroupsResource, SignersResource, type SimulateInboundRequest, type SimulateInboundType, type SimulateOnboardingRequest, type SimulateOnboardingResponse, type SimulateOnboardingType, type SimulationCallbackRecord, type SimulationInspection, type SimulationResponse, type SubClientSummary, type SwapAccount, type SwapAccountCreateRequest, type TransactionListParams, type TransactionStatus, TransactionsResource, TransportError, type UpdateCustomerSubClientRequest, type UploadedDocumentMetadata, type User, type UserCreateRequest, type UserUpdateRequest, UsersResource, type Wallet, type WalletBalance, type WalletBalances, type WalletCreateRequest, type WalletTransaction, type WalletTransactionRequest, WalletsResource, type WebhookEvent, type WebhookHistoryList, type WebhookHistoryListParams, type WebhookHistoryResponse, type WebhookReplayResponse, type WebhookTarget, type WebhookTargetCreateRequest, type WebhookTargetUpdateRequest, WebhooksResource, consoleLogger, getEnvironmentURL, noopLogger, paginate };
|
package/dist/index.d.ts
CHANGED
|
@@ -4652,6 +4652,14 @@ type WalletBalance = components['schemas']['AssetBalance'];
|
|
|
4652
4652
|
type WalletBalances = components['schemas']['WalletBalances'];
|
|
4653
4653
|
/** Wallet transaction request */
|
|
4654
4654
|
type WalletTransactionRequest = components['schemas']['SendTransactionIntent'];
|
|
4655
|
+
/**
|
|
4656
|
+
* Endorsed request envelope: `{ signatures: string[], intent: <one of the
|
|
4657
|
+
* endorsed intent types> }`. Required by every mutating policy / signer-group
|
|
4658
|
+
* / wallet-transaction endpoint. Build the canonical intent, sign it with
|
|
4659
|
+
* each required signer's private key, and pass the resulting envelope as
|
|
4660
|
+
* the `endorsement` option on the relevant resource method.
|
|
4661
|
+
*/
|
|
4662
|
+
type EndorsedRequest = components['schemas']['EndorsedRequest'];
|
|
4655
4663
|
/** Wallet transaction response */
|
|
4656
4664
|
type WalletTransaction = components['schemas']['WalletTransaction'];
|
|
4657
4665
|
/** Slim reference to a policy attached to a wallet (id + name) */
|
|
@@ -5131,6 +5139,17 @@ interface RequestOptions {
|
|
|
5131
5139
|
* - Not reused across different business intents
|
|
5132
5140
|
*/
|
|
5133
5141
|
idempotencyKey?: string;
|
|
5142
|
+
/**
|
|
5143
|
+
* Endorsed-request envelope (`{ signatures, intent }`) for mutating
|
|
5144
|
+
* policy, signer-group, and wallet-transaction endpoints. Required by the
|
|
5145
|
+
* server on all endorsed routes — passing this is the only way the
|
|
5146
|
+
* signature ever reaches the wire. On methods that already accept a
|
|
5147
|
+
* typed `data` argument (e.g. `policies.addRule`, `policies.updateRule`),
|
|
5148
|
+
* `endorsement` takes precedence over `data` when both are provided so
|
|
5149
|
+
* you can swap a bare data shape for an endorsed envelope at the call
|
|
5150
|
+
* site without breaking the typed signature.
|
|
5151
|
+
*/
|
|
5152
|
+
endorsement?: EndorsedRequest;
|
|
5134
5153
|
}
|
|
5135
5154
|
/** Pagination metadata */
|
|
5136
5155
|
type Meta = components['schemas']['Meta'];
|
|
@@ -6023,9 +6042,14 @@ declare class PoliciesResource extends BaseResource {
|
|
|
6023
6042
|
/**
|
|
6024
6043
|
* Delete a policy.
|
|
6025
6044
|
*
|
|
6045
|
+
* Endorsed endpoint — `options.endorsement` must contain a signed
|
|
6046
|
+
* `DeletePolicyIntent`. The server rejects requests without a valid
|
|
6047
|
+
* endorsement body.
|
|
6048
|
+
*
|
|
6026
6049
|
* @param policyId - Policy ID
|
|
6050
|
+
* @param options - Request options (must include `endorsement`)
|
|
6027
6051
|
*/
|
|
6028
|
-
delete(policyId: string): Promise<void>;
|
|
6052
|
+
delete(policyId: string, options?: RequestOptions): Promise<void>;
|
|
6029
6053
|
/**
|
|
6030
6054
|
* Add a rule to a policy.
|
|
6031
6055
|
*
|
|
@@ -6046,10 +6070,15 @@ declare class PoliciesResource extends BaseResource {
|
|
|
6046
6070
|
/**
|
|
6047
6071
|
* Delete a policy rule.
|
|
6048
6072
|
*
|
|
6073
|
+
* Endorsed endpoint — `options.endorsement` must contain a signed
|
|
6074
|
+
* `RemovePolicyRuleIntent`. The server rejects requests without a valid
|
|
6075
|
+
* endorsement body.
|
|
6076
|
+
*
|
|
6049
6077
|
* @param policyId - Policy ID
|
|
6050
6078
|
* @param ruleId - Rule ID
|
|
6079
|
+
* @param options - Request options (must include `endorsement`)
|
|
6051
6080
|
*/
|
|
6052
|
-
deleteRule(policyId: string, ruleId: string): Promise<void>;
|
|
6081
|
+
deleteRule(policyId: string, ruleId: string, options?: RequestOptions): Promise<void>;
|
|
6053
6082
|
/**
|
|
6054
6083
|
* Get wallets attached to a policy.
|
|
6055
6084
|
*
|
|
@@ -6062,17 +6091,27 @@ declare class PoliciesResource extends BaseResource {
|
|
|
6062
6091
|
/**
|
|
6063
6092
|
* Attach a policy to a wallet.
|
|
6064
6093
|
*
|
|
6094
|
+
* Endorsed endpoint — `options.endorsement` must contain a signed
|
|
6095
|
+
* `AttachPolicyToWalletIntent`. The server rejects requests without a
|
|
6096
|
+
* valid endorsement body.
|
|
6097
|
+
*
|
|
6065
6098
|
* @param policyId - Policy ID
|
|
6066
6099
|
* @param walletId - Wallet ID
|
|
6100
|
+
* @param options - Request options (must include `endorsement`)
|
|
6067
6101
|
*/
|
|
6068
6102
|
attachToWallet(policyId: string, walletId: string, options?: RequestOptions): Promise<void>;
|
|
6069
6103
|
/**
|
|
6070
6104
|
* Detach a policy from a wallet.
|
|
6071
6105
|
*
|
|
6106
|
+
* Endorsed endpoint — `options.endorsement` must contain a signed
|
|
6107
|
+
* `DetachPolicyFromWalletIntent`. The server rejects requests without a
|
|
6108
|
+
* valid endorsement body.
|
|
6109
|
+
*
|
|
6072
6110
|
* @param policyId - Policy ID
|
|
6073
6111
|
* @param walletId - Wallet ID
|
|
6112
|
+
* @param options - Request options (must include `endorsement`)
|
|
6074
6113
|
*/
|
|
6075
|
-
detachFromWallet(policyId: string, walletId: string): Promise<void>;
|
|
6114
|
+
detachFromWallet(policyId: string, walletId: string, options?: RequestOptions): Promise<void>;
|
|
6076
6115
|
}
|
|
6077
6116
|
|
|
6078
6117
|
/**
|
|
@@ -6131,17 +6170,27 @@ declare class SignerGroupsResource extends BaseResource {
|
|
|
6131
6170
|
/**
|
|
6132
6171
|
* Attach a signer group to a wallet.
|
|
6133
6172
|
*
|
|
6173
|
+
* Endorsed endpoint — `options.endorsement` must contain a signed
|
|
6174
|
+
* `AttachGroupToWalletIntent`. The server rejects requests without a
|
|
6175
|
+
* valid endorsement body.
|
|
6176
|
+
*
|
|
6134
6177
|
* @param walletId - Wallet ID
|
|
6135
6178
|
* @param signerGroupId - Signer group ID
|
|
6179
|
+
* @param options - Request options (must include `endorsement`)
|
|
6136
6180
|
*/
|
|
6137
6181
|
attachToWallet(walletId: string, signerGroupId: string, options?: RequestOptions): Promise<void>;
|
|
6138
6182
|
/**
|
|
6139
6183
|
* Detach a signer group from a wallet.
|
|
6140
6184
|
*
|
|
6185
|
+
* Endorsed endpoint — `options.endorsement` must contain a signed
|
|
6186
|
+
* `DetachGroupFromWalletIntent`. The server rejects requests without a
|
|
6187
|
+
* valid endorsement body.
|
|
6188
|
+
*
|
|
6141
6189
|
* @param walletId - Wallet ID
|
|
6142
6190
|
* @param signerGroupId - Signer group ID
|
|
6191
|
+
* @param options - Request options (must include `endorsement`)
|
|
6143
6192
|
*/
|
|
6144
|
-
detachFromWallet(walletId: string, signerGroupId: string): Promise<void>;
|
|
6193
|
+
detachFromWallet(walletId: string, signerGroupId: string, options?: RequestOptions): Promise<void>;
|
|
6145
6194
|
/**
|
|
6146
6195
|
* List signer groups attached to a wallet.
|
|
6147
6196
|
*
|
|
@@ -6374,7 +6423,7 @@ declare class InfoResource extends BaseResource {
|
|
|
6374
6423
|
* }
|
|
6375
6424
|
* ```
|
|
6376
6425
|
*/
|
|
6377
|
-
getNetworks(): Promise<
|
|
6426
|
+
getNetworks(): Promise<string[]>;
|
|
6378
6427
|
}
|
|
6379
6428
|
|
|
6380
6429
|
/**
|
|
@@ -6829,4 +6878,4 @@ declare class ConfigurationError extends Error {
|
|
|
6829
6878
|
constructor(message: string);
|
|
6830
6879
|
}
|
|
6831
6880
|
|
|
6832
|
-
export { APIError, type Account, type AccountCreateRequest, type AccountListParams, type AccountUpdateRequest, AccountsResource, type Address, type AdvanceSimulationRequest, type AdvanceSimulationResult, type ApiKey, type ApiKeyCreateRequest, type ApiKeyResponse, ApiKeysResource, type Application, type ApplicationDocumentType, type ApplicationDocumentUploadRequest, type ApplicationDocumentUploadUrlRequest, type ApplicationListItem, type ApplicationStatus, type ApplicationSubmissionRequest, ApplicationsResource, type AssociatedIndividual, type AssociatedIndividualRequest, type AttachedPolicy, type AttachedWallet, type AttestationSubmitRequest, type AttestationType, AuthMode, type AutoTransaction, AutoTransactionsResource, type AverageMonthlyRevenue, type BulkImportSumsubTokensRequest, type BulkImportSumsubTokensResponse, type BulkImportSumsubTokensResult, type BusinessApplicationCreateRequest, type BusinessDetailsResponse, type BusinessPurposeOfAccount, type BusinessSourceOfFunds, type ClientPricingConfig, ConfigurationError, type Country, type CreateApiKeyForClientRequest, type CryptoDestination, type CryptoDestinationRequest, type CursorExtractor, type Customer, type CustomerCreateRequest, type CustomerCreateResponse, type CustomerListParams, CustomersResource, DEFAULT_RETRY_POLICY, DakotaClient, type DakotaClientConfig, type Destination, type DestinationRequest, DestinationsResource, type DocumentUploadResponse, type DocumentUploadUrlResponse, type EDDRequest, type EDDWithApplicationID, type EmploymentStatus, Environment, type Event, type EventListParams, type EventType, EventsResource, type ExpectedMonthlyDeposit, type Family, type FiatUSDestination, type FiatUSDestinationRequest, type IndividualDetailsResponse, type IndividualDocumentType, type IndividualDocumentUploadRequest, type IndividualDocumentUploadUrlRequest, type IndividualRequest, type IndividualRole, type IndividualTitle, InfoResource, type KSUID, type KybStatus, type LegalStructure, type ListParams, type Logger, type Meta, type Network, type NetworkId, type OfframpAccount, type OfframpAccountCreateRequest, type OneOffTransaction, type OneOffTransactionRequest, type OnrampAccount, type OnrampAccountCreateRequest, type PageFetcher, PaginatedIterator, type PaginatedResponse, type PaginationMeta, type PaginationParams, type PaymentCapability, type PersonName, PoliciesResource, type Policy, type PolicyCreateRequest, type PolicyRule, type PolicyRuleCreateRequest, type Recipient, type RecipientRequest, type RecipientUpdateRequest, RecipientsResource, type RequestOptions, type ResolvedConfig, type RetryPolicy, SandboxResource, type SandboxScenario, type SelfServeCreditTier, type SelfServeCreditTiersResponse, type SelfServeCreditsBalanceResponse, type SelfServeCreditsLedgerEntry, type SelfServeCreditsLedgerEntryType, type SelfServeCreditsLedgerParams, type SelfServeCreditsLedgerResponse, type SelfServeCreditsPricingResponse, type SelfServeCreditsPurchaseRequest, type SelfServeCreditsPurchaseResponse, SelfServeResource, type Signer, type SignerCreateRequest, type SignerGroup, type SignerGroupCreateRequest, SignerGroupsResource, SignersResource, type SimulateInboundRequest, type SimulateInboundType, type SimulateOnboardingRequest, type SimulateOnboardingResponse, type SimulateOnboardingType, type SimulationCallbackRecord, type SimulationInspection, type SimulationResponse, type SubClientSummary, type SwapAccount, type SwapAccountCreateRequest, type TransactionListParams, type TransactionStatus, TransactionsResource, TransportError, type UpdateCustomerSubClientRequest, type UploadedDocumentMetadata, type User, type UserCreateRequest, type UserUpdateRequest, UsersResource, type Wallet, type WalletBalance, type WalletBalances, type WalletCreateRequest, type WalletTransaction, type WalletTransactionRequest, WalletsResource, type WebhookEvent, type WebhookHistoryList, type WebhookHistoryListParams, type WebhookHistoryResponse, type WebhookReplayResponse, type WebhookTarget, type WebhookTargetCreateRequest, type WebhookTargetUpdateRequest, WebhooksResource, consoleLogger, getEnvironmentURL, noopLogger, paginate };
|
|
6881
|
+
export { APIError, type Account, type AccountCreateRequest, type AccountListParams, type AccountUpdateRequest, AccountsResource, type Address, type AdvanceSimulationRequest, type AdvanceSimulationResult, type ApiKey, type ApiKeyCreateRequest, type ApiKeyResponse, ApiKeysResource, type Application, type ApplicationDocumentType, type ApplicationDocumentUploadRequest, type ApplicationDocumentUploadUrlRequest, type ApplicationListItem, type ApplicationStatus, type ApplicationSubmissionRequest, ApplicationsResource, type AssociatedIndividual, type AssociatedIndividualRequest, type AttachedPolicy, type AttachedWallet, type AttestationSubmitRequest, type AttestationType, AuthMode, type AutoTransaction, AutoTransactionsResource, type AverageMonthlyRevenue, type BulkImportSumsubTokensRequest, type BulkImportSumsubTokensResponse, type BulkImportSumsubTokensResult, type BusinessApplicationCreateRequest, type BusinessDetailsResponse, type BusinessPurposeOfAccount, type BusinessSourceOfFunds, type ClientPricingConfig, ConfigurationError, type Country, type CreateApiKeyForClientRequest, type CryptoDestination, type CryptoDestinationRequest, type CursorExtractor, type Customer, type CustomerCreateRequest, type CustomerCreateResponse, type CustomerListParams, CustomersResource, DEFAULT_RETRY_POLICY, DakotaClient, type DakotaClientConfig, type Destination, type DestinationRequest, DestinationsResource, type DocumentUploadResponse, type DocumentUploadUrlResponse, type EDDRequest, type EDDWithApplicationID, type EmploymentStatus, type EndorsedRequest, Environment, type Event, type EventListParams, type EventType, EventsResource, type ExpectedMonthlyDeposit, type Family, type FiatUSDestination, type FiatUSDestinationRequest, type IndividualDetailsResponse, type IndividualDocumentType, type IndividualDocumentUploadRequest, type IndividualDocumentUploadUrlRequest, type IndividualRequest, type IndividualRole, type IndividualTitle, InfoResource, type KSUID, type KybStatus, type LegalStructure, type ListParams, type Logger, type Meta, type Network, type NetworkId, type OfframpAccount, type OfframpAccountCreateRequest, type OneOffTransaction, type OneOffTransactionRequest, type OnrampAccount, type OnrampAccountCreateRequest, type PageFetcher, PaginatedIterator, type PaginatedResponse, type PaginationMeta, type PaginationParams, type PaymentCapability, type PersonName, PoliciesResource, type Policy, type PolicyCreateRequest, type PolicyRule, type PolicyRuleCreateRequest, type Recipient, type RecipientRequest, type RecipientUpdateRequest, RecipientsResource, type RequestOptions, type ResolvedConfig, type RetryPolicy, SandboxResource, type SandboxScenario, type SelfServeCreditTier, type SelfServeCreditTiersResponse, type SelfServeCreditsBalanceResponse, type SelfServeCreditsLedgerEntry, type SelfServeCreditsLedgerEntryType, type SelfServeCreditsLedgerParams, type SelfServeCreditsLedgerResponse, type SelfServeCreditsPricingResponse, type SelfServeCreditsPurchaseRequest, type SelfServeCreditsPurchaseResponse, SelfServeResource, type Signer, type SignerCreateRequest, type SignerGroup, type SignerGroupCreateRequest, SignerGroupsResource, SignersResource, type SimulateInboundRequest, type SimulateInboundType, type SimulateOnboardingRequest, type SimulateOnboardingResponse, type SimulateOnboardingType, type SimulationCallbackRecord, type SimulationInspection, type SimulationResponse, type SubClientSummary, type SwapAccount, type SwapAccountCreateRequest, type TransactionListParams, type TransactionStatus, TransactionsResource, TransportError, type UpdateCustomerSubClientRequest, type UploadedDocumentMetadata, type User, type UserCreateRequest, type UserUpdateRequest, UsersResource, type Wallet, type WalletBalance, type WalletBalances, type WalletCreateRequest, type WalletTransaction, type WalletTransactionRequest, WalletsResource, type WebhookEvent, type WebhookHistoryList, type WebhookHistoryListParams, type WebhookHistoryResponse, type WebhookReplayResponse, type WebhookTarget, type WebhookTargetCreateRequest, type WebhookTargetUpdateRequest, WebhooksResource, consoleLogger, getEnvironmentURL, noopLogger, paginate };
|
package/dist/index.js
CHANGED
|
@@ -229,6 +229,7 @@ function resolveConfig(config) {
|
|
|
229
229
|
// src/client/transport.ts
|
|
230
230
|
var RETRYABLE_STATUS_CODES2 = /* @__PURE__ */ new Set([429, 500, 502, 503, 504]);
|
|
231
231
|
var SAFE_METHODS = /* @__PURE__ */ new Set(["GET", "HEAD", "PUT", "DELETE", "OPTIONS"]);
|
|
232
|
+
var IDEMPOTENT_METHODS = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH"]);
|
|
232
233
|
var Transport = class {
|
|
233
234
|
config;
|
|
234
235
|
constructor(config) {
|
|
@@ -274,7 +275,7 @@ var Transport = class {
|
|
|
274
275
|
...customHeaders
|
|
275
276
|
};
|
|
276
277
|
this.addAuthHeader(headers, path);
|
|
277
|
-
if (method
|
|
278
|
+
if (IDEMPOTENT_METHODS.has(method)) {
|
|
278
279
|
const key = idempotencyKey ?? (this.config.automaticIdempotency ? this.config.idempotencyKeyGenerator() : void 0);
|
|
279
280
|
if (key) {
|
|
280
281
|
headers["x-idempotency-key"] = key;
|
|
@@ -386,7 +387,7 @@ var Transport = class {
|
|
|
386
387
|
if (SAFE_METHODS.has(method)) {
|
|
387
388
|
return true;
|
|
388
389
|
}
|
|
389
|
-
if (method
|
|
390
|
+
if (IDEMPOTENT_METHODS.has(method) && init.headers) {
|
|
390
391
|
const headers = init.headers;
|
|
391
392
|
return !!headers["x-idempotency-key"];
|
|
392
393
|
}
|
|
@@ -402,7 +403,7 @@ var Transport = class {
|
|
|
402
403
|
if (SAFE_METHODS.has(method)) {
|
|
403
404
|
return true;
|
|
404
405
|
}
|
|
405
|
-
if (method
|
|
406
|
+
if (IDEMPOTENT_METHODS.has(method) && init.headers) {
|
|
406
407
|
const headers = init.headers;
|
|
407
408
|
return !!headers["x-idempotency-key"];
|
|
408
409
|
}
|
|
@@ -1271,7 +1272,7 @@ var WalletsResource = class extends BaseResource {
|
|
|
1271
1272
|
method: "GET",
|
|
1272
1273
|
path: `/wallets/${walletId}/balances`
|
|
1273
1274
|
});
|
|
1274
|
-
return response.
|
|
1275
|
+
return response.balances ? [...response.balances] : [];
|
|
1275
1276
|
}
|
|
1276
1277
|
/**
|
|
1277
1278
|
* Create a wallet transaction.
|
|
@@ -1686,12 +1687,19 @@ var PoliciesResource = class extends BaseResource {
|
|
|
1686
1687
|
/**
|
|
1687
1688
|
* Delete a policy.
|
|
1688
1689
|
*
|
|
1690
|
+
* Endorsed endpoint — `options.endorsement` must contain a signed
|
|
1691
|
+
* `DeletePolicyIntent`. The server rejects requests without a valid
|
|
1692
|
+
* endorsement body.
|
|
1693
|
+
*
|
|
1689
1694
|
* @param policyId - Policy ID
|
|
1695
|
+
* @param options - Request options (must include `endorsement`)
|
|
1690
1696
|
*/
|
|
1691
|
-
async delete(policyId) {
|
|
1697
|
+
async delete(policyId, options) {
|
|
1692
1698
|
await this.transport.request({
|
|
1693
1699
|
method: "DELETE",
|
|
1694
|
-
path: `/policies/${policyId}
|
|
1700
|
+
path: `/policies/${policyId}`,
|
|
1701
|
+
body: options?.endorsement,
|
|
1702
|
+
idempotencyKey: options?.idempotencyKey
|
|
1695
1703
|
});
|
|
1696
1704
|
}
|
|
1697
1705
|
/**
|
|
@@ -1705,7 +1713,7 @@ var PoliciesResource = class extends BaseResource {
|
|
|
1705
1713
|
return this.transport.request({
|
|
1706
1714
|
method: "POST",
|
|
1707
1715
|
path: `/policies/${policyId}/rules`,
|
|
1708
|
-
body: data,
|
|
1716
|
+
body: options?.endorsement ?? data,
|
|
1709
1717
|
idempotencyKey: options?.idempotencyKey
|
|
1710
1718
|
});
|
|
1711
1719
|
}
|
|
@@ -1721,20 +1729,27 @@ var PoliciesResource = class extends BaseResource {
|
|
|
1721
1729
|
return this.transport.request({
|
|
1722
1730
|
method: "PATCH",
|
|
1723
1731
|
path: `/policies/${policyId}/rules/${ruleId}`,
|
|
1724
|
-
body: data,
|
|
1732
|
+
body: options?.endorsement ?? data,
|
|
1725
1733
|
idempotencyKey: options?.idempotencyKey
|
|
1726
1734
|
});
|
|
1727
1735
|
}
|
|
1728
1736
|
/**
|
|
1729
1737
|
* Delete a policy rule.
|
|
1730
1738
|
*
|
|
1739
|
+
* Endorsed endpoint — `options.endorsement` must contain a signed
|
|
1740
|
+
* `RemovePolicyRuleIntent`. The server rejects requests without a valid
|
|
1741
|
+
* endorsement body.
|
|
1742
|
+
*
|
|
1731
1743
|
* @param policyId - Policy ID
|
|
1732
1744
|
* @param ruleId - Rule ID
|
|
1745
|
+
* @param options - Request options (must include `endorsement`)
|
|
1733
1746
|
*/
|
|
1734
|
-
async deleteRule(policyId, ruleId) {
|
|
1747
|
+
async deleteRule(policyId, ruleId, options) {
|
|
1735
1748
|
await this.transport.request({
|
|
1736
1749
|
method: "DELETE",
|
|
1737
|
-
path: `/policies/${policyId}/rules/${ruleId}
|
|
1750
|
+
path: `/policies/${policyId}/rules/${ruleId}`,
|
|
1751
|
+
body: options?.endorsement,
|
|
1752
|
+
idempotencyKey: options?.idempotencyKey
|
|
1738
1753
|
});
|
|
1739
1754
|
}
|
|
1740
1755
|
/**
|
|
@@ -1754,26 +1769,39 @@ var PoliciesResource = class extends BaseResource {
|
|
|
1754
1769
|
/**
|
|
1755
1770
|
* Attach a policy to a wallet.
|
|
1756
1771
|
*
|
|
1772
|
+
* Endorsed endpoint — `options.endorsement` must contain a signed
|
|
1773
|
+
* `AttachPolicyToWalletIntent`. The server rejects requests without a
|
|
1774
|
+
* valid endorsement body.
|
|
1775
|
+
*
|
|
1757
1776
|
* @param policyId - Policy ID
|
|
1758
1777
|
* @param walletId - Wallet ID
|
|
1778
|
+
* @param options - Request options (must include `endorsement`)
|
|
1759
1779
|
*/
|
|
1760
1780
|
async attachToWallet(policyId, walletId, options) {
|
|
1761
1781
|
await this.transport.request({
|
|
1762
1782
|
method: "PUT",
|
|
1763
1783
|
path: `/policies/${policyId}/wallets/${walletId}`,
|
|
1784
|
+
body: options?.endorsement,
|
|
1764
1785
|
idempotencyKey: options?.idempotencyKey
|
|
1765
1786
|
});
|
|
1766
1787
|
}
|
|
1767
1788
|
/**
|
|
1768
1789
|
* Detach a policy from a wallet.
|
|
1769
1790
|
*
|
|
1791
|
+
* Endorsed endpoint — `options.endorsement` must contain a signed
|
|
1792
|
+
* `DetachPolicyFromWalletIntent`. The server rejects requests without a
|
|
1793
|
+
* valid endorsement body.
|
|
1794
|
+
*
|
|
1770
1795
|
* @param policyId - Policy ID
|
|
1771
1796
|
* @param walletId - Wallet ID
|
|
1797
|
+
* @param options - Request options (must include `endorsement`)
|
|
1772
1798
|
*/
|
|
1773
|
-
async detachFromWallet(policyId, walletId) {
|
|
1799
|
+
async detachFromWallet(policyId, walletId, options) {
|
|
1774
1800
|
await this.transport.request({
|
|
1775
1801
|
method: "DELETE",
|
|
1776
|
-
path: `/policies/${policyId}/wallets/${walletId}
|
|
1802
|
+
path: `/policies/${policyId}/wallets/${walletId}`,
|
|
1803
|
+
body: options?.endorsement,
|
|
1804
|
+
idempotencyKey: options?.idempotencyKey
|
|
1777
1805
|
});
|
|
1778
1806
|
}
|
|
1779
1807
|
};
|
|
@@ -1859,26 +1887,39 @@ var SignerGroupsResource = class extends BaseResource {
|
|
|
1859
1887
|
/**
|
|
1860
1888
|
* Attach a signer group to a wallet.
|
|
1861
1889
|
*
|
|
1890
|
+
* Endorsed endpoint — `options.endorsement` must contain a signed
|
|
1891
|
+
* `AttachGroupToWalletIntent`. The server rejects requests without a
|
|
1892
|
+
* valid endorsement body.
|
|
1893
|
+
*
|
|
1862
1894
|
* @param walletId - Wallet ID
|
|
1863
1895
|
* @param signerGroupId - Signer group ID
|
|
1896
|
+
* @param options - Request options (must include `endorsement`)
|
|
1864
1897
|
*/
|
|
1865
1898
|
async attachToWallet(walletId, signerGroupId, options) {
|
|
1866
1899
|
await this.transport.request({
|
|
1867
1900
|
method: "PUT",
|
|
1868
1901
|
path: `/wallets/${walletId}/signer-groups/${signerGroupId}`,
|
|
1902
|
+
body: options?.endorsement,
|
|
1869
1903
|
idempotencyKey: options?.idempotencyKey
|
|
1870
1904
|
});
|
|
1871
1905
|
}
|
|
1872
1906
|
/**
|
|
1873
1907
|
* Detach a signer group from a wallet.
|
|
1874
1908
|
*
|
|
1909
|
+
* Endorsed endpoint — `options.endorsement` must contain a signed
|
|
1910
|
+
* `DetachGroupFromWalletIntent`. The server rejects requests without a
|
|
1911
|
+
* valid endorsement body.
|
|
1912
|
+
*
|
|
1875
1913
|
* @param walletId - Wallet ID
|
|
1876
1914
|
* @param signerGroupId - Signer group ID
|
|
1915
|
+
* @param options - Request options (must include `endorsement`)
|
|
1877
1916
|
*/
|
|
1878
|
-
async detachFromWallet(walletId, signerGroupId) {
|
|
1917
|
+
async detachFromWallet(walletId, signerGroupId, options) {
|
|
1879
1918
|
await this.transport.request({
|
|
1880
1919
|
method: "DELETE",
|
|
1881
|
-
path: `/wallets/${walletId}/signer-groups/${signerGroupId}
|
|
1920
|
+
path: `/wallets/${walletId}/signer-groups/${signerGroupId}`,
|
|
1921
|
+
body: options?.endorsement,
|
|
1922
|
+
idempotencyKey: options?.idempotencyKey
|
|
1882
1923
|
});
|
|
1883
1924
|
}
|
|
1884
1925
|
/**
|
|
@@ -2185,11 +2226,10 @@ var InfoResource = class extends BaseResource {
|
|
|
2185
2226
|
* ```
|
|
2186
2227
|
*/
|
|
2187
2228
|
async getCountries() {
|
|
2188
|
-
|
|
2229
|
+
return this.transport.request({
|
|
2189
2230
|
method: "GET",
|
|
2190
2231
|
path: "/capabilities/countries"
|
|
2191
2232
|
});
|
|
2192
|
-
return response.data;
|
|
2193
2233
|
}
|
|
2194
2234
|
/**
|
|
2195
2235
|
* Get supported networks.
|
|
@@ -2205,11 +2245,10 @@ var InfoResource = class extends BaseResource {
|
|
|
2205
2245
|
* ```
|
|
2206
2246
|
*/
|
|
2207
2247
|
async getNetworks() {
|
|
2208
|
-
|
|
2248
|
+
return this.transport.request({
|
|
2209
2249
|
method: "GET",
|
|
2210
2250
|
path: "/capabilities/networks"
|
|
2211
2251
|
});
|
|
2212
|
-
return response.data;
|
|
2213
2252
|
}
|
|
2214
2253
|
};
|
|
2215
2254
|
|