types

package
v0.0.0-...-cc24d94 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeCreateTransfer         = "create_transfer"
	EventTypeDepositToSubaccount    = "deposit_to_subaccount"
	EventTypeWithdrawFromSubaccount = "withdraw_from_subaccount"

	AttributeKeySender          = "sender"
	AttributeKeySenderNumber    = "sender_number"
	AttributeKeyRecipient       = "recipient"
	AttributeKeyRecipientNumber = "recipient_number"
	AttributeKeyQuantums        = "quantums"
	AttributeKeyAssetId         = "asset_id"
)

sending module event types

View Source
const (
	// ModuleName defines the module name
	ModuleName = "sending"

	// StoreKey defines the primary module store key
	StoreKey = ModuleName
)

Module name and store keys

Variables

View Source
var (
	ErrSenderSameAsRecipient = errorsmod.Register(ModuleName, 1, "Sender is the same as recipient")
	ErrInvalidTransferAmount = errorsmod.Register(ModuleName, 2, "Invalid transfer amount")
	ErrDuplicatedTransfer    = errorsmod.Register(ModuleName, 3, "Duplicated transfer")
	ErrTransferNotFound      = errorsmod.Register(ModuleName, 4, "Transfer not found")
	ErrMissingFields         = errorsmod.Register(
		ModuleName,
		5,
		"Transfer does not contain all required fields",
	)
	ErrInvalidAccountAddress              = errorsmod.Register(ModuleName, 6, "Account address is invalid")
	ErrEmptyModuleName                    = errorsmod.Register(ModuleName, 7, "Module name is empty")
	ErrInvalidAuthority                   = errorsmod.Register(ModuleName, 8, "Authority is invalid")
	ErrNonUsdcAssetTransferNotImplemented = errorsmod.Register(
		ModuleName,
		1101,
		"Non-USDC asset transfer not implemented",
	)
)

x/sending module sentinel errors

View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTransfer        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTransfer          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTransfer = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)

Functions

func NewCreateTransferEvent

func NewCreateTransferEvent(
	sender satypes.SubaccountId,
	recipient satypes.SubaccountId,
	assetId uint32,
	quantums uint64,
) sdk.Event

NewCreateTransferEvent constructs a new create_transfer sdk.Event

func NewDepositToSubaccountEvent

func NewDepositToSubaccountEvent(
	sender sdk.Address,
	recipient satypes.SubaccountId,
	assetId uint32,
	quantums uint64,
) sdk.Event

NewDepositToSubaccountEvent a new deposit_to_subaccount sdk.Event

func NewWithdrawFromSubaccountEvent

func NewWithdrawFromSubaccountEvent(
	sender satypes.SubaccountId,
	recipient sdk.Address,
	assetId uint32,
	quantums uint64,
) sdk.Event

NewWithdrawFromSubaccount constructs a new withdraw_from_subaccount sdk.Event

func RegisterCodec

func RegisterCodec(cdc *codec.LegacyAmino)

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
	HasAccount(ctx sdk.Context, addr sdk.AccAddress) bool
	SetAccount(ctx sdk.Context, acc types.AccountI)
	NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
	GetModuleAddress(moduleName string) sdk.AccAddress
}

AccountKeeper defines the expected account keeper used for simulations.

type BankKeeper

type BankKeeper interface {
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
}

BankKeeper defines the expected bank keeper used for simulations.

type GenesisState

type GenesisState struct {
}

GenesisState defines the sending module's genesis state.

func DefaultGenesis

func DefaultGenesis() *GenesisState

DefaultGenesis returns the default Sending genesis state

func (*GenesisState) Descriptor

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) Marshal

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

func (m *GenesisState) Size() (n int)

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (GenesisState) Validate

func (gs GenesisState) Validate() error

Validate performs basic genesis state validation returning an error upon any failure.

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type MsgClient

type MsgClient interface {
	// CreateTransfer initiates a new transfer between subaccounts.
	CreateTransfer(ctx context.Context, in *MsgCreateTransfer, opts ...grpc.CallOption) (*MsgCreateTransferResponse, error)
	// DepositToSubaccount initiates a new transfer from an `x/bank` account
	// to an `x/subaccounts` subaccount.
	DepositToSubaccount(ctx context.Context, in *MsgDepositToSubaccount, opts ...grpc.CallOption) (*MsgDepositToSubaccountResponse, error)
	// WithdrawFromSubaccount initiates a new transfer from an `x/subaccounts`
	// subaccount to an `x/bank` account.
	WithdrawFromSubaccount(ctx context.Context, in *MsgWithdrawFromSubaccount, opts ...grpc.CallOption) (*MsgWithdrawFromSubaccountResponse, error)
	// SendFromModuleToAccount initiates a new transfer from a module to an
	// `x/bank` account (should only be executed by governance).
	SendFromModuleToAccount(ctx context.Context, in *MsgSendFromModuleToAccount, opts ...grpc.CallOption) (*MsgSendFromModuleToAccountResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgCreateTransfer

type MsgCreateTransfer struct {
	Transfer *Transfer `protobuf:"bytes,1,opt,name=transfer,proto3" json:"transfer,omitempty"`
}

MsgCreateTransfer is a request type used for initiating new transfers.

func NewMsgCreateTransfer

func NewMsgCreateTransfer(transfer *Transfer) *MsgCreateTransfer

func (*MsgCreateTransfer) Descriptor

func (*MsgCreateTransfer) Descriptor() ([]byte, []int)

func (*MsgCreateTransfer) GetSigners

func (msg *MsgCreateTransfer) GetSigners() []sdk.AccAddress

func (*MsgCreateTransfer) GetTransfer

func (m *MsgCreateTransfer) GetTransfer() *Transfer

func (*MsgCreateTransfer) Marshal

func (m *MsgCreateTransfer) Marshal() (dAtA []byte, err error)

func (*MsgCreateTransfer) MarshalTo

func (m *MsgCreateTransfer) MarshalTo(dAtA []byte) (int, error)

func (*MsgCreateTransfer) MarshalToSizedBuffer

func (m *MsgCreateTransfer) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgCreateTransfer) ProtoMessage

func (*MsgCreateTransfer) ProtoMessage()

func (*MsgCreateTransfer) Reset

func (m *MsgCreateTransfer) Reset()

func (*MsgCreateTransfer) Size

func (m *MsgCreateTransfer) Size() (n int)

func (*MsgCreateTransfer) String

func (m *MsgCreateTransfer) String() string

func (*MsgCreateTransfer) Unmarshal

func (m *MsgCreateTransfer) Unmarshal(dAtA []byte) error

func (*MsgCreateTransfer) ValidateBasic

func (msg *MsgCreateTransfer) ValidateBasic() error

func (*MsgCreateTransfer) XXX_DiscardUnknown

func (m *MsgCreateTransfer) XXX_DiscardUnknown()

func (*MsgCreateTransfer) XXX_Marshal

func (m *MsgCreateTransfer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgCreateTransfer) XXX_Merge

func (m *MsgCreateTransfer) XXX_Merge(src proto.Message)

func (*MsgCreateTransfer) XXX_Size

func (m *MsgCreateTransfer) XXX_Size() int

func (*MsgCreateTransfer) XXX_Unmarshal

func (m *MsgCreateTransfer) XXX_Unmarshal(b []byte) error

type MsgCreateTransferResponse

type MsgCreateTransferResponse struct {
}

MsgCreateTransferResponse is a response type used for new transfers.

func (*MsgCreateTransferResponse) Descriptor

func (*MsgCreateTransferResponse) Descriptor() ([]byte, []int)

func (*MsgCreateTransferResponse) Marshal

func (m *MsgCreateTransferResponse) Marshal() (dAtA []byte, err error)

func (*MsgCreateTransferResponse) MarshalTo

func (m *MsgCreateTransferResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgCreateTransferResponse) MarshalToSizedBuffer

func (m *MsgCreateTransferResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgCreateTransferResponse) ProtoMessage

func (*MsgCreateTransferResponse) ProtoMessage()

func (*MsgCreateTransferResponse) Reset

func (m *MsgCreateTransferResponse) Reset()

func (*MsgCreateTransferResponse) Size

func (m *MsgCreateTransferResponse) Size() (n int)

func (*MsgCreateTransferResponse) String

func (m *MsgCreateTransferResponse) String() string

func (*MsgCreateTransferResponse) Unmarshal

func (m *MsgCreateTransferResponse) Unmarshal(dAtA []byte) error

func (*MsgCreateTransferResponse) XXX_DiscardUnknown

func (m *MsgCreateTransferResponse) XXX_DiscardUnknown()

func (*MsgCreateTransferResponse) XXX_Marshal

func (m *MsgCreateTransferResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgCreateTransferResponse) XXX_Merge

func (m *MsgCreateTransferResponse) XXX_Merge(src proto.Message)

func (*MsgCreateTransferResponse) XXX_Size

func (m *MsgCreateTransferResponse) XXX_Size() int

func (*MsgCreateTransferResponse) XXX_Unmarshal

func (m *MsgCreateTransferResponse) XXX_Unmarshal(b []byte) error

type MsgDepositToSubaccount

type MsgDepositToSubaccount struct {
	// The sender wallet address.
	Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	// The recipient subaccount ID.
	Recipient types.SubaccountId `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient"`
	// Id of the asset to transfer.
	AssetId uint32 `protobuf:"varint,3,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"`
	// The number of quantums of asset to transfer.
	Quantums uint64 `protobuf:"varint,4,opt,name=quantums,proto3" json:"quantums,omitempty"`
}

MsgDepositToSubaccount represents a single transfer from an `x/bank` account to an `x/subaccounts` subaccount.

func NewMsgDepositToSubaccount

func NewMsgDepositToSubaccount(
	sender string,
	recipient satypes.SubaccountId,
	assetId uint32,
	quantums uint64,
) *MsgDepositToSubaccount

NewMsgDepositToSubaccount constructs a `MsgDepositToSubaccount` from an `x/bank` account sender, an `x/subaccounts` subaccount sender, an asset ID, and a number of quantums.

func (*MsgDepositToSubaccount) Descriptor

func (*MsgDepositToSubaccount) Descriptor() ([]byte, []int)

func (*MsgDepositToSubaccount) GetAssetId

func (m *MsgDepositToSubaccount) GetAssetId() uint32

func (*MsgDepositToSubaccount) GetQuantums

func (m *MsgDepositToSubaccount) GetQuantums() uint64

func (*MsgDepositToSubaccount) GetRecipient

func (m *MsgDepositToSubaccount) GetRecipient() types.SubaccountId

func (*MsgDepositToSubaccount) GetSender

func (m *MsgDepositToSubaccount) GetSender() string

func (*MsgDepositToSubaccount) GetSigners

func (msg *MsgDepositToSubaccount) GetSigners() []sdk.AccAddress

GetSigners specifies that the sender of the message must sign.

func (*MsgDepositToSubaccount) Marshal

func (m *MsgDepositToSubaccount) Marshal() (dAtA []byte, err error)

func (*MsgDepositToSubaccount) MarshalTo

func (m *MsgDepositToSubaccount) MarshalTo(dAtA []byte) (int, error)

func (*MsgDepositToSubaccount) MarshalToSizedBuffer

func (m *MsgDepositToSubaccount) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgDepositToSubaccount) ProtoMessage

func (*MsgDepositToSubaccount) ProtoMessage()

func (*MsgDepositToSubaccount) Reset

func (m *MsgDepositToSubaccount) Reset()

func (*MsgDepositToSubaccount) Size

func (m *MsgDepositToSubaccount) Size() (n int)

func (*MsgDepositToSubaccount) String

func (m *MsgDepositToSubaccount) String() string

func (*MsgDepositToSubaccount) Unmarshal

func (m *MsgDepositToSubaccount) Unmarshal(dAtA []byte) error

func (*MsgDepositToSubaccount) ValidateBasic

func (msg *MsgDepositToSubaccount) ValidateBasic() error

ValidateBasic runs validation on the fields of a MsgDepositToSubaccount.

func (*MsgDepositToSubaccount) XXX_DiscardUnknown

func (m *MsgDepositToSubaccount) XXX_DiscardUnknown()

func (*MsgDepositToSubaccount) XXX_Marshal

func (m *MsgDepositToSubaccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgDepositToSubaccount) XXX_Merge

func (m *MsgDepositToSubaccount) XXX_Merge(src proto.Message)

func (*MsgDepositToSubaccount) XXX_Size

func (m *MsgDepositToSubaccount) XXX_Size() int

func (*MsgDepositToSubaccount) XXX_Unmarshal

func (m *MsgDepositToSubaccount) XXX_Unmarshal(b []byte) error

type MsgDepositToSubaccountResponse

type MsgDepositToSubaccountResponse struct {
}

MsgDepositToSubaccountResponse is a response type used for new account-to-subaccount transfers.

func (*MsgDepositToSubaccountResponse) Descriptor

func (*MsgDepositToSubaccountResponse) Descriptor() ([]byte, []int)

func (*MsgDepositToSubaccountResponse) Marshal

func (m *MsgDepositToSubaccountResponse) Marshal() (dAtA []byte, err error)

func (*MsgDepositToSubaccountResponse) MarshalTo

func (m *MsgDepositToSubaccountResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgDepositToSubaccountResponse) MarshalToSizedBuffer

func (m *MsgDepositToSubaccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgDepositToSubaccountResponse) ProtoMessage

func (*MsgDepositToSubaccountResponse) ProtoMessage()

func (*MsgDepositToSubaccountResponse) Reset

func (m *MsgDepositToSubaccountResponse) Reset()

func (*MsgDepositToSubaccountResponse) Size

func (m *MsgDepositToSubaccountResponse) Size() (n int)

func (*MsgDepositToSubaccountResponse) String

func (*MsgDepositToSubaccountResponse) Unmarshal

func (m *MsgDepositToSubaccountResponse) Unmarshal(dAtA []byte) error

func (*MsgDepositToSubaccountResponse) XXX_DiscardUnknown

func (m *MsgDepositToSubaccountResponse) XXX_DiscardUnknown()

func (*MsgDepositToSubaccountResponse) XXX_Marshal

func (m *MsgDepositToSubaccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgDepositToSubaccountResponse) XXX_Merge

func (m *MsgDepositToSubaccountResponse) XXX_Merge(src proto.Message)

func (*MsgDepositToSubaccountResponse) XXX_Size

func (m *MsgDepositToSubaccountResponse) XXX_Size() int

func (*MsgDepositToSubaccountResponse) XXX_Unmarshal

func (m *MsgDepositToSubaccountResponse) XXX_Unmarshal(b []byte) error

type MsgSendFromModuleToAccount

type MsgSendFromModuleToAccount struct {
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// The sender module name.
	SenderModuleName string `protobuf:"bytes,2,opt,name=sender_module_name,json=senderModuleName,proto3" json:"sender_module_name,omitempty"`
	// The recipient account address (can be either a module account address
	// or a user account address).
	Recipient string `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"`
	// The coin to transfer, which specifies both denom and amount.
	Coin types1.Coin `protobuf:"bytes,4,opt,name=coin,proto3" json:"coin"`
}

MsgSendFromModuleToAccount represents a single transfer from a module to an `x/bank` account (can be either a module account address or a user account address). Should only be executed by governance.

func NewMsgSendFromModuleToAccount

func NewMsgSendFromModuleToAccount(
	authority string,
	senderModuleName string,
	recipient string,
	coin sdk.Coin,
) *MsgSendFromModuleToAccount

NewMsgWithdrawFromSubaccount constructs a `MsgWithdrawFromSubaccount` from an `x/subaccounts` subaccount sender, an `x/bank` account recipient, an asset ID, and a number of quantums.

func (*MsgSendFromModuleToAccount) Descriptor

func (*MsgSendFromModuleToAccount) Descriptor() ([]byte, []int)

func (*MsgSendFromModuleToAccount) GetAuthority

func (m *MsgSendFromModuleToAccount) GetAuthority() string

func (*MsgSendFromModuleToAccount) GetCoin

func (m *MsgSendFromModuleToAccount) GetCoin() types1.Coin

func (*MsgSendFromModuleToAccount) GetRecipient

func (m *MsgSendFromModuleToAccount) GetRecipient() string

func (*MsgSendFromModuleToAccount) GetSenderModuleName

func (m *MsgSendFromModuleToAccount) GetSenderModuleName() string

func (*MsgSendFromModuleToAccount) GetSigners

func (msg *MsgSendFromModuleToAccount) GetSigners() []sdk.AccAddress

func (*MsgSendFromModuleToAccount) Marshal

func (m *MsgSendFromModuleToAccount) Marshal() (dAtA []byte, err error)

func (*MsgSendFromModuleToAccount) MarshalTo

func (m *MsgSendFromModuleToAccount) MarshalTo(dAtA []byte) (int, error)

func (*MsgSendFromModuleToAccount) MarshalToSizedBuffer

func (m *MsgSendFromModuleToAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgSendFromModuleToAccount) ProtoMessage

func (*MsgSendFromModuleToAccount) ProtoMessage()

func (*MsgSendFromModuleToAccount) Reset

func (m *MsgSendFromModuleToAccount) Reset()

func (*MsgSendFromModuleToAccount) Size

func (m *MsgSendFromModuleToAccount) Size() (n int)

func (*MsgSendFromModuleToAccount) String

func (m *MsgSendFromModuleToAccount) String() string

func (*MsgSendFromModuleToAccount) Unmarshal

func (m *MsgSendFromModuleToAccount) Unmarshal(dAtA []byte) error

func (*MsgSendFromModuleToAccount) ValidateBasic

func (msg *MsgSendFromModuleToAccount) ValidateBasic() error

ValidateBasic runs validation on the fields of a MsgSendFromModuleToAccount.

func (*MsgSendFromModuleToAccount) XXX_DiscardUnknown

func (m *MsgSendFromModuleToAccount) XXX_DiscardUnknown()

func (*MsgSendFromModuleToAccount) XXX_Marshal

func (m *MsgSendFromModuleToAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgSendFromModuleToAccount) XXX_Merge

func (m *MsgSendFromModuleToAccount) XXX_Merge(src proto.Message)

func (*MsgSendFromModuleToAccount) XXX_Size

func (m *MsgSendFromModuleToAccount) XXX_Size() int

func (*MsgSendFromModuleToAccount) XXX_Unmarshal

func (m *MsgSendFromModuleToAccount) XXX_Unmarshal(b []byte) error

type MsgSendFromModuleToAccountResponse

type MsgSendFromModuleToAccountResponse struct {
}

MsgSendFromModuleToAccountResponse is a response type used for new module-to-account transfers.

func (*MsgSendFromModuleToAccountResponse) Descriptor

func (*MsgSendFromModuleToAccountResponse) Descriptor() ([]byte, []int)

func (*MsgSendFromModuleToAccountResponse) Marshal

func (m *MsgSendFromModuleToAccountResponse) Marshal() (dAtA []byte, err error)

func (*MsgSendFromModuleToAccountResponse) MarshalTo

func (m *MsgSendFromModuleToAccountResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgSendFromModuleToAccountResponse) MarshalToSizedBuffer

func (m *MsgSendFromModuleToAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgSendFromModuleToAccountResponse) ProtoMessage

func (*MsgSendFromModuleToAccountResponse) ProtoMessage()

func (*MsgSendFromModuleToAccountResponse) Reset

func (*MsgSendFromModuleToAccountResponse) Size

func (*MsgSendFromModuleToAccountResponse) String

func (*MsgSendFromModuleToAccountResponse) Unmarshal

func (m *MsgSendFromModuleToAccountResponse) Unmarshal(dAtA []byte) error

func (*MsgSendFromModuleToAccountResponse) XXX_DiscardUnknown

func (m *MsgSendFromModuleToAccountResponse) XXX_DiscardUnknown()

func (*MsgSendFromModuleToAccountResponse) XXX_Marshal

func (m *MsgSendFromModuleToAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgSendFromModuleToAccountResponse) XXX_Merge

func (*MsgSendFromModuleToAccountResponse) XXX_Size

func (*MsgSendFromModuleToAccountResponse) XXX_Unmarshal

func (m *MsgSendFromModuleToAccountResponse) XXX_Unmarshal(b []byte) error

type MsgServer

type MsgServer interface {
	// CreateTransfer initiates a new transfer between subaccounts.
	CreateTransfer(context.Context, *MsgCreateTransfer) (*MsgCreateTransferResponse, error)
	// DepositToSubaccount initiates a new transfer from an `x/bank` account
	// to an `x/subaccounts` subaccount.
	DepositToSubaccount(context.Context, *MsgDepositToSubaccount) (*MsgDepositToSubaccountResponse, error)
	// WithdrawFromSubaccount initiates a new transfer from an `x/subaccounts`
	// subaccount to an `x/bank` account.
	WithdrawFromSubaccount(context.Context, *MsgWithdrawFromSubaccount) (*MsgWithdrawFromSubaccountResponse, error)
	// SendFromModuleToAccount initiates a new transfer from a module to an
	// `x/bank` account (should only be executed by governance).
	SendFromModuleToAccount(context.Context, *MsgSendFromModuleToAccount) (*MsgSendFromModuleToAccountResponse, error)
}

MsgServer is the server API for Msg service.

type MsgWithdrawFromSubaccount

type MsgWithdrawFromSubaccount struct {
	// The sender subaccount ID.
	Sender types.SubaccountId `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender"`
	// The recipient wallet address.
	Recipient string `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"`
	// Id of the asset to transfer.
	AssetId uint32 `protobuf:"varint,3,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"`
	// The number of quantums of asset to transfer.
	Quantums uint64 `protobuf:"varint,4,opt,name=quantums,proto3" json:"quantums,omitempty"`
}

MsgWithdrawFromSubaccount represents a single transfer from an `x/subaccounts` subaccount to an `x/bank` account.

func NewMsgWithdrawFromSubaccount

func NewMsgWithdrawFromSubaccount(
	sender satypes.SubaccountId,
	recipient string,
	assetId uint32,
	quantums uint64,
) *MsgWithdrawFromSubaccount

NewMsgWithdrawFromSubaccount constructs a `MsgWithdrawFromSubaccount` from an `x/subaccounts` subaccount sender, an `x/bank` account recipient, an asset ID, and a number of quantums.

func (*MsgWithdrawFromSubaccount) Descriptor

func (*MsgWithdrawFromSubaccount) Descriptor() ([]byte, []int)

func (*MsgWithdrawFromSubaccount) GetAssetId

func (m *MsgWithdrawFromSubaccount) GetAssetId() uint32

func (*MsgWithdrawFromSubaccount) GetQuantums

func (m *MsgWithdrawFromSubaccount) GetQuantums() uint64

func (*MsgWithdrawFromSubaccount) GetRecipient

func (m *MsgWithdrawFromSubaccount) GetRecipient() string

func (*MsgWithdrawFromSubaccount) GetSender

func (*MsgWithdrawFromSubaccount) GetSigners

func (msg *MsgWithdrawFromSubaccount) GetSigners() []sdk.AccAddress

GetSigners specifies that the sender of the message must sign.

func (*MsgWithdrawFromSubaccount) Marshal

func (m *MsgWithdrawFromSubaccount) Marshal() (dAtA []byte, err error)

func (*MsgWithdrawFromSubaccount) MarshalTo

func (m *MsgWithdrawFromSubaccount) MarshalTo(dAtA []byte) (int, error)

func (*MsgWithdrawFromSubaccount) MarshalToSizedBuffer

func (m *MsgWithdrawFromSubaccount) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgWithdrawFromSubaccount) ProtoMessage

func (*MsgWithdrawFromSubaccount) ProtoMessage()

func (*MsgWithdrawFromSubaccount) Reset

func (m *MsgWithdrawFromSubaccount) Reset()

func (*MsgWithdrawFromSubaccount) Size

func (m *MsgWithdrawFromSubaccount) Size() (n int)

func (*MsgWithdrawFromSubaccount) String

func (m *MsgWithdrawFromSubaccount) String() string

func (*MsgWithdrawFromSubaccount) Unmarshal

func (m *MsgWithdrawFromSubaccount) Unmarshal(dAtA []byte) error

func (*MsgWithdrawFromSubaccount) ValidateBasic

func (msg *MsgWithdrawFromSubaccount) ValidateBasic() error

ValidateBasic runs validation on the fields of a MsgWithdrawFromSubaccount.

func (*MsgWithdrawFromSubaccount) XXX_DiscardUnknown

func (m *MsgWithdrawFromSubaccount) XXX_DiscardUnknown()

func (*MsgWithdrawFromSubaccount) XXX_Marshal

func (m *MsgWithdrawFromSubaccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgWithdrawFromSubaccount) XXX_Merge

func (m *MsgWithdrawFromSubaccount) XXX_Merge(src proto.Message)

func (*MsgWithdrawFromSubaccount) XXX_Size

func (m *MsgWithdrawFromSubaccount) XXX_Size() int

func (*MsgWithdrawFromSubaccount) XXX_Unmarshal

func (m *MsgWithdrawFromSubaccount) XXX_Unmarshal(b []byte) error

type MsgWithdrawFromSubaccountResponse

type MsgWithdrawFromSubaccountResponse struct {
}

MsgWithdrawFromSubaccountResponse is a response type used for new subaccount-to-account transfers.

func (*MsgWithdrawFromSubaccountResponse) Descriptor

func (*MsgWithdrawFromSubaccountResponse) Descriptor() ([]byte, []int)

func (*MsgWithdrawFromSubaccountResponse) Marshal

func (m *MsgWithdrawFromSubaccountResponse) Marshal() (dAtA []byte, err error)

func (*MsgWithdrawFromSubaccountResponse) MarshalTo

func (m *MsgWithdrawFromSubaccountResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgWithdrawFromSubaccountResponse) MarshalToSizedBuffer

func (m *MsgWithdrawFromSubaccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgWithdrawFromSubaccountResponse) ProtoMessage

func (*MsgWithdrawFromSubaccountResponse) ProtoMessage()

func (*MsgWithdrawFromSubaccountResponse) Reset

func (*MsgWithdrawFromSubaccountResponse) Size

func (m *MsgWithdrawFromSubaccountResponse) Size() (n int)

func (*MsgWithdrawFromSubaccountResponse) String

func (*MsgWithdrawFromSubaccountResponse) Unmarshal

func (m *MsgWithdrawFromSubaccountResponse) Unmarshal(dAtA []byte) error

func (*MsgWithdrawFromSubaccountResponse) XXX_DiscardUnknown

func (m *MsgWithdrawFromSubaccountResponse) XXX_DiscardUnknown()

func (*MsgWithdrawFromSubaccountResponse) XXX_Marshal

func (m *MsgWithdrawFromSubaccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgWithdrawFromSubaccountResponse) XXX_Merge

func (*MsgWithdrawFromSubaccountResponse) XXX_Size

func (m *MsgWithdrawFromSubaccountResponse) XXX_Size() int

func (*MsgWithdrawFromSubaccountResponse) XXX_Unmarshal

func (m *MsgWithdrawFromSubaccountResponse) XXX_Unmarshal(b []byte) error

type QueryClient

type QueryClient interface {
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryServer

type QueryServer interface {
}

QueryServer is the server API for Query service.

type SendingKeeper

type SendingKeeper interface {
	ProcessTransfer(ctx sdk.Context, transfer *Transfer) error
	ProcessDepositToSubaccount(
		ctx sdk.Context,
		msgDepositToSubaccount *MsgDepositToSubaccount,
	) error
	ProcessWithdrawFromSubaccount(
		ctx sdk.Context,
		msgWithdrawFromSubaccount *MsgWithdrawFromSubaccount,
	) error
	SendFromModuleToAccount(
		ctx sdk.Context,
		msg *MsgSendFromModuleToAccount,
	) error
	HasAuthority(authority string) bool
}

type SubaccountsKeeper

type SubaccountsKeeper interface {
	GetAllSubaccount(ctx sdk.Context) (list []satypes.Subaccount)
	GetRandomSubaccount(ctx sdk.Context, rand *rand.Rand) (satypes.Subaccount, error)
	GetNetCollateralAndMarginRequirements(
		ctx sdk.Context,
		update satypes.Update,
	) (
		bigNetCollateral *big.Int,
		bigInitialMargin *big.Int,
		bigMaintenanceMargin *big.Int,
		err error,
	)
	CanUpdateSubaccounts(
		ctx sdk.Context,
		updates []satypes.Update,
	) (
		success bool,
		successPerUpdate []satypes.UpdateResult,
		err error,
	)
	UpdateSubaccounts(
		ctx sdk.Context,
		updates []satypes.Update,
	) (
		success bool,
		successPerUpdate []satypes.UpdateResult,
		err error,
	)
	DepositFundsFromAccountToSubaccount(
		ctx sdk.Context,
		fromAccount sdk.AccAddress,
		toSubaccountId satypes.SubaccountId,
		assetId uint32,
		amount *big.Int,
	) (err error)
	WithdrawFundsFromSubaccountToAccount(
		ctx sdk.Context,
		fromSubaccountId satypes.SubaccountId,
		toAccount sdk.AccAddress,
		assetId uint32,
		amount *big.Int,
	) (err error)
	SetSubaccount(ctx sdk.Context, subaccount satypes.Subaccount)
	GetSubaccount(
		ctx sdk.Context,
		id satypes.SubaccountId,
	) (val satypes.Subaccount)
}

type Transfer

type Transfer struct {
	// The sender subaccount ID.
	Sender types.SubaccountId `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender"`
	// The recipient subaccount ID.
	Recipient types.SubaccountId `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient"`
	// Id of the asset to transfer.
	AssetId uint32 `protobuf:"varint,3,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"`
	// The amount of asset to transfer
	Amount uint64 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"`
}

Transfer represents a single transfer between two subaccounts.

func (*Transfer) Descriptor

func (*Transfer) Descriptor() ([]byte, []int)

func (*Transfer) GetAmount

func (m *Transfer) GetAmount() uint64

func (*Transfer) GetAssetId

func (m *Transfer) GetAssetId() uint32

func (*Transfer) GetBigQuantums

func (t *Transfer) GetBigQuantums() (bigNotional *big.Int)

GetBigQuantums returns the amount of the transfer in big notional. Currently only supports quote balance update.

func (*Transfer) GetRecipient

func (m *Transfer) GetRecipient() types.SubaccountId

func (*Transfer) GetRecipientSubaccountUpdate

func (t *Transfer) GetRecipientSubaccountUpdate() (update types.Update)

GetRecipientSubaccountUpdate returns the recipient subaccount update for this transfer. Currently only supports quote balance update.

func (*Transfer) GetSender

func (m *Transfer) GetSender() types.SubaccountId

func (*Transfer) GetSenderSubaccountUpdate

func (t *Transfer) GetSenderSubaccountUpdate() (update types.Update)

GetSenderSubaccountUpdate returns the sender subaccount update for this transfer. Currently only supports quote balance update.

func (*Transfer) Marshal

func (m *Transfer) Marshal() (dAtA []byte, err error)

func (*Transfer) MarshalTo

func (m *Transfer) MarshalTo(dAtA []byte) (int, error)

func (*Transfer) MarshalToSizedBuffer

func (m *Transfer) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Transfer) ProtoMessage

func (*Transfer) ProtoMessage()

func (*Transfer) Reset

func (m *Transfer) Reset()

func (*Transfer) Size

func (m *Transfer) Size() (n int)

func (*Transfer) String

func (m *Transfer) String() string

func (*Transfer) Unmarshal

func (m *Transfer) Unmarshal(dAtA []byte) error

func (*Transfer) XXX_DiscardUnknown

func (m *Transfer) XXX_DiscardUnknown()

func (*Transfer) XXX_Marshal

func (m *Transfer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Transfer) XXX_Merge

func (m *Transfer) XXX_Merge(src proto.Message)

func (*Transfer) XXX_Size

func (m *Transfer) XXX_Size() int

func (*Transfer) XXX_Unmarshal

func (m *Transfer) XXX_Unmarshal(b []byte) error

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) CreateTransfer

func (*UnimplementedMsgServer) DepositToSubaccount

func (*UnimplementedMsgServer) SendFromModuleToAccount

func (*UnimplementedMsgServer) WithdrawFromSubaccount

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

Jump to

Keyboard shortcuts

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