AlgoAppCallWTxn
Clicking the AlgoAppCallWTxn
button will assemble an call and transfer/payment transaction and open a new window prompting the user to confirm the transaction.
info
The rendered button below is nonfunctional. To see it in action, check out the Component Demo!
caution
The AlgoOpt button executes transactions on the MainNet by default. To switch to TestNet, check out SwitchNet Component
Upon confirmation, it returns the transaction id to the context and key specified. Failing to include to correct object parameters, or setting them incorrectly will result in a transaction not executing.
Accessing returned transaction id
The returned id can be accessed several different ways. Setting the context
prop to {this}
and the returnTo
prop to a state
key (as string) will return the number directly to your parent component's state without the need for additional callback or event handler code, but can also be accessed with an onChange
handler:
handleChange = (value) =>{
this.setState({txId: value})
}
render(){
return
<AlgoAppCallWTxn
appId={123456}
appArgs={[]}
receiver="C5E5W3BERJALL2ZH4YB3TAP7ZSJH2PJUPDHLGF74YE6DBMQ62AA47IXGNQ"
amount={0}
note=""
index={0}
/>
}
Props
Prop | Type | Default | Description |
---|---|---|---|
appId | integer | index of app to opt-in to | |
appArgs | array | array of integers/strings | |
receiver | string | receiver's Algorand address | |
amount | integer | amount to send in smallest units | |
note | string | ||
index | integer | index of ASA, or 0 for Algos |