-
Notifications
You must be signed in to change notification settings - Fork 11
base.PolymeshTransaction.PolymeshTransaction
base/PolymeshTransaction.PolymeshTransaction
Wrapper class for a Polymesh Transaction
Name | Type |
---|---|
ReturnValue |
ReturnValue |
TransformedReturnValue |
ReturnValue |
Args |
extends unknown [] | [] = unknown [] |
-
PolymeshTransactionBase
<ReturnValue
,TransformedReturnValue
>↳
PolymeshTransaction
- getProtocolFees
- getTotalFees
- onProcessedByMiddleware
- onStatusChange
- run
- runAsProposal
- supportsSubsidy
- toSignablePayload
• args: Args
arguments for the transaction in SCALE format (polkadot.js Codec)
base/PolymeshTransaction.ts:40
• Optional
blockHash: string
hash of the block where this transaction resides (status: Succeeded
, Failed
)
PolymeshTransactionBase.blockHash
base/PolymeshTransactionBase.ts:106
• Optional
blockNumber: BigNumber
number of the block where this transaction resides (status: Succeeded
, Failed
)
PolymeshTransactionBase.blockNumber
base/PolymeshTransactionBase.ts:111
• Optional
error: PolymeshError
stores errors thrown while running the transaction (status: Failed
, Aborted
)
base/PolymeshTransactionBase.ts:86
• multiSig: null
| MultiSig
This will be set if the signingAddress is a MultiSig signer, otherwise null
When set it indicates the transaction will be wrapped as a proposal for the MultiSig,
meaning .runAsProposal
should be used instead of .run
PolymeshTransactionBase.multiSig
base/PolymeshTransactionBase.ts:119
• Optional
receipt: ISubmittableResult
stores the transaction receipt (if successful)
PolymeshTransactionBase.receipt
base/PolymeshTransactionBase.ts:91
• status: TransactionStatus
= TransactionStatus.Idle
current status of the transaction
PolymeshTransactionBase.status
base/PolymeshTransactionBase.ts:81
• tag: TxTag
type of transaction represented by this instance (mostly for display purposes)
base/PolymeshTransaction.ts:45
• Optional
txHash: string
transaction hash (status: Running
, Succeeded
, Failed
)
PolymeshTransactionBase.txHash
base/PolymeshTransactionBase.ts:96
• Optional
txIndex: BigNumber
transaction index within its block (status: Succeeded
, Failed
)
PolymeshTransactionBase.txIndex
base/PolymeshTransactionBase.ts:101
• get
isSuccess(): boolean
returns true if transaction has completed successfully
boolean
PolymeshTransactionBase.isSuccess
base/PolymeshTransactionBase.ts:903
• get
result(): TransformedReturnValue
returns the transaction result - this is the same value as the Promise run returns
TransformedReturnValue
Note
it is generally preferable to await
the Promise
returned by transaction.run() instead of reading this property
Throws
if the transaction.isSuccess property is false — be sure to check that before accessing!
PolymeshTransactionBase.result
base/PolymeshTransactionBase.ts:819
▸ getProtocolFees(): Promise
<BigNumber
>
Return this transaction's protocol fees. These are extra fees charged for specific operations on the chain. Not to be confused with network fees (which depend on the complexity of the operation), protocol fees are set by governance and/or chain upgrades
Promise
<BigNumber
>
PolymeshTransactionBase.getProtocolFees
base/PolymeshTransaction.ts:108
▸ getTotalFees(): Promise
<PayingAccountFees
>
Retrieve a breakdown of the fees required to run this transaction, as well as the Account responsible for paying them
Promise
<PayingAccountFees
>
Note
these values might be inaccurate if the transaction is run at a later time. This can be due to a governance vote or other chain related factors (like modifications to a specific subsidizer relationship or a chain upgrade)
PolymeshTransactionBase.getTotalFees
base/PolymeshTransactionBase.ts:537
▸ onProcessedByMiddleware(listener
): UnsubCallback
Subscribe to the results of this transaction being processed by the indexing service (and as such, available to the middleware)
Name | Type | Description |
---|---|---|
listener |
(err? : PolymeshError ) => void
|
callback function that will be called whenever the middleware is updated with the latest data. If there is an error (timeout or middleware offline) it will be passed to this callback |
unsubscribe function
Note
this event will be fired even if the queue fails
Throws
if the middleware wasn't enabled when instantiating the SDK client
PolymeshTransactionBase.onProcessedByMiddleware
base/PolymeshTransactionBase.ts:577
▸ onStatusChange(listener
): UnsubCallback
Subscribe to status changes
Name | Type | Description |
---|---|---|
listener |
(transaction : GenericPolymeshTransaction <ReturnValue , TransformedReturnValue >) => void
|
callback function that will be called whenever the status changes |
unsubscribe function
PolymeshTransactionBase.onStatusChange
base/PolymeshTransactionBase.ts:519
▸ run(): Promise
<TransformedReturnValue
>
Run the transaction, update its status and return a result if applicable. Certain transactions create Entities on the blockchain, and those Entities are returned for convenience. For example, when running a transaction that creates an Asset, the Asset itself is returned
Promise
<TransformedReturnValue
>
base/PolymeshTransactionBase.ts:270
▸ runAsProposal(): Promise
<MultiSigProposal
>
Run the transaction as a multiSig proposal
Promise
<MultiSigProposal
>
PolymeshTransactionBase.runAsProposal
base/PolymeshTransactionBase.ts:228
▸ supportsSubsidy(): boolean
Return whether the transaction can be subsidized. If the result is false AND the caller is being subsidized by a third party, the transaction can't be executed and trying to do so will result in an error
boolean
Note
this depends on the type of transaction itself (e.g. staking.bond
can't be subsidized, but asset.createAsset
can)
PolymeshTransactionBase.supportsSubsidy
base/PolymeshTransaction.ts:131
▸ toSignablePayload(metadata?
): Promise
<TransactionPayload
>
Returns a representation intended for offline signers.
Name | Type |
---|---|
metadata |
Record <string , string > |
Promise
<TransactionPayload
>
Note
Usually .run()
should be preferred due to is simplicity.
Note
When using this method, details like account nonces, and transaction mortality require extra consideration. Generating a payload for offline sign implies asynchronicity. If using this API, be sure each procedure is created with the correct nonce, accounting for in flight transactions, and the lifetime is sufficient.
Entities
- Account
- Asset
- Authorization Request
- Checkpoint
- Checkpoint Schedule
- Corporate Action
- Corporate Action Base
- Custom Permission Group
- Default Portfolio
- Default Trusted Claim Issuer
- Dividend Distribution
- Entity
- Identity
- Instruction
- Known Permission Group
- Metadata Entry
- Multi Sig Proposal
- Numbered Portfolio
- Offering
- Permission Group
- Portfolio
- Subsidies
- Subsidy
- Ticker Reservation
- Venue
- Authorizations
- Types