Versions in this module Expand all Collapse all v1 v1.4.9 Jul 5, 2021 Changes in this version type VM + func (vm *VM) Connected(id ids.ShortID) error + func (vm *VM) Disconnected(id ids.ShortID) error v1.4.5 Jul 5, 2021 Changes in this version + var ID = ids.ID + func NewPubSubFilterer(tx *Tx) pubsub.Filterer + type AssetDefinition struct + Denomination cjson.Uint8 + InitialState map[string][]interface{} + Memo string + Name string + Symbol string + type AssetIDChangeAddr struct + type Balance struct + AssetID string + Balance json.Uint64 + type BaseTx struct + func (t *BaseTx) ExecuteWithSideEffects(_ *VM, batch database.Batch) error + func (t *BaseTx) SemanticVerify(vm *VM, tx UnsignedTx, creds []verify.Verifiable) error + func (t *BaseTx) SyntacticVerify(ctx *snow.Context, c codec.Manager, txFeeAssetID ids.ID, txFee uint64, ...) error + type BuildGenesisArgs struct + Encoding formatting.Encoding + GenesisData map[string]AssetDefinition + NetworkID cjson.Uint32 + type BuildGenesisReply struct + Bytes string + Encoding formatting.Encoding + type Client struct + func NewClient(uri, chain string, requestTimeout time.Duration) *Client + func (c *Client) ConfirmTx(txID ids.ID, attempts int, delay time.Duration) (choices.Status, error) + func (c *Client) CreateAddress(user api.UserPass) (string, error) + func (c *Client) CreateAsset(user api.UserPass, from []string, changeAddr, name, symbol string, ...) (ids.ID, error) + func (c *Client) CreateFixedCapAsset(user api.UserPass, from []string, changeAddr, name, symbol string, ...) (ids.ID, error) + func (c *Client) CreateNFTAsset(user api.UserPass, from []string, changeAddr, name, symbol string, ...) (ids.ID, error) + func (c *Client) CreateVariableCapAsset(user api.UserPass, from []string, changeAddr, name, symbol string, ...) (ids.ID, error) + func (c *Client) Export(user api.UserPass, from []string, changeAddr string, amount uint64, to string, ...) (ids.ID, error) + func (c *Client) ExportAVAX(user api.UserPass, from []string, changeAddr string, amount uint64, to string) (ids.ID, error) + func (c *Client) ExportKey(user api.UserPass, addr string) (string, error) + func (c *Client) GetAllBalances(addr string, includePartial bool) (*GetAllBalancesReply, error) + func (c *Client) GetAssetDescription(assetID string) (*GetAssetDescriptionReply, error) + func (c *Client) GetAtomicUTXOs(addrs []string, sourceChain string, limit uint32, ...) ([][]byte, api.Index, error) + func (c *Client) GetBalance(addr string, assetID string, includePartial bool) (*GetBalanceReply, error) + func (c *Client) GetTx(txID ids.ID) ([]byte, error) + func (c *Client) GetTxStatus(txID ids.ID) (choices.Status, error) + func (c *Client) GetUTXOs(addrs []string, limit uint32, startAddress, startUTXOID string) ([][]byte, api.Index, error) + func (c *Client) Import(user api.UserPass, to, sourceChain string) (ids.ID, error) + func (c *Client) ImportAVAX(user api.UserPass, to, sourceChain string) (ids.ID, error) + func (c *Client) ImportKey(user api.UserPass, privateKey string) (string, error) + func (c *Client) IssueTx(txBytes []byte) (ids.ID, error) + func (c *Client) ListAddresses(user api.UserPass) ([]string, error) + func (c *Client) Mint(user api.UserPass, from []string, changeAddr string, amount uint64, ...) (ids.ID, error) + func (c *Client) MintNFT(user api.UserPass, from []string, changeAddr string, assetID string, ...) (ids.ID, error) + func (c *Client) Send(user api.UserPass, from []string, changeAddr string, amount uint64, ...) (ids.ID, error) + func (c *Client) SendMultiple(user api.UserPass, from []string, changeAddr string, outputs []SendOutput, ...) (ids.ID, error) + func (c *Client) SendNFT(user api.UserPass, from []string, changeAddr string, assetID string, ...) (ids.ID, error) + type CreateAssetArgs struct + Denomination byte + InitialHolders []*Holder + MinterSets []Owners + Name string + Symbol string + type CreateAssetTx struct + Denomination byte + Name string + States []*InitialState + Symbol string + func (t *CreateAssetTx) InitialStates() []*InitialState + func (t *CreateAssetTx) Sort() + func (t *CreateAssetTx) SyntacticVerify(ctx *snow.Context, c codec.Manager, txFeeAssetID ids.ID, _ uint64, ...) error + func (t *CreateAssetTx) UTXOs() []*avax.UTXO + type CreateNFTAssetArgs struct + MinterSets []Owners + Name string + Symbol string + type ExportAVAXArgs struct + Amount json.Uint64 + To string + type ExportArgs struct + AssetID string + type ExportKeyArgs struct + Address string + type ExportKeyReply struct + PrivateKey string + type ExportTx struct + DestinationChain ids.ID + ExportedOuts []*avax.TransferableOutput + func (t *ExportTx) ExecuteWithSideEffects(vm *VM, batch database.Batch) error + func (t *ExportTx) SemanticVerify(vm *VM, tx UnsignedTx, creds []verify.Verifiable) error + func (t *ExportTx) SyntacticVerify(ctx *snow.Context, c codec.Manager, txFeeAssetID ids.ID, txFee uint64, ...) error + type Factory struct + CreationFee uint64 + Fee uint64 + func (f *Factory) New(*snow.Context) (interface{}, error) + type FormattedAssetID struct + AssetID ids.ID + type Fx interface + Bootstrapped func() error + Bootstrapping func() error + Initialize func(vm interface{}) error + VerifyOperation func(tx, op, cred interface{}, utxos []interface{}) error + VerifyTransfer func(tx, in, cred, utxo interface{}) error + type FxOperation interface + Outs func() []verify.State + type Genesis struct + Txs []*GenesisAsset + func (g *Genesis) IsSortedAndUnique() bool + func (g *Genesis) Len() int + func (g *Genesis) Less(i, j int) bool + func (g *Genesis) Sort() + func (g *Genesis) Swap(i, j int) + type GenesisAsset struct + Alias string + type GetAllBalancesArgs struct + IncludePartial bool + type GetAllBalancesReply struct + Balances []Balance + type GetAssetDescriptionArgs struct + AssetID string + type GetAssetDescriptionReply struct + Denomination json.Uint8 + Name string + Symbol string + type GetBalanceArgs struct + Address string + AssetID string + IncludePartial bool + type GetBalanceReply struct + Balance json.Uint64 + UTXOIDs []avax.UTXOID + type GetTxStatusReply struct + Status choices.Status + type Holder struct + Address string + Amount json.Uint64 + type ImportArgs struct + SourceChain string + To string + type ImportKeyArgs struct + PrivateKey string + type ImportKeyReply struct + Address string + type ImportTx struct + ImportedIns []*avax.TransferableInput + SourceChain ids.ID + func (t *ImportTx) AssetIDs() ids.Set + func (t *ImportTx) ConsumedAssetIDs() ids.Set + func (t *ImportTx) ExecuteWithSideEffects(vm *VM, batch database.Batch) error + func (t *ImportTx) InputUTXOs() []*avax.UTXOID + func (t *ImportTx) NumCredentials() int + func (t *ImportTx) SemanticVerify(vm *VM, tx UnsignedTx, creds []verify.Verifiable) error + func (t *ImportTx) SyntacticVerify(ctx *snow.Context, c codec.Manager, txFeeAssetID ids.ID, txFee uint64, ...) error + type InitialState struct + FxID uint32 + Outs []verify.State + func (is *InitialState) Sort(c codec.Manager) + func (is *InitialState) Verify(c codec.Manager, numFxs int) error + type MintArgs struct + Amount json.Uint64 + AssetID string + To string + type MintNFTArgs struct + AssetID string + Encoding formatting.Encoding + Payload string + To string + type Operation struct + Op FxOperation + UTXOIDs []*avax.UTXOID + func (op *Operation) Verify(c codec.Manager) error + type OperationTx struct + Ops []*Operation + func (t *OperationTx) AssetIDs() ids.Set + func (t *OperationTx) ConsumedAssetIDs() ids.Set + func (t *OperationTx) InputUTXOs() []*avax.UTXOID + func (t *OperationTx) NumCredentials() int + func (t *OperationTx) Operations() []*Operation + func (t *OperationTx) SemanticVerify(vm *VM, tx UnsignedTx, creds []verify.Verifiable) error + func (t *OperationTx) SyntacticVerify(ctx *snow.Context, c codec.Manager, txFeeAssetID ids.ID, txFee uint64, ...) error + func (t *OperationTx) UTXOs() []*avax.UTXO + type Owners struct + Minters []string + Threshold json.Uint32 + type SendArgs struct + Memo string + type SendMultipleArgs struct + Memo string + Outputs []SendOutput + type SendNFTArgs struct + AssetID string + GroupID json.Uint32 + To string + type SendOutput struct + Amount json.Uint64 + AssetID string + To string + type Service struct + func (service *Service) CreateAddress(r *http.Request, args *api.UserPass, reply *api.JSONAddress) error + func (service *Service) CreateAsset(r *http.Request, args *CreateAssetArgs, reply *AssetIDChangeAddr) error + func (service *Service) CreateFixedCapAsset(r *http.Request, args *CreateAssetArgs, reply *AssetIDChangeAddr) error + func (service *Service) CreateNFTAsset(r *http.Request, args *CreateNFTAssetArgs, reply *AssetIDChangeAddr) error + func (service *Service) CreateVariableCapAsset(r *http.Request, args *CreateAssetArgs, reply *AssetIDChangeAddr) error + func (service *Service) Export(_ *http.Request, args *ExportArgs, reply *api.JSONTxIDChangeAddr) error + func (service *Service) ExportAVAX(_ *http.Request, args *ExportAVAXArgs, reply *api.JSONTxIDChangeAddr) error + func (service *Service) ExportKey(r *http.Request, args *ExportKeyArgs, reply *ExportKeyReply) error + func (service *Service) GetAllBalances(r *http.Request, args *GetAllBalancesArgs, reply *GetAllBalancesReply) error + func (service *Service) GetAssetDescription(_ *http.Request, args *GetAssetDescriptionArgs, ...) error + func (service *Service) GetBalance(r *http.Request, args *GetBalanceArgs, reply *GetBalanceReply) error + func (service *Service) GetTx(r *http.Request, args *api.GetTxArgs, reply *api.FormattedTx) error + func (service *Service) GetTxStatus(r *http.Request, args *api.JSONTxID, reply *GetTxStatusReply) error + func (service *Service) GetUTXOs(r *http.Request, args *api.GetUTXOsArgs, reply *api.GetUTXOsReply) error + func (service *Service) Import(_ *http.Request, args *ImportArgs, reply *api.JSONTxID) error + func (service *Service) ImportAVAX(_ *http.Request, args *ImportArgs, reply *api.JSONTxID) error + func (service *Service) ImportKey(r *http.Request, args *ImportKeyArgs, reply *api.JSONAddress) error + func (service *Service) IssueTx(r *http.Request, args *api.FormattedTx, reply *api.JSONTxID) error + func (service *Service) ListAddresses(_ *http.Request, args *api.UserPass, response *api.JSONAddresses) error + func (service *Service) Mint(r *http.Request, args *MintArgs, reply *api.JSONTxIDChangeAddr) error + func (service *Service) MintNFT(r *http.Request, args *MintNFTArgs, reply *api.JSONTxIDChangeAddr) error + func (service *Service) Send(r *http.Request, args *SendArgs, reply *api.JSONTxIDChangeAddr) error + func (service *Service) SendMultiple(r *http.Request, args *SendMultipleArgs, reply *api.JSONTxIDChangeAddr) error + func (service *Service) SendNFT(r *http.Request, args *SendNFTArgs, reply *api.JSONTxIDChangeAddr) error + type State interface + DeduplicateTx func(tx *UniqueTx) *UniqueTx + func NewMeteredState(db database.Database, genesisCodec, codec codec.Manager, namespace string, ...) (State, error) + func NewState(db database.Database, genesisCodec, codec codec.Manager) State + type StaticService struct + func CreateStaticService() *StaticService + func (ss *StaticService) BuildGenesis(_ *http.Request, args *BuildGenesisArgs, reply *BuildGenesisReply) error + type Tx struct + Creds []verify.Verifiable + func (t *Tx) Credentials() []verify.Verifiable + func (t *Tx) SemanticVerify(vm *VM, tx UnsignedTx) error + func (t *Tx) SignNFTFx(c codec.Manager, signers [][]*crypto.PrivateKeySECP256K1R) error + func (t *Tx) SignSECP256K1Fx(c codec.Manager, signers [][]*crypto.PrivateKeySECP256K1R) error + func (t *Tx) SyntacticVerify(ctx *snow.Context, c codec.Manager, txFeeAssetID ids.ID, txFee uint64, ...) error + type TxCachedState struct + type TxState interface + DeleteTx func(txID ids.ID) error + GetTx func(txID ids.ID) (*Tx, error) + PutTx func(txID ids.ID, tx *Tx) error + func NewMeteredTxState(db database.Database, codec codec.Manager, namespace string, ...) (TxState, error) + func NewTxState(db database.Database, codec codec.Manager) TxState + type UniqueTx struct + func (tx *UniqueTx) Accept() error + func (tx *UniqueTx) Bytes() []byte + func (tx *UniqueTx) Dependencies() []snowstorm.Tx + func (tx *UniqueTx) Evict() + func (tx *UniqueTx) ID() ids.ID + func (tx *UniqueTx) InputIDs() []ids.ID + func (tx *UniqueTx) InputUTXOs() []*avax.UTXOID + func (tx *UniqueTx) Key() interface{} + func (tx *UniqueTx) Reject() error + func (tx *UniqueTx) SemanticVerify() error + func (tx *UniqueTx) Status() choices.Status + func (tx *UniqueTx) SyntacticVerify() error + func (tx *UniqueTx) UTXOs() []*avax.UTXO + func (tx *UniqueTx) Verify() error + type UnsignedTx interface + AssetIDs func() ids.Set + Bytes func() []byte + ConsumedAssetIDs func() ids.Set + ExecuteWithSideEffects func(vm *VM, batch database.Batch) error + ID func() ids.ID + Initialize func(unsignedBytes, bytes []byte) + InputUTXOs func() []*avax.UTXOID + NumCredentials func() int + SemanticVerify func(vm *VM, tx UnsignedTx, creds []verify.Verifiable) error + SyntacticVerify func(ctx *snow.Context, c codec.Manager, txFeeAssetID ids.ID, txFee uint64, ...) error + UTXOs func() []*avax.UTXO + UnsignedBytes func() []byte + type VM struct + func (vm *VM) Bootstrapped() error + func (vm *VM) Bootstrapping() error + func (vm *VM) Clock() *timer.Clock + func (vm *VM) Codec() codec.Manager + func (vm *VM) CodecRegistry() codec.Registry + func (vm *VM) CreateHandlers() (map[string]*common.HTTPHandler, error) + func (vm *VM) CreateStaticHandlers() (map[string]*common.HTTPHandler, error) + func (vm *VM) FlushTxs() + func (vm *VM) GetTx(txID ids.ID) (snowstorm.Tx, error) + func (vm *VM) HealthCheck() (interface{}, error) + func (vm *VM) Initialize(ctx *snow.Context, dbManager manager.Manager, genesisBytes []byte, ...) error + func (vm *VM) IssueTx(b []byte) (ids.ID, error) + func (vm *VM) LoadUser(username string, password string, addrsToUse ids.ShortSet) ([]*avax.UTXO, *secp256k1fx.Keychain, error) + func (vm *VM) Logger() logging.Logger + func (vm *VM) Mint(utxos []*avax.UTXO, kc *secp256k1fx.Keychain, amounts map[ids.ID]uint64, ...) ([]*Operation, [][]*crypto.PrivateKeySECP256K1R, error) + func (vm *VM) MintNFT(utxos []*avax.UTXO, kc *secp256k1fx.Keychain, assetID ids.ID, payload []byte, ...) ([]*Operation, [][]*crypto.PrivateKeySECP256K1R, error) + func (vm *VM) ParseTx(b []byte) (snowstorm.Tx, error) + func (vm *VM) PendingTxs() []snowstorm.Tx + func (vm *VM) Shutdown() error + func (vm *VM) Spend(utxos []*avax.UTXO, kc *secp256k1fx.Keychain, amounts map[ids.ID]uint64) (map[ids.ID]uint64, []*avax.TransferableInput, [][]*crypto.PrivateKeySECP256K1R, ...) + func (vm *VM) SpendAll(utxos []*avax.UTXO, kc *secp256k1fx.Keychain) (map[ids.ID]uint64, []*avax.TransferableInput, [][]*crypto.PrivateKeySECP256K1R, ...) + func (vm *VM) SpendNFT(utxos []*avax.UTXO, kc *secp256k1fx.Keychain, assetID ids.ID, groupID uint32, ...) ([]*Operation, [][]*crypto.PrivateKeySECP256K1R, error) + type WalletClient struct + func NewWalletClient(uri, chain string, requestTimeout time.Duration) *WalletClient + func (c *WalletClient) IssueTx(txBytes []byte) (ids.ID, error) + func (c *WalletClient) Send(user api.UserPass, from []string, changeAddr string, amount uint64, ...) (ids.ID, error) + func (c *WalletClient) SendMultiple(user api.UserPass, from []string, changeAddr string, outputs []SendOutput, ...) (ids.ID, error) + type WalletService struct + func (w *WalletService) IssueTx(r *http.Request, args *api.FormattedTx, reply *api.JSONTxID) error + func (w *WalletService) Send(r *http.Request, args *SendArgs, reply *api.JSONTxIDChangeAddr) error + func (w *WalletService) SendMultiple(r *http.Request, args *SendMultipleArgs, reply *api.JSONTxIDChangeAddr) error