extension

package
v0.0.0-...-efcff09 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesGcmDecrypt

func AesGcmDecrypt(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func AesGcmEncrypt

func AesGcmEncrypt(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func B64ToBuf

func B64ToBuf(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func BufCompare

func BufCompare(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func BufConcat

func BufConcat(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func BufEqual

func BufEqual(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func BufReverse

func BufReverse(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func BufToB64

func BufToB64(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func BufToBip32Key

func BufToBip32Key(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func BufToHex

func BufToHex(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func BufToU32BE

func BufToU32BE(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func BufToU32LE

func BufToU32LE(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func Ecrecover

func Ecrecover(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func GetCPUID

func GetCPUID() string

func GetEthSignedMessage

func GetEthSignedMessage(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func GetTSC

func GetTSC(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func GetTSCBenchEnd

func GetTSCBenchEnd(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func GetTSCBenchStart

func GetTSCBenchStart(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func HexToBuf

func HexToBuf(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func HexToPaddingBuf

func HexToPaddingBuf(f goja.FunctionCall, vm *goja.Runtime) goja.Value

HexToPaddingBuf encodes a hex string to a padding buffer in big-endian

func Keccak256

func Keccak256(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func MerkleProofToRootAndMatches

func MerkleProofToRootAndMatches(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func ND_GetEphemeralID

func ND_GetEphemeralID() string

func ND_ReadTsc

func ND_ReadTsc() uint64

func Printf

func Printf(format string, a ...any)

func Println

func Println(a ...any)

Only for egvm script debugging

func Ripemd160

func Ripemd160(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func Sha256

func Sha256(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func SignTxAndSerialize

func SignTxAndSerialize(tx BchTx, privateKeys ...PrivateKey) string

func Sleep

func Sleep(seconds uint)

func SleepMs

func SleepMs(ms uint)

func U32ToBufBE

func U32ToBufBE(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func U32ToBufLE

func U32ToBufLE(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func U64ToBufBE

func U64ToBufBE(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func U64ToBufLE

func U64ToBufLE(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func UTF8StrToBuf

func UTF8StrToBuf(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func VerifyMerkleProofKeccak256

func VerifyMerkleProofKeccak256(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func VerifyMerkleProofSha256

func VerifyMerkleProofSha256(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func VerifySignature

func VerifySignature(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func XxHash128

func XxHash128(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func XxHash32

func XxHash32(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func XxHash32Int

func XxHash32Int(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func XxHash64

func XxHash64(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func ZstdCompress

func ZstdCompress(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func ZstdDecompress

func ZstdDecompress(f goja.FunctionCall, vm *goja.Runtime) goja.Value

Types

type BchTx

type BchTx struct {
	HexTxID  string
	Version  int32
	TxIn     []TxIn
	TxOut    []TxOut
	LockTime uint32
}

func ParseTxInHex

func ParseTxInHex(hexStr string) BchTx

type Bip32Key

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

func B58ToBip32Key

func B58ToBip32Key(data string) Bip32Key

func GenerateRandomBip32Key

func GenerateRandomBip32Key() Bip32Key

func NewBip32Key

func NewBip32Key(key *bip32.Key) Bip32Key

Only for golang

func (Bip32Key) B58Serialize

func (key Bip32Key) B58Serialize() string

func (Bip32Key) Derive

func (key Bip32Key) Derive(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func (Bip32Key) DeriveWithBytes32

func (key Bip32Key) DeriveWithBytes32(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func (Bip32Key) IsPrivate

func (key Bip32Key) IsPrivate() bool

func (Bip32Key) NewChildKey

func (key Bip32Key) NewChildKey(childIdx uint32) Bip32Key

func (Bip32Key) PublicKey

func (key Bip32Key) PublicKey() Bip32Key

func (Bip32Key) Serialize

func (key Bip32Key) Serialize(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func (Bip32Key) ToPrivateKey

func (key Bip32Key) ToPrivateKey() PrivateKey

type OutPoint

type OutPoint struct {
	HexTxID string
	Index   uint32
}

type PrivateKey

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

func BufToPrivateKey

func BufToPrivateKey(buf goja.ArrayBuffer) PrivateKey

func (PrivateKey) Decrypt

func (prv PrivateKey) Decrypt(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func (PrivateKey) ECDH

func (prv PrivateKey) ECDH(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func (PrivateKey) Encapsulate

func (prv PrivateKey) Encapsulate(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func (PrivateKey) Equal

func (prv PrivateKey) Equal(other PrivateKey) bool

func (PrivateKey) GetPublicKey

func (prv PrivateKey) GetPublicKey() PublicKey

func (PrivateKey) Hex

func (prv PrivateKey) Hex() string

func (PrivateKey) Serialize

func (prv PrivateKey) Serialize(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func (PrivateKey) Sign

func (prv PrivateKey) Sign(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func (PrivateKey) VrfProve

func (prv PrivateKey) VrfProve(f goja.FunctionCall, vm *goja.Runtime) goja.Value

type PublicKey

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

func BufToPublicKey

func BufToPublicKey(buf goja.ArrayBuffer) PublicKey

func (PublicKey) Decapsulate

func (pub PublicKey) Decapsulate(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func (PublicKey) Encrypt

func (pub PublicKey) Encrypt(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func (PublicKey) Equal

func (pub PublicKey) Equal(other PublicKey) bool

func (PublicKey) Hex

func (pub PublicKey) Hex(compressed bool) string

func (PublicKey) SerializeCompressed

func (pub PublicKey) SerializeCompressed(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func (PublicKey) SerializeUncompressed

func (pub PublicKey) SerializeUncompressed(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func (PublicKey) ToCashAddress

func (pub PublicKey) ToCashAddress(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func (PublicKey) ToEvmAddress

func (pub PublicKey) ToEvmAddress(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func (PublicKey) VrfVerify

func (pub PublicKey) VrfVerify(f goja.FunctionCall, vm *goja.Runtime) goja.Value

type TxIn

type TxIn struct {
	PreviousOutPoint OutPoint
	HexPubkey        string
	Sequence         uint32
	Value            int64
}

type TxOut

type TxOut struct {
	Value           int64
	HexPubkeyHash   string   // for P2PKH
	HexDataElements []string // the pushed data in OP_RETURN, empty when it's P2PKH
}

Jump to

Keyboard shortcuts

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