xrp

package
v0.0.0-...-eb4c3ac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PubKeyBytesLenCompressed   = 33
	PubKeyBytesLenUncompressed = 65
)

Variables

View Source
var XRP_DEFAULT_FEE, _ = new(big.Int).SetString("10", 10)

Functions

func XRPInit

func XRPInit()

func XRP_FundAddress

func XRP_FundAddress(toaddress string)

给一个地址打10000块钱激活, 需要一个有足够钱的大帐户 大帐户地址: rwLc28nRV7WZiBv6vsHnpxUGAVcj8qpAtE 大帐户seed: ssfL5tmpTTqCw5sHjnRHQ4yyUCQKf 大帐户密钥类型: ecdsa keysequence: 0

func XRP_Remit

func XRP_Remit(seed string, cryptoType string, keyseq *uint32, toaddress string, amount *big.Int, fee int64)

普通xrp转账

func XRP_getAddress

func XRP_getAddress(k crypto.Key, sequence *uint32) string

func XRP_getSig

func XRP_getSig(tx data.Transaction, key crypto.Key, keyseq *uint32, hash data.Hash256, msg []byte) []byte

func XRP_importKeyFromSeed

func XRP_importKeyFromSeed(seed string, cryptoType string) crypto.Key

cryptoType = "ed25519" or "ecdsa"

func XRP_importPublicKey

func XRP_importPublicKey(pubkey []byte) crypto.Key

func XRP_importPublicKey_ed

func XRP_importPublicKey_ed(pubkey []byte) crypto.Key

////////ed

func XRP_makeSignedTx

func XRP_makeSignedTx(tx data.Transaction, sig []byte) data.Transaction

func XRP_newUnsignedPaymentTransaction

func XRP_newUnsignedPaymentTransaction(key crypto.Key, keyseq *uint32, txseq uint32, dest string, amt string, fee int64, path string, nodirect bool, partial bool, limit bool) (data.Transaction, data.Hash256, []byte)

keyseq is only supported by ecdsa, leave nil when key crypto type is ed25519 amt format: "value/currency/issuer"

func XRP_newUnsignedSimplePaymentTransaction

func XRP_newUnsignedSimplePaymentTransaction(fromAddress string, publicKey []byte, toAddress string, amount *big.Int, fee int64) (data.Transaction, data.Hash256, []byte)

func XRP_publicKeyToAddress

func XRP_publicKeyToAddress(pubkey []byte) string

func XRP_publicKeyToAddress_ed

func XRP_publicKeyToAddress_ed(pubkey []byte) string

func XRP_submitTx

func XRP_submitTx(signedTx data.Transaction) string

Types

type Account

type Account struct {
	Balance  string
	Sequence uint32
}

type Account_info_Res

type Account_info_Res struct {
	Account_data Account
}

type EcdsaPublic

type EcdsaPublic struct {
	// contains filtered or unexported fields
}

func (*EcdsaPublic) Id

func (k *EcdsaPublic) Id(sequence *uint32) []byte

func (*EcdsaPublic) Private

func (k *EcdsaPublic) Private(sequence *uint32) []byte

func (*EcdsaPublic) Public

func (k *EcdsaPublic) Public(sequence *uint32) []byte

type JsonRet

type JsonRet struct {
	Result Account_info_Res
}

type XRPHandler

type XRPHandler struct{}

func NewXRPHandler

func NewXRPHandler() *XRPHandler

func (*XRPHandler) BuildUnsignedTransaction

func (h *XRPHandler) BuildUnsignedTransaction(fromAddress, fromPublicKey, toAddress string, amount *big.Int, jsonstring string) (transaction interface{}, digests []string, err error)

jsonstring:'{"fee":1}'

func (*XRPHandler) GetAddressBalance

func (h *XRPHandler) GetAddressBalance(address string, jsonstring string) (balance types.Balance, err error)

func (*XRPHandler) GetDefaultFee

func (h *XRPHandler) GetDefaultFee() types.Value

func (*XRPHandler) GetTransactionInfo

func (h *XRPHandler) GetTransactionInfo(txhash string) (fromAddress string, txOutputs []types.TxOutput, jsonstring string, confirmed bool, fee types.Value, err error)

func (*XRPHandler) IsToken

func (h *XRPHandler) IsToken() bool

func (*XRPHandler) MakeSignedTransaction

func (h *XRPHandler) MakeSignedTransaction(rsv []string, transaction interface{}) (signedTransaction interface{}, err error)

func (*XRPHandler) PublicKeyToAddress

func (h *XRPHandler) PublicKeyToAddress(pubKeyHex string) (address string, err error)

func (*XRPHandler) SignTransaction

func (h *XRPHandler) SignTransaction(hash []string, privateKey interface{}) (rsv []string, err error)

func (*XRPHandler) SubmitTransaction

func (h *XRPHandler) SubmitTransaction(signedTransaction interface{}) (txhash string, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL