oas20

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// InstantiatedEventCode is the event code for the contract instantiated event.
	InstantiatedEventCode = 1
	// TransferredEventCode is the event code for the transfer event.
	TransferredEventCode = 2
	// SentEventCode is the event code for the sens event.
	SentEventCode = 3
	// BurnedEventCode is the event code for the burn event.
	BurnedEventCode = 4
	// AllowanceChangedEventCode is the event code for the allowance changed event.
	AllowanceChangedEventCode = 5
	// WithdrewEventCode is the event code for the withdraw event.
	WithdrewEventCode = 6
	// MintedEventCode is the event code for the minted event.
	MintedEventCode = 7
)

Variables

This section is empty.

Functions

func EventDecoder

func EventDecoder(codeID contracts.CodeID, instanceID contracts.InstanceID) client.EventDecoder

Types

type AllowanceChangedEvent

type AllowanceChangedEvent struct {
	Owner        types.Address     `json:"owner"`
	Beneficiary  types.Address     `json:"beneficiary"`
	Allowance    quantity.Quantity `json:"quantity"`
	Negative     bool              `json:"negative"`
	AmountChange quantity.Quantity `json:"amount_change"`
}

AllowanceChangedEvent is the allowance change event.

type Balance

type Balance struct {
	Address types.Address `json:"address"`
}

Balance is the OAS20 contract's balance query request.

type BalanceResponse

type BalanceResponse struct {
	Balance quantity.Quantity `json:"balance"`
}

BalanceResponse is the OAS20 balance response.

type BurnedEvent

type BurnedEvent struct {
	From   types.Address     `json:"from"`
	Amount quantity.Quantity `json:"amount"`
}

BurnedEvent is the burn event.

type Empty

type Empty struct{}

Empty is the empty response.

type Event

type Event struct {
	Instantiated     *InstantiatedEvent     `json:"instantiated,omitempty"`
	Transferred      *TransferredEvent      `json:"transferred,omitempty"`
	Sent             *SentEvent             `json:"sent,omitempty"`
	Burned           *BurnedEvent           `json:"burned,omitempty"`
	AllowanceChanged *AllowanceChangedEvent `json:"allowance_changed,omitempty"`
	Withdrew         *WithdrewEvent         `json:"withdrew,omitempty"`
	Minted           *MintedEvent           `json:"minted,omitempty"`
}

Event is an OAS20 event.

type InitialBalance

type InitialBalance struct {
	Address types.Address     `json:"address"`
	Amount  quantity.Quantity `json:"amount"`
}

InitialBalance is the OAS20 contract initial balance information.

type Instantiate

type Instantiate struct {
	// Name is the name of the token.
	Name string `json:"name"`
	// Symbol is the token symbol.
	Symbol string `json:"symbol"`
	// Decimals is the number of token decimals.
	Decimals uint8 `json:"decimals"`
	// InitialBalances are the initial balances of the token.
	InitialBalances []InitialBalance `json:"initial_balances,omitempty"`
	// Minting is the information about minting in case the token supports minting.
	Mintting *MintingInformation `json:"minting,omitempty"`
}

Instantiate is the OAS20 contract's initial state.

type InstantiatedEvent

type InstantiatedEvent struct {
	TokenInformation TokenInformationResponse `json:"token_information"`
}

InstantiatedEvent is the contract instantiated event.

type MintedEvent

type MintedEvent struct {
	To     types.Address     `json:"to"`
	Amount quantity.Quantity `json:"amount"`
}

MintedEvent is the mint event.

type MintingInformation

type MintingInformation struct {
	Minter types.Address      `json:"minter"`
	Cap    *quantity.Quantity `json:"cap,omitempty"`
}

MintingInformation is the OAS20 contract minting information.

type Request

type Request struct {
	Instantiate      *Instantiate      `json:"instantiate,omitempty"`
	Transfer         *Transfer         `json:"transfer,omitempty"`
	Send             *Send             `json:"send,omitempty"`
	TokenInformation *TokenInformation `json:"token_information,omitempty"`
	Balance          *Balance          `json:"balance,omitempty"`
}

Request is an OAS20 contract request.

type Response

type Response struct {
	TokenInformation *TokenInformationResponse `json:"token_information,omitempty"`
	Balance          *BalanceResponse          `json:"balance,omitempty"`
	Empty            *Empty                    `json:"empty,omitempty"`
}

Response is an OAS20 contract response.

type Send

type Send struct {
	To     contracts.InstanceID `json:"to"`
	Amount quantity.Quantity    `json:"amount"`
	Data   interface{}          `json:"data"`
}

Send is the OAS20 contract's send request.

type SentEvent

type SentEvent struct {
	From   types.Address        `json:"from"`
	To     contracts.InstanceID `json:"to"`
	Amount quantity.Quantity    `json:"amount"`
}

SentEvent is the send event.

type TokenInformation

type TokenInformation struct{}

TokenInformation is the OAS20 contract's token information request.

type TokenInformationResponse

type TokenInformationResponse struct {
	// Name is the name of the token.
	Name string `json:"name"`
	// Symbol is the token symbol.
	Symbol string `json:"symbol"`
	// Decimals is the number of token decimals.
	Decimals uint8 `json:"decimals"`
	// TotalSupply is the total supply of the token.
	TotalSupply quantity.Quantity `json:"total_supply"`
	// Minting is the information about minting in case the token supports minting.
	Minting *MintingInformation `json:"minting,omitempty"`
}

TokenInformationResponse is the token information response.

func (*TokenInformationResponse) Equal

Equal compares token information response for equality.

type Transfer

type Transfer struct {
	To     types.Address     `json:"to"`
	Amount quantity.Quantity `json:"amount"`
}

Transfer is the OAS20 contract's transfer request.

type TransferredEvent

type TransferredEvent struct {
	From   types.Address     `json:"from"`
	To     types.Address     `json:"to"`
	Amount quantity.Quantity `json:"amount"`
}

TransferredEvent is the transfer event.

type WithdrewEvent

type WithdrewEvent struct {
	From   types.Address     `json:"from"`
	To     types.Address     `json:"to"`
	Amount quantity.Quantity `json:"amount"`
}

WithdrewEvent is the withdraw event.

Jump to

Keyboard shortcuts

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