-
Notifications
You must be signed in to change notification settings - Fork 1
RawTransaction
public struct RawTransaction: KeyProtocol, Equatable
Equatable
, KeyProtocol
public init(
sender: AccountAddress,
sequenceNumber: UInt64,
payload: TransactionPayload,
maxGasAmount: UInt64,
gasUnitPrice: UInt64,
expirationTimestampSecs: UInt64,
chainId: UInt8
)
The sender of the transaction
public var sender: AccountAddress
The sequence number (number of transactions) for the sender account
public var sequenceNumber: UInt64
The contents of the transaction itself (e.g., the program)
public var payload: TransactionPayload
The maximum gas amount is the maximum gas units the transaction is allowed to consume.
public var maxGasAmount: UInt64
This is the amount the sender is willing to pay per unit of gas to execute the transaction. Gas is a way to pay for computation and storage. A gas unit is an abstract measurement of computation with no inherent real-world value.
public var gasUnitPrice: UInt64
A timestamp after which the transaction ceases to be valid (i.e., expires).
public var expirationTimestampSecs: UInt64
An identifier that distinguishes the Aptos network deployments (to prevent cross-network attacks).
public var chainId: UInt8
Compute the SHA3-256 hash of a string representation of a transaction.
public func prehash() throws -> Data
This function computes the SHA3-256 hash of the string "APTOS::RawTransaction", which serves as a prefix to the transaction data, and returns the result.
An AptosError object indicating that the conversion from string to Data object has failed.
A Data object containing the SHA3-256 hash of the string "APTOS::RawTransaction".
Serialize and hash a transaction for signing.
public func keyed() throws -> Data
This function serializes the transaction using a Serializer instance, computes the SHA3-256 hash of the serialized transaction concatenated with a prehash, and returns the result.
An error of type AptosError indicating that the serialization or prehash computation has failed.
A Data object containing the SHA3-256 hash of the serialized transaction concatenated with a prehash.
Sign the transaction using the provided private key.
public func sign(_ key: PrivateKey) throws -> Signature
This function signs the transaction using the provided private key and returns the resulting signature.
- key: A PrivateKey object to be used for signing the transaction.
- Returns: A Signature object containing the signature of the transaction.
- Throws: An error of type Ed25519Error indicating that the signing operation has failed.
Verify the signature of the transaction using the provided public key.
public func verify(_ key: PublicKey, _ signature: Signature) throws -> Bool
This function verifies the signature of the transaction using the provided public key and returns a Boolean value indicating whether the signature is valid or not.
- key: A PublicKey object to be used for verifying the signature of the transaction.
- signature: A Signature object containing the signature to be verified.
- Returns: A Boolean value indicating whether the signature is valid or not.
- Throws: An error of type Ed25519Error indicating that the verification operation has failed.
public static func deserialize(from deserializer: Deserializer) throws -> RawTransaction
public func serialize(_ serializer: Serializer) throws
public static func == (lhs: RawTransaction, rhs: RawTransaction) -> Bool
Generated at 2023-07-20T02:24:43+0000 using swift-doc 1.0.0-rc.1.
Types
- Account
- AccountAddress
- AccountAddressTag
- AccountResponse
- AnyTransactionArgument
- AptosError
- AptosRestClientError
- BoolTag
- ClientConfig
- Collection
- Ed25519Authenticator
- Ed25519BIP32
- EntryFunction
- HTTPMethod
- InfoResponse
- InvalidPropertyType
- Mnemonic
- Mnemonic.Error
- ModuleBundle
- ModuleId
- MultiAgentAuthenticator
- MultiAgentRawTransaction
- MultiEd25519Authenticator
- MultiPublicKey
- MultiSignature
- Object
- PrivateKey
- Property
- PropertyMap
- PublicKey
- RawTransaction
- RotatingProofChallenge
- Royalty
- Script
- ScriptArgument
- SeedMode
- Serializer
- Signature
- SignedTransaction
- StructTag
- StructTagValue
- Token
- TransactionArgument
- U128Tag
- U16Tag
- U256Tag
- U32Tag
- U64Tag
- U8Tag
- UInt128
- UInt128Errors
- Wallet
- Wordlists
Protocols
Global Variables
Global Functions
- _struct(_:)
- account(_:ledgerVersion:)
- accountBalance(_:_:)
- accountResource(_:_:_:)
- accountResources(_:_:)
- accountSequenceNumber(_:_:)
- addTokenProperty(_:_:_:)
- aggregatorValue(_:_:_:)
- asyncData(with:method:headers:body:)
- bcsTransfer(_:_:_:)
- bool()
- burnToken(_:_:)
- claimToken(_:_:_:_:_:_:)
- createBcsSignedTransaction(_:_:)
- createBcsSignedTransaction(_:_:_:)
- createBcsTransaction(_:_:)
- createBcsTransaction(_:_:_:)
- createCollection(_:_:_:_:)
- createCollection(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:)
- createCollectionPayload(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:)
- createMultiAgentBcsTransaction(_:_:_:)
- createToken(_:_:_:_:_:_:_:)
- decodeData(_:with:keyDecodingStrategy:dataDecodingStrategy:dateDecodingStrategy:)
- decodeUrl(_:with:)
- decodeUrl(with:_:)
- decodeUrl(with:_:_:)
- deserialize(from:)
- directTransferToken(_:_:_:_:_:_:_:)
- fixedBytes(length:)
- freezeToken(_:_:)
- fundAccount(_:_:)
- getCollection(_:_:)
- getTableItem(_:_:_:_:_:_:)
- getToken(_:_:_:_:_:)
- getTokenBalance(_:_:_:_:_:)
- getTokenData(_:_:_:_:)
- info()
- map(keyDecoder:valueDecoder:)
- mintSoulBoundToken(_:_:_:_:_:_:_:)
- mintToken(_:_:_:_:_:_:)
- mintTokenPayload(_:_:_:_:_:)
- offerToken(_:_:_:_:_:_:_:)
- publishPackage(_:_:_:)
- readObject(address:)
- remaining()
- removeTokenProperty(_:_:_:)
- sequence(valueDecoder:)
- serialize(_:)
- simulateTransaction(_:_:)
- string(_:)
- submitBcsTransaction(_:)
- submitTransaction(_:_:)
- toBytes(_:)
- transactionPending(_:)
- transfer(_:_:_:)
- u128(_:)
- u16(_:)
- u256(_:)
- u32(_:)
- u64(_:)
- u8(_:)
- uleb128()
- unfreezeToken(_:_:)
- updateTokenProperty(_:_:_:)
- verify(_:)
- waitForTransaction(_:)