operation

package
v0.0.0-...-cdae4ff Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	TestFactoryContractAddress = "0x39490616B61302B7d0Af8993cB694a54064EBA17"
	ProdFactoryContractAddress = "0x3c763e46456915922a4647a1E3f3B8916c93171e"

	SafeChainBitcoin  = 1
	SafeChainEthereum = 2
	SafeChainMixin    = 3
	SafeChainMVM      = 4
	SafeChainLitecoin = 5
	SafeChainPolygon  = 6

	SafeBitcoinChainId  = "c6d0c728-2624-429b-8e0d-d9d19b6592fa"
	SafeLitecoinChainId = "76c802a2-7c88-447f-a93e-c29c9e5dd9c8"
	SafeEthereumChainId = "43d61dcd-e413-450d-80b8-101d5e903357"
	SafeMVMChainId      = "a0ffd769-5850-4b48-9651-d2ae44a3e64d"
	SafePolygonChainId  = "b7938396-3f94-4e0a-9179-d3440718156f"
)
View Source
const (
	BitcoinAssetId = "c6d0c728-2624-429b-8e0d-d9d19b6592fa"
	PusdAssetId    = "31d2ea9c-95eb-3355-b65b-ba096853bc18"

	CurveSecp256k1ECDSABitcoin  = 1
	CurveSecp256k1ECDSAEthereum = 2
	CurveSecp256k1ECDSALitecoin = 100 + CurveSecp256k1ECDSABitcoin
	CurveSecp256k1ECDSAMVM      = 100 + CurveSecp256k1ECDSAEthereum
	CurveSecp256k1ECDSAPolygon  = 110 + CurveSecp256k1ECDSAEthereum

	// For all Bitcoin like chains
	ActionBitcoinSafeProposeAccount     = 110
	ActionBitcoinSafeApproveAccount     = 111
	ActionBitcoinSafeProposeTransaction = 112
	ActionBitcoinSafeApproveTransaction = 113
	ActionBitcoinSafeRevokeTransaction  = 114
	ActionBitcoinSafeCloseAccount       = 115

	// For all Ethereum like chains
	ActionEthereumSafeProposeAccount     = 130
	ActionEthereumSafeApproveAccount     = 131
	ActionEthereumSafeProposeTransaction = 132
	ActionEthereumSafeApproveTransaction = 133
	ActionEthereumSafeRevokeTransaction  = 134
	ActionEthereumSafeCloseAccount       = 135
	ActionEthereumSafeRefundTransaction  = 136

	TransactionTypeNormal   = 0
	TransactionTypeRecovery = 1
)

Variables

View Source
var (
	MVMChainBase string
	MVMChainId   crypto.Hash
)

Functions

func AESDecrypt

func AESDecrypt(secret, b []byte) []byte

func AESEncrypt

func AESEncrypt(secret, b []byte, sid string) []byte

func BuildChainAssetId

func BuildChainAssetId(base, asset string) crypto.Hash

func CheckTransactionPartiallySignedBy

func CheckTransactionPartiallySignedBy(raw, public string, chain byte) bool

func DecodeExtra

func DecodeExtra(aesKey []byte, memo string) (*types.Operation, error)

func ECDHEd25519

func ECDHEd25519(priv, pub string) [32]byte

func GenerateAssetId

func GenerateAssetId(assetKey string) crypto.Hash

func GetFactoryAssetAddress

func GetFactoryAssetAddress(assetId, symbol, name string, holder string) common.Address

func GetSafeBTCAssetId

func GetSafeBTCAssetId(chainId, holder, symbol, name string) (string, error)

func HashMessageForSignature

func HashMessageForSignature(msg string, chain byte) ([]byte, error)

func ProposeAccount

func ProposeAccount(operationId, publicKey string, owners []string, threshold, chain byte, timeLock uint16) (*types.Operation, error)

func ProposeBatchTransaction

func ProposeBatchTransaction(operationId, publicKey string, typ byte, head string, hash []byte, chain byte) (*types.Operation, error)

func ProposeTransaction

func ProposeTransaction(operationId, publicKey string, typ byte, head, destination string, chain byte) (*types.Operation, error)

func SetFactoryContractAddress

func SetFactoryContractAddress(address string)

func SignSafeMessage

func SignSafeMessage(msg, priv string, chain byte) (string, error)

func SignSafeTx

func SignSafeTx(rawStr, privateStr string, chain byte) (string, error)

func VerifyAssetKey

func VerifyAssetKey(assetKey string) error

func VerifySafeMessage

func VerifySafeMessage(public string, msg, sig []byte, chain byte) error

Types

type MixinExtraPack

type MixinExtraPack struct {
	T uuid.UUID
	M string `msgpack:",omitempty"`
}

func DecodeMixinExtra

func DecodeMixinExtra(b []byte) *MixinExtraPack

Jump to

Keyboard shortcuts

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