Documentation ¶
Overview ¶
Package base91 implements base91 encoding, fork from https://github.com/mtraver/base91
Index ¶
- Constants
- func AESDecrypt(secret, b []byte) []byte
- func AESEncrypt(secret, b []byte, sid string) []byte
- func Base91Decode(src string) ([]byte, error)
- func Base91Encode(src []byte) string
- func CheckMixinDomainAddress(rpc string, chainId, address string) (bool, error)
- func CheckTestEnvironment(ctx context.Context) bool
- func CheckUnique(args ...any) bool
- func DecodeHexOrPanic(s string) []byte
- func ECDHEd25519(priv, pub string) [32]byte
- func EnableTestEnvironment(ctx context.Context) context.Context
- func Fingerprint(public string) []byte
- func MarshalPanic(m encoding.BinaryMarshaler) []byte
- func NormalizeCurve(crv uint8) uint8
- func OpenSQLite3ReadOnlyStore(path string) (*sql.DB, error)
- func OpenSQLite3Store(path, schema string) (*sql.DB, error)
- func ReadKernelTransaction(rpc string, tx crypto.Hash) (*common.VersionedTransaction, error)
- func SendTransaction(ctx context.Context, client *mixin.Client, assetId string, receivers []string, ...) error
- func SendTransactionUntilSufficient(ctx context.Context, client *mixin.Client, assetId string, receivers []string, ...) error
- func StateName(state int) string
- func VerifyKernelTransaction(rpc string, out *mtg.Output, timeout time.Duration) error
- type Encoding
- type Operation
- type Request
Constants ¶
const ( OperationTypeWrapper = 0 OperationTypeKeygenInput = 1 OperationTypeSignInput = 2 OperationTypeKeygenOutput = 11 OperationTypeSignOutput = 12 CurveSecp256k1ECDSABitcoin = 1 CurveSecp256k1ECDSAEthereum = 2 CurveSecp256k1SchnorrBitcoin = 3 CurveEdwards25519Default = 4 CurveEdwards25519Mixin = 5 CurveSecp256k1ECDSALitecoin = 100 + CurveSecp256k1ECDSABitcoin CurveSecp256k1ECDSABitcoinCash = 110 + CurveSecp256k1ECDSABitcoin )
const ( RequestRoleHolder = 1 RequestRoleSigner = 2 RequestRoleObserver = 3 RequestStateInitial = 1 RequestStatePending = 2 RequestStateDone = 3 RequestStateFailed = 4 ActionTerminate = 100 ActionObserverAddKey = 101 ActionObserverRequestSignerKeys = 102 ActionObserverUpdateNetworkStatus = 103 ActionObserverHolderDeposit = 104 ActionObserverSetAccountPlan = 106 // For all Bitcoin like chains ActionBitcoinSafeProposeAccount = 110 ActionBitcoinSafeApproveAccount = 111 ActionBitcoinSafeProposeTransaction = 112 ActionBitcoinSafeApproveTransaction = 113 ActionBitcoinSafeRevokeTransaction = 114 // For Mixin Kernel mainnet ActionMixinSafeProposeAccount = 120 ActionMixinSafeApproveAccount = 121 ActionMixinSafeProposeTransaction = 122 ActionMixinSafeApproveTransaction = 123 ActionMixinSafeRevokeTransaction = 124 // For all Ethereum like chains ActionEthereumSafeProposeAccount = 130 ActionEthereumSafeApproveAccount = 131 )
Variables ¶
This section is empty.
Functions ¶
func AESDecrypt ¶
func AESEncrypt ¶
func Base91Decode ¶
func Base91Encode ¶
func CheckMixinDomainAddress ¶
func CheckTestEnvironment ¶
func CheckUnique ¶
func DecodeHexOrPanic ¶
func ECDHEd25519 ¶
func Fingerprint ¶ added in v0.3.0
func MarshalPanic ¶
func MarshalPanic(m encoding.BinaryMarshaler) []byte
func NormalizeCurve ¶ added in v0.2.0
func ReadKernelTransaction ¶
func SendTransaction ¶
Types ¶
type Encoding ¶
type Encoding struct {
// contains filtered or unexported fields
}
An Encoding is a base 91 encoding/decoding scheme defined by a 91-character alphabet.
func (*Encoding) Decode ¶
Decode decodes src using the encoding enc. It writes at most DecodedLen(len(src)) bytes to dst and returns the number of bytes written. If src contains invalid base91 data, it will return the number of bytes successfully written and CorruptInputError.
func (*Encoding) DecodedLen ¶
DecodedLen returns the maximum length in bytes of the decoded data corresponding to n bytes of base91-encoded data.
func (*Encoding) Encode ¶
Encode encodes src using the encoding enc, writing bytes to dst. It returns the number of bytes written, because the exact output size cannot be known before encoding takes place. EncodedLen(len(src)) may be used to determine an upper bound on the output size when allocating a dst slice.
func (*Encoding) EncodedLen ¶
EncodedLen returns an upper bound on the length in bytes of the base91 encoding of an input buffer of length n. The true encoded length may be shorter.