-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ong ont precision go sdk modify (#133)
* go sdk support ont ong precision * update readme md * update sdk test * add v2 md * add v2 unit test * fix parse ont event * replace transferstate from ont to local * update parse payload * add parse transferFromV2 payload * modify datat type * add changelog * modify go mod ontology version * go fmt code * modify parse payload * update code * update test case * modify test net url * update test case * fix credential test case * fix parse event decimal
- Loading branch information
1 parent
8bc271d
commit 6117f13
Showing
12 changed files
with
1,423 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# ChangeLog | ||
|
||
## 1、Add ONT interface | ||
|
||
### 1、Get balance V2 | ||
|
||
``` | ||
ontSdk.Native.Ont.BalanceOfV2(address common.Address) (*big.Int, error) | ||
``` | ||
|
||
### 2、 Transfer V2 | ||
|
||
``` | ||
ontSdk.Native.Ont.TransferV2(gasPrice, gasLimit uint64, from *Account, to common.Address, amount *big.Int) (common.Uint256, error) | ||
``` | ||
|
||
### 3、 Multiple Transfer V2 | ||
|
||
``` | ||
ontSdk.Native.Ont.MultiTransferV2(gasPrice, gasLimit uint64, states []*ont.State, signer *Account) (common.Uint256, error) | ||
``` | ||
|
||
A multi transfer does more than one transfer of ONT in one transaction. | ||
|
||
### 4、Approve V2 | ||
|
||
``` | ||
ontSdk.Native.Ont.ApproveV2(gasPrice, gasLimit uint64, from *Account, to common.Address, amount *big.Int) (common.Uint256, error) | ||
``` | ||
|
||
### 5、 Allowance V2 | ||
|
||
``` | ||
ontSdk.Native.Ont.AllowanceV2(from, to common.Address) (*big.Int, error) | ||
``` | ||
|
||
### 6、 Transfer From V2 | ||
|
||
``` | ||
ontSdk.Native.Ont.TransferFromV2(gasPrice, gasLimit uint64, sender *Account, from, to common.Address, amount *big.Int) (common.Uint256, error) | ||
``` | ||
|
||
## 2、Add ONG interface | ||
|
||
### 1、 Get balance V2 | ||
|
||
``` | ||
ontSdk.Native.Ong.BalanceOfV2(address common.Address) (*big.Int, error) | ||
``` | ||
|
||
### 2、 Transfer V2 | ||
|
||
``` | ||
ontSdk.Native.Ong.TransferV2(gasPrice, gasLimit uint64, from *Account, to common.Address, amount *big.Int) (common.Uint256, error) | ||
``` | ||
|
||
### 3、 Multiple Transfer V2 | ||
|
||
``` | ||
ontSdk.Native.Ong.MultiTransferV2(gasPrice, gasLimit uint64, states []*ont.State, signer *Account) (common.Uint256, error) | ||
``` | ||
|
||
A multi transfer does more than one transfer of ONG in one transaction. | ||
|
||
### 4、 Approve V2 | ||
|
||
``` | ||
ontSdk.Native.Ong.ApproveV2(gasPrice, gasLimit uint64, from *Account, to common.Address, amount *big.Int) (common.Uint256, error) | ||
``` | ||
|
||
### 5、 Approve Balance V2 | ||
|
||
``` | ||
ontSdk.Native.Ong.AllowanceV2(from, to common.Address) (*big.Int, error) | ||
``` | ||
|
||
### 6、 TransferFrom V2 | ||
|
||
``` | ||
ontSdk.Native.Ong.TransferFrom(gasPrice, gasLimit uint64, sender *Account, from, to common.Address, amount *big.Int) (common.Uint256, error) | ||
``` | ||
|
||
### 7、 Withdraw ONG V2 | ||
|
||
``` | ||
ontSdk.Native.Ong.WithdrawONG(gasPrice, gasLimit uint64, address *Account, amount *big.Int) (common.Uint256, error) | ||
``` | ||
|
||
### 8、 Get unbound ONG V2 | ||
|
||
``` | ||
ontSdk.Native.Ong.UnboundONGV2(address common.Address) (*big.Int, error) | ||
``` | ||
|
||
3、Modify TransferOng Event Parse | ||
``` | ||
type TransferEventV2 struct { | ||
FuncName string | ||
From string | ||
To string | ||
Amount *big.Int | ||
} | ||
ParseNativeTransferEventV2(event *sdkcom.NotifyEventInfo) (*TransferEventV2, error) | ||
``` |
Oops, something went wrong.