Skip to content
This repository has been archived by the owner on Jan 25, 2021. It is now read-only.

Commit

Permalink
nep9 without attr for gomobile
Browse files Browse the repository at this point in the history
  • Loading branch information
apisit committed Feb 20, 2018
1 parent 3ec4b5d commit 53cf550
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions dep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go get github.com/o3labs/nep9-go
18 changes: 16 additions & 2 deletions neoutils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,20 @@ func ConvertByteArrayToBigInt(hexString string) *big.Int {
return v
}

func ParseNEP9URI(uri string) (*nep9.NEP9, error) {
return nep9.ParseNEP9URI(uri)
type SimplifiedNEP9 struct {
To string `json:"to"`
AssetID string `json:"assetID"`
Amount float64 `json:"amount"`
}

func ParseNEP9URI(uri string) (*SimplifiedNEP9, error) {
parsed, err := nep9.ParseNEP9URI(uri)
if err != nil {
return nil, err
}
return &SimplifiedNEP9{
To: parsed.To,
AssetID: parsed.AssetID,
Amount: parsed.Amount,
}, nil
}

0 comments on commit 53cf550

Please sign in to comment.