backend

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCrudOperations = map[string]*framework.FieldSchema{
	"name": {
		Type: framework.TypeString,
	},
	"address": {
		Type: framework.TypeString,
	},
	"private_key": {
		Type:        framework.TypeString,
		Description: "(Optional, default random key) Hex string for the private key",
		Default:     "",
	},
	"external_data": {
		Type:        framework.TypeMap,
		Description: "(Optional) Arbitrary external metadata to attach to this key pair",
		Default:     nil,
	},
	"lock": {
		Type:        framework.TypeBool,
		Description: "(Optional) Lock the key",
		Default:     false,
	},
	"rnd": {
		Type:        framework.TypeString,
		Description: "(default random key) only for vault success operations",
		Default:     "",
	},
}
View Source
var DefaultHelpDescriptionCreateList = `
    POST - create a new keyManager
    GET - list all addresses
`
View Source
var DefaultHelpHelpSynopsisCreateList = "" /* 129-byte string literal not displayed */
View Source
var DefaultSignOperation = map[string]*framework.FieldSchema{
	"name": {Type: framework.TypeString},
	"hash": {
		Type:        framework.TypeString,
		Description: "Hex string of the hash that should be signed.",
		Default:     "",
	},
	"address": {
		Type:        framework.TypeString,
		Description: "The address that belongs to a private key in the key-manager.",
	},
}
View Source
var DefaultUpdateOperations = map[string]*framework.FieldSchema{
	"name": {
		Type: framework.TypeString,
	},
	"address": {
		Type: framework.TypeString,
	},
	"external_data": {
		Type:        framework.TypeMap,
		Description: "(Optional) Arbitrary external metadata to attach to this key pair",
		Default:     nil,
	},
	"lock": {
		Type:        framework.TypeBool,
		Description: "(Optional) Lock the key",
		Default:     false,
	},
}

Functions

func All added in v1.1.0

func All() map[config.ChainType]Endpoints

All возвращает копию реестра

func GetKeyPairByAddressAndChain

func GetKeyPairByAddressAndChain(
	ctx context.Context,
	req *logical.Request,
	name string,
	address string,
	chain config.ChainType,
) (*types.KeyPair, error)

func GetSignParamsFromData

func GetSignParamsFromData(data *framework.FieldData) (serviceName, hashInput, address string, err error)

func KeyManagerExistenceCheck added in v1.2.4

func KeyManagerExistenceCheck(chain config.ChainType) func(ctx context.Context, req *logical.Request, data *framework.FieldData) (bool, error)

func PathCrudList added in v1.1.0

func PathCrudList(chain config.ChainType) *framework.Path

func PathUpdateExternalData added in v1.2.5

func PathUpdateExternalData(chain config.ChainType) *framework.Path

func Register added in v1.1.0

func Register(chain config.ChainType, e Endpoints)

Register вызывают из каждого coin-пакета в init()

func RetrieveKeyManager

func RetrieveKeyManager(ctx context.Context, req *logical.Request, chain config.ChainType, service string) (*types.KeyManager, error)

func WrapperDeleteKeyManager added in v1.0.2

func WrapperDeleteKeyManager(chain config.ChainType) func(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error)

func WrapperListKeyManager

func WrapperListKeyManager(chain config.ChainType) func(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error)

func WrapperReadKeyManager added in v1.0.2

func WrapperReadKeyManager(chain config.ChainType) func(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error)

func WriteExternalData added in v1.2.4

func WriteExternalData(chain config.ChainType) func(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error)

Types

type Backend

type Backend struct{ *framework.Backend }

type Endpoints added in v1.1.0

type Endpoints struct {
	Crud func() *framework.Path
	Sign func() *framework.Path
}

Endpoints описывает пару CRUD/Sign для одной монеты

Jump to

Keyboard shortcuts

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