Documentation ¶
Index ¶
- Constants
- func GetInfiniteSupply() *big.Int
- type API
- func (api *API) Burn(ctx context.Context, chainID uint64, contractAddress string, ...) (string, error)
- func (api *API) DeployAssets(ctx context.Context, chainID uint64, deploymentParameters DeploymentParameters, ...) (DeploymentDetails, error)
- func (api *API) DeployAssetsEstimate(ctx context.Context, chainID uint64, fromAddress string) (*CommunityTokenFees, error)
- func (api *API) DeployCollectibles(ctx context.Context, chainID uint64, deploymentParameters DeploymentParameters, ...) (DeploymentDetails, error)
- func (api *API) DeployCollectiblesEstimate(ctx context.Context, chainID uint64, fromAddress string) (*CommunityTokenFees, error)
- func (api *API) DeployOwnerToken(ctx context.Context, chainID uint64, ownerTokenParameters DeploymentParameters, ...) (DeploymentDetails, error)
- func (api *API) DeployOwnerTokenEstimate(ctx context.Context, chainID uint64, fromAddress string, ...) (*CommunityTokenFees, error)
- func (api *API) EstimateBurn(ctx context.Context, chainID uint64, contractAddress string, ...) (*CommunityTokenFees, error)
- func (api *API) EstimateMintTokens(ctx context.Context, chainID uint64, contractAddress string, ...) (*CommunityTokenFees, error)
- func (api *API) EstimateRemoteBurn(ctx context.Context, chainID uint64, contractAddress string, ...) (*CommunityTokenFees, error)
- func (api *API) EstimateSetSignerPubKey(ctx context.Context, chainID uint64, contractAddress string, ...) (*CommunityTokenFees, error)
- func (api *API) GetAssetContractInstance(chainID uint64, contractAddress string) (*assets.Assets, error)
- func (api *API) GetCollectiblesContractInstance(chainID uint64, contractAddress string) (*collectibles.Collectibles, error)
- func (api *API) GetSignerPubKey(ctx context.Context, chainID uint64, contractAddress string) (string, error)
- func (api *API) MintTokens(ctx context.Context, chainID uint64, contractAddress string, ...) (string, error)
- func (api *API) NewAssetsInstance(chainID uint64, contractAddress string) (*assets.Assets, error)
- func (api *API) NewCollectiblesInstance(chainID uint64, contractAddress string) (*collectibles.Collectibles, error)
- func (api *API) NewCommunityOwnerTokenRegistryInstance(chainID uint64, contractAddress string) (*communityownertokenregistry.CommunityOwnerTokenRegistry, error)
- func (api *API) NewCommunityTokenDeployerInstance(chainID uint64) (*communitytokendeployer.CommunityTokenDeployer, error)
- func (api *API) NewOwnerTokenInstance(chainID uint64, contractAddress string) (*ownertoken.OwnerToken, error)
- func (api *API) OwnerTokenOwnerAddress(ctx context.Context, chainID uint64, contractAddress string) (string, error)
- func (api *API) ReTrackOwnerTokenDeploymentTransaction(ctx context.Context, chainID uint64, contractAddress string) error
- func (api *API) RemainingSupply(ctx context.Context, chainID uint64, contractAddress string) (*bigint.BigInt, error)
- func (api *API) RemoteBurn(ctx context.Context, chainID uint64, contractAddress string, ...) (string, error)
- func (api *API) RemoteDestructedAmount(ctx context.Context, chainID uint64, contractAddress string) (*bigint.BigInt, error)
- func (api *API) SafeGetOwnerTokenAddress(ctx context.Context, chainID uint64, communityID string) (string, error)
- func (api *API) SafeGetSignerPubKey(ctx context.Context, chainID uint64, communityID string) (string, error)
- func (api *API) SetSignerPubKey(ctx context.Context, chainID uint64, contractAddress string, ...) (string, error)
- type AssetInstance
- func (t AssetInstance) Mint(transactOpts *bind.TransactOpts, walletAddresses []string, ...) (*types.Transaction, error)
- func (t AssetInstance) PackMethod(ctx context.Context, methodName string, args ...interface{}) ([]byte, error)
- func (t AssetInstance) RemoteBurn(transactOpts *bind.TransactOpts, tokenIds []*big.Int) (*types.Transaction, error)
- func (t AssetInstance) SetMaxSupply(transactOpts *bind.TransactOpts, maxSupply *big.Int) (*types.Transaction, error)
- type CollectibleInstance
- func (t CollectibleInstance) Mint(transactOpts *bind.TransactOpts, walletAddresses []string, ...) (*types.Transaction, error)
- func (t CollectibleInstance) PackMethod(ctx context.Context, methodName string, args ...interface{}) ([]byte, error)
- func (t CollectibleInstance) RemoteBurn(transactOpts *bind.TransactOpts, tokenIds []*big.Int) (*types.Transaction, error)
- func (t CollectibleInstance) SetMaxSupply(transactOpts *bind.TransactOpts, maxSupply *big.Int) (*types.Transaction, error)
- type CommunityTokenFees
- type DeploymentDetails
- type DeploymentParameters
- type Manager
- func (m *Manager) DeploymentSignatureDigest(chainID uint64, addressFrom string, communityID string) ([]byte, error)
- func (m *Manager) GetAssetContractData(chainID uint64, contractAddress string) (*communities.AssetContractData, error)
- func (m *Manager) GetAssetContractInstance(chainID uint64, contractAddress string) (*assets.Assets, error)
- func (m *Manager) GetCollectibleContractData(chainID uint64, contractAddress string) (*communities.CollectibleContractData, error)
- func (m *Manager) GetCollectiblesContractInstance(chainID uint64, contractAddress string) (*collectibles.Collectibles, error)
- func (m *Manager) NewAssetsInstance(chainID uint64, contractAddress string) (*assets.Assets, error)
- func (m *Manager) NewCollectiblesInstance(chainID uint64, contractAddress string) (*collectibles.Collectibles, error)
- func (m *Manager) NewCommunityTokenDeployerInstance(chainID uint64) (*communitytokendeployer.CommunityTokenDeployer, error)
- type MasterTokenInstance
- func (t MasterTokenInstance) Mint(transactOpts *bind.TransactOpts, walletAddresses []string, ...) (*types.Transaction, error)
- func (t MasterTokenInstance) PackMethod(ctx context.Context, methodName string, args ...interface{}) ([]byte, error)
- func (t MasterTokenInstance) RemoteBurn(transactOpts *bind.TransactOpts, tokenIds []*big.Int) (*types.Transaction, error)
- func (t MasterTokenInstance) SetMaxSupply(transactOpts *bind.TransactOpts, maxSupply *big.Int) (*types.Transaction, error)
- type OwnerTokenInstance
- func (t OwnerTokenInstance) Mint(transactOpts *bind.TransactOpts, walletAddresses []string, ...) (*types.Transaction, error)
- func (t OwnerTokenInstance) PackMethod(ctx context.Context, methodName string, args ...interface{}) ([]byte, error)
- func (t OwnerTokenInstance) RemoteBurn(transactOpts *bind.TransactOpts, tokenIds []*big.Int) (*types.Transaction, error)
- func (t OwnerTokenInstance) SetMaxSupply(transactOpts *bind.TransactOpts, maxSupply *big.Int) (*types.Transaction, error)
- type Service
- func (s *Service) APIs() []ethRpc.API
- func (s *Service) CreateCommunityTokenAndSave(chainID int, deploymentParameters DeploymentParameters, deployerAddress string, ...) (*token.CommunityToken, error)
- func (s *Service) DeploymentSignatureDigest(chainID uint64, addressFrom string, communityID string) ([]byte, error)
- func (s *Service) GetAssetContractData(chainID uint64, contractAddress string) (*communities.AssetContractData, error)
- func (s *Service) GetCollectibleContractData(chainID uint64, contractAddress string) (*communities.CollectibleContractData, error)
- func (s *Service) GetMasterTokenContractAddressFromHash(ctx context.Context, chainID uint64, txHash string) (string, error)
- func (s *Service) GetOwnerTokenContractAddressFromHash(ctx context.Context, chainID uint64, txHash string) (string, error)
- func (s *Service) GetSignerPubKey(ctx context.Context, chainID uint64, contractAddress string) (string, error)
- func (s *Service) HashFromTemporaryContractAddress(address string) string
- func (s *Service) Init(messenger *protocol.Messenger)
- func (s *Service) NewCommunityOwnerTokenRegistryInstance(chainID uint64, contractAddress string) (*communityownertokenregistry.CommunityOwnerTokenRegistry, error)
- func (s *Service) NewMasterTokenInstance(chainID uint64, contractAddress string) (*mastertoken.MasterToken, error)
- func (s *Service) NewOwnerTokenInstance(chainID uint64, contractAddress string) (*ownertoken.OwnerToken, error)
- func (s *Service) ProcessCommunityTokenAction(message *protobuf.CommunityTokenAction) error
- func (s *Service) Protocols() []p2p.Protocol
- func (s *Service) ReTrackOwnerTokenDeploymentTransaction(ctx context.Context, chainID uint64, contractAddress string) error
- func (s *Service) SafeGetOwnerTokenAddress(ctx context.Context, chainID uint64, communityID string) (string, error)
- func (s *Service) SafeGetSignerPubKey(ctx context.Context, chainID uint64, communityID string) (string, error)
- func (s *Service) SetSignerPubKey(ctx context.Context, chainID uint64, contractAddress string, ...) (string, error)
- func (s *Service) Start() error
- func (s *Service) Stop() error
- func (s *Service) TemporaryMasterContractAddress(hash string) string
- func (s *Service) TemporaryOwnerContractAddress(hash string) string
- func (s *Service) ValidateWalletsAndAmounts(walletAddresses []string, amount *bigint.BigInt) error
- type TokenInstance
Constants ¶
const ( MasterSuffix = "-master" OwnerSuffix = "-owner" )
Variables ¶
This section is empty.
Functions ¶
func GetInfiniteSupply ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) DeployAssets ¶
func (api *API) DeployAssets(ctx context.Context, chainID uint64, deploymentParameters DeploymentParameters, txArgs transactions.SendTxArgs, password string) (DeploymentDetails, error)
func (*API) DeployAssetsEstimate ¶
func (*API) DeployCollectibles ¶
func (api *API) DeployCollectibles(ctx context.Context, chainID uint64, deploymentParameters DeploymentParameters, txArgs transactions.SendTxArgs, password string) (DeploymentDetails, error)
func (*API) DeployCollectiblesEstimate ¶
func (*API) DeployOwnerToken ¶
func (api *API) DeployOwnerToken(ctx context.Context, chainID uint64, ownerTokenParameters DeploymentParameters, masterTokenParameters DeploymentParameters, signerPubKey string, txArgs transactions.SendTxArgs, password string) (DeploymentDetails, error)
func (*API) DeployOwnerTokenEstimate ¶
func (api *API) DeployOwnerTokenEstimate(ctx context.Context, chainID uint64, fromAddress string, ownerTokenParameters DeploymentParameters, masterTokenParameters DeploymentParameters, communityID string, signerPubKey string) (*CommunityTokenFees, error)
func (*API) EstimateBurn ¶
func (*API) EstimateMintTokens ¶
func (*API) EstimateRemoteBurn ¶
func (api *API) EstimateRemoteBurn(ctx context.Context, chainID uint64, contractAddress string, fromAddress string, tokenIds []*bigint.BigInt) (*CommunityTokenFees, error)
This is only ERC721 function
func (*API) EstimateSetSignerPubKey ¶ added in v0.168.1
func (*API) GetAssetContractInstance ¶
func (*API) GetCollectiblesContractInstance ¶
func (api *API) GetCollectiblesContractInstance(chainID uint64, contractAddress string) (*collectibles.Collectibles, error)
func (*API) GetSignerPubKey ¶ added in v0.168.1
func (api *API) GetSignerPubKey(ctx context.Context, chainID uint64, contractAddress string) (string, error)
Gets signer public key from smart contract with a given chainId and address
func (*API) MintTokens ¶
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 ¶
func (*API) NewCollectiblesInstance ¶
func (api *API) NewCollectiblesInstance(chainID uint64, contractAddress string) (*collectibles.Collectibles, error)
func (*API) NewCommunityOwnerTokenRegistryInstance ¶ added in v0.168.1
func (api *API) NewCommunityOwnerTokenRegistryInstance(chainID uint64, contractAddress string) (*communityownertokenregistry.CommunityOwnerTokenRegistry, error)
func (*API) NewCommunityTokenDeployerInstance ¶ added in v0.168.1
func (api *API) NewCommunityTokenDeployerInstance(chainID uint64) (*communitytokendeployer.CommunityTokenDeployer, error)
func (*API) NewOwnerTokenInstance ¶ added in v0.168.1
func (api *API) NewOwnerTokenInstance(chainID uint64, contractAddress string) (*ownertoken.OwnerToken, error)
func (*API) OwnerTokenOwnerAddress ¶ added in v0.171.11
func (*API) ReTrackOwnerTokenDeploymentTransaction ¶ added in v0.179.24
func (api *API) ReTrackOwnerTokenDeploymentTransaction(ctx context.Context, chainID uint64, contractAddress string) error
recovery function which starts transaction tracking again
func (*API) RemainingSupply ¶
func (*API) RemoteBurn ¶
func (api *API) RemoteBurn(ctx context.Context, chainID uint64, contractAddress string, txArgs transactions.SendTxArgs, password string, tokenIds []*bigint.BigInt, additionalData string) (string, error)
This is only ERC721 function
func (*API) RemoteDestructedAmount ¶
func (api *API) RemoteDestructedAmount(ctx context.Context, chainID uint64, contractAddress string) (*bigint.BigInt, error)
This is only ERC721 function
func (*API) SafeGetOwnerTokenAddress ¶ added in v0.168.1
func (api *API) SafeGetOwnerTokenAddress(ctx context.Context, chainID uint64, communityID string) (string, error)
Gets owner token contract address from deployer contract
func (*API) SafeGetSignerPubKey ¶ added in v0.168.1
func (api *API) SafeGetSignerPubKey(ctx context.Context, chainID uint64, communityID string) (string, error)
Gets signer public key directly from deployer contract
func (*API) SetSignerPubKey ¶ added in v0.168.1
type AssetInstance ¶
type AssetInstance struct { TokenInstance // contains filtered or unexported fields }
Asset
func (AssetInstance) Mint ¶
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 ¶
func (AssetInstance) RemoteBurn ¶
func (t AssetInstance) RemoteBurn(transactOpts *bind.TransactOpts, tokenIds []*big.Int) (*types.Transaction, error)
func (AssetInstance) SetMaxSupply ¶
func (t AssetInstance) SetMaxSupply(transactOpts *bind.TransactOpts, maxSupply *big.Int) (*types.Transaction, error)
type CollectibleInstance ¶
type CollectibleInstance struct { TokenInstance // contains filtered or unexported fields }
Collectible
func (CollectibleInstance) Mint ¶
func (t CollectibleInstance) Mint(transactOpts *bind.TransactOpts, walletAddresses []string, amount *bigint.BigInt) (*types.Transaction, error)
func (CollectibleInstance) PackMethod ¶
func (CollectibleInstance) RemoteBurn ¶
func (t CollectibleInstance) RemoteBurn(transactOpts *bind.TransactOpts, tokenIds []*big.Int) (*types.Transaction, error)
func (CollectibleInstance) SetMaxSupply ¶
func (t CollectibleInstance) SetMaxSupply(transactOpts *bind.TransactOpts, maxSupply *big.Int) (*types.Transaction, error)
type CommunityTokenFees ¶ added in v0.179.20
type CommunityTokenFees struct { GasUnits uint64 `json:"gasUnits"` SuggestedFees *router.SuggestedFeesGwei `json:"suggestedFees"` }
type DeploymentDetails ¶
type DeploymentDetails struct { ContractAddress string `json:"contractAddress"` TransactionHash string `json:"transactionHash"` CommunityToken *token.CommunityToken `json:"communityToken"` OwnerToken *token.CommunityToken `json:"ownerToken"` MasterToken *token.CommunityToken `json:"masterToken"` }
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"` CommunityID string `json:"communityId"` Description string `json:"description"` CroppedImage *images.CroppedImage `json:"croppedImage,omitempty"` // for community tokens Base64Image string `json:"base64image"` // for owner & master tokens Decimals int `json:"decimals"` }
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 Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) DeploymentSignatureDigest ¶ added in v0.168.1
func (m *Manager) DeploymentSignatureDigest(chainID uint64, addressFrom string, communityID string) ([]byte, error)
Creates
func (*Manager) GetAssetContractData ¶
func (m *Manager) GetAssetContractData(chainID uint64, contractAddress string) (*communities.AssetContractData, error)
func (*Manager) GetAssetContractInstance ¶
func (*Manager) GetCollectibleContractData ¶
func (m *Manager) GetCollectibleContractData(chainID uint64, contractAddress string) (*communities.CollectibleContractData, error)
func (*Manager) GetCollectiblesContractInstance ¶
func (m *Manager) GetCollectiblesContractInstance(chainID uint64, contractAddress string) (*collectibles.Collectibles, error)
func (*Manager) NewAssetsInstance ¶
func (*Manager) NewCollectiblesInstance ¶
func (m *Manager) NewCollectiblesInstance(chainID uint64, contractAddress string) (*collectibles.Collectibles, error)
func (*Manager) NewCommunityTokenDeployerInstance ¶ added in v0.168.1
func (m *Manager) NewCommunityTokenDeployerInstance(chainID uint64) (*communitytokendeployer.CommunityTokenDeployer, error)
type MasterTokenInstance ¶
type MasterTokenInstance struct { TokenInstance // contains filtered or unexported fields }
Master Token
func (MasterTokenInstance) Mint ¶
func (t MasterTokenInstance) Mint(transactOpts *bind.TransactOpts, walletAddresses []string, amount *bigint.BigInt) (*types.Transaction, error)
func (MasterTokenInstance) PackMethod ¶
func (MasterTokenInstance) RemoteBurn ¶
func (t MasterTokenInstance) RemoteBurn(transactOpts *bind.TransactOpts, tokenIds []*big.Int) (*types.Transaction, error)
func (MasterTokenInstance) SetMaxSupply ¶
func (t MasterTokenInstance) SetMaxSupply(transactOpts *bind.TransactOpts, maxSupply *big.Int) (*types.Transaction, error)
type OwnerTokenInstance ¶ added in v0.168.1
type OwnerTokenInstance struct { TokenInstance // contains filtered or unexported fields }
Owner Token
func (OwnerTokenInstance) Mint ¶ added in v0.168.1
func (t OwnerTokenInstance) Mint(transactOpts *bind.TransactOpts, walletAddresses []string, amount *bigint.BigInt) (*types.Transaction, error)
func (OwnerTokenInstance) PackMethod ¶ added in v0.168.1
func (OwnerTokenInstance) RemoteBurn ¶ added in v0.168.1
func (t OwnerTokenInstance) RemoteBurn(transactOpts *bind.TransactOpts, tokenIds []*big.Int) (*types.Transaction, error)
func (OwnerTokenInstance) SetMaxSupply ¶ added in v0.168.1
func (t OwnerTokenInstance) SetMaxSupply(transactOpts *bind.TransactOpts, maxSupply *big.Int) (*types.Transaction, error)
type Service ¶
Collectibles service
func NewService ¶
func NewService(rpcClient *rpc.Client, accountsManager *account.GethManager, pendingTracker *transactions.PendingTxTracker, config *params.NodeConfig, appDb *sql.DB, walletFeed *event.Feed, transactor *transactions.Transactor) *Service
Returns a new Collectibles Service.
func (*Service) CreateCommunityTokenAndSave ¶ added in v0.179.19
func (s *Service) CreateCommunityTokenAndSave(chainID int, deploymentParameters DeploymentParameters, deployerAddress string, contractAddress string, tokenType protobuf.CommunityTokenType, privilegesLevel token.PrivilegesLevel, transactionHash string) (*token.CommunityToken, error)
func (*Service) DeploymentSignatureDigest ¶ added in v0.168.1
func (*Service) GetAssetContractData ¶
func (s *Service) GetAssetContractData(chainID uint64, contractAddress string) (*communities.AssetContractData, error)
func (*Service) GetCollectibleContractData ¶
func (s *Service) GetCollectibleContractData(chainID uint64, contractAddress string) (*communities.CollectibleContractData, error)
func (*Service) GetMasterTokenContractAddressFromHash ¶ added in v0.179.19
func (*Service) GetOwnerTokenContractAddressFromHash ¶ added in v0.179.19
func (*Service) GetSignerPubKey ¶ added in v0.171.1
func (*Service) HashFromTemporaryContractAddress ¶ added in v0.179.24
func (*Service) NewCommunityOwnerTokenRegistryInstance ¶ added in v0.171.1
func (s *Service) NewCommunityOwnerTokenRegistryInstance(chainID uint64, contractAddress string) (*communityownertokenregistry.CommunityOwnerTokenRegistry, error)
func (*Service) NewMasterTokenInstance ¶ added in v0.179.20
func (s *Service) NewMasterTokenInstance(chainID uint64, contractAddress string) (*mastertoken.MasterToken, error)
func (*Service) NewOwnerTokenInstance ¶ added in v0.171.1
func (s *Service) NewOwnerTokenInstance(chainID uint64, contractAddress string) (*ownertoken.OwnerToken, error)
func (*Service) ProcessCommunityTokenAction ¶ added in v0.179.27
func (s *Service) ProcessCommunityTokenAction(message *protobuf.CommunityTokenAction) error
func (*Service) ReTrackOwnerTokenDeploymentTransaction ¶ added in v0.179.24
func (*Service) SafeGetOwnerTokenAddress ¶ added in v0.171.1
func (*Service) SafeGetSignerPubKey ¶ added in v0.171.1
func (*Service) SetSignerPubKey ¶ added in v0.171.1
func (*Service) TemporaryMasterContractAddress ¶ added in v0.179.19
func (*Service) TemporaryOwnerContractAddress ¶ added in v0.179.19
type TokenInstance ¶
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 ¶
func NewTokenInstance(s *Service, chainID uint64, contractAddress string) (TokenInstance, error)