Comment on page
There are two ways to pay blockchain network fees when submitting order or cancellation requests on-chain with Dinari.
- 1.Direct: You can submit requests directly to our Order Processor contracts and pay the network fees in native currency.
- 2.Sponsored (Coming Soon): You can sign request data, submit the data to our API, and pay the network fees in payment token. The Dinari API service then submits the request on your behalf, paying the network fee in native currency and taking the network fee from you in payment token.
With a hierarchical deterministic (hd) wallet, the recovery phrase (mnemonic) can be used to create any number of private key/wallet pairs. The mnemonic is used in conjunction with a "path". The default path for Ethereum wallets is
m/44'/60'/0'/0/0with the last integer specifying the account index to be incremented when creating additional accounts. See bip44 for the path spec.
Store and load your hd wallet mnemonic safely! You can also opt to use an independent key management system or a third party wallet provider to manage these secrets and low-level wallet operations.
client, _ := ethclient.Dial(rpcURL)
chainID, _ := client.NetworkID(context.Background())
wallet, _ := hdwallet.NewFromMnemonic(mnemonic)
path := hdwallet.MustParseDerivationPath("m/44'/60'/0'/0/0")
account, _ := wallet.Derive(path, true)
privateKey, _ := wallet.PrivateKey(account)
signer, _ := bind.NewKeyedTransactorWithChainID(privateKey, chainID)
Full example scripts are available.
Last modified 1mo ago