Open jelilat opened 7 months ago
I'd like to start with this issue, and make my way up from here :) Please assign this to me @jelilat 😁
I'd like to start with this issue, and make my way up from here :) Please assign this to me @jelilat 😁
Done
I see a common problem where,
this is the output (also seen in other PRs)
This is the code
name: "starknet_call",
params: {
context,
request: functionCall,
block_id,
},
starknetJs: ``,
starknetGo: `package main
import (
"context"
"fmt"
"log"
"github.com/NethermindEth/starknet.go/rpc"
)
func main() {
rpcUrl := "https://free-rpc.nethermind.io/mainnet-juno/"
client, err := rpc.NewClient(rpcUrl)
if err != nil {
log.Fatal(err)
}
provider := rpc.NewProvider(client)
feltVar := fp.NewElement(1)
var one uint64 = 1
blockId := rpc.BlockID{Number: &one, Hash: felt.NewFelt(&feltVar)}
res, err := provider.Call(
context.Background(),
rpc.FunctionCall{
Calldata: ,
ContractAddress: ${contract_address},
EntryPointSelector: ${entry_point_selector},
},
${block_id},
)
if err != nil {
log.Fatal(err)
}
fmt.Println(res)
}`,
It looks like the UI auto renders after detecting the function, this'll need to be updated, at least for golang, where each function takes in a context.Context; and parameters aren't passed in as a simple ring 🤔 . I'm going to work to figure this out, if a different implementation will be needed for go examples.
Implement autogenerated
starknet.go
code for the following RPC endpointsstarknet_call
starknet_estimateFee
starknet_estimateMessageFee
Additional Context: