xpExchange Actions
xp.cancelContract(recordName: string, address: string, options: RecordActionOptions): Promise<GenericResult>
Cancels a contract contract via the xpExchange and refunds any funds.
The first parameter is a string and is the name of the record that the contract is stored in.
The second parameter is a string and is the address of the contract to cancel.
The third parameter is a RecordActionOptions and is the options for the request.
xp.getAccountBalances(options: RecordActionOptions): Promise<GenericResult>
Attempts to retrieve the account balances for the user's account.
The first parameter is a RecordActionOptions and is the options for the request.
xp.getContract(recordName: string, address: string, options: RecordActionOptions): Promise<(ContractRecord | null)>
Gets the contract with the given address.
The first parameter is a string and is the name of the record that the contract is stored in.
The second parameter is a string and is the address of the contract.
The third parameter is a RecordActionOptions and is the options for the request.
xp.getContractPricing(recordName: string, address: string, options: RecordActionOptions): Promise<GenericResult>
Gets the pricing for the given contract.
The first parameter is a string and is the name of the record that the contracts are stored in.
The second parameter is a string and is the address of the contract.
The third parameter is a RecordActionOptions and is the options for the request.
xp.invoiceContract(request: APIInvoiceContractRequest, options: RecordActionOptions): Promise<GenericResult>
Creates a new invoice for the given contract.
The first parameter is a APIInvoiceContractRequest and is the request for the invoice.
The second parameter is a RecordActionOptions and is the options for the request.
xp.listContracts(recordName: string, address: string, options: RecordActionOptions): Promise<ContractRecord[]>
Gets a list of contracts from the given record.
The first parameter is a string and is the name of the record that the contracts are stored in.
The second parameter is a string and is the address that the contracts should be listed after. If null, then the first page of contracts will be returned.
The third parameter is a RecordActionOptions and is the options for the request.
xp.listInvoices(contractId: string, options: RecordActionOptions): Promise<GenericResult>
Lists the invoices for the given contract.
The first parameter is a string and is the ID of the contract to list invoices for.
The second parameter is a RecordActionOptions and is the options for the request.
xp.payout(request: APIPayoutRequest, options: RecordActionOptions): Promise<GenericResult>
Attempts to payout funds from the user's account to their linked payout destination.
The first parameter is a APIPayoutRequest and is the payout request.
The second parameter is a RecordActionOptions and is the options for the request.
xp.purchaseContract(request: APIPurchaseContractRequest, options: RecordActionOptions): Promise<GenericResult>
Attempts to purchase a contract via the xpExchange.
The first parameter is a APIPurchaseContractRequest and is the request for the purchase.
The second parameter is a RecordActionOptions and is the options for the request.
xp.recordContract(recordName: string, contract: ContractRecordInput, options: RecordActionOptions): Promise<void>
Creates a new contract record in the XP system.
The first parameter is a string and is the name of the record that the contract should be stored in.
The second parameter is a ContractRecordInput and is the contract record data.
The third parameter is a RecordActionOptions and is the options for the request.
xp.voidInvoice(invoiceId: string, options: RecordActionOptions): Promise<GenericResult>
Voids (cancels) an invoice.
The first parameter is a string and is the ID of the invoice to void.
The second parameter is a RecordActionOptions and is the options for the request.