Support account's execute
See original GitHub issueThis is different from #6. The account interface exposes an execute
method to invoke multiple external functions in one transaction.
The proposed interface is:
const { execute, loading, error } = useStarknetExecute()
Where execute
is:
execute: ({ calls: CallArgs, metadata?: any }) => Promise<AddTransactionResponse | undefined>
type CallArgs = { args?: T, contract?: Contract, method?: string }
Example
const { token } = useTokenContract()
const { other } = useOtherContract()
const { account } = useStarknet()
const { execute } = useStarknetExecute()
const [amount, setAmount] = useState(0)
// ...
execute({
metadata: { message: 'Approve token and swap' },
calls: [
{ contract: token, method: 'approve', args: amount && account ? [amount, account] : undefined },
{ contract: other, method: 'swap', args: amount && account ? [amount, account /*, more data here */] : undefined },
]
})
Like invoke
, execute
checks that all calls arguments are defined before making the call.
Issue Analytics
- State:
- Created a year ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
What Does An Account Support Representative Do - Zippia
Account Support Representative Responsibilities Perform inside sales, including telemarketing, prospecting, account penetration and product application, ...
Read more >It's Time to Execute Your Account Management Strategy
There are three components of an effective account management strategy: The creation of a plan; The tools to support the plan; Execution.
Read more >How Key Account Management Supports an Execution Mindset
We've mapped those disciplines to a successful account planning process, and we'll highlight below how the right KAM platform can support your team's...
Read more >Service Accounts | Microsoft Learn
A service account is a user account that's created explicitly to provide a security context for services that are running on Windows Server ......
Read more >Applies to - My Oracle Support
How To Execute Bulk Rename Accounts Using runcat.sh/runcat.bat (renameAccounts) (Doc ID 2437991.1). Last updated on SEPTEMBER 30, 2022 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Pulled from StarkNet fees - This is a huge potential saving if we batch transactions.
I like the proposed interface for execute. I’m wondering if we should deprecate
invoke
api in favor of a single execute api. It seems that is the direction theAccountInterface
has taken: