JS API Reference

Module: payment/api

Table of contents

Interfaces

Type Aliases

Type Aliases

PaymentEvents

Ƭ PaymentEvents: Object

Type declaration

NameType
allocationCreated(event: { allocation: Allocation }) => void
errorCreatingAllocation(event: { error: Error }) => void
allocationReleased(event: { allocation: Allocation }) => void
errorReleasingAllocation(event: { allocation: Allocation ; error: Error }) => void
allocationAmended(event: { allocation: Allocation }) => void
errorAmendingAllocation(event: { allocation: Allocation ; error: Error }) => void
invoiceReceived(event: { invoice: Invoice }) => void
debitNoteReceived(event: { debitNote: DebitNote }) => void
invoiceAccepted(event: { invoice: Invoice }) => void
invoiceRejected(event: { invoice: Invoice }) => void
errorAcceptingInvoice(event: { invoice: Invoice ; error: Error }) => void
errorRejectingInvoice(event: { invoice: Invoice ; error: Error }) => void
debitNoteAccepted(event: { debitNote: DebitNote }) => void
debitNoteRejected(event: { debitNote: DebitNote }) => void
errorAcceptingDebitNote(event: { debitNote: DebitNote ; error: Error }) => void
errorRejectingDebitNote(event: { debitNote: DebitNote ; error: Error }) => void

Defined in

src/payment/api.ts:6


CreateAllocationParams

Ƭ CreateAllocationParams: Object

Type declaration

NameTypeDescription
budgetnumberHow much to allocate
expirationSecnumberHow long the allocation should be valid
paymentPlatform?stringOptionally override the payment platform to use for this allocation
deposit?{ contract: string ; id: string }Optionally provide a deposit to be used for the allocation, instead of using funds from the yagna wallet. Deposit is a way to pay for the computation using someone else's funds. The other party has to call the createDeposit method on the LockPayment smart contract and provide the deposit ID. Deprecated NOT IMPLEMENTED BY YAGNA This is a feature that's not yet released in Yagna. The deprecation note will be removed once the feature will be supported by the network.
deposit.contractstringAddress of the smart contract that holds the deposit.
deposit.idstringID of the deposit, obtained by calling the createDeposit method on the smart contract.

Defined in

src/payment/api.ts:56

Was this helpful?