Skip to content

promises/Payment.ts

This module provides promise-based core functionality.

Added in v0.3.2

Signature

export declare const createBatchPayment: (options: {
payees: ReadonlyArray<payment.CreateBatchPaymentPayee>
destinationChainId: UniversalChainId
}) => Promise<payment.CreateBatchPaymentResult[]>

Added in v0.4.0

Signature

export declare const generateKey: () => Promise<PaymentKey>

Added in v0.4.0

Signature

export declare const generateProof: (
options: {
destinationPublicClient: PublicClient.PublicClient
sourcePublicClient: PublicClient.PublicClient
publicClient: PublicClient.PublicClient
prover: Prover.Prover
} & Parameters<typeof payment.generateProof>[0]
) => Promise<payment.Proof>

Added in v0.4.0

Signature

export declare const getDepositAddress: (options: {
paymentKey: PaymentKey
beneficiaries: ReadonlyArray<Erc20Address>
destinationChainId: UniversalChainId
}) => Promise<{
beneficiaries: [Erc20Address, Erc20Address, Erc20Address, Erc20Address]
zAssetAddress: ZAssetAddress
destinationChainId: string & Brand<"UniversalChainId">
}>

Added in v0.4.0

Signature

export declare const getNullifier: (options: {
paymentKey: PaymentKey
destinationChainId: UniversalChainId
}) => Promise<Nullifier>

Added in v0.4.0

Signature

export declare const prepareDeposit: (
options: { sourceWalletClient: WalletClient.WalletClient } & Parameters<typeof payment.prepareDeposit>[0]
) => Promise<
readonly [
{
readonly _tag: "PreparedEvm"
readonly kind: "Erc20.Approve" | "Erc20.Wrap" | "ZAsset.Transfer" | "LoopbackClient.Update"
readonly universalChainId: UniversalChainId
readonly contractAddress: Erc20Address
readonly abi: Abi
readonly functionName: string
readonly args: ReadonlyArray<unknown>
},
...{
readonly _tag: "PreparedEvm"
readonly kind: "Erc20.Approve" | "Erc20.Wrap" | "ZAsset.Transfer" | "LoopbackClient.Update"
readonly universalChainId: UniversalChainId
readonly contractAddress: Erc20Address
readonly abi: Abi
readonly functionName: string
readonly args: ReadonlyArray<unknown>
}[]
]
>

Added in v0.4.0

Signature

export declare const prepareRedemption: (
options: { destinationWalletClient: WalletClient.WalletClient } & Parameters<typeof payment.prepareRedemption>[0]
) => Promise<{
readonly _tag: "PreparedEvm"
readonly kind: "Erc20.Approve" | "Erc20.Wrap" | "ZAsset.Transfer" | "LoopbackClient.Update"
readonly universalChainId: UniversalChainId
readonly contractAddress: Erc20Address
readonly abi: Abi
readonly functionName: string
readonly args: ReadonlyArray<unknown>
}>

Added in v0.4.0