Documentation
¶
Index ¶
- Constants
- func GetHexByteLength(v string) int
- func IsHex(v string) bool
- func IsValidSuiAddress(v string) bool
- func IsValidSuiObjectId(v string) bool
- func IsValidTransactionDigest(v string) bool
- func NormalizeShortSuiAddress(v string) string
- func NormalizeShortSuiCoinType(v string) string
- func NormalizeShortSuiObjectId(v string) string
- func NormalizeSuiAddress(v string) string
- func NormalizeSuiCoinType(v string) string
- func NormalizeSuiObjectId(v string) string
Constants ¶
const ( SuiAddressLength = 32 TxDigestLength = 32 )
Variables ¶
This section is empty.
Functions ¶
func GetHexByteLength ¶ added in v0.0.15
func IsValidSuiAddress ¶ added in v0.0.15
func IsValidSuiObjectId ¶ added in v0.0.15
func IsValidTransactionDigest ¶ added in v0.0.15
Returns whether the tx digest is valid based on the serialization format
func NormalizeShortSuiAddress ¶ added in v0.0.15
0x0000000000000000000000000000000000000000000000000000000000000001 -> 0x1
func NormalizeShortSuiCoinType ¶ added in v0.0.15
0x2::sui::SUI -> 0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI
func NormalizeShortSuiObjectId ¶ added in v0.0.15
0x0000000000000000000000000000000000000000000000000000000000000001 -> 0x1
func NormalizeSuiAddress ¶ added in v0.0.15
*
Perform the following operations:
1. Make the address lower case
2. Prepend `0x` if the string does not start with `0x`.
3. Add more zeros if the length of the address(excluding `0x`) is less than `SUI_ADDRESS_LENGTH` *
WARNING: if the address value itself starts with `0x`, e.g., `0x0x`, the default behavior
is to treat the first `0x` not as part of the address. The default behavior can be overridden by
setting `forceAdd0x` to true *
0x1 -> 0x0000000000000000000000000000000000000000000000000000000000000001
func NormalizeSuiCoinType ¶ added in v0.0.15
0x2::sui::SUI -> 0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI
func NormalizeSuiObjectId ¶ added in v0.0.15
0x1 -> 0x0000000000000000000000000000000000000000000000000000000000000001
Types ¶
This section is empty.