MCPcopy Create free account
hub / github.com/DNAProject/DNA / GetAllowance

Function GetAllowance

cmd/utils/gas.go:102–113  ·  view source on GitHub ↗
(asset, from, to string)

Source from the content-addressed store, hash-verified

100}
101
102func GetAllowance(asset, from, to string) (string, error) {
103 result, ontErr := sendRpcRequest("getallowance", []interface{}{asset, from, to})
104 if ontErr != nil {
105 return "", ontErr.Error
106 }
107 balance := ""
108 err := json.Unmarshal(result, &balance)
109 if err != nil {
110 return "", fmt.Errorf("json.Unmarshal error:%s", err)
111 }
112 return balance, nil
113}
114
115//Transfer ont|ong from account to another account
116func Transfer(gasPrice, gasLimit uint64, signer *account.Account, asset, from, to string, amount uint64) (string, error) {

Callers 1

getAllowanceFunction · 0.92

Calls 2

sendRpcRequestFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected