@fairmint/canton-node-sdk
Version:
Canton Node SDK
61 lines • 2.2 kB
TypeScript
import { type LedgerJsonApiClient } from '../../clients/ledger-json-api';
import { type SubmitAndWaitForTransactionTreeResponse } from '../../clients/ledger-json-api/operations/v2/commands/submit-and-wait-for-transaction-tree';
import { type ValidatorApiClient } from '../../clients/validator-api';
export interface TransferRequest {
/** Recipient party ID */
recipientPartyId: string;
/** Amount to transfer */
amount: string;
/** Optional description for the transfer */
description?: string;
}
export interface TransferToPreapprovedParams {
/** Party ID sending the transfer */
senderPartyId: string;
/** Array of transfer requests */
transfers: TransferRequest[];
}
export interface TransferToPreapprovedResult {
/** Array of transfer results */
transferResults: Array<{
/** Recipient party ID */
recipientPartyId: string;
/** Contract ID of the TransferPreapproval contract used */
contractId: string;
/** Domain ID where the transfer occurred */
domainId: string;
/** Transfer result summary */
transferResult: SubmitAndWaitForTransactionTreeResponse;
}>;
}
/**
* Transfers coins to multiple parties that have pre-approved transfers enabled
*
* @example
* ```typescript
* const result = await transferToPreapproved(ledgerClient, validatorClient, {
* senderPartyId: 'sender-party-id',
* transfers: [
* {
* recipientPartyId: 'recipient-1',
* amount: '100',
* description: 'Payment for services'
* },
* {
* recipientPartyId: 'recipient-2',
* amount: '50',
* description: 'Bonus payment'
* }
* ]
* });
*
*
* ```;
*
* @param ledgerClient - Ledger JSON API client for submitting commands
* @param validatorClient - Validator API client for getting network information
* @param params - Parameters for the transfers
* @returns Promise resolving to the transfer results
*/
export declare function transferToPreapproved(ledgerClient: LedgerJsonApiClient, validatorClient: ValidatorApiClient, params: TransferToPreapprovedParams): Promise<TransferToPreapprovedResult>;
//# sourceMappingURL=transfer-to-preapproved.d.ts.map