From 2d1d7ad6c16e6685ab163363f0fef368971d18de Mon Sep 17 00:00:00 2001 From: rianhughes Date: Mon, 31 Jul 2023 14:54:35 +0300 Subject: [PATCH] Update Readme --- README.md | 19 ++----------------- examples/simpleCall/go.mod | 32 ++++++++++++++++++++++++++++---- examples/simpleCall/main.go | 8 ++++---- 3 files changed, 34 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 7d9a2b06..e2da5169 100644 --- a/README.md +++ b/README.md @@ -51,29 +51,14 @@ operations on the wallets. The package has excellent documentation for a smooth ### Run Examples -***starkcurve*** +***starknet simpleCall*** ```sh -cd examples/curve +cd examples/simpleCall go mod tidy go run main.go ``` -***starknet contract*** - -```sh -cd examples/contract -go mod tidy -go run main.go -``` - -***starknet account*** - -```sh -cd examples/account -go mod tidy -go run main.go -``` ### RPC diff --git a/examples/simpleCall/go.mod b/examples/simpleCall/go.mod index eb24beb6..264a4e75 100644 --- a/examples/simpleCall/go.mod +++ b/examples/simpleCall/go.mod @@ -2,10 +2,34 @@ module account go 1.18 -require github.com/NethermindEth/starknet.go v0.2.1-0.20220620163912-1db2ca279608 +require ( + github.com/NethermindEth/starknet.go v0.2.1-0.20220620163912-1db2ca279608 + github.com/ethereum/go-ethereum v1.10.26 + github.com/joho/godotenv v1.4.0 +) + replace github.com/NethermindEth/starknet.go => ../../ + require ( - github.com/google/go-querystring v1.1.0 // indirect - golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect - golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect + github.com/NethermindEth/juno v0.3.1 // indirect + github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect + github.com/bits-and-blooms/bitset v1.7.0 // indirect + github.com/consensys/gnark-crypto v0.11.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/deckarep/golang-set v1.8.0 // indirect + github.com/fxamacker/cbor/v2 v2.4.0 // indirect + github.com/go-ole/go-ole v1.2.1 // indirect + github.com/go-stack/stack v1.8.0 // indirect + github.com/gorilla/websocket v1.4.2 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect + github.com/stretchr/testify v1.8.1 // indirect + github.com/test-go/testify v1.1.4 // indirect + github.com/tklauser/go-sysconf v0.3.5 // indirect + github.com/tklauser/numcpus v0.2.2 // indirect + github.com/x448/float16 v0.8.4 // indirect + golang.org/x/crypto v0.2.0 // indirect + golang.org/x/sys v0.3.0 // indirect + gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/examples/simpleCall/main.go b/examples/simpleCall/main.go index 6c77f0d3..6a1b9e74 100644 --- a/examples/simpleCall/main.go +++ b/examples/simpleCall/main.go @@ -5,7 +5,7 @@ import ( "fmt" "os" - "github.com/NethermindEth/starknet.go/rpcv02" + "github.com/NethermindEth/starknet.go/rpc" "github.com/NethermindEth/starknet.go/types" "github.com/NethermindEth/starknet.go/utils" ethrpc "github.com/ethereum/go-ethereum/rpc" @@ -26,7 +26,7 @@ func main() { if err != nil { panic(err) } - clientv02 := rpcv02.NewProvider(c) + clientv02 := rpc.NewProvider(c) fmt.Println("Established connection with the client") contractAddress, err := utils.HexToFelt(someMainnetContract) @@ -35,13 +35,13 @@ func main() { } // Make read contract call - tx := rpcv02.FunctionCall{ + tx := rpc.FunctionCall{ ContractAddress: contractAddress, EntryPointSelector: types.GetSelectorFromNameFelt(contractMethod), } fmt.Println("Making Call() request") - callResp, err := clientv02.Call(context.Background(), tx, rpcv02.BlockID{Tag: "latest"}) + callResp, err := clientv02.Call(context.Background(), tx, rpc.BlockID{Tag: "latest"}) if err != nil { panic(err.Error()) }