Skip to content

Commit

Permalink
ong ont precision go sdk modify (#133)
Browse files Browse the repository at this point in the history
* 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
xiemylogos authored Feb 17, 2022
1 parent 8bc271d commit 6117f13
Show file tree
Hide file tree
Showing 12 changed files with 1,423 additions and 232 deletions.
105 changes: 105 additions & 0 deletions CHANGELOG.md
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)
```
Loading

0 comments on commit 6117f13

Please sign in to comment.