collectibles

package
v0.164.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: MPL-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInfiniteSupply added in v0.163.4

func GetInfiniteSupply() *big.Int

Types

type API

type API struct {
	RPCClient *rpc.Client
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(rpcClient *rpc.Client, accountsManager *account.GethManager, rpcFiltersSrvc *rpcfilters.Service, config *params.NodeConfig, appDb *sql.DB) *API

func (*API) Burn added in v0.158.0

func (api *API) Burn(ctx context.Context, chainID uint64, contractAddress string, txArgs transactions.SendTxArgs, password string, burnAmount *bigint.BigInt) (string, error)

func (*API) DeployAssets added in v0.160.1

func (api *API) DeployAssets(ctx context.Context, chainID uint64, deploymentParameters DeploymentParameters, txArgs transactions.SendTxArgs, password string) (DeploymentDetails, error)

func (*API) DeployAssetsEstimate added in v0.160.1

func (api *API) DeployAssetsEstimate(ctx context.Context) (uint64, error)

Returns gas units + 10%

func (*API) DeployCollectibles added in v0.160.1

func (api *API) DeployCollectibles(ctx context.Context, chainID uint64, deploymentParameters DeploymentParameters, txArgs transactions.SendTxArgs, password string) (DeploymentDetails, error)

func (*API) DeployCollectiblesEstimate added in v0.142.9

func (api *API) DeployCollectiblesEstimate(ctx context.Context) (uint64, error)

Returns gas units + 10%

func (*API) DeployOwnerToken added in v0.163.14

func (api *API) DeployOwnerToken(ctx context.Context, chainID uint64, ownerTokenParameters DeploymentParameters, masterTokenParameters DeploymentParameters, txArgs transactions.SendTxArgs, password string) (DeploymentDetails, error)

func (*API) DeployOwnerTokenEstimate added in v0.163.14

func (api *API) DeployOwnerTokenEstimate(ctx context.Context) (uint64, error)

Returns gas units + 10%

func (*API) EstimateBurn added in v0.158.0

func (api *API) EstimateBurn(ctx context.Context, chainID uint64, contractAddress string, fromAddress string, burnAmount *bigint.BigInt) (uint64, error)

func (*API) EstimateMintAssets added in v0.162.1

func (api *API) EstimateMintAssets(ctx context.Context, chainID uint64, contractAddress string, fromAddress string, walletAddresses []string, amount *bigint.BigInt) (uint64, error)

Estimate MintAssets cost.

func (*API) EstimateMintCollectibles added in v0.162.1

func (api *API) EstimateMintCollectibles(ctx context.Context, chainID uint64, contractAddress string, fromAddress string, walletAddresses []string, amount *bigint.BigInt) (uint64, error)

func (*API) EstimateMintTokens added in v0.162.1

func (api *API) EstimateMintTokens(ctx context.Context, chainID uint64, contractAddress string, fromAddress string, walletAddresses []string, amount *bigint.BigInt) (uint64, error)

func (*API) EstimateRemoteBurn added in v0.152.2

func (api *API) EstimateRemoteBurn(ctx context.Context, chainID uint64, contractAddress string, fromAddress string, tokenIds []*bigint.BigInt) (uint64, error)

This is only ERC721 function

func (*API) GetAssetContractInstance added in v0.163.4

func (api *API) GetAssetContractInstance(chainID uint64, contractAddress string) (*assets.Assets, error)

func (*API) GetCollectiblesContractInstance added in v0.163.14

func (api *API) GetCollectiblesContractInstance(chainID uint64, contractAddress string) (*collectibles.Collectibles, error)

func (*API) GetMasterTokenContractAddressFromHash added in v0.163.14

func (api *API) GetMasterTokenContractAddressFromHash(ctx context.Context, chainID uint64, txHash string) (string, error)

func (*API) MintTokens added in v0.162.1

func (api *API) MintTokens(ctx context.Context, chainID uint64, contractAddress string, txArgs transactions.SendTxArgs, password string, walletAddresses []string, amount *bigint.BigInt) (string, error)

Universal minting function for every type of token.

func (*API) NewAssetsInstance added in v0.163.14

func (api *API) NewAssetsInstance(chainID uint64, contractAddress string) (*assets.Assets, error)

func (*API) NewCollectiblesInstance added in v0.163.14

func (api *API) NewCollectiblesInstance(chainID uint64, contractAddress string) (*collectibles.Collectibles, error)

func (*API) NewMasterTokenInstance added in v0.163.14

func (api *API) NewMasterTokenInstance(chainID uint64, contractAddress string) (*mastertoken.MasterToken, error)

func (*API) PrepareMintAssetsData added in v0.163.14

func (api *API) PrepareMintAssetsData(walletAddresses []string, amount *bigint.BigInt) ([]common.Address, []*big.Int)

func (*API) PrepareMintCollectiblesData added in v0.163.14

func (api *API) PrepareMintCollectiblesData(walletAddresses []string, amount *bigint.BigInt) []common.Address

func (*API) RemainingSupply added in v0.158.0

func (api *API) RemainingSupply(ctx context.Context, chainID uint64, contractAddress string) (*bigint.BigInt, error)

func (*API) RemoteBurn added in v0.152.2

func (api *API) RemoteBurn(ctx context.Context, chainID uint64, contractAddress string, txArgs transactions.SendTxArgs, password string, tokenIds []*bigint.BigInt) (string, error)

This is only ERC721 function

func (*API) RemoteDestructedAmount added in v0.162.14

func (api *API) RemoteDestructedAmount(ctx context.Context, chainID uint64, contractAddress string) (*bigint.BigInt, error)

This is only ERC721 function

func (*API) ValidateWalletsAndAmounts added in v0.163.14

func (api *API) ValidateWalletsAndAmounts(walletAddresses []string, amount *bigint.BigInt) error

type AssetInstance added in v0.163.14

type AssetInstance struct {
	TokenInstance
	// contains filtered or unexported fields
}

Asset

func (AssetInstance) Mint added in v0.163.14

func (t AssetInstance) Mint(transactOpts *bind.TransactOpts, walletAddresses []string, amount *bigint.BigInt) (*types.Transaction, error)

The amount should be in smallest denomination of the asset (like wei) with decimal = 18, eg. if we want to mint 2.34 of the token, then amount should be 234{16 zeros}.

func (AssetInstance) PackMethod added in v0.163.14

func (t AssetInstance) PackMethod(ctx context.Context, methodName string, args ...interface{}) ([]byte, error)

func (AssetInstance) RemoteBurn added in v0.163.14

func (t AssetInstance) RemoteBurn(transactOpts *bind.TransactOpts, tokenIds []*big.Int) (*types.Transaction, error)

func (AssetInstance) SetMaxSupply added in v0.163.14

func (t AssetInstance) SetMaxSupply(transactOpts *bind.TransactOpts, maxSupply *big.Int) (*types.Transaction, error)

type CollectibleInstance added in v0.163.14

type CollectibleInstance struct {
	TokenInstance
	// contains filtered or unexported fields
}

Collectible

func (CollectibleInstance) Mint added in v0.163.14

func (t CollectibleInstance) Mint(transactOpts *bind.TransactOpts, walletAddresses []string, amount *bigint.BigInt) (*types.Transaction, error)

func (CollectibleInstance) PackMethod added in v0.163.14

func (t CollectibleInstance) PackMethod(ctx context.Context, methodName string, args ...interface{}) ([]byte, error)

func (CollectibleInstance) RemoteBurn added in v0.163.14

func (t CollectibleInstance) RemoteBurn(transactOpts *bind.TransactOpts, tokenIds []*big.Int) (*types.Transaction, error)

func (CollectibleInstance) SetMaxSupply added in v0.163.14

func (t CollectibleInstance) SetMaxSupply(transactOpts *bind.TransactOpts, maxSupply *big.Int) (*types.Transaction, error)

type Database added in v0.141.1

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

func NewCommunityTokensDatabase added in v0.160.1

func NewCommunityTokensDatabase(db *sql.DB) *Database

func (*Database) GetTokenPrivilegesLevel added in v0.163.14

func (db *Database) GetTokenPrivilegesLevel(chainID uint64, contractAddress string) (token.PrivilegesLevel, error)

func (*Database) GetTokenType added in v0.160.1

func (db *Database) GetTokenType(chainID uint64, contractAddress string) (protobuf.CommunityTokenType, error)

type DeploymentDetails

type DeploymentDetails struct {
	ContractAddress string `json:"contractAddress"`
	TransactionHash string `json:"transactionHash"`
}

type DeploymentParameters

type DeploymentParameters struct {
	Name               string         `json:"name"`
	Symbol             string         `json:"symbol"`
	Supply             *bigint.BigInt `json:"supply"`
	InfiniteSupply     bool           `json:"infiniteSupply"`
	Transferable       bool           `json:"transferable"`
	RemoteSelfDestruct bool           `json:"remoteSelfDestruct"`
	TokenURI           string         `json:"tokenUri"`
	OwnerTokenAddress  string         `json:"ownerTokenAddress"`
	MasterTokenAddress string         `json:"masterTokenAddress"`
}

func (*DeploymentParameters) GetInfiniteSupply

func (d *DeploymentParameters) GetInfiniteSupply() *big.Int

infinite supply for ERC721 is 2^256-1

func (*DeploymentParameters) GetSupply

func (d *DeploymentParameters) GetSupply() *big.Int

func (*DeploymentParameters) Validate

func (d *DeploymentParameters) Validate(isAsset bool) error

type MasterTokenInstance added in v0.163.14

type MasterTokenInstance struct {
	TokenInstance
	// contains filtered or unexported fields
}

Master Token

func (MasterTokenInstance) Mint added in v0.163.14

func (t MasterTokenInstance) Mint(transactOpts *bind.TransactOpts, walletAddresses []string, amount *bigint.BigInt) (*types.Transaction, error)

func (MasterTokenInstance) PackMethod added in v0.163.14

func (t MasterTokenInstance) PackMethod(ctx context.Context, methodName string, args ...interface{}) ([]byte, error)

func (MasterTokenInstance) RemoteBurn added in v0.163.14

func (t MasterTokenInstance) RemoteBurn(transactOpts *bind.TransactOpts, tokenIds []*big.Int) (*types.Transaction, error)

func (MasterTokenInstance) SetMaxSupply added in v0.163.14

func (t MasterTokenInstance) SetMaxSupply(transactOpts *bind.TransactOpts, maxSupply *big.Int) (*types.Transaction, error)

type Service

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

Collectibles service

func NewService

func NewService(rpcClient *rpc.Client, accountsManager *account.GethManager, rpcFiltersSrvc *rpcfilters.Service, config *params.NodeConfig, appDb *sql.DB) *Service

Returns a new Collectibles Service.

func (*Service) API added in v0.163.4

func (s *Service) API() *API

func (*Service) APIs

func (s *Service) APIs() []ethRpc.API

APIs returns a list of new APIs.

func (*Service) Protocols

func (s *Service) Protocols() []p2p.Protocol

Protocols returns a new protocols list. In this case, there are none.

func (*Service) Start

func (s *Service) Start() error

Start is run when a service is started.

func (*Service) Stop

func (s *Service) Stop() error

Stop is run when a service is stopped.

type TokenInstance added in v0.163.14

type TokenInstance interface {
	RemoteBurn(*bind.TransactOpts, []*big.Int) (*types.Transaction, error)
	Mint(*bind.TransactOpts, []string, *bigint.BigInt) (*types.Transaction, error)
	SetMaxSupply(*bind.TransactOpts, *big.Int) (*types.Transaction, error)
	PackMethod(ctx context.Context, methodName string, args ...interface{}) ([]byte, error)
}

func NewTokenInstance added in v0.163.14

func NewTokenInstance(api *API, chainID uint64, contractAddress string) (TokenInstance, error)

Jump to

Keyboard shortcuts

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