Struct flow_sdk::prelude::TransactionHeaderBuilder [−][src]
pub struct TransactionHeaderBuilder { /* fields omitted */ }
Expand description
A builder for TransactionHeader
s.
Implementations
A builder for a transaction header.
use cadence_json::ValueRef;
const SCRIPT: &str = r#"
transaction(greeting: String) {
let guest: Address
prepare(authorizer: AuthAccount) {
self.guest = authorizer.address
}
execute {
log(greeting.concat(",").concat(guest.toString()))
}
}
"#;
let argument = ValueRef::String("Hello");
let header = TransactionHeaderBuilder::new().script_static(SCRIPT).argument(&argument);
assert_eq!(header.build(), TransactionHeader {
script: SCRIPT.into(),
arguments: vec![serde_json::to_vec(&argument).unwrap().into_boxed_slice()]
})
Creates a new builder for TransactionHeader
s.
Sets the script of the transaction.
Sets the script of the transaction.
Clone the script into the builder. Do not use this if you have owned instances or static reference.
Adds an argument to the transaction header.
Adds arguments to the transaction header.
Builds a transaction header, assuming the script was set.
Shorthand for self.build().into_party_builder()
.
Builds a transaction header, returning Err(self) if the script was not set.
Trait Implementations
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for TransactionHeaderBuilder
impl Send for TransactionHeaderBuilder
impl Sync for TransactionHeaderBuilder
impl Unpin for TransactionHeaderBuilder
impl UnwindSafe for TransactionHeaderBuilder
Blanket Implementations
Mutably borrows from an owned value. Read more
Wrap the input message T
in a tonic::Request
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more