A Binance Chain vanity address generator written in golang

BNC Chain Go SDK

The Binance Chain GO SDK provides a thin wrapper around the BNC Chain API for readonly endpoints, in addition to creating and submitting different transactions. It includes the following core components:

  • client - implementations of Binance Chain transaction types and query, such as for transfers and trading.
  • common - core cryptographic functions, uuid functions and other useful functions.
  • e2e - end-to-end test package for go-sdk developer. For common users, it is also a good reference to use go-sdk.
  • keys - implement KeyManage to manage private key and accounts.
  • types - core type of Binance Chain, such as coin, account, tx and msg.

Disclaimer

This branch is under active development, all subject to potential future change without notification and not ready for production use. The code and security audit have not been fully completed and not ready for any bug bounty.

Install

Requirement

Go version above 1.11

Use go mod(recommend)

Add "github.com/binance-chain/go-sdk" dependency into your go.mod file. Example:

require (
	github.com/binance-chain/go-sdk latest
)
replace github.com/tendermint/go-amino => github.com/binance-chain/bnc-go-amino v0.14.1-binance.1

NOTE: Please make sure you use binance-chain amino repo instead of tendermint amino.

Usage

Key Manager

Before start using API, you should construct a Key Manager to help sign the transaction msg or verify signature. Key Manager is an Identity Manager to define who you are in the bnbchain. It provide following interface:

type KeyManager interface {
	Sign(tx.StdSignMsg) ([]byte, error)
	GetPrivKey() crypto.PrivKey
	GetAddr() txmsg.AccAddress
	
	ExportAsMnemonic() (string, error)
	ExportAsPrivateKey() (string, error)
	ExportAsKeyStore(password string) (*EncryptedKeyJSON, error)
}

We provide four construct functions to generate Key Manager:

NewKeyManager() (KeyManager, error)

NewMnemonicKeyManager(mnemonic string) (KeyManager, error)

NewMnemonicPathKeyManager(mnemonic, keyPath string) (KeyManager, error) 

NewKeyStoreKeyManager(file string, auth string) (KeyManager, error)

NewPrivateKeyManager(priKey string) (KeyManager, error) 

NewLedgerKeyManager(path ledger.DerivationPath) (KeyManager, error)
  • NewKeyManager. You will get a new private key without provide anything, you can export and save this KeyManager.
  • NewMnemonicKeyManager. You should provide your mnemonic, usually is a string of 24 words.
  • NewMnemonicPathKeyManager. The difference between NewMnemonicKeyManager is that you can use custom keypath to generate different keyManager while using the same mnemonic. 5 levels in BIP44 path: "purpose' / coin_type' / account' / change / address_index", "purpose' / coin_type'" is fixed as "44'/714'/", you can customize the rest part.
  • NewKeyStoreKeyManager. You should provide a keybase json file and you password, you can download the key base json file when your create a wallet account.
  • NewPrivateKeyManager. You should provide a Hex encoded string of your private key.
  • NewLedgerKeyManager. You must have a ledger device with binance ledger app and connect it to your machine.

Examples:

From mnemonic:

mnemonic := "lock globe panda armed mandate fabric couple dove climb step stove price recall decrease fire sail ring media enhance excite deny valid ceiling arm"
keyManager, _ := keys.NewMnemonicKeyManager(mnemonic)

From key base file:

file := "testkeystore.json"
keyManager, err := NewKeyStoreKeyManager(file, "your password")

From raw private key string:

priv := "9579fff0cab07a4379e845a890105004ba4c8276f8ad9d22082b2acbf02d884b"
keyManager, err := NewPrivateKeyManager(priv)

From ledger device:

bip44Params := keys.NewBinanceBIP44Params(0, 0)
keyManager, err := NewLedgerKeyManager(bip44Params.DerivationPath())

We provide three export functions to persistent a Key Manager:

ExportAsMnemonic() (string, error)

ExportAsPrivateKey() (string, error)

ExportAsKeyStore(password string) (*EncryptedKeyJSON, error)

Examples:

km, _ := NewKeyManager()
encryPlain1, _ := km.GetPrivKey().Sign([]byte("test plain"))
keyJSONV1, err := km.ExportAsKeyStore("testpassword")
bz, _ := json.Marshal(keyJSONV1)
ioutil.WriteFile("TestGenerateKeyStoreNoError.json", bz, 0660)
newkm, _ := NewKeyStoreKeyManager("TestGenerateKeyStoreNoError.json", "testpassword")
encryPlain2, _ := newkm.GetPrivKey().Sign([]byte("test plain"))
assert.True(t, bytes.Equal(encryPlain1, encryPlain2))

As for ledger key, it can't be exported. Because its private key is saved on ledger device and no one can directly access it outside.

Init Client

import sdk "github.com/binance-chain/go-sdk/client"

mnemonic := "lock globe panda armed mandate fabric couple dove climb step stove price recall decrease fire sail ring media enhance excite deny valid ceiling arm"
//-----   Init KeyManager  -------------
keyManager, _ := keys.NewMnemonicKeyManager(mnemonic)

//-----   Init sdk  -------------
client, err := sdk.NewDexClient("testnet-dex.binance.org", types.TestNetwork, keyManager)

For sdk init, you should know the famous api address. Besides, you should know what kind of network the api gateway is in, since we have different configurations for test network and production network.

ChainNetwork ApiAddr
TestNetwork testnet-dex.binance.org
ProdNetwork dex.binance.org

If you want broadcast some transactions, like send coins, create orders or cancel orders, you should construct a key manager.

Example

Create a buy order:

createOrderResult, err := client.CreateOrder(tradeSymbol, nativeSymbol, txmsg.OrderSide.BUY, 100000000, 100000000, true)

If want to attach memo or source to the transaction, more WithSource and WithMemo options are required:

createOrderResult, err := client.CreateOrder(tradeSymbol, nativeSymbol, msg.OrderSide.BUY, 100000000, 100000000, true, transaction.WithSource(100),transaction.WithMemo("test memo"))

In some scenarios, continuously send multi transactions very fast. Before the previous transaction being included in the chain, the next transaction is being sent, to avoid sequence mismatch error, option WithAcNumAndSequence is required:

acc,err:=client.GetAccount(client.GetKeyManager().GetAddr().String())
_, err = client.CreateOrder(tradeSymbol, nativeSymbol, msg.OrderSide.BUY, 100000000, 100000000, true, transaction.WithAcNumAndSequence(acc.Number,acc.Sequence))
_, err = client.CreateOrder(tradeSymbol, nativeSymbol, msg.OrderSide.BUY, 100000000, 100000000, true, transaction.WithAcNumAndSequence(acc.Number,acc.Sequence+1))
_, err = client.CreateOrder(tradeSymbol, nativeSymbol, msg.OrderSide.BUY, 100000000, 100000000, true, transaction.WithAcNumAndSequence(acc.Number,acc.Sequence+2))

For more API usage documentation, please check the wiki..

RPC Client(Beta)

RPC endpoints may be used to interact with a node directly over HTTP or websockets. Using RPC, you may perform low-level operations like executing ABCI queries, viewing network/consensus state or broadcasting a transaction against full node or light client.

Example

nodeAddr := "tcp://127.0.0.1:27147"
testClientInstance := rpc.NewRPCClient(nodeAddr,types.TestNetwork)
status, err := c.Status()
Owner
For Binance Smart Chain, BSC, Binance Chain
null
Comments
  • CreateOrder failed: signature verification failed

    CreateOrder failed: signature verification failed

    Getting error message:

    {"code":65540,"message":"{\"codespace\":1,\"code\":4,\"abci_code\":65540,\"message\":\"signature verification failed\"}"}
    

    Following the e2e example. It's strange that issuing token works (shares some code path for signing).

    Also saw other people experienced this error for go-sdk as well, so I don't believe it's a problem on my side.

  • unmarshal to tx.StdTx failed

    unmarshal to tx.StdTx failed

    hello: I had a error when I use go-sdk
    unmarshal to tx.StdTx failed after 6 bytes (error reading array contents: unrecognized prefix bytes 07921531):

  • Invalid Sequence Error

    Invalid Sequence Error

    Got the following error when trying to send multiple orders simultaneously

    bad response, status code 403, response: {\"code\":403,\"failed_tx_index\":0,\"message\":\"Invalid sequence. Got 40, expected 41\",\"success_tx_results\":[]}\n"
    
  • How can I decode token transfer transaction?

    How can I decode token transfer transaction?

    Using client.GetTx("BF45D076F5FFBDA4473C82B325FE2A2C08F65C37F922ACD3DF55F5BDC184B8C4") could get TxResult, but I want to get transafer detail, such as amount, from, to, token symbol. And in your document, there are fee description about decoding result: Please note that this transaction information is amino-encoded. You will see the original transaction information after decoding. So, I want to know how can I decoding the transaction. Or maybe you can return the transaction detail strightly instead of the decoded raw tx.

  • KeyManager - testnet tbnb addresses

    KeyManager - testnet tbnb addresses

    Hi, I would like to understand test / prod wallet addresses better

    I am creating a wallet like so:

    km, err := keys.NewKeyManager()
    

    And the public address can be obtained with:

    address := km.GetAddr() // "bnb1683m5xkxa3p69yagrpdsvkp94xvx6utj863596"
    

    But the testnet address is actually: tbnb1683m5xkxa3p69yagrpdsvkp94xvx6utjf0cs9t

    In the Go sdk, how do I derive or obtain the testnet address?

  • goroutine reveal &&

    goroutine reveal &&

    Hi, go-sdk contributer, I have a problem with the increasing number of goroutines and websocket disconnection when I use goroutine to call the RPC client concurrently err:websocket client is dialing or stopped, can't send any request

    `panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x10 pc=0xbb8fce]

    goroutine 1623 [running]: github.com/gorilla/websocket.(*Conn).WriteMessage(0x0, 0x8, 0xc000984000, 0x2, 0x2, 0xc001305ef8, 0xc0010e7400) D:/code/go/GoDep/coinutils/pkg/mod/github.com/gorilla/[email protected]/conn.go:742 +0x3e github.com/binance-chain/go-sdk/client/rpc.(*WSClient).writeRoutine(0xc000c7cf00) D:/code/go/GoDep/coinutils/pkg/mod/github.com/binance-chain/[email protected]/client/rpc/ws_client.go:795 +0x6c2 created by github.com/binance-chain/go-sdk/client/rpc.(*WSClient).startReadWriteRoutines D:/code/go/GoDep/coinutils/pkg/mod/github.com/binance-chain/[email protected]/client/rpc/ws_client.go:731 +0x68 panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x0 pc=0xbbae47]

    goroutine 1622 [running]: github.com/gorilla/websocket.(*Conn).SetPongHandler(0x0, 0xc00014b730) D:/code/go/GoDep/coinutils/pkg/mod/github.com/gorilla/[email protected]/conn.go:1124 +0x27 github.com/binance-chain/go-sdk/client/rpc.(*WSClient).readRoutine(0xc000c7cf00) D:/code/go/GoDep/coinutils/pkg/mod/github.com/binance-chain/[email protected]/client/rpc/ws_client.go:807 +0x9d created by github.com/binance-chain/go-sdk/client/rpc.(*WSClient).startReadWriteRoutines D:/code/go/GoDep/coinutils/pkg/mod/github.com/binance-chain/[email protected]/client/rpc/ws_client.go:730 +0x46 `

  • Error in method for get TX by hash

    Error in method for get TX by hash

    Hey, when I try to get TX by hash (https://github.com/binance-chain/go-sdk/blob/fe7524098533a6ce6077cf5f28f677329963d17b/client/rpc/basic_client.go#L192) I get error The length of hash is not 32

    This is my code client := getRpcClient(nil) res, err := client.Tx([]byte(params["hash"]), true)

    in general every TxHash equal 64, may be someone had at the same trouble?

  • Mismatch of docs/code of getting account balances

    Mismatch of docs/code of getting account balances

    I noticed the documentation on how to query for account balances, and how the code does it in this repo is different.

    In the code you're using /account/<addr>... https://github.com/binance-chain/go-sdk/blob/master/client/rpc/dex_client.go#L144

    But in the docs you're using /store/acc/key... https://docs.binance.org/api-reference/node-rpc.html#619-abciquery

    Which one is correct?

  • Checksum mismatch error while downloading dependencies

    Checksum mismatch error while downloading dependencies

    Hey, I am getting the following error while trying to download dependencies for the project:

    go: downloading github.com/btcsuite/btcd v0.20.0-beta verifying github.com/btcsuite/[email protected]: checksum mismatch downloaded: h1:PamBMopnHxO2nEIsU89ibVVnqnXR2yFTgGNc+PdG68o= sum.golang.org: h1:DnZGUjFbRkpytojHWwy6nfUSA7vFrzWXDLpFNzt74ZA=

    SECURITY ERROR This download does NOT match the one reported by the checksum server. The bits may have been replaced on the origin server, or an attacker may have intercepted the download attempt.

    For more information, see 'go help module-auth'.

    This issue should be fixed by upgrading btcd to v0.20.1-beta, here is more info on this: https://github.com/btcsuite/btcd/issues/1487

    I tried to do it myself, however some tests are failing after making this upgrade. Could you look into this? I can't verify if these tests are failing due to my change or not, since I can't run tests with previous version of btcd :)

  • signature verification failed

    signature verification failed

    hi i am trying to create an order programmatically, but getting

    bad response, status code 401, response: {"code":401,"failed_tx_index":0,"message":"signature verification failed","success_tx_results":[]}
    

    a simple test program:

    package main
    
    import (
    	"errors"
    	"fmt"
    	"log"
    	"os"
    
    	"github.com/binance-chain/go-sdk/client"
    	"github.com/binance-chain/go-sdk/common/types"
    	"github.com/binance-chain/go-sdk/keys"
    	"github.com/binance-chain/go-sdk/types/msg"
    	"github.com/davecgh/go-spew/spew"
    )
    
    func runTestTrader2() error {
    	key, ok := os.LookupEnv("BNBKEY")
    	if !ok {
    		return errors.New("please set BNBKEY")
    	}
    
    	km, err := keys.NewPrivateKeyManager(string(key))
    	if err != nil {
    		return err
    	}
    
    	c, err := client.NewDexClient("dex.binance.org", types.ProdNetwork, km)
    	if err != nil {
    		return err
    	}
    
    	// 0.00274999
    	r, err := c.CreateOrder("LTO-BDF", "BNB", msg.OrderSide.BUY, 274999, types.NewFixed8(5).ToInt64(), true)
    	if err != nil {
    		return err
    	}
    
    	fmt.Println("order created")
    	spew.Dump(r)
    
    	return nil
    }
    
    func main() {
    	err := runTestTrader2()
    	if err != nil {
    		log.Fatalln(err)
    	}
    }
    
    
  • Error when import keys

    Error when import keys "github.com/binance-chain/go-sdk/keys"

    I added your libs, ex: "github.com/binance-chain/go-sdk/keys" ... and use NewKeyManager method and I also use libs: gobcy, btcsuite, go-ethereum ... but when I run "go run server.go" for my API I got an error bellow. Can anybody help me fix this, thank you very much! I think it ref to zondax lib, because eth new version use this lib too.

    Phuong_Mac$ go run server.go 
    # command-line-arguments
    /usr/local/Cellar/go/1.12.5/libexec/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
    duplicate symbol _hid_read_timeout in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000031.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000035.o
    duplicate symbol _hid_get_feature_report in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000031.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000035.o
    duplicate symbol _hid_send_feature_report in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000031.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000035.o
    duplicate symbol _hid_exit in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000031.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000035.o
    duplicate symbol _hid_init in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000031.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000035.o
    duplicate symbol _hid_error in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000031.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000035.o
    duplicate symbol _hid_free_enumeration in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000031.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000035.o
    duplicate symbol _hid_open in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000031.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000035.o
    duplicate symbol _hid_open_path in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000031.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000035.o
    duplicate symbol _hid_get_product_string in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000031.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000035.o
    duplicate symbol _hid_get_manufacturer_string in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000031.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000035.o
    duplicate symbol _hid_get_serial_number_string in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000031.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000035.o
    duplicate symbol _hid_get_indexed_string in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000031.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000035.o
    duplicate symbol _hid_set_nonblocking in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000031.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000035.o
    duplicate symbol _hid_write in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000031.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000035.o
    duplicate symbol _hid_enumerate in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000031.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000035.o
    duplicate symbol _hid_close in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000031.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000035.o
    duplicate symbol _hid_read in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000031.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000035.o
    duplicate symbol _gowchar_set in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000032.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000038.o
    duplicate symbol _gowchar_get in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000032.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000038.o
    duplicate symbol _SIZEOF_WCHAR_T in:
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000032.o
        /var/folders/96/hxkc6mhn1v711hytk9z4w5wc0000gn/T/go-link-990687738/000038.o
    ld: 21 duplicate symbols for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
  • Bump github.com/btcsuite/btcd from 0.20.1-beta to 0.23.2

    Bump github.com/btcsuite/btcd from 0.20.1-beta to 0.23.2

    Bumps github.com/btcsuite/btcd from 0.20.1-beta to 0.23.2.

    Release notes

    Sourced from github.com/btcsuite/btcd's releases.

    btcd v0.23.2

    What's Changed

    New Contributors

    Full Changelog: https://github.com/btcsuite/btcd/compare/v0.23.1...v0.23.2

    btcd v0.23.1-beta

    What's Changed

    ... (truncated)

    Commits
    • 6b5418d Merge pull request #1898 from Roasbeef/v0-23-2-branch
    • 1a4af39 build: bump version to v0.23.2
    • d0aa747 Merge pull request #1896 from Roasbeef/witness-wire-hot-fix
    • f523d4c wire: remove erroneous witness size check in wire parsing
    • 38ee9a4 build: bump golang base image version to 1.17
    • ef4a8d3 doc: fix Tor hidden service setup link
    • 0f49e10 Merge pull request #1866 from darioush/bump-btcutils-versions
    • da4b534 Merge pull request #1865 from sputn1ck/musig2_0.3.0
    • 06ce960 btcec/schnorr/musig2: add infinity testvectors
    • 44eb8c6 btcec/schnorr/musig2: Allow infinity nonces
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

  • Not able to communicate with RPC public node

    Not able to communicate with RPC public node

    I get "websocket client is dialing or stopped, can't send any request" when I try to communicate with public RPC node.

    nodeAddr := "https://seed1.4leapbnb.com:443" testClientInstance := rpc.NewRPCClient(nodeAddr,types.ProdNetwork) status, err := testClientInstance.Status()

    Can someone help me to identify what is going wrong here?

  • response:  RPC error -32603 - Internal error: Timed out waiting for tx to be included in a block

    response: RPC error -32603 - Internal error: Timed out waiting for tx to be included in a block

    Request api: broadcast_tx_commit, return error message: RPC error -32603-Internal error: Timed out waiting for tx to be included in a block. How can I solve it? Thanks 调用api broadcast_tx_commit 时,返回的错误信息如上描叙,但是链上看交易出去了。 这种情况怎么解决呢? 感谢

  • No support for creating orders with IOC TimeInForce

    No support for creating orders with IOC TimeInForce

    client.CreateOrder does not have a function parameter to allow setting TimeInForce resulting in using the default GTE value every time. The only thought I had was to make use of the Option functions to manually overwrite the message as follows:

    	// gymnastics to be able to set TimeInForce value to IOC (Immediate or Cancel)
    	// https://docs.binance.org/trading-spec.html
    	m := msg.CreateOrderMsg{
    		Sender:      addr,
    		ID:          "",
    		Symbol:      sym,
    		OrderType:   msg.OrderType.LIMIT,
    		Side:        s,
    		Price:       price,
    		Quantity:    quantity,
    		TimeInForce: msg.TimeInForce.IOC,
    	}
    	withMsg := func(txMsg *tx.StdSignMsg) *tx.StdSignMsg {
    		txMsg.Msgs = []msg.Msg{m}
    		return txMsg
    	}
    
    	createOrderResult, err := client.CreateOrder(base, quote, s, price, quantity, true, withMsg)
    	if err != nil {
                    panic(err)
    	}
    

    However, after looking more closely, the msg is overwritten with the order message created by CreateOrder regardless at: https://github.com/binance-chain/go-sdk/blob/8f0e838a5402c99cc08057a04eaece6dfd99181f/client/transaction/transaction.go#L101 resulting in no possibility to use the IOC TimeInForce as far as I can tell.

    It would be a bit difficult to add without breaking the CreateOrder API as it stands. Can you think of any reasonable way to go about adding this functionality? Or please let me know if I am overlooking something and there is another way to accomplish this. Thank you!

DND-magic-item-Generator - D&D magic item generator like in Diablo

DND-magic-item-Generator D&D magic item generator like in Diablo Legendary items

Mar 28, 2022
A Golang Client Library for building Cosmos SDK chain clients

Cosmos Client Lib in Go This is the start of ideas around how to implement the cosmos client libraries in a seperate repo How to instantiate and use t

Jan 6, 2023
Chain Name System

Chain Name Service (CNS) The CNS module is a new Cosmos SDK module that allows Cosmos addresses to purchase, sell, and administer chain names. Why Cos

Nov 16, 2022
Ant Chain CAFECMDB SDK for Go

English | 简体中文 Ant Chain CAFECMDB SDK for Go Requirements It's necessary for you to make sure your system have installed Go environment which version

Dec 2, 2021
Ant Chain COMMERCIALEXTERNAL SDK for Go

English | 简体中文 Ant Chain COMMERCIALEXTERNAL SDK for Go Requirements It's necessa

Dec 24, 2021
Account - Ant Chain ACCOUNT SDK for Go

English | 简体中文 Ant Chain ACCOUNT SDK for Go Requirements It's necessary for you

Jan 13, 2022
A simple IP address lookup service | 基于 ip2region 使用 go 扩展的一个简单的 IP 地址归属地查询服务
A simple IP address lookup service | 基于 ip2region 使用 go 扩展的一个简单的 IP 地址归属地查询服务

go-ip2region 基于 ip2region 使用 go 扩展的一个简单的 IP 地址归属地查询服务 在线IP地址归属地查询 功能 提供 http 接口查询 IP 地址归属地 提供命令行 下载/更新 最新的 ip2region.db ip 库 (数据来源原仓库) 使用 可直接下载 releas

Dec 23, 2022
Lambda microservice triggered by API Gateway to lookup ip address, domain or hash (md5, sha1, sha256)

lambdaGatewayAPI Lambda microservice triggered by API Gateway to lookup ip address, domain or hash (md5, sha1, sha256) How to deploy Build the lambdaG

Dec 21, 2021
Package to check if the email used during signup or registration process is a Disposable Email Address ( DEA ).

Table of contents Disposable Email Address ( DEA ) checker How does dea works ? Requirements Installation Usage Reference Future plans FAQs What are D

Apr 28, 2023
Spotify account generator, just for fun purpose.

go-spotify-account-generator Spotify account generator, just for fun purpose. Install $ go get github.com/HamzaAnis/go-spotify-account-generator How

Dec 16, 2022
Repository generator for Go

repogen repogen is a Golang Codegen that generates database query and mutation end-to-end with its model. How it works repogen describe our given tabl

Aug 4, 2022
SDBOTs Inifinity Account Generator ⚙️

Account-Generator Variables Env Vars - BOT_TOKEN - Get it from @BotFather CHANNEL_ID - Channel ID of Join Check Channel. CHANNEL_USERNAME - Channel Us

Dec 10, 2021
File-generator - Creates a file filled with bytes

creates a file filled with bytes ./filegen from to from : index of first piece t

Feb 14, 2022
An experimental OpenAPI -> Terraform Provider generator that does not yet function

tfpgen An experimental OpenAPI -> Terraform Provider generator that does not yet function. The goal is to allow developers to incrementally generate a

Feb 19, 2022
A simple pep talk generator based on a tweet from @VVh1sp3r

Description Based on a pep talk generator that @VVh1sp3r tweeted. (see image). I thought it would be a fun little project to use as my first Go progra

Jan 23, 2022
A small, fast, reliable pastemyst API wrapper written in Golang

A small, fast, reliable pastemyst API wrapper written in Golang. Official pastemyst API docs found here.

Dec 12, 2022
Pterodactyl API wrapper written in Golang

WARNING That repository isn't available for production environment. Many endpoints aren't yet implemented. Be careful if you are using that module. pt

Oct 4, 2022
A API scanner written in GOLANG to scan files recursively and look for API keys and IDs.

GO FIND APIS _____ ____ ______ _____ _ _ _____ _____ _____ _____ / ____|/ __ \ | ____|_ _| \ | | __ \ /\ | __ \_

Oct 25, 2021
Inofficial SDK for gameanalytics written in Golang

gameanalytics-go gameanalytics-go is an inofficial sdk for gameanalytics which is written in go. It currently can send the following events: Business

Sep 3, 2022