NEWTON
Asked
6 months ago
119
views
0
Hi everyone,
When i try to invoke my functions with arguments from my frontend app using starknetjs, i get error invalid character, which i presume is an issue from my function accepting felt, but i'm passing texts. Is there any way to convert to felts from the browser or does starknetjs do this by default?
Anyone knows how i can solve the error?
This question was originally posted on StarkNet Discord
Newton
asked
6 months ago
0
Accepted answer
Hi,
invoke
like in invokeFunction
on the Provider ?
1- There is nothing wrong about using strings. You should use string as you can see from the type that is used in the invokeFunction
here https://github.com/0xs34n/starknet.js/blob/b4785793ea912dc8562de4c69b0dcbda4358e144/src/types/lib.ts#L20
2- The correct way to proceed (assuming you want to write to the blockchain) would be (1) create an account and (2) execute
a contract function from that account. But before that, did you connect to your wallet? How did you do that? The way it works is the transaction needs to be signed by the user and the easiest way is definitely to ask your wallet to sign it for you.
3- You also need to check the version of starknet-js. What version are you using?
4- If you are stuck, there are several things you could do: (1) find an example and make sure it works; (2) explain where you are stuck (3) provide the code extract and the exact error message you get in details
This answer was originally posted on StarkNet Discord
Newton
answered
6 months ago
anyone know how to disconnect the connected wallet on the frontend with starknetjs or another way?
How can I interact with my contract on Starknet using starknetjs?
How do I connect my DAPP to Starknet mainnet using starknetjs?
How do I connect my DAPP to Starknet testnet using starknetjs?
How do I connect my DAPP to a Starknet node using starknetjs?
How do I connect my DAPP to Starknet-devnet using starknetjs?
How do I develop against cairo devnet with browser wallets?
What’s the difference between Account Abstraction (AA) and Externally Owned Accounts (EOA)?
Why does this Cairo program put powers of 2 in the memory?
Cairo: When do you use tempvar and when do you use local
ApeWorX: Why am I getting the error message "ArgumentsLengthError"?
How to make recursive function in Cairo Lang?
AssertionError with range_check_ptr_ptr
Is it possible to import local python files into hints?