@interlay/interbtc-api / Exports / DefaultTransactionAPI
• new DefaultTransactionAPI(api
, account?
): DefaultTransactionAPI
Name | Type |
---|---|
api |
ApiPromise |
account? |
AddressOrPair |
src/parachain/transaction.ts:58
• Private
Optional
account: AddressOrPair
src/parachain/transaction.ts:58
• api: ApiPromise
src/parachain/transaction.ts:58
▸ buildBatchExtrinsic(extrinsics
, atomic?
): SubmittableExtrinsic
<"promise"
, ISubmittableResult
>
Builds a submittable extrinsic to send other extrinsic in batch.
Name | Type | Default value | Description |
---|---|---|---|
extrinsics |
SubmittableExtrinsic <"promise" , ISubmittableResult >[] |
undefined |
An array of extrinsics to be submitted as batch. |
atomic |
boolean |
true |
Whether the given extrinsics should be handled atomically or not. When true (default) all extrinsics will rollback if one fails (batchAll), otherwise allows partial successes (batch). |
SubmittableExtrinsic
<"promise"
, ISubmittableResult
>
A batch/batchAll submittable extrinsic.
TransactionAPI.buildBatchExtrinsic
src/parachain/transaction.ts:107
▸ dryRun(extrinsic
): Promise
<DryRunResult
>
Tests extrinsic execution against runtime.
Name | Type | Description |
---|---|---|
extrinsic |
SubmittableExtrinsic <"promise" , ISubmittableResult > |
Extrinsic to dry run. |
Promise
<DryRunResult
>
Object consisting of success
boolean that is true if extrinsic
was successfully executed, false otherwise. If execution fails, caught error is exposed.
src/parachain/transaction.ts:95
▸ getAccount(): undefined
| AddressOrPair
undefined
| AddressOrPair
src/parachain/transaction.ts:68
▸ getFeeEstimate(extrinsic
): Promise
<MonetaryAmount
<Currency
>>
Getter for fee estimate of the extrinsic.
Name | Type | Description |
---|---|---|
extrinsic |
SubmittableExtrinsic <"promise" , ISubmittableResult > |
Extrinsic to get fee estimation about. |
Promise
<MonetaryAmount
<Currency
>>
amount of native currency that will be paid as transaction fee.
Note
This fee estimation does not include tip.
src/parachain/transaction.ts:83
▸ removeAccount(): void
void
src/parachain/transaction.ts:64
▸ sendLogged<T
>(transaction
, successEventType?
, extrinsicStatus?
): Promise
<ISubmittableResult
>
Name | Type |
---|---|
T |
extends AnyTuple |
Name | Type |
---|---|
transaction |
SubmittableExtrinsic <"promise" , ISubmittableResult > |
successEventType? |
AugmentedEvent <ApiTypes , T > |
extrinsicStatus? |
ExtrinsicStatus |
Promise
<ISubmittableResult
>
src/parachain/transaction.ts:72
▸ setAccount(account
): void
Name | Type |
---|---|
account |
AddressOrPair |
void
src/parachain/transaction.ts:60
▸ buildBatchExtrinsic(api
, extrinsics
, atomic?
): SubmittableExtrinsic
<"promise"
, ISubmittableResult
>
Builds a submittable extrinsic to send other extrinsic in batch.
Name | Type | Default value | Description |
---|---|---|---|
api |
ApiPromise |
undefined |
The ApiPromis instance to construct the batch extrinsic with. |
extrinsics |
SubmittableExtrinsic <"promise" , ISubmittableResult >[] |
undefined |
An array of extrinsics to be submitted as batch. |
atomic |
boolean |
true |
Whether the given extrinsics should be handled atomically or not. When true (default) all extrinsics will rollback if one fails (batchAll), otherwise allows partial successes (batch). |
SubmittableExtrinsic
<"promise"
, ISubmittableResult
>
A batch/batchAll submittable extrinsic.
src/parachain/transaction.ts:123
▸ doesArrayContainEvent<T
>(events
, eventType
): boolean
Name | Type |
---|---|
T |
extends AnyTuple |
Name | Type |
---|---|
events |
EventRecord [] |
eventType |
AugmentedEvent <ApiTypes , T > |
boolean
src/parachain/transaction.ts:238
▸ isDispatchError(eventData
): eventData is DispatchError
Name | Type |
---|---|
eventData |
unknown |
eventData is DispatchError
src/parachain/transaction.ts:234
▸ printEvents(api
, events
): void
Name | Type |
---|---|
api |
ApiPromise |
events |
EventRecord [] |
void
src/parachain/transaction.ts:204
▸ sendLogged<T
>(api
, account
, transaction
, successEventType?
, extrinsicStatus?
): Promise
<ISubmittableResult
>
Name | Type |
---|---|
T |
extends AnyTuple |
Name | Type |
---|---|
api |
ApiPromise |
account |
AddressOrPair |
transaction |
SubmittableExtrinsic <"promise" , ISubmittableResult > |
successEventType? |
AugmentedEvent <ApiTypes , T > |
extrinsicStatus? |
ExtrinsicStatus |
Promise
<ISubmittableResult
>