keeper

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAndSaveBalance

func AddAndSaveBalance(ctx context.Context, table api.BatchBalanceTable, addr sdk.AccAddress, batchKey uint64, amt math.Dec) error

AddAndSaveBalance adds 'amt' to the addr's tradable balance.

func BatchSupplyInvariant

func BatchSupplyInvariant(ctx context.Context, k Keeper, basketBalances map[uint64]math.Dec) (msg string, broken bool)

BatchSupplyInvariant checks - calculated total tradable balance of each credit batch matches the total tradable supply - calculated total retired balance of each credit batch matches the total retired supply

func RetireAndSaveBalance

func RetireAndSaveBalance(ctx context.Context, table api.BatchBalanceTable, addr sdk.AccAddress, batchKey uint64, amount math.Dec) error

RetireAndSaveBalance adds 'amt' to the addr's retired balance.

func RetireSupply

func RetireSupply(ctx context.Context, table api.BatchSupplyTable, batchKey uint64, amount math.Dec) error

RetireSupply moves `amount` of credits from the supply's tradable amount to its retired amount.

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	ss api.StateStore,
	bk ecocredit.BankKeeper,
	ma sdk.AccAddress,
	basketStore basketapi.StateStore,
	marketStore marketplaceapi.StateStore,
	authority sdk.AccAddress,
) Keeper

func (Keeper) AddClassCreator

func (Keeper) AddCreditType

AddCreditType adds a new credit type to the network.

func (Keeper) AllBalances

AllBalances queries all credit balances from state with optional pagination. NOTE: If no pagination is given in the request, responses will be limited by the Cosmos SDK's default limit (100).

func (Keeper) AllowedClassCreators

AllowedClassCreators queries list of allowed class creators.

func (Keeper) Balance

Balance queries the balance (both tradable and retired) of a given credit batch for a given account.

func (Keeper) Balances

func (Keeper) Batch

Batch queries for information on a credit batch.

func (Keeper) Batches

Batches queries for all batches in the given credit class.

func (Keeper) BatchesByClass

BatchesByClass queries all batches issued under a given credit class.

func (Keeper) BatchesByIssuer

BatchesByIssuer queries all batches issued from the given issuer address

func (Keeper) BatchesByProject

BatchesByProject queries for all batches in the given credit class.

func (Keeper) Bridge

Bridge cancel credits, removing them from the supply and balance of the holder

func (Keeper) BridgeReceive

BridgeReceive bridges credits received from another chain.

func (Keeper) Cancel

Cancel credits, removing them from the supply and balance of the owner

func (Keeper) Class

Class queries for information on a credit class.

func (Keeper) ClassCreatorAllowlist

ClassCreatorAllowlist queries credit class allowlist setting.

func (Keeper) ClassFee

ClassFee queries credit class creation fees.

func (Keeper) ClassIssuers

ClassIssuers returns a list of addresses that are allowed to issue batches from the given class.

func (Keeper) Classes

Classes queries for all credit classes with pagination.

func (Keeper) ClassesByAdmin

ClassesByAdmin queries for all classes with a specific admin address.

func (Keeper) CreateBatch

CreateBatch creates a new batch of credits. Credits in the batch must not have more decimal places than the credit type's specified precision.

func (Keeper) CreateClass

CreateClass creates a new class of ecocredit

The admin is charged a fee for creating the class. This is controlled by the global parameter CreditClassFee, which can be updated through the governance process.

func (Keeper) CreateProject

CreateProject creates a new project for a specific credit class.

func (Keeper) CreditType

CreditType queries credit type information by abbreviation.

func (Keeper) CreditTypes

CreditTypes queries the list of allowed types that credit classes can have.

func (Keeper) MintBatchCredits

MintBatchCredits issues additional credits from an open batch.

func (Keeper) Params

Params queries the ecocredit module parameters. Deprecated: This rpc method is deprecated and will be removed in next version. Use individual param query instead.

func (Keeper) Project

Project queries project info from the given project name.

func (Keeper) Projects

Projects queries all projects.

func (Keeper) ProjectsByClass

ProjectsByClass queries all projects from a given credit class.

func (Keeper) ProjectsByReferenceId

ProjectsByReferenceId queries projects by reference id.

func (Keeper) Retire

Retire credits to the specified jurisdiction. WARNING: retiring credits is permanent. Retired credits cannot be un-retired.

func (Keeper) SealBatch

SealBatch sets the Open field to false in a batch IFF the requester address matches the batch issuer address. This method is a no-op for batches which already have Open set to false.

func (Keeper) Send

func (k Keeper) Send(ctx context.Context, req *types.MsgSend) (*types.MsgSendResponse, error)

Send sends credits to a recipient. Send also retires credits if the amount to retire is specified in the request.

func (Keeper) Supply

Supply queries the supply (tradable, retired, cancelled) of a given credit batch.

func (Keeper) UpdateBatchMetadata

UpdateBatchMetadata updates the metadata for the batch.

func (Keeper) UpdateClassAdmin

UpdateClassAdmin updates the admin address for a class. WARNING: this method will forfeit control of the entire class to the provided address. double check your inputs to ensure you do not lose control of the class.

func (Keeper) UpdateClassFee

func (Keeper) UpdateClassIssuers

UpdateClassIssuers updates a class's issuers by either adding more issuers, or removing issuers from the class issuer store.

func (Keeper) UpdateClassMetadata

UpdateClassMetadata updates the metadata for the class.

func (Keeper) UpdateProjectAdmin

UpdateProjectAdmin updates the project admin.

func (Keeper) UpdateProjectMetadata

UpdateProjectMetadata updates the project metadata.

Jump to

Keyboard shortcuts

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