JS API Reference
Module: payment/api
Table of contents
Interfaces
Type Aliases
Type Aliases
PaymentEvents
Ƭ PaymentEvents: Object
Type declaration
Name | Type |
---|---|
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
CreateAllocationParams
Ƭ CreateAllocationParams: Object
Type declaration
Name | Type | Description |
---|---|---|
budget | number | How much to allocate |
expirationSec | number | How long the allocation should be valid |
paymentPlatform? | string | Optionally 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.contract | string | Address of the smart contract that holds the deposit. |
deposit.id | string | ID of the deposit, obtained by calling the createDeposit method on the smart contract. |