Documentation
¶
Index ¶
- Constants
- Variables
- func AddressBytesFromBech32(bech32Prefix string, address string) ([]byte, error)
- func AddressHexFromBytes(address []byte) (string, error)
- func Bech32FromBytes(bech32Prefix string, bs []byte) (string, error)
- func Bytes32FromAddressHex(addr string) ([]byte, error)
- func BytesFromAddressHex(addr string) ([]byte, error)
- func BytesFromBech32(bech32Prefix string, address string) (addr []byte, err error)
- func BytesFromHex(hexStr string) ([]byte, error)
- func CosmosPrivateKeyFromMnemonic(mnemonic string) (crypto.PrivKey, error)
- func CosmosPublicKeyFromHex(pubKeyHex string) (crypto.PubKey, error)
- func CosmosPublicKeyFromMnemonic(mnemonic string) (crypto.PubKey, error)
- func CosmosPublicKeyHexFromMnemonic(mnemonic string) (string, error)
- func Ensure0xPrefix(str string) string
- func EthereumAddressFromMnemonic(mnemonic string) (string, error)
- func EthereumPrivateKeyFromMnemonic(mnemonic string) (*ecdsa.PrivateKey, error)
- func EthereumPrivateKeyToAddressHex(privateKey *ecdsa.PrivateKey) (string, error)
- func HexFromBytes(bytes []byte) string
- func HexToAddress(hex string) ethcommon.Address
- func IsValidAddressHex(s string) bool
- func IsValidBech32Address(bech32Prefix string, address string) bool
- func IsValidCosmosPublicKey(s string) bool
- func IsValidEthereumAddress(s string) bool
- func RemoveDuplicates(elements []primitive.ObjectID) []primitive.ObjectID
- type GCPKeyManagementClient
- type GcpKmsSigner
- type MnemonicSigner
- type Signer
Constants ¶
View Source
const ( CollectionLocks = "locks" CollectionTransactions = "transactions" CollectionRefunds = "refunds" CollectionMessages = "messages" CollectionNodes = "nodes" )
View Source
const ( AddressLength = 20 CosmosPublicKeyLength = 33 DefaultEntropySize = 256 DefaultBIP39Passphrase = "" DefaultCosmosHDPath = "m/44'/118'/0'/0/0" DefaultETHHDPath = "m/44'/60'/0'/0/0" ZeroAddress = "0x0000000000000000000000000000000000000000" )
View Source
const (
HyperlaneVersion uint8 = 3
)
Variables ¶
View Source
var ErrInvalidAddressLength = errors.New("invalid address length")
View Source
var (
ErrInvalidPublicKeyLength = errors.New("invalid public key length")
)
View Source
var NewGCPKeyManagementClient = func(ctx context.Context) (GCPKeyManagementClient, error) { return kms.NewKeyManagementClient(ctx) }
Functions ¶
func AddressBytesFromBech32 ¶
func AddressHexFromBytes ¶
func Bytes32FromAddressHex ¶
func BytesFromAddressHex ¶
func BytesFromBech32 ¶
func BytesFromHex ¶
func Ensure0xPrefix ¶
func EthereumPrivateKeyFromMnemonic ¶
func EthereumPrivateKeyFromMnemonic(mnemonic string) (*ecdsa.PrivateKey, error)
func EthereumPrivateKeyToAddressHex ¶
func EthereumPrivateKeyToAddressHex(privateKey *ecdsa.PrivateKey) (string, error)
func HexFromBytes ¶
func HexToAddress ¶
func IsValidAddressHex ¶
func IsValidBech32Address ¶
func IsValidCosmosPublicKey ¶
func IsValidEthereumAddress ¶
Types ¶
type GCPKeyManagementClient ¶
type GCPKeyManagementClient interface { Close() error GetPublicKey(ctx context.Context, req *kmspb.GetPublicKeyRequest, opts ...gax.CallOption) (*kmspb.PublicKey, error) AsymmetricSign(ctx context.Context, req *kmspb.AsymmetricSignRequest, opts ...gax.CallOption) (*kmspb.AsymmetricSignResponse, error) GetCryptoKeyVersion(ctx context.Context, req *kmspb.GetCryptoKeyVersionRequest, opts ...gax.CallOption) (*kmspb.CryptoKeyVersion, error) }
type GcpKmsSigner ¶
type GcpKmsSigner struct {
// contains filtered or unexported fields
}
Struct Definition
func (*GcpKmsSigner) CosmosPublicKey ¶
func (s *GcpKmsSigner) CosmosPublicKey() types.PubKey
func (*GcpKmsSigner) CosmosSign ¶
func (s *GcpKmsSigner) CosmosSign(data []byte) ([]byte, error)
func (*GcpKmsSigner) EthAddress ¶
func (s *GcpKmsSigner) EthAddress() common.Address
type MnemonicSigner ¶
type MnemonicSigner struct {
// contains filtered or unexported fields
}
Struct Definition
func NewMnemonicSigner ¶
func NewMnemonicSigner(mnemonic string) (*MnemonicSigner, error)
Constructor Function
func (*MnemonicSigner) CosmosPublicKey ¶
func (s *MnemonicSigner) CosmosPublicKey() types.PubKey
func (*MnemonicSigner) CosmosSign ¶
func (s *MnemonicSigner) CosmosSign(data []byte) ([]byte, error)
func (*MnemonicSigner) EthAddress ¶
func (s *MnemonicSigner) EthAddress() common.Address
Click to show internal directories.
Click to hide internal directories.