Documentation ¶
Index ¶
- Constants
- Variables
- func CreateEmptyRawTransactionAndHash(from, pubkey string, sequence uint32, to string, amount, fee uint64, ...) (string, string, error)
- func Decode(input string, alphabet *Alphabet) ([]byte, error)
- func Encode(input []byte, alphabet *Alphabet) string
- func GetProgramHashFromAddress(address string) ([]byte, error)
- func SignRawTransaction(hash string, prikey []byte) (string, error)
- func VerifyAndCombinRawTransaction(emptyTrans string, signature, publicKey string) (bool, string)
- type Alphabet
- type TxStruct
- type Value
Constants ¶
View Source
const ( AddressPrefix byte = 0x00 PAYMENT uint16 = 0x00 HP_TRANSACTION_SIGN uint32 = 0x53545800 TxCanonicalSignature uint32 = 0x80000000 )
Variables ¶
View Source
var ( CurveOrder = []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xBA, 0xAE, 0xDC, 0xE6, 0xAF, 0x48, 0xA0, 0x3B, 0xBF, 0xD2, 0x5E, 0x8C, 0xD0, 0x36, 0x41, 0x41} HalfCurveOrder = []byte{0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5D, 0x57, 0x6E, 0x73, 0x57, 0xA4, 0x50, 0x1D, 0xDF, 0xE9, 0x2F, 0x46, 0x68, 0x1B, 0x20, 0xA0} )
View Source
var (
ErrorInvalidBase58String = errors.New("invalid base58 string")
)
Errors
View Source
var (
RippleAlphabet = NewAlphabet("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz")
)
Alphabet: copy from https://en.wikipedia.org/wiki/Base58
Functions ¶
Types ¶
type Alphabet ¶
type Alphabet struct {
// contains filtered or unexported fields
}
Alphabet The base58 alphabet object.
func NewAlphabet ¶
NewAlphabet create a custom alphabet from 58-length string. Note: len(rune(alphabet)) must be 58.
Click to show internal directories.
Click to hide internal directories.