Documentation ¶
Overview ¶
Package sdk provides a client library for the Catapult REST API.
Index ¶
- Constants
- Variables
- func BigIntegerToHex(id *big.Int) string
- func ExtractVersion(version uint64) (uint64, error)
- func FromBigInt(int *big.Int) []uint32
- func GenerateChecksum(b []byte) ([]byte, error)
- func GenerateNamespacePath(name string) ([]*big.Int, error)
- type Account
- type AccountInfo
- type AccountService
- func (a *AccountService) AggregateBondedTransactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]*AggregateTransaction, *http.Response, error)
- func (a *AccountService) GetAccountInfo(ctx context.Context, address *Address) (*AccountInfo, *http.Response, error)
- func (a *AccountService) GetAccountsInfo(ctx context.Context, addresses []*Address) ([]*AccountInfo, *http.Response, error)
- func (a *AccountService) GetMultisigAccountGraphInfo(ctx context.Context, address *Address) (*MultisigAccountGraphInfo, *http.Response, error)
- func (a *AccountService) GetMultisigAccountInfo(ctx context.Context, address *Address) (*MultisigAccountInfo, *http.Response, error)
- func (a *AccountService) IncomingTransactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]Transaction, *http.Response, error)
- func (a *AccountService) OutgoingTransactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]Transaction, *http.Response, error)
- func (a *AccountService) Transactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]Transaction, *http.Response, error)
- func (a *AccountService) UnconfirmedTransactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]Transaction, *http.Response, error)
- type AccountTransactionsOption
- type Address
- type Addresses
- type AggregateTransaction
- func (tx *AggregateTransaction) GetAbstractTransaction() *abstractTransaction
- func (tx *AggregateTransaction) HasMissingSignatures() bool
- func (tx *AggregateTransaction) IsConfirmed() bool
- func (tx *AggregateTransaction) IsUnannounced() bool
- func (tx *AggregateTransaction) IsUnconfirmed() bool
- func (tx *AggregateTransaction) String() string
- type AggregateTransactionCosignature
- type BlockInfo
- type BlockchainService
- func (b *BlockchainService) GetBlockByHeight(ctx context.Context, height *big.Int) (*BlockInfo, *http.Response, error)
- func (b *BlockchainService) GetBlockTransactions(ctx context.Context, height *big.Int) ([]Transaction, *http.Response, error)
- func (b *BlockchainService) GetBlockchainHeight(ctx context.Context) (*big.Int, *http.Response, error)
- func (b *BlockchainService) GetBlockchainScore(ctx context.Context) (*big.Int, *http.Response, error)
- func (b *BlockchainService) GetBlockchainStorage(ctx context.Context) (*BlockchainStorageInfo, *http.Response, error)
- func (b *BlockchainService) GetBlocksByHeightWithLimit(ctx context.Context, height, limit *big.Int) ([]*BlockInfo, *http.Response, error)
- type BlockchainStorageInfo
- type Client
- func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*http.Response, error)
- func (s *Client) DoNewRequest(ctx context.Context, method string, path string, body interface{}, ...) (*http.Response, error)
- func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)
- type ClientWs
- type Config
- type CosignatureSignedTransaction
- type CosignatureTransaction
- type Deadline
- type HashType
- type ListNamespaceInfo
- type LockFundsTransaction
- func (tx *LockFundsTransaction) GetAbstractTransaction() *abstractTransaction
- func (tx *LockFundsTransaction) HasMissingSignatures() bool
- func (tx *LockFundsTransaction) IsConfirmed() bool
- func (tx *LockFundsTransaction) IsUnannounced() bool
- func (tx *LockFundsTransaction) IsUnconfirmed() bool
- func (tx *LockFundsTransaction) String() string
- type Message
- type ModifyMultisigAccountTransaction
- func (tx *ModifyMultisigAccountTransaction) GetAbstractTransaction() *abstractTransaction
- func (tx *ModifyMultisigAccountTransaction) HasMissingSignatures() bool
- func (tx *ModifyMultisigAccountTransaction) IsConfirmed() bool
- func (tx *ModifyMultisigAccountTransaction) IsUnannounced() bool
- func (tx *ModifyMultisigAccountTransaction) IsUnconfirmed() bool
- func (tx *ModifyMultisigAccountTransaction) String() string
- type Mosaic
- type MosaicDefinitionTransaction
- func (tx *MosaicDefinitionTransaction) GetAbstractTransaction() *abstractTransaction
- func (tx *MosaicDefinitionTransaction) HasMissingSignatures() bool
- func (tx *MosaicDefinitionTransaction) IsConfirmed() bool
- func (tx *MosaicDefinitionTransaction) IsUnannounced() bool
- func (tx *MosaicDefinitionTransaction) IsUnconfirmed() bool
- func (tx *MosaicDefinitionTransaction) String() string
- type MosaicId
- type MosaicIds
- type MosaicInfo
- type MosaicName
- type MosaicProperties
- type MosaicService
- func (ref *MosaicService) GetMosaic(ctx context.Context, mosaicId MosaicId) (mscInfo *MosaicInfo, resp *http.Response, err error)
- func (ref *MosaicService) GetMosaicNames(ctx context.Context, mosaicIds MosaicIds) (mscNames []*MosaicName, resp *http.Response, err error)
- func (ref *MosaicService) GetMosaics(ctx context.Context, mosaicIds MosaicIds) (mscInfoArr MosaicsInfo, resp *http.Response, err error)
- func (ref *MosaicService) GetMosaicsFromNamespace(ctx context.Context, namespaceId *NamespaceId, mosaicId *MosaicId, ...) (mscInfo []*MosaicInfo, resp *http.Response, err error)
- type MosaicSupplyChangeTransaction
- func (tx *MosaicSupplyChangeTransaction) GetAbstractTransaction() *abstractTransaction
- func (tx *MosaicSupplyChangeTransaction) HasMissingSignatures() bool
- func (tx *MosaicSupplyChangeTransaction) IsConfirmed() bool
- func (tx *MosaicSupplyChangeTransaction) IsUnannounced() bool
- func (tx *MosaicSupplyChangeTransaction) IsUnconfirmed() bool
- func (tx *MosaicSupplyChangeTransaction) String() string
- type MosaicSupplyType
- type Mosaics
- type MosaicsInfo
- type MultisigAccountGraphInfo
- type MultisigAccountInfo
- type MultisigCosignatoryModification
- type MultisigCosignatoryModificationType
- type NamespaceId
- type NamespaceIds
- type NamespaceInfo
- type NamespaceName
- type NamespaceService
- func (ref *NamespaceService) GetNamespace(ctx context.Context, nsId *NamespaceId) (nsInfo *NamespaceInfo, resp *http.Response, err error)
- func (ref *NamespaceService) GetNamespaceNames(ctx context.Context, nsIds NamespaceIds) (nsList []*NamespaceName, resp *http.Response, err error)
- func (ref *NamespaceService) GetNamespacesFromAccount(ctx context.Context, address *Address, nsId string, pageSize int) (nsList ListNamespaceInfo, resp *http.Response, err error)
- func (ref *NamespaceService) GetNamespacesFromAccounts(ctx context.Context, addresses *Addresses, nsId string, pageSize int) (nsList ListNamespaceInfo, resp *http.Response, err error)
- type NamespaceType
- type NetworkService
- type NetworkType
- type PublicAccount
- type RegisterNamespaceTransaction
- func (tx *RegisterNamespaceTransaction) GetAbstractTransaction() *abstractTransaction
- func (tx *RegisterNamespaceTransaction) HasMissingSignatures() bool
- func (tx *RegisterNamespaceTransaction) IsConfirmed() bool
- func (tx *RegisterNamespaceTransaction) IsUnannounced() bool
- func (tx *RegisterNamespaceTransaction) IsUnconfirmed() bool
- func (tx *RegisterNamespaceTransaction) String() string
- type SecretLockTransaction
- func (tx *SecretLockTransaction) GetAbstractTransaction() *abstractTransaction
- func (tx *SecretLockTransaction) HasMissingSignatures() bool
- func (tx *SecretLockTransaction) IsConfirmed() bool
- func (tx *SecretLockTransaction) IsUnannounced() bool
- func (tx *SecretLockTransaction) IsUnconfirmed() bool
- func (tx *SecretLockTransaction) String() string
- type SecretProofTransaction
- func (tx *SecretProofTransaction) GetAbstractTransaction() *abstractTransaction
- func (tx *SecretProofTransaction) HasMissingSignatures() bool
- func (tx *SecretProofTransaction) IsConfirmed() bool
- func (tx *SecretProofTransaction) IsUnannounced() bool
- func (tx *SecretProofTransaction) IsUnconfirmed() bool
- func (tx *SecretProofTransaction) String() string
- type SignedTransaction
- type SignerInfo
- type StatusInfo
- type Subscribe
- type SubscribeHash
- type SubscribePartialRemoved
- type SubscribeService
- func (c *SubscribeService) Block() (*Subscribe, error)
- func (c *SubscribeService) ConfirmedAdded(add string) (*Subscribe, error)
- func (c *SubscribeService) Cosignature(add string) (*Subscribe, error)
- func (c *SubscribeService) PartialAdded(add string) (*Subscribe, error)
- func (c *SubscribeService) PartialRemoved(add string) (*Subscribe, error)
- func (c *SubscribeService) Status(add string) (*Subscribe, error)
- func (c *SubscribeService) UnconfirmedAdded(add string) (*Subscribe, error)
- func (c *SubscribeService) UnconfirmedRemoved(add string) (*Subscribe, error)
- type Transaction
- type TransactionHashesDTO
- type TransactionIdsDTO
- type TransactionInfo
- type TransactionService
- func (txs *TransactionService) Announce(ctx context.Context, tx *SignedTransaction) (string, *http.Response, error)
- func (txs *TransactionService) AnnounceAggregateBonded(ctx context.Context, tx *SignedTransaction) (string, *http.Response, error)
- func (txs *TransactionService) AnnounceAggregateBondedCosignature(ctx context.Context, c *CosignatureSignedTransaction) (string, *http.Response, error)
- func (txs *TransactionService) GetTransaction(ctx context.Context, id string) (Transaction, *http.Response, error)
- func (txs *TransactionService) GetTransactionStatus(ctx context.Context, id string) (*TransactionStatus, *http.Response, error)
- func (txs *TransactionService) GetTransactionStatuses(ctx context.Context, hashes []string) ([]*TransactionStatus, *http.Response, error)
- func (txs *TransactionService) GetTransactions(ctx context.Context, ids []string) ([]Transaction, *http.Response, error)
- type TransactionStatus
- type TransactionType
- type TransferTransaction
- func (tx *TransferTransaction) GetAbstractTransaction() *abstractTransaction
- func (tx *TransferTransaction) HasMissingSignatures() bool
- func (tx *TransferTransaction) IsConfirmed() bool
- func (tx *TransferTransaction) IsUnannounced() bool
- func (tx *TransferTransaction) IsUnconfirmed() bool
- func (tx *TransferTransaction) String() string
- func (tx *TransferTransaction) ToAggregate(publicAccount *PublicAccount) *abstractTransaction
- type VarSize
Constants ¶
const NUM_CHECKSUM_BYTES = 4
Variables ¶
var TimestampNemesisBlock = time.Unix(1459468800, 0)
var XemMosaicId, _ = NewMosaicId(nil, "nem:xem")
Functions ¶
func ExtractVersion ¶
func FromBigInt ¶
func GenerateChecksum ¶
Types ¶
type Account ¶
type Account struct { *PublicAccount *crypto.KeyPair }
func NewAccount ¶
func NewAccount(pKey string, networkType NetworkType) (*Account, error)
func (*Account) Sign ¶
func (a *Account) Sign(tx Transaction) (*SignedTransaction, error)
Sign a transaction
func (*Account) SignCosignatureTransaction ¶
func (a *Account) SignCosignatureTransaction(tx *CosignatureTransaction) (*CosignatureSignedTransaction, error)
Sign aggregate signature transaction
func (*Account) SignWithCosignatures ¶
func (a *Account) SignWithCosignatures(tx *AggregateTransaction, cosignatories []*Account) (*SignedTransaction, error)
Sign transaction with cosignatories creating a new SignedTransaction
type AccountInfo ¶
type AccountInfo struct { Address *Address AddressHeight *big.Int PublicKey string PublicKeyHeight *big.Int Importance *big.Int ImportanceHeight *big.Int Mosaics []*Mosaic }
func (*AccountInfo) String ¶
func (tx *AccountInfo) String() string
type AccountService ¶
type AccountService service
func (*AccountService) AggregateBondedTransactions ¶
func (a *AccountService) AggregateBondedTransactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]*AggregateTransaction, *http.Response, error)
Gets an array of transactions for which an account is the sender or has sign the transaction. A transaction is said to be aggregate bonded with respect to an account if there are missing signatures.
func (*AccountService) GetAccountInfo ¶
func (a *AccountService) GetAccountInfo(ctx context.Context, address *Address) (*AccountInfo, *http.Response, error)
func (*AccountService) GetAccountsInfo ¶
func (a *AccountService) GetAccountsInfo(ctx context.Context, addresses []*Address) ([]*AccountInfo, *http.Response, error)
Gets AccountsInfo for different accounts.
func (*AccountService) GetMultisigAccountGraphInfo ¶
func (a *AccountService) GetMultisigAccountGraphInfo(ctx context.Context, address *Address) (*MultisigAccountGraphInfo, *http.Response, error)
Gets a MultisigAccountGraphInfo for an account.
func (*AccountService) GetMultisigAccountInfo ¶
func (a *AccountService) GetMultisigAccountInfo(ctx context.Context, address *Address) (*MultisigAccountInfo, *http.Response, error)
Gets a MultisigAccountInfo for an account.
func (*AccountService) IncomingTransactions ¶
func (a *AccountService) IncomingTransactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]Transaction, *http.Response, error)
Gets an array of transactions for which an account is the recipient of a transaction. A transaction is said to be incoming with respect to an account if the account is the recipient of a transaction.
func (*AccountService) OutgoingTransactions ¶
func (a *AccountService) OutgoingTransactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]Transaction, *http.Response, error)
Gets an array of transactions for which an account is the sender a transaction. A transaction is said to be outgoing with respect to an account if the account is the sender of a transaction.
func (*AccountService) Transactions ¶
func (a *AccountService) Transactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]Transaction, *http.Response, error)
Gets an array of confirmed transactions for which an account is signer or receiver.
func (*AccountService) UnconfirmedTransactions ¶
func (a *AccountService) UnconfirmedTransactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]Transaction, *http.Response, error)
Gets the array of transactions for which an account is the sender or receiver and which have not yet been included in a block. Unconfirmed transactions are those transactions that have not yet been included in a block. Unconfirmed transactions are not guaranteed to be included in any block.
type Address ¶
type Address struct { Type NetworkType Address string }
func NewAddress ¶
func NewAddress(address string, networkType NetworkType) *Address
Create an Address from a given raw address
func NewAddressFromEncoded ¶
func NewAddressFromPublicKey ¶
func NewAddressFromPublicKey(pKey string, networkType NetworkType) (*Address, error)
Create an Address from a given raw address.
func NewAddressFromRaw ¶
type Addresses ¶
type Addresses struct { List []*Address // contains filtered or unexported fields }
func (*Addresses) AddAddress ¶
func (*Addresses) MarshalJSON ¶
func (*Addresses) UnmarshalJSON ¶
type AggregateTransaction ¶
type AggregateTransaction struct { InnerTransactions []Transaction Cosignatures []*AggregateTransactionCosignature // contains filtered or unexported fields }
AggregateTransaction
func NewBondedAggregateTransaction ¶
func NewBondedAggregateTransaction(deadline *Deadline, innerTxs []Transaction, networkType NetworkType) (*AggregateTransaction, error)
func NewCompleteAggregateTransaction ¶
func NewCompleteAggregateTransaction(deadline *Deadline, innerTxs []Transaction, networkType NetworkType) (*AggregateTransaction, error)
Create an aggregate complete transaction
func (*AggregateTransaction) GetAbstractTransaction ¶
func (tx *AggregateTransaction) GetAbstractTransaction() *abstractTransaction
func (*AggregateTransaction) HasMissingSignatures ¶
func (tx *AggregateTransaction) HasMissingSignatures() bool
func (*AggregateTransaction) IsConfirmed ¶
func (tx *AggregateTransaction) IsConfirmed() bool
func (*AggregateTransaction) IsUnannounced ¶
func (tx *AggregateTransaction) IsUnannounced() bool
func (*AggregateTransaction) IsUnconfirmed ¶
func (tx *AggregateTransaction) IsUnconfirmed() bool
func (*AggregateTransaction) String ¶
func (tx *AggregateTransaction) String() string
type AggregateTransactionCosignature ¶
type AggregateTransactionCosignature struct { Signature string Signer *PublicAccount }
AggregateTransactionCosignature
func (*AggregateTransactionCosignature) String ¶
func (agt *AggregateTransactionCosignature) String() string
type BlockInfo ¶
type BlockInfo struct { NetworkType Hash string GenerationHash string TotalFee *big.Int NumTransactions uint64 Signature string Signer *PublicAccount Version uint64 Type uint64 Height *big.Int Timestamp *big.Int Difficulty *big.Int PreviousBlockHash string BlockTransactionsHash string }
Models Block
type BlockchainService ¶
type BlockchainService service
func (*BlockchainService) GetBlockByHeight ¶
func (b *BlockchainService) GetBlockByHeight(ctx context.Context, height *big.Int) (*BlockInfo, *http.Response, error)
Get Block Height
func (*BlockchainService) GetBlockTransactions ¶
func (b *BlockchainService) GetBlockTransactions(ctx context.Context, height *big.Int) ([]Transaction, *http.Response, error)
Get Transactions from a block information
func (*BlockchainService) GetBlockchainHeight ¶
func (b *BlockchainService) GetBlockchainHeight(ctx context.Context) (*big.Int, *http.Response, error)
Get the Chain Height
func (*BlockchainService) GetBlockchainScore ¶
func (b *BlockchainService) GetBlockchainScore(ctx context.Context) (*big.Int, *http.Response, error)
Get the Chain Score
func (*BlockchainService) GetBlockchainStorage ¶
func (b *BlockchainService) GetBlockchainStorage(ctx context.Context) (*BlockchainStorageInfo, *http.Response, error)
Get the Storage Information
type BlockchainStorageInfo ¶
type BlockchainStorageInfo struct { NumBlocks int `json:"numBlocks"` NumTransactions int `json:"numTransactions"` NumAccounts int `json:"numAccounts"` }
Blockchain Storage
type Client ¶
type Client struct { // Services for communicating to the Catapult REST APIs Blockchain *BlockchainService Mosaic *MosaicService Namespace *NamespaceService Network *NetworkService Transaction *TransactionService Account *AccountService // contains filtered or unexported fields }
Catapult API Client configuration
func NewClient ¶
NewClient returns a new Catapult API client. If httpClient is nil then it will create http.DefaultClient
type ClientWs ¶
type ClientWs struct { Uid string Subscribe *SubscribeService // contains filtered or unexported fields }
Catapult Websocket Client configuration
func NewConnectWs ¶
type Config ¶
type Config struct { BaseURL *url.URL NetworkType }
Provides service configuration
func LoadMainnetConfig ¶
Mainnet config default
func LoadTestnetConfig ¶
Testnet config default
type CosignatureSignedTransaction ¶
type CosignatureSignedTransaction struct { ParentHash string `json:"parentHash"` Signature string `json:"signature"` Signer string `json:"signer"` }
CosignatureSignedTransaction
type CosignatureTransaction ¶
type CosignatureTransaction struct {
TransactionToCosign *AggregateTransaction
}
func NewCosignatureTransaction ¶
func NewCosignatureTransaction(txToCosign *AggregateTransaction) (*CosignatureTransaction, error)
func (*CosignatureTransaction) String ¶
func (tx *CosignatureTransaction) String() string
type ListNamespaceInfo ¶
type ListNamespaceInfo struct {
// contains filtered or unexported fields
}
ListNamespaceInfo is a list NamespaceInfo
type LockFundsTransaction ¶
type LockFundsTransaction struct { *Mosaic Duration *big.Int *SignedTransaction // contains filtered or unexported fields }
LockFundsTransaction
func NewLockFundsTransaction ¶
func NewLockFundsTransaction(deadline *Deadline, mosaic *Mosaic, duration *big.Int, signedTx *SignedTransaction, networkType NetworkType) (*LockFundsTransaction, error)
func (*LockFundsTransaction) GetAbstractTransaction ¶
func (tx *LockFundsTransaction) GetAbstractTransaction() *abstractTransaction
func (*LockFundsTransaction) HasMissingSignatures ¶
func (tx *LockFundsTransaction) HasMissingSignatures() bool
func (*LockFundsTransaction) IsConfirmed ¶
func (tx *LockFundsTransaction) IsConfirmed() bool
func (*LockFundsTransaction) IsUnannounced ¶
func (tx *LockFundsTransaction) IsUnannounced() bool
func (*LockFundsTransaction) IsUnconfirmed ¶
func (tx *LockFundsTransaction) IsUnconfirmed() bool
func (*LockFundsTransaction) String ¶
func (tx *LockFundsTransaction) String() string
type ModifyMultisigAccountTransaction ¶
type ModifyMultisigAccountTransaction struct { MinApprovalDelta int32 MinRemovalDelta int32 Modifications []*MultisigCosignatoryModification // contains filtered or unexported fields }
ModifyMultisigAccountTransaction
func NewModifyMultisigAccountTransaction ¶
func NewModifyMultisigAccountTransaction(deadline *Deadline, minApprovalDelta int32, minRemovalDelta int32, modifications []*MultisigCosignatoryModification, networkType NetworkType) (*ModifyMultisigAccountTransaction, error)
func (*ModifyMultisigAccountTransaction) GetAbstractTransaction ¶
func (tx *ModifyMultisigAccountTransaction) GetAbstractTransaction() *abstractTransaction
func (*ModifyMultisigAccountTransaction) HasMissingSignatures ¶
func (tx *ModifyMultisigAccountTransaction) HasMissingSignatures() bool
func (*ModifyMultisigAccountTransaction) IsConfirmed ¶
func (tx *ModifyMultisigAccountTransaction) IsConfirmed() bool
func (*ModifyMultisigAccountTransaction) IsUnannounced ¶
func (tx *ModifyMultisigAccountTransaction) IsUnannounced() bool
func (*ModifyMultisigAccountTransaction) IsUnconfirmed ¶
func (tx *ModifyMultisigAccountTransaction) IsUnconfirmed() bool
func (*ModifyMultisigAccountTransaction) String ¶
func (tx *ModifyMultisigAccountTransaction) String() string
type MosaicDefinitionTransaction ¶
type MosaicDefinitionTransaction struct { *MosaicProperties *NamespaceId *MosaicId MosaicName string // contains filtered or unexported fields }
MosaicDefinitionTransaction
func NewMosaicDefinitionTransaction ¶
func NewMosaicDefinitionTransaction(deadline *Deadline, mosaicName string, namespaceName string, mosaicProps *MosaicProperties, networkType NetworkType) (*MosaicDefinitionTransaction, error)
func (*MosaicDefinitionTransaction) GetAbstractTransaction ¶
func (tx *MosaicDefinitionTransaction) GetAbstractTransaction() *abstractTransaction
func (*MosaicDefinitionTransaction) HasMissingSignatures ¶
func (tx *MosaicDefinitionTransaction) HasMissingSignatures() bool
func (*MosaicDefinitionTransaction) IsConfirmed ¶
func (tx *MosaicDefinitionTransaction) IsConfirmed() bool
func (*MosaicDefinitionTransaction) IsUnannounced ¶
func (tx *MosaicDefinitionTransaction) IsUnannounced() bool
func (*MosaicDefinitionTransaction) IsUnconfirmed ¶
func (tx *MosaicDefinitionTransaction) IsUnconfirmed() bool
func (*MosaicDefinitionTransaction) String ¶
func (tx *MosaicDefinitionTransaction) String() string
type MosaicIds ¶
type MosaicIds struct {
MosaicIds []*MosaicId `json:"mosaicIds"`
}
MosaicIds is a list MosaicId
func (*MosaicIds) MarshalJSON ¶
type MosaicInfo ¶
type MosaicInfo struct { Active bool Index int MetaId string NamespaceId *NamespaceId MosaicId *MosaicId Supply *big.Int Height *big.Int Owner *PublicAccount Properties *MosaicProperties }
MosaicInfo info structure contains its properties, the owner and the namespace to which it belongs to.
type MosaicName ¶
type MosaicName struct { MosaicId *MosaicId Name string ParentId *NamespaceId }
type MosaicProperties ¶
type MosaicProperties struct { SupplyMutable bool Transferable bool LevyMutable bool Divisibility int64 Duration *big.Int }
MosaicProperties structure describes mosaic properties.
func NewMosaicProperties ¶
func (*MosaicProperties) String ¶
func (mp *MosaicProperties) String() string
type MosaicService ¶
type MosaicService service
func (*MosaicService) GetMosaic ¶
func (ref *MosaicService) GetMosaic(ctx context.Context, mosaicId MosaicId) (mscInfo *MosaicInfo, resp *http.Response, err error)
mosaics get mosaics Info @get /mosaic/{mosaicId}
func (*MosaicService) GetMosaicNames ¶
func (ref *MosaicService) GetMosaicNames(ctx context.Context, mosaicIds MosaicIds) (mscNames []*MosaicName, resp *http.Response, err error)
GetMosaicNames Get readable names for a set of mosaics post @/mosaic/names
func (*MosaicService) GetMosaics ¶
func (ref *MosaicService) GetMosaics(ctx context.Context, mosaicIds MosaicIds) (mscInfoArr MosaicsInfo, resp *http.Response, err error)
GetMosaics get list mosaics Info post @/mosaic/
func (*MosaicService) GetMosaicsFromNamespace ¶
func (ref *MosaicService) GetMosaicsFromNamespace(ctx context.Context, namespaceId *NamespaceId, mosaicId *MosaicId, pageSize int) (mscInfo []*MosaicInfo, resp *http.Response, err error)
GetMosaicsFromNamespace Get mosaics information from namespaceId (nsId) get @/namespaces/{namespaceId}/mosaic/
type MosaicSupplyChangeTransaction ¶
type MosaicSupplyChangeTransaction struct { MosaicSupplyType *MosaicId Delta *big.Int // contains filtered or unexported fields }
MosaicSupplyChangeTransaction
func NewMosaicSupplyChangeTransaction ¶
func NewMosaicSupplyChangeTransaction(deadline *Deadline, mosaicId *MosaicId, supplyType MosaicSupplyType, delta *big.Int, networkType NetworkType) (*MosaicSupplyChangeTransaction, error)
func (*MosaicSupplyChangeTransaction) GetAbstractTransaction ¶
func (tx *MosaicSupplyChangeTransaction) GetAbstractTransaction() *abstractTransaction
func (*MosaicSupplyChangeTransaction) HasMissingSignatures ¶
func (tx *MosaicSupplyChangeTransaction) HasMissingSignatures() bool
func (*MosaicSupplyChangeTransaction) IsConfirmed ¶
func (tx *MosaicSupplyChangeTransaction) IsConfirmed() bool
func (*MosaicSupplyChangeTransaction) IsUnannounced ¶
func (tx *MosaicSupplyChangeTransaction) IsUnannounced() bool
func (*MosaicSupplyChangeTransaction) IsUnconfirmed ¶
func (tx *MosaicSupplyChangeTransaction) IsUnconfirmed() bool
func (*MosaicSupplyChangeTransaction) String ¶
func (tx *MosaicSupplyChangeTransaction) String() string
type MosaicSupplyType ¶
type MosaicSupplyType uint8
MosaicSupplyType mosaic supply type : Decrease the supply - DECREASE. Increase the supply - INCREASE.
const ( Decrease MosaicSupplyType = iota Increase )
func (MosaicSupplyType) String ¶
func (tx MosaicSupplyType) String() string
type MosaicsInfo ¶
type MosaicsInfo []*MosaicInfo
func (MosaicsInfo) String ¶
func (ref MosaicsInfo) String() string
type MultisigAccountGraphInfo ¶
type MultisigAccountGraphInfo struct {
MultisigAccounts map[int32][]*MultisigAccountInfo
}
type MultisigAccountInfo ¶
type MultisigAccountInfo struct { Account PublicAccount MinApproval int32 MinRemoval int32 Cosignatories []*PublicAccount MultisigAccounts []*PublicAccount }
func (*MultisigAccountInfo) String ¶
func (ref *MultisigAccountInfo) String() string
type MultisigCosignatoryModification ¶
type MultisigCosignatoryModification struct { Type MultisigCosignatoryModificationType *PublicAccount }
MultisigCosignatoryModification
func (*MultisigCosignatoryModification) String ¶
func (m *MultisigCosignatoryModification) String() string
type MultisigCosignatoryModificationType ¶
type MultisigCosignatoryModificationType uint8
const ( Add MultisigCosignatoryModificationType = iota Remove )
func (MultisigCosignatoryModificationType) String ¶
func (t MultisigCosignatoryModificationType) String() string
type NamespaceId ¶
NamespaceId
func NewNamespaceId ¶
func NewNamespaceId(id *big.Int) (*NamespaceId, error)
NewNamespaceId generate new NamespaceId from bigInt
func NewNamespaceIdFromName ¶
func NewNamespaceIdFromName(namespaceName string) (*NamespaceId, error)
NewNamespaceIdFromName generate Id from namespaceName
func (*NamespaceId) Equals ¶
func (ref *NamespaceId) Equals(nsId NamespaceId) bool
Equals compares namespaceIds for equality
type NamespaceIds ¶
type NamespaceIds struct {
List []*NamespaceId
}
NamespaceIds is a list of NamespaceId
func (*NamespaceIds) Decode ¶
func (ref *NamespaceIds) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)
func (*NamespaceIds) Encode ¶
func (ref *NamespaceIds) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)
func (*NamespaceIds) MarshalJSON ¶
func (ref *NamespaceIds) MarshalJSON() (buf []byte, err error)
type NamespaceInfo ¶
type NamespaceInfo struct { Active bool Index int MetaId string TypeSpace NamespaceType Depth int Levels []*NamespaceId ParentId *NamespaceId Owner *PublicAccount StartHeight *big.Int EndHeight *big.Int }
NamespaceInfo contains the state information of a Namespace.
func (*NamespaceInfo) String ¶
func (ref *NamespaceInfo) String() string
type NamespaceName ¶
type NamespaceName struct { NamespaceId *NamespaceId Name string ParentId *NamespaceId /* Optional NamespaceId my be nil */ }
NamespaceName name info structure describes basic information of a namespace and name.
type NamespaceService ¶
type NamespaceService service
NamespaceService provides a set of methods for obtaining information about the namespace
func NewNamespaceService ¶
func NewNamespaceService(httpClient *http.Client, conf *Config) *NamespaceService
func (*NamespaceService) GetNamespace ¶
func (ref *NamespaceService) GetNamespace(ctx context.Context, nsId *NamespaceId) (nsInfo *NamespaceInfo, resp *http.Response, err error)
func (*NamespaceService) GetNamespaceNames ¶
func (ref *NamespaceService) GetNamespaceNames(ctx context.Context, nsIds NamespaceIds) (nsList []*NamespaceName, resp *http.Response, err error)
GetNamespaceNames
func (*NamespaceService) GetNamespacesFromAccount ¶
func (ref *NamespaceService) GetNamespacesFromAccount(ctx context.Context, address *Address, nsId string, pageSize int) (nsList ListNamespaceInfo, resp *http.Response, err error)
GetNamespacesFromAccount get required params addresses, other skipped if value < 0
func (*NamespaceService) GetNamespacesFromAccounts ¶
func (ref *NamespaceService) GetNamespacesFromAccounts(ctx context.Context, addresses *Addresses, nsId string, pageSize int) (nsList ListNamespaceInfo, resp *http.Response, err error)
GetNamespacesFromAccounts get required params addresses, other skipped if value is empty
type NetworkService ¶
type NetworkService service
func (*NetworkService) GetNetworkType ¶
func (ref *NetworkService) GetNetworkType(ctx context.Context) (mscInfo NetworkType, resp *http.Response, err error)
mosaics get mosaics Info @get /network
type NetworkType ¶
type NetworkType uint8
const ( MainNet NetworkType = 104 TestNet NetworkType = 152 Mijin NetworkType = 96 MijinTest NetworkType = 144 NotSupportedNet NetworkType = 0 )
NetworkType enums
func ExtractNetworkType ¶
func ExtractNetworkType(version uint64) NetworkType
func (NetworkType) String ¶
func (nt NetworkType) String() string
type PublicAccount ¶
func NewPublicAccount ¶
func NewPublicAccount(pKey string, networkType NetworkType) (*PublicAccount, error)
func (*PublicAccount) String ¶
func (ref *PublicAccount) String() string
type RegisterNamespaceTransaction ¶
type RegisterNamespaceTransaction struct { *NamespaceId NamespaceType NamspaceName string Duration *big.Int ParentId *NamespaceId // contains filtered or unexported fields }
RegisterNamespaceTransaction
func NewRegisterRootNamespaceTransaction ¶
func NewRegisterRootNamespaceTransaction(deadline *Deadline, namespaceName string, duration *big.Int, networkType NetworkType) (*RegisterNamespaceTransaction, error)
func NewRegisterSubNamespaceTransaction ¶
func NewRegisterSubNamespaceTransaction(deadline *Deadline, namespaceName string, parentId *NamespaceId, networkType NetworkType) (*RegisterNamespaceTransaction, error)
func (*RegisterNamespaceTransaction) GetAbstractTransaction ¶
func (tx *RegisterNamespaceTransaction) GetAbstractTransaction() *abstractTransaction
func (*RegisterNamespaceTransaction) HasMissingSignatures ¶
func (tx *RegisterNamespaceTransaction) HasMissingSignatures() bool
func (*RegisterNamespaceTransaction) IsConfirmed ¶
func (tx *RegisterNamespaceTransaction) IsConfirmed() bool
func (*RegisterNamespaceTransaction) IsUnannounced ¶
func (tx *RegisterNamespaceTransaction) IsUnannounced() bool
func (*RegisterNamespaceTransaction) IsUnconfirmed ¶
func (tx *RegisterNamespaceTransaction) IsUnconfirmed() bool
func (*RegisterNamespaceTransaction) String ¶
func (tx *RegisterNamespaceTransaction) String() string
type SecretLockTransaction ¶
type SecretLockTransaction struct { *Mosaic HashType Duration *big.Int Secret string Recipient *Address // contains filtered or unexported fields }
SecretLockTransaction
func NewSecretLockTransaction ¶
func NewSecretLockTransaction(deadline *Deadline, mosaic *Mosaic, duration *big.Int, hashType HashType, secret string, recipient *Address, networkType NetworkType) (*SecretLockTransaction, error)
func (*SecretLockTransaction) GetAbstractTransaction ¶
func (tx *SecretLockTransaction) GetAbstractTransaction() *abstractTransaction
func (*SecretLockTransaction) HasMissingSignatures ¶
func (tx *SecretLockTransaction) HasMissingSignatures() bool
func (*SecretLockTransaction) IsConfirmed ¶
func (tx *SecretLockTransaction) IsConfirmed() bool
func (*SecretLockTransaction) IsUnannounced ¶
func (tx *SecretLockTransaction) IsUnannounced() bool
func (*SecretLockTransaction) IsUnconfirmed ¶
func (tx *SecretLockTransaction) IsUnconfirmed() bool
func (*SecretLockTransaction) String ¶
func (tx *SecretLockTransaction) String() string
type SecretProofTransaction ¶
type SecretProofTransaction struct { HashType Secret string Proof string // contains filtered or unexported fields }
SecretProofTransaction
func NewSecretProofTransaction ¶
func NewSecretProofTransaction(deadline *Deadline, hashType HashType, secret string, proof string, networkType NetworkType) (*SecretProofTransaction, error)
func (*SecretProofTransaction) GetAbstractTransaction ¶
func (tx *SecretProofTransaction) GetAbstractTransaction() *abstractTransaction
func (*SecretProofTransaction) HasMissingSignatures ¶
func (tx *SecretProofTransaction) HasMissingSignatures() bool
func (*SecretProofTransaction) IsConfirmed ¶
func (tx *SecretProofTransaction) IsConfirmed() bool
func (*SecretProofTransaction) IsUnannounced ¶
func (tx *SecretProofTransaction) IsUnannounced() bool
func (*SecretProofTransaction) IsUnconfirmed ¶
func (tx *SecretProofTransaction) IsUnconfirmed() bool
func (*SecretProofTransaction) String ¶
func (tx *SecretProofTransaction) String() string
type SignedTransaction ¶
type SignedTransaction struct { TransactionType `json:"transactionType"` Payload string `json:"payload"` Hash string `json:"hash"` }
SignedTransaction
type SignerInfo ¶
type StatusInfo ¶
type Subscribe ¶
type Subscribe struct { Uid string `json:"uid"` Subscribe string `json:"subscribe"` ChIn chan interface{} // contains filtered or unexported fields }
func (*Subscribe) Unsubscribe ¶
Unsubscribe terminates the specified subscription. It does not have any specific param.
type SubscribeHash ¶
type SubscribeHash struct {
Hash string `json:"hash"`
}
structure for Subscribe status
type SubscribePartialRemoved ¶
type SubscribePartialRemoved struct {
Meta SubscribeHash `json:"meta"`
}
structure for Subscribe PartialRemoved
type SubscribeService ¶
type SubscribeService serviceWs
func (*SubscribeService) Block ¶
func (c *SubscribeService) Block() (*Subscribe, error)
Block notifies for every new block. The message contains the BlockInfo struct.
func (*SubscribeService) ConfirmedAdded ¶
func (c *SubscribeService) ConfirmedAdded(add string) (*Subscribe, error)
ConfirmedAdded notifies when a transaction related to an address is included in a block. The message contains the transaction.
func (*SubscribeService) Cosignature ¶
func (c *SubscribeService) Cosignature(add string) (*Subscribe, error)
Cosignature notifies when a cosignature signed transaction related to an address is added to an aggregate bonded transaction with partial state. The message contains the cosignature signed transaction.
func (*SubscribeService) PartialAdded ¶
func (c *SubscribeService) PartialAdded(add string) (*Subscribe, error)
PartialAdded notifies when an aggregate bonded transaction related to an address is in partial state and waiting to have all required cosigners. The message contains a transaction.
func (*SubscribeService) PartialRemoved ¶
func (c *SubscribeService) PartialRemoved(add string) (*Subscribe, error)
PartialRemoved notifies when a transaction related to an address was in partial state but not anymore. The message contains the transaction hash.
func (*SubscribeService) Status ¶
func (c *SubscribeService) Status(add string) (*Subscribe, error)
Status notifies when a transaction related to an address rises an error. The message contains the error message and the transaction hash.
func (*SubscribeService) UnconfirmedAdded ¶
func (c *SubscribeService) UnconfirmedAdded(add string) (*Subscribe, error)
UnconfirmedAdded notifies when a transaction related to an address is in unconfirmed state and waiting to be included in a block. The message contains the transaction.
func (*SubscribeService) UnconfirmedRemoved ¶
func (c *SubscribeService) UnconfirmedRemoved(add string) (*Subscribe, error)
UnconfirmedRemoved notifies when a transaction related to an address was in unconfirmed state but not anymore. The message contains the transaction hash.
type Transaction ¶
type Transaction interface { GetAbstractTransaction() *abstractTransaction String() string // contains filtered or unexported methods }
Models Transaction
func MapTransaction ¶
func MapTransaction(b *bytes.Buffer) (Transaction, error)
func MapTransactions ¶
func MapTransactions(b *bytes.Buffer) ([]Transaction, error)
type TransactionHashesDTO ¶
type TransactionHashesDTO struct {
Hashes []string `json:"hashes"`
}
TransactionHashes
type TransactionIdsDTO ¶
type TransactionIdsDTO struct {
Ids []string `json:"transactionIds"`
}
TransactionIds
type TransactionInfo ¶
type TransactionInfo struct { Height *big.Int Index uint32 Id string Hash string MerkleComponentHash string AggregateHash string AggregateId string }
Transaction Info
func (*TransactionInfo) String ¶
func (ti *TransactionInfo) String() string
type TransactionService ¶
type TransactionService service
func (*TransactionService) Announce ¶
func (txs *TransactionService) Announce(ctx context.Context, tx *SignedTransaction) (string, *http.Response, error)
Announce a transaction to the network
func (*TransactionService) AnnounceAggregateBonded ¶
func (txs *TransactionService) AnnounceAggregateBonded(ctx context.Context, tx *SignedTransaction) (string, *http.Response, error)
Announce a partial transaction to the network
func (*TransactionService) AnnounceAggregateBondedCosignature ¶
func (txs *TransactionService) AnnounceAggregateBondedCosignature(ctx context.Context, c *CosignatureSignedTransaction) (string, *http.Response, error)
Announce a cosignature transaction to the network
func (*TransactionService) GetTransaction ¶
func (txs *TransactionService) GetTransaction(ctx context.Context, id string) (Transaction, *http.Response, error)
Returns transaction information for a given transaction id or hash
func (*TransactionService) GetTransactionStatus ¶
func (txs *TransactionService) GetTransactionStatus(ctx context.Context, id string) (*TransactionStatus, *http.Response, error)
Returns transaction status for a given transaction id or hash
func (*TransactionService) GetTransactionStatuses ¶
func (txs *TransactionService) GetTransactionStatuses(ctx context.Context, hashes []string) ([]*TransactionStatus, *http.Response, error)
Returns transaction information for a given set of transaction hash
func (*TransactionService) GetTransactions ¶
func (txs *TransactionService) GetTransactions(ctx context.Context, ids []string) ([]Transaction, *http.Response, error)
Returns transaction information for a given set of transaction id or hash
type TransactionStatus ¶
TransactionStatus
func (*TransactionStatus) String ¶
func (ts *TransactionStatus) String() string
type TransactionType ¶
type TransactionType uint16
const ( AggregateCompleted TransactionType = iota AggregateBonded MosaicDefinition MosaicSupplyChange ModifyMultisig RegisterNamespace Transfer Lock SecretLock SecretProof )
TransactionType enums
func TransactionTypeFromRaw ¶
func TransactionTypeFromRaw(value uint32) (TransactionType, error)
func (TransactionType) Hex ¶
func (t TransactionType) Hex() uint16
func (TransactionType) Raw ¶
func (t TransactionType) Raw() uint32
func (TransactionType) String ¶
func (t TransactionType) String() string
type TransferTransaction ¶
type TransferTransaction struct { *Message Mosaics Mosaics Recipient *Address // contains filtered or unexported fields }
TransferTransaction
func NewTransferTransaction ¶
func NewTransferTransaction(deadline *Deadline, recipient *Address, mosaics Mosaics, message *Message, networkType NetworkType) (*TransferTransaction, error)
Create a transfer transaction
func (*TransferTransaction) GetAbstractTransaction ¶
func (tx *TransferTransaction) GetAbstractTransaction() *abstractTransaction
func (*TransferTransaction) HasMissingSignatures ¶
func (tx *TransferTransaction) HasMissingSignatures() bool
func (*TransferTransaction) IsConfirmed ¶
func (tx *TransferTransaction) IsConfirmed() bool
func (*TransferTransaction) IsUnannounced ¶
func (tx *TransferTransaction) IsUnannounced() bool
func (*TransferTransaction) IsUnconfirmed ¶
func (tx *TransferTransaction) IsUnconfirmed() bool
func (*TransferTransaction) String ¶
func (tx *TransferTransaction) String() string
func (*TransferTransaction) ToAggregate ¶
func (tx *TransferTransaction) ToAggregate(publicAccount *PublicAccount) *abstractTransaction
Convert an aggregate transaction to an inner transaction including transaction signer
Source Files ¶
- account.go
- account_model.go
- blockchain.go
- blockchain_model.go
- consts.go
- errors.go
- mosaic.go
- mosaic_model.go
- namespace.go
- namespace_model.go
- network.go
- network_model.go
- sdk.go
- sdk_model.go
- sdk_schema.go
- signer_info.go
- status_info.go
- subscribe_block.go
- transaction.go
- transaction_model.go
- transaction_schema.go
- websocket.go