Skip to content

Commit

Permalink
feat: Added token_id
Browse files Browse the repository at this point in the history
  • Loading branch information
andrix10 committed Oct 16, 2020
1 parent 8e62952 commit 5b6fd0b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions token_id.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package hedera

import "github.com/hashgraph/hedera-sdk-go/proto"

type TokenID struct {
Shard uint64
Realm uint64
Token uint64
}

func tokenIDFromProtobuf(tokenID *proto.TokenID) TokenID {
return TokenID{
Shard: uint64(tokenID.ShardNum),
Realm: uint64(tokenID.RealmNum),
Token: uint64(tokenID.TokenNum),
}
}

func (id *TokenID) toProtobuf() *proto.TokenID {
return &proto.TokenID{
ShardNum: int64(id.Shard),
RealmNum: int64(id.Realm),
TokenNum: int64(id.Token),
}
}

0 comments on commit 5b6fd0b

Please sign in to comment.