proposer
A builder function that adds the proposer to a transaction.
The proposer is responsible for providing the proposal key and paying the network fee for the transaction. The proposer key is used to specify the sequence number and prevent replay attacks.
Every transaction requires exactly one proposer.
Read more about transaction roles and signing transactions.
Import
You can import the entire package and access the function:
_10import * as sdk from "@onflow/sdk"_10_10sdk.proposer(authz)
Or import directly the specific function:
_10import { proposer } from "@onflow/sdk"_10_10proposer(authz)
Usage
_28import * as fcl from "@onflow/fcl";_28_28// Using the current user as proposer_28await fcl.mutate({_28 cadence: `_28 transaction {_28 prepare(account: AuthAccount) {_28 log("Hello from proposer!")_28 }_28 }_28 `,_28 proposer: fcl.authz_28});_28_28// Using builder pattern_28await fcl.send([_28 fcl.transaction`_28 transaction {_28 prepare(account: AuthAccount) {_28 log("Transaction executed")_28 }_28 }_28 `,_28 fcl.proposer(proposerAuthz),_28 fcl.payer(payerAuthz),_28 fcl.authorizations([authorizerAuthz]),_28 fcl.limit(100)_28]);
Parameters
authz
- Type:
AccountAuthorization
- Description: The authorization object for the proposer
_10export type AccountAuthorization =_10 | (AuthorizationFn & Partial<InteractionAccount>)_10 | Partial<InteractionAccount>
Returns
function