Class: Transaction
Transaction Builder
Constructors
new Transaction()
new Transaction():
Transaction
Returns
Properties
object()
object: (
value
) =>object
Add a new object input to the transaction.
Parameters
• value: TransactionObjectInput
Returns
object
$kind
$kind:
"Input"
Input
Input:
number
type?
optional
type:"object"
system()
Returns
object
$kind
$kind:
"Input"
Input
Input:
number
type?
optional
type:"object"
clock()
Returns
object
$kind
$kind:
"Input"
Input
Input:
number
type?
optional
type:"object"
random()
Returns
object
$kind
$kind:
"Input"
Input
Input:
number
type?
optional
type:"object"
denyList()
Returns
object
$kind
$kind:
"Input"
Input
Input:
number
type?
optional
type:"object"
Accessors
blockData
Get Signature
get blockData():
object
Deprecated
Use getData()
instead.
Returns
object
version
version:
1
sender?
optional
sender:string
expiration?
optional
expiration:null
|object
|object
gasConfig
gasConfig:
object
=GasConfig
gasConfig.budget?
optional
budget:string
|number
|bigint
gasConfig.price?
optional
price:string
|number
|bigint
gasConfig.payment?
optional
payment:object
[]
gasConfig.owner?
optional
owner:string
inputs
inputs: (
object
|object
)[]
transactions
transactions: (
object
|object
|object
|object
|object
|object
|object
)[]
pure
Get Signature
get pure(): <
T
>(type
,value
) =>T
(value
) =>T
Returns
Function
Type Parameters
• T extends PureTypeName
Parameters
• type: T
extends PureTypeName
? ValidPureTypeName
<T
<T
>> : T
• value: ShapeFromPureTypeName
<T
>
Returns
T
Parameters
• value: Uint8Array
| SerializedBcs
<any
, any
>
The pure value, serialized to BCS. If this is a Uint8Array, then the value is assumed to be raw bytes, and will be used directly.
Returns
T
u8()
Parameters
• value: number
Returns
object
| object
| object
| object
| object
u16()
Parameters
• value: number
Returns
object
| object
| object
| object
| object
u32()
Parameters
• value: number
Returns
object
| object
| object
| object
| object
u64()
Parameters
• value: string
| number
| bigint
Returns
object
| object
| object
| object
| object
u128()
Parameters
• value: string
| number
| bigint
Returns
object
| object
| object
| object
| object
u256()
Parameters
• value: string
| number
| bigint
Returns
object
| object
| object
| object
| object
bool()
Parameters
• value: boolean
Returns
object
| object
| object
| object
| object
string()
Parameters
• value: string
Returns
object
| object
| object
| object
| object
address()
Parameters
• value: string
Returns
object
| object
| object
| object
| object
id()
id: (
value
) =>object
|object
|object
|object
|object
Parameters
• value: string
Returns
object
| object
| object
| object
| object
vector()
Type Parameters
• Type extends PureTypeName
Parameters
• type: Type
• value: Iterable
<ShapeFromPureTypeName
<Type
>, any
, any
> & object
Returns
object
| object
| object
| object
| object
option()
Type Parameters
• Type extends PureTypeName
Parameters
• type: Type
• value: undefined
| null
| ShapeFromPureTypeName
<Type
>
Returns
object
| object
| object
| object
| object
gas
Get Signature
get gas():
object
Returns an argument for the gas coin, to be used in a transaction.
Returns
object
$kind
$kind:
"GasCoin"
GasCoin
GasCoin:
true
Methods
fromKind()
static
fromKind(serialized
):Transaction
Converts from a serialize transaction kind (built with build({ onlyTransactionKind: true })
) to a Transaction
class.
Supports either a byte array, or base64-encoded bytes.
Parameters
• serialized: string
| Uint8Array
Returns
from()
static
from(transaction
):Transaction
Converts from a serialized transaction format to a Transaction
class.
There are two supported serialized formats:
- A string returned from
Transaction#serialize
. The serialized format must be compatible, or it will throw an error. - A byte array (or base64-encoded bytes) containing BCS transaction data.
Parameters
• transaction: string
| Uint8Array
| Transaction
Returns
registerGlobalSerializationPlugin()
static
registerGlobalSerializationPlugin(step
):void
Parameters
• step: TransactionPlugin
Returns
void
registerGlobalBuildPlugin()
static
registerGlobalBuildPlugin(step
):void
Parameters
• step: TransactionPlugin
Returns
void
addSerializationPlugin()
addSerializationPlugin(
step
):void
Parameters
• step: TransactionPlugin
Returns
void