https://github.com/zulhfreelancer/go_parity_next_nonce
A simple Go package for Parity Next Nonce
https://github.com/zulhfreelancer/go_parity_next_nonce
ethereum go-ethereum parity
Last synced: about 1 month ago
JSON representation
A simple Go package for Parity Next Nonce
- Host: GitHub
- URL: https://github.com/zulhfreelancer/go_parity_next_nonce
- Owner: zulhfreelancer
- Created: 2019-06-14T13:23:50.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-14T15:40:26.000Z (almost 7 years ago)
- Last Synced: 2025-12-02T05:25:25.648Z (6 months ago)
- Topics: ethereum, go-ethereum, parity
- Language: Go
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Parity Next Nonce (Golang)
A simple Go package for [Parity Next Nonce](https://wiki.parity.io/JSONRPC-parity-module#parity_nextnonce)
### Installation
```
// If you are not using Go 1.11 Modules
$ go get github.com/zulhfreelancer/go_parity_next_nonce
// If you are using Go 1.11 Modules, run this before executing the code below
$ go mod tidy
```
### Usage
```
import (
// Short version (implicit)
"github.com/zulhfreelancer/go_parity_next_nonce"
// If you prefer to make it explicit
nnonce "github.com/zulhfreelancer/go_parity_next_nonce"
)
func yourFunction() {
// insert an address with some past transactions
address := "0x..."
// insert the Parity node RPC URL and port number
nodeURL := "http://xx.xxx.xxx.xxx:8545"
nonce, err := nnonce.NextNonce(address, nodeURL)
if err != nil {
// handle error
}
fmt.Printf("Nonce : %v\n", nonce) // 193
fmt.Printf("Type : %T\n", nonce) // uint64
}
```