Documentation
¶
Overview ¶
Package sdk provides a client library for the Catapult REST API.
Index ¶
- Constants
- Variables
- func GenerateChecksum(b []byte) ([]byte, error)
- func NewReputationConfig(minInter uint64, defaultRep float64) (*reputationConfig, error)
- type AbstractTransaction
- func (tx *AbstractTransaction) HasMissingSignatures() bool
- func (tx *AbstractTransaction) IsConfirmed() bool
- func (tx *AbstractTransaction) IsUnannounced() bool
- func (tx *AbstractTransaction) IsUnconfirmed() bool
- func (tx *AbstractTransaction) String() string
- func (tx *AbstractTransaction) ToAggregate(signer *PublicAccount)
- type Account
- func (a *Account) DecryptMessage(encryptedMessage *SecureMessage, senderPublicAccount *PublicAccount) (*PlainMessage, error)
- func (a *Account) EncryptMessage(message string, recipientPublicAccount *PublicAccount) (*SecureMessage, error)
- func (a *Account) Sign(tx Transaction) (*SignedTransaction, error)
- func (a *Account) SignCosignatureTransaction(tx *CosignatureTransaction) (*CosignatureSignedTransaction, error)
- func (a *Account) SignWithCosignatures(tx *AggregateTransaction, cosignatories []*Account) (*SignedTransaction, error)
- type AccountInfo
- type AccountLinkAction
- type AccountLinkTransaction
- type AccountName
- type AccountProperties
- type AccountPropertiesAddressModification
- type AccountPropertiesAddressTransaction
- type AccountPropertiesEntityTypeModification
- type AccountPropertiesEntityTypeTransaction
- type AccountPropertiesMosaicModification
- type AccountPropertiesMosaicTransaction
- type AccountService
- func (a *AccountService) AggregateBondedTransactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]*AggregateTransaction, error)
- func (a *AccountService) GetAccountInfo(ctx context.Context, address *Address) (*AccountInfo, error)
- func (ref *AccountService) GetAccountNames(ctx context.Context, addr ...*Address) ([]*AccountName, error)
- func (a *AccountService) GetAccountProperties(ctx context.Context, address *Address) (*AccountProperties, error)
- func (a *AccountService) GetAccountsInfo(ctx context.Context, addresses ...*Address) ([]*AccountInfo, error)
- func (a *AccountService) GetAccountsProperties(ctx context.Context, addresses ...*Address) ([]*AccountProperties, error)
- func (a *AccountService) GetMultisigAccountGraphInfo(ctx context.Context, address *Address) (*MultisigAccountGraphInfo, error)
- func (a *AccountService) GetMultisigAccountInfo(ctx context.Context, address *Address) (*MultisigAccountInfo, error)
- func (a *AccountService) IncomingTransactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]Transaction, error)
- func (a *AccountService) OutgoingTransactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]Transaction, error)
- func (a *AccountService) Transactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]Transaction, error)
- func (a *AccountService) UnconfirmedTransactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]Transaction, error)
- type AccountTransactionsOption
- type AccountType
- type Address
- func EncodedStringToAddresses(addresses ...string) ([]*Address, error)
- func NewAddress(address string, networkType NetworkType) *Address
- func NewAddressFromBase32(encoded string) (*Address, error)
- func NewAddressFromNamespace(namespaceId *NamespaceId) (*Address, error)
- func NewAddressFromPublicKey(pKey string, networkType NetworkType) (*Address, error)
- func NewAddressFromRaw(address string) (*Address, error)
- type AddressAliasTransaction
- type AddressMetadataInfo
- type AggregateTransaction
- type AggregateTransactionCosignature
- type AliasActionType
- type AliasTransaction
- type AliasType
- type Amount
- type AssetId
- type AssetIdType
- type BlockChainVersion
- type BlockInfo
- type BlockMapper
- type BlockMapperFn
- type BlockchainConfig
- type BlockchainService
- func (b *BlockchainService) GetBlockByHeight(ctx context.Context, height Height) (*BlockInfo, error)
- func (b *BlockchainService) GetBlockTransactions(ctx context.Context, height Height) ([]Transaction, error)
- func (b *BlockchainService) GetBlockchainHeight(ctx context.Context) (Height, error)
- func (b *BlockchainService) GetBlockchainScore(ctx context.Context) (*ChainScore, error)
- func (b *BlockchainService) GetBlockchainStorage(ctx context.Context) (*BlockchainStorageInfo, error)
- func (b *BlockchainService) GetBlocksByHeightWithLimit(ctx context.Context, height Height, limit Amount) ([]*BlockInfo, error)
- type BlockchainStorageInfo
- type BlockchainTimestamp
- type BlockchainUpgradeTransaction
- type ChainScore
- type Client
- func (c *Client) AdaptAccount(account *Account) (*Account, error)
- func (c *Client) GenerationHash() *Hash
- func (c *Client) NetworkType() NetworkType
- func (c *Client) NewAccount() (*Account, error)
- func (c *Client) NewAccountFromPrivateKey(pKey string) (*Account, error)
- func (c *Client) NewAccountFromPublicKey(pKey string) (*PublicAccount, error)
- func (c *Client) NewAccountLinkTransaction(deadline *Deadline, remoteAccount *PublicAccount, linkAction AccountLinkAction) (*AccountLinkTransaction, error)
- func (c *Client) NewAccountPropertiesAddressTransaction(deadline *Deadline, propertyType PropertyType, ...) (*AccountPropertiesAddressTransaction, error)
- func (c *Client) NewAccountPropertiesEntityTypeTransaction(deadline *Deadline, propertyType PropertyType, ...) (*AccountPropertiesEntityTypeTransaction, error)
- func (c *Client) NewAccountPropertiesMosaicTransaction(deadline *Deadline, propertyType PropertyType, ...) (*AccountPropertiesMosaicTransaction, error)
- func (c *Client) NewAddressAliasTransaction(deadline *Deadline, address *Address, namespaceId *NamespaceId, ...) (*AddressAliasTransaction, error)
- func (c *Client) NewBlockchainUpgradeTransaction(deadline *Deadline, upgradePeriod Duration, ...) (*BlockchainUpgradeTransaction, error)
- func (c *Client) NewBondedAggregateTransaction(deadline *Deadline, innerTxs []Transaction) (*AggregateTransaction, error)
- func (c *Client) NewCompleteAggregateTransaction(deadline *Deadline, innerTxs []Transaction) (*AggregateTransaction, error)
- func (c *Client) NewLockFundsTransaction(deadline *Deadline, mosaic *Mosaic, duration Duration, ...) (*LockFundsTransaction, error)
- func (c *Client) NewModifyContractTransaction(deadline *Deadline, durationDelta Duration, hash *Hash, ...) (*ModifyContractTransaction, error)
- func (c *Client) NewModifyMetadataAddressTransaction(deadline *Deadline, address *Address, modifications []*MetadataModification) (*ModifyMetadataAddressTransaction, error)
- func (c *Client) NewModifyMetadataMosaicTransaction(deadline *Deadline, mosaicId *MosaicId, modifications []*MetadataModification) (*ModifyMetadataMosaicTransaction, error)
- func (c *Client) NewModifyMetadataNamespaceTransaction(deadline *Deadline, namespaceId *NamespaceId, ...) (*ModifyMetadataNamespaceTransaction, error)
- func (c *Client) NewModifyMultisigAccountTransaction(deadline *Deadline, minApprovalDelta int8, minRemovalDelta int8, ...) (*ModifyMultisigAccountTransaction, error)
- func (c *Client) NewMosaicAliasTransaction(deadline *Deadline, mosaicId *MosaicId, namespaceId *NamespaceId, ...) (*MosaicAliasTransaction, error)
- func (c *Client) NewMosaicDefinitionTransaction(deadline *Deadline, nonce uint32, ownerPublicKey string, ...) (*MosaicDefinitionTransaction, error)
- func (c *Client) NewMosaicSupplyChangeTransaction(deadline *Deadline, assetId AssetId, supplyType MosaicSupplyType, ...) (*MosaicSupplyChangeTransaction, error)
- func (c *Client) NewNetworkConfigTransaction(deadline *Deadline, delta Duration, config *NetworkConfig, ...) (*NetworkConfigTransaction, error)
- func (c *Client) NewRegisterRootNamespaceTransaction(deadline *Deadline, namespaceName string, duration Duration) (*RegisterNamespaceTransaction, error)
- func (c *Client) NewRegisterSubNamespaceTransaction(deadline *Deadline, namespaceName string, parentId *NamespaceId) (*RegisterNamespaceTransaction, error)
- func (c *Client) NewSecretLockTransaction(deadline *Deadline, mosaic *Mosaic, duration Duration, secret *Secret, ...) (*SecretLockTransaction, error)
- func (c *Client) NewSecretProofTransaction(deadline *Deadline, hashType HashType, proof *Proof, recipient *Address) (*SecretProofTransaction, error)
- func (c *Client) NewTransferTransaction(deadline *Deadline, recipient *Address, mosaics []*Mosaic, message Message) (*TransferTransaction, error)
- func (c *Client) NewTransferTransactionWithNamespace(deadline *Deadline, recipient *NamespaceId, mosaics []*Mosaic, message Message) (*TransferTransaction, error)
- type Config
- type ConfigBag
- type ConfirmedAddedMapper
- type ContractInfo
- type ContractService
- type CosignatureMapper
- type CosignatureMapperFn
- type CosignatureSignedTransaction
- type CosignatureTransaction
- type Deadline
- type Difficulty
- type Duration
- type Entity
- type EntityType
- type EntityVersion
- type FeeCalculationStrategy
- type Field
- type Hash
- type HashType
- type Height
- type HttpError
- type LockFundsTransaction
- type Message
- type MessageType
- type MetadataInfo
- type MetadataModification
- type MetadataModificationType
- type MetadataService
- func (ref *MetadataService) GetAddressMetadatasInfo(ctx context.Context, addresses ...string) ([]*AddressMetadataInfo, error)
- func (ref *MetadataService) GetMetadataByAddress(ctx context.Context, address string) (*AddressMetadataInfo, error)
- func (ref *MetadataService) GetMetadataByMosaicId(ctx context.Context, mosaicId *MosaicId) (*MosaicMetadataInfo, error)
- func (ref *MetadataService) GetMetadataByNamespaceId(ctx context.Context, namespaceId *NamespaceId) (*NamespaceMetadataInfo, error)
- func (ref *MetadataService) GetMosaicMetadatasInfo(ctx context.Context, mosaicIds ...*MosaicId) ([]*MosaicMetadataInfo, error)
- func (ref *MetadataService) GetNamespaceMetadatasInfo(ctx context.Context, namespaceIds ...*NamespaceId) ([]*NamespaceMetadataInfo, error)
- type MetadataType
- type ModifyContractTransaction
- type ModifyMetadataAddressTransaction
- type ModifyMetadataMosaicTransaction
- type ModifyMetadataNamespaceTransaction
- type ModifyMetadataTransaction
- type ModifyMultisigAccountTransaction
- type Mosaic
- type MosaicAliasTransaction
- type MosaicDefinitionTransaction
- type MosaicId
- type MosaicInfo
- type MosaicMetadataInfo
- type MosaicName
- type MosaicProperties
- type MosaicPropertiesHeader
- type MosaicProperty
- type MosaicPropertyId
- type MosaicService
- func (ref *MosaicService) GetMosaicInfo(ctx context.Context, mosaicId *MosaicId) (*MosaicInfo, error)
- func (ref *MosaicService) GetMosaicInfos(ctx context.Context, mscIds []*MosaicId) ([]*MosaicInfo, error)
- func (ref *MosaicService) GetMosaicsNames(ctx context.Context, mscIds ...*MosaicId) ([]*MosaicName, error)
- type MosaicSupplyChangeTransaction
- type MosaicSupplyType
- type MultisigAccountGraphInfo
- type MultisigAccountInfo
- type MultisigCosignatoryModification
- type MultisigCosignatoryModificationType
- type NamespaceAlias
- type NamespaceId
- type NamespaceInfo
- type NamespaceMetadataInfo
- type NamespaceName
- type NamespaceService
- func (ref *NamespaceService) GetLinkedAddress(ctx context.Context, namespaceId *NamespaceId) (*Address, error)
- func (ref *NamespaceService) GetLinkedMosaicId(ctx context.Context, namespaceId *NamespaceId) (*MosaicId, error)
- func (ref *NamespaceService) GetNamespaceInfo(ctx context.Context, nsId *NamespaceId) (*NamespaceInfo, error)
- func (ref *NamespaceService) GetNamespaceInfosFromAccount(ctx context.Context, address *Address, nsId *NamespaceId, pageSize int) ([]*NamespaceInfo, error)
- func (ref *NamespaceService) GetNamespaceInfosFromAccounts(ctx context.Context, addrs []*Address, nsId *NamespaceId, pageSize int) ([]*NamespaceInfo, error)
- func (ref *NamespaceService) GetNamespaceNames(ctx context.Context, nsIds []*NamespaceId) ([]*NamespaceName, error)
- type NamespaceType
- type NetworkConfig
- type NetworkConfigTransaction
- type NetworkService
- func (ref *NetworkService) GetNetworkConfig(ctx context.Context) (*BlockchainConfig, error)
- func (ref *NetworkService) GetNetworkConfigAtHeight(ctx context.Context, height Height) (*BlockchainConfig, error)
- func (ref *NetworkService) GetNetworkType(ctx context.Context) (NetworkType, error)
- func (ref *NetworkService) GetNetworkVersion(ctx context.Context) (*NetworkVersion, error)
- func (ref *NetworkService) GetNetworkVersionAtHeight(ctx context.Context, height Height) (*NetworkVersion, error)
- type NetworkType
- type NetworkVersion
- type PartialAddedMapper
- type PartialRemovedInfo
- type PartialRemovedMapper
- type PartialRemovedMapperFn
- type PlainMessage
- type Proof
- func NewProofFromBytes(proof []byte) *Proof
- func NewProofFromHexString(hexProof string) (*Proof, error)
- func NewProofFromString(proof string) *Proof
- func NewProofFromUint16(number uint16) *Proof
- func NewProofFromUint32(number uint32) *Proof
- func NewProofFromUint64(number uint64) *Proof
- func NewProofFromUint8(number uint8) *Proof
- type PropertyModificationType
- type PropertyType
- type PublicAccount
- type RegisterNamespaceTransaction
- type ResolverService
- type RespErr
- type Secret
- type SecretLockTransaction
- type SecretProofTransaction
- type SecureMessage
- type Signature
- type SignedTransaction
- type SignerInfo
- type StatusInfo
- type StatusMapper
- type StatusMapperFn
- type SupportedEntities
- type Timestamp
- type Transaction
- type TransactionHashesDTO
- type TransactionIdsDTO
- type TransactionInfo
- type TransactionOrder
- type TransactionService
- func (txs *TransactionService) Announce(ctx context.Context, tx *SignedTransaction) (string, error)
- func (txs *TransactionService) AnnounceAggregateBonded(ctx context.Context, tx *SignedTransaction) (string, error)
- func (txs *TransactionService) AnnounceAggregateBondedCosignature(ctx context.Context, c *CosignatureSignedTransaction) (string, error)
- func (txs *TransactionService) GetTransaction(ctx context.Context, id string) (Transaction, error)
- func (txs *TransactionService) GetTransactionEffectiveFee(ctx context.Context, transactionId string) (int, error)
- func (txs *TransactionService) GetTransactionStatus(ctx context.Context, id string) (*TransactionStatus, error)
- func (txs *TransactionService) GetTransactionStatuses(ctx context.Context, hashes []string) ([]*TransactionStatus, error)
- func (txs *TransactionService) GetTransactions(ctx context.Context, ids []string) ([]Transaction, error)
- type TransactionStatus
- type TransferTransaction
- type UnconfirmedAddedMapper
- type UnconfirmedRemoved
- type UnconfirmedRemovedMapper
- type UnconfirmedRemovedMapperFn
- type VarSize
- type WsMessageInfo
- type WsMessageInfoDTO
Constants ¶
const ( DefaultWebsocketReconnectionTimeout = time.Second * 5 DefaultFeeCalculationStrategy = MiddleCalculationStrategy DefaultMaxFee = 5 * 1000000 )
const ( AddressSize int = 25 BaseInt64Size int = 8 AmountSize int = BaseInt64Size KeySize int = 32 Hash256 int = 32 MosaicIdSize int = BaseInt64Size NamespaceSize int = BaseInt64Size SizeSize int = 4 MaxStringSize int = 2 SignerSize int = KeySize SignatureSize int = 64 HalfOfSignature int = SignatureSize / 2 VersionSize int = 4 TypeSize int = 2 MaxFeeSize int = BaseInt64Size DeadLineSize int = BaseInt64Size DurationSize int = BaseInt64Size TransactionHeaderSize int = SizeSize + SignerSize + SignatureSize + VersionSize + TypeSize + MaxFeeSize + DeadLineSize PropertyTypeSize int = 2 PropertyModificationTypeSize int = 1 AccountPropertiesAddressModificationSize int = PropertyModificationTypeSize + AddressSize AccountPropertiesMosaicModificationSize int = PropertyModificationTypeSize + MosaicIdSize AccountPropertiesEntityModificationSize int = PropertyModificationTypeSize + TypeSize AccountPropertyAddressHeader int = TransactionHeaderSize + PropertyTypeSize AccountPropertyMosaicHeader int = TransactionHeaderSize + PropertyTypeSize AccountPropertyEntityTypeHeader int = TransactionHeaderSize + PropertyTypeSize LinkActionSize int = 1 AccountLinkTransactionSize int = TransactionHeaderSize + KeySize + LinkActionSize AliasActionSize int = 1 AliasTransactionHeaderSize int = TransactionHeaderSize + NamespaceSize + AliasActionSize AggregateBondedHeaderSize int = TransactionHeaderSize + SizeSize NetworkConfigHeaderSize int = TransactionHeaderSize + BaseInt64Size + MaxStringSize + MaxStringSize BlockchainUpgradeTransactionSize int = TransactionHeaderSize + DurationSize + BaseInt64Size HashTypeSize int = 1 LockSize int = TransactionHeaderSize + MosaicIdSize + AmountSize + DurationSize + Hash256 MetadataTypeSize int = 1 MetadataHeaderSize int = TransactionHeaderSize + MetadataTypeSize ModificationsSizeSize int = 1 ModifyContractHeaderSize int = TransactionHeaderSize + DurationSize + Hash256 + 3*ModificationsSizeSize MinApprovalSize int = 1 MinRemovalSize int = 1 ModifyMultisigHeaderSize int = TransactionHeaderSize + MinApprovalSize + MinRemovalSize + ModificationsSizeSize MosaicNonceSize int = 4 MosaicPropertiesHeaderSize int = 3 MosaicPropertyIdSize int = 1 MosaicOptionalPropertySize int = MosaicPropertyIdSize + BaseInt64Size MosaicDefinitionTransactionHeaderSize int = TransactionHeaderSize + MosaicNonceSize + MosaicIdSize + MosaicPropertiesHeaderSize MosaicSupplyDirectionSize int = 1 MosaicSupplyChangeTransactionSize int = TransactionHeaderSize + MosaicIdSize + AmountSize + MosaicSupplyDirectionSize NamespaceTypeSize int = 1 NamespaceNameSizeSize int = 1 RegisterNamespaceHeaderSize int = TransactionHeaderSize + NamespaceTypeSize + DurationSize + NamespaceSize + NamespaceNameSizeSize SecretLockSize int = TransactionHeaderSize + MosaicIdSize + AmountSize + DurationSize + HashTypeSize + Hash256 + AddressSize ProofSizeSize int = 2 SecretProofHeaderSize int = TransactionHeaderSize + HashTypeSize + Hash256 + AddressSize + ProofSizeSize MosaicsSizeSize int = 1 MessageSizeSize int = 2 TransferHeaderSize int = TransactionHeaderSize + AddressSize + MosaicsSizeSize + MessageSizeSize )
const EmptyPublicKey = "0000000000000000000000000000000000000000000000000000000000000000"
const NUM_CHECKSUM_BYTES = 4
const NamespaceBit uint64 = 1 << 63
const Supply_Mutable = 0x01
const TimestampNemesisBlockMilliseconds int64 = 1459468800 * 1000
const Transferable = 0x02
Variables ¶
var ( ErrResourceNotFound = newRespError("resource is not found") ErrArgumentNotValid = newRespError("argument is not valid") ErrInvalidRequest = newRespError("request is not valid") ErrInternalError = newRespError("response is nil") ErrNotAcceptedResponseStatusCode = newRespError("not accepted response status code") )
Catapult REST API errors
var ( ErrMetadataEmptyAddresses = errors.New("list adresses ids must not by empty") ErrMetadataNilAdress = errors.New("adress must not be blank") ErrMetadataEmptyMosaicIds = errors.New("list mosaics ids must not by empty") ErrMetadataNilMosaicId = errors.New("mosaicId must not be nil") ErrMetadataEmptyNamespaceIds = errors.New("list namespaces ids must not by empty") ErrMetadataNilNamespaceId = errors.New("namespaceId must not be nil") )
Metadata errors
var ( ErrNilAssetId = errors.New("AssetId should not be nil") ErrEmptyAssetIds = errors.New("AssetId's array should not be empty") ErrUnknownBlockchainType = errors.New("Not supported Blockchain Type") ErrInvalidHashLength = errors.New("The length of Hash is invalid") ErrInvalidSignatureLength = errors.New("The length of Signature is invalid") )
Common errors
var ( ErrEmptyMosaicIds = errors.New("list mosaics ids must not by empty") ErrNilMosaicId = errors.New("mosaicId must not be nil") ErrWrongBitMosaicId = errors.New("mosaicId has 64th bit") ErrInvalidOwnerPublicKey = errors.New("public owner key is invalid") ErrNilMosaicProperties = errors.New("mosaic properties must not be nil") )
Mosaic errors
var ( ErrNamespaceTooManyPart = errors.New("too many parts") ErrNilNamespaceId = errors.New("namespaceId is nil or zero") ErrWrongBitNamespaceId = errors.New("namespaceId doesn't have 64th bit") ErrEmptyNamespaceIds = errors.New("list namespace ids must not by empty") ErrInvalidNamespaceName = errors.New("namespace name is invalid") )
Namespace errors
var ( ErrNilOrZeroHeight = errors.New("block height should not be nil or zero") ErrNilOrZeroLimit = errors.New("limit should not be nil or zero") )
Blockchain errors
var ( ErrNilSecret = errors.New("Secret should not be nil") ErrNilProof = errors.New("Proof should not be nil") )
Lock errors
var ( ErrEmptyAddressesIds = errors.New("list of addresses should not be empty") ErrNilAddress = errors.New("address is nil") ErrBlankAddress = errors.New("address is blank") ErrNilAccount = errors.New("account should not be nil") ErrInvalidAddress = errors.New("wrong address") )
plain errors
var (
ErrInvalidReputationConfig = errors.New("default reputation should be greater than 0 and less than 1")
)
reputations error
var XemNamespaceId, _ = NewNamespaceIdFromName("nem.xem")
namespace id for XEM mosaic
var XpxNamespaceId, _ = NewNamespaceIdFromName("prx.xpx")
namespace id for XPX mosaic
Functions ¶
func GenerateChecksum ¶
func NewReputationConfig ¶
Types ¶
type AbstractTransaction ¶
type AbstractTransaction struct { *TransactionInfo NetworkType NetworkType Deadline *Deadline Type EntityType Version EntityVersion MaxFee Amount Signature string Signer *PublicAccount }
func (*AbstractTransaction) HasMissingSignatures ¶
func (tx *AbstractTransaction) HasMissingSignatures() bool
func (*AbstractTransaction) IsConfirmed ¶
func (tx *AbstractTransaction) IsConfirmed() bool
func (*AbstractTransaction) IsUnannounced ¶
func (tx *AbstractTransaction) IsUnannounced() bool
func (*AbstractTransaction) IsUnconfirmed ¶
func (tx *AbstractTransaction) IsUnconfirmed() bool
func (*AbstractTransaction) String ¶
func (tx *AbstractTransaction) String() string
func (*AbstractTransaction) ToAggregate ¶
func (tx *AbstractTransaction) ToAggregate(signer *PublicAccount)
type Account ¶
type Account struct { *PublicAccount *crypto.KeyPair // contains filtered or unexported fields }
func NewAccount ¶
func NewAccount(networkType NetworkType, generationHash *Hash) (*Account, error)
returns new Account generated for passed NetworkType
func NewAccountFromPrivateKey ¶
func NewAccountFromPrivateKey(pKey string, networkType NetworkType, generationHash *Hash) (*Account, error)
returns new Account from private key for passed NetworkType and generationHash
func (*Account) DecryptMessage ¶
func (a *Account) DecryptMessage(encryptedMessage *SecureMessage, senderPublicAccount *PublicAccount) (*PlainMessage, error)
func (*Account) EncryptMessage ¶
func (a *Account) EncryptMessage(message string, recipientPublicAccount *PublicAccount) (*SecureMessage, error)
func (*Account) Sign ¶
func (a *Account) Sign(tx Transaction) (*SignedTransaction, error)
func (*Account) SignCosignatureTransaction ¶
func (a *Account) SignCosignatureTransaction(tx *CosignatureTransaction) (*CosignatureSignedTransaction, error)
func (*Account) SignWithCosignatures ¶
func (a *Account) SignWithCosignatures(tx *AggregateTransaction, cosignatories []*Account) (*SignedTransaction, error)
sign AggregateTransaction with current Account and with every passed cosignatory Account's returns announced Aggregate SignedTransaction
type AccountInfo ¶
type AccountInfo struct { Address *Address AddressHeight Height PublicKey string PublicKeyHeight Height AccountType AccountType LinkedAccount *PublicAccount Mosaics []*Mosaic Reputation float64 }
func (*AccountInfo) String ¶
func (a *AccountInfo) String() string
type AccountLinkAction ¶
type AccountLinkAction uint8
const ( AccountLink AccountLinkAction = iota AccountUnlink )
AccountLinkAction enums
type AccountLinkTransaction ¶
type AccountLinkTransaction struct { AbstractTransaction RemoteAccount *PublicAccount LinkAction AccountLinkAction }
func NewAccountLinkTransaction ¶
func NewAccountLinkTransaction(deadline *Deadline, remoteAccount *PublicAccount, linkAction AccountLinkAction, networkType NetworkType) (*AccountLinkTransaction, error)
returns AccountLinkTransaction from passed PublicAccount and AccountLinkAction
func (*AccountLinkTransaction) GetAbstractTransaction ¶
func (tx *AccountLinkTransaction) GetAbstractTransaction() *AbstractTransaction
func (*AccountLinkTransaction) Size ¶
func (tx *AccountLinkTransaction) Size() int
func (*AccountLinkTransaction) String ¶
func (tx *AccountLinkTransaction) String() string
type AccountName ¶
func (*AccountName) String ¶
func (a *AccountName) String() string
type AccountProperties ¶
type AccountProperties struct { Address *Address AllowedAddresses []*Address AllowedMosaicId []*MosaicId AllowedEntityTypes []EntityType BlockedAddresses []*Address BlockedMosaicId []*MosaicId BlockedEntityTypes []EntityType }
func (*AccountProperties) String ¶
func (a *AccountProperties) String() string
type AccountPropertiesAddressModification ¶
type AccountPropertiesAddressModification struct { ModificationType PropertyModificationType Address *Address }
func (*AccountPropertiesAddressModification) String ¶
func (mod *AccountPropertiesAddressModification) String() string
type AccountPropertiesAddressTransaction ¶
type AccountPropertiesAddressTransaction struct { AbstractTransaction PropertyType PropertyType Modifications []*AccountPropertiesAddressModification }
func NewAccountPropertiesAddressTransaction ¶
func NewAccountPropertiesAddressTransaction(deadline *Deadline, propertyType PropertyType, modifications []*AccountPropertiesAddressModification, networkType NetworkType) (*AccountPropertiesAddressTransaction, error)
returns AccountPropertiesAddressTransaction from passed PropertyType and AccountPropertiesAddressModification's
func (*AccountPropertiesAddressTransaction) GetAbstractTransaction ¶
func (tx *AccountPropertiesAddressTransaction) GetAbstractTransaction() *AbstractTransaction
func (*AccountPropertiesAddressTransaction) Size ¶
func (tx *AccountPropertiesAddressTransaction) Size() int
func (*AccountPropertiesAddressTransaction) String ¶
func (tx *AccountPropertiesAddressTransaction) String() string
type AccountPropertiesEntityTypeModification ¶
type AccountPropertiesEntityTypeModification struct { ModificationType PropertyModificationType EntityType EntityType }
func (*AccountPropertiesEntityTypeModification) String ¶
func (mod *AccountPropertiesEntityTypeModification) String() string
type AccountPropertiesEntityTypeTransaction ¶
type AccountPropertiesEntityTypeTransaction struct { AbstractTransaction PropertyType PropertyType Modifications []*AccountPropertiesEntityTypeModification }
func NewAccountPropertiesEntityTypeTransaction ¶
func NewAccountPropertiesEntityTypeTransaction(deadline *Deadline, propertyType PropertyType, modifications []*AccountPropertiesEntityTypeModification, networkType NetworkType) (*AccountPropertiesEntityTypeTransaction, error)
returns AccountPropertiesEntityTypeTransaction from passed PropertyType and AccountPropertiesEntityTypeModification's
func (*AccountPropertiesEntityTypeTransaction) GetAbstractTransaction ¶
func (tx *AccountPropertiesEntityTypeTransaction) GetAbstractTransaction() *AbstractTransaction
func (*AccountPropertiesEntityTypeTransaction) Size ¶
func (tx *AccountPropertiesEntityTypeTransaction) Size() int
func (*AccountPropertiesEntityTypeTransaction) String ¶
func (tx *AccountPropertiesEntityTypeTransaction) String() string
type AccountPropertiesMosaicModification ¶
type AccountPropertiesMosaicModification struct { ModificationType PropertyModificationType AssetId AssetId }
func (*AccountPropertiesMosaicModification) String ¶
func (mod *AccountPropertiesMosaicModification) String() string
type AccountPropertiesMosaicTransaction ¶
type AccountPropertiesMosaicTransaction struct { AbstractTransaction PropertyType PropertyType Modifications []*AccountPropertiesMosaicModification }
func NewAccountPropertiesMosaicTransaction ¶
func NewAccountPropertiesMosaicTransaction(deadline *Deadline, propertyType PropertyType, modifications []*AccountPropertiesMosaicModification, networkType NetworkType) (*AccountPropertiesMosaicTransaction, error)
returns AccountPropertiesMosaicTransaction from passed PropertyType and AccountPropertiesMosaicModification's
func (*AccountPropertiesMosaicTransaction) GetAbstractTransaction ¶
func (tx *AccountPropertiesMosaicTransaction) GetAbstractTransaction() *AbstractTransaction
func (*AccountPropertiesMosaicTransaction) Size ¶
func (tx *AccountPropertiesMosaicTransaction) Size() int
func (*AccountPropertiesMosaicTransaction) String ¶
func (tx *AccountPropertiesMosaicTransaction) String() string
type AccountService ¶
type AccountService service
func (*AccountService) AggregateBondedTransactions ¶
func (a *AccountService) AggregateBondedTransactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]*AggregateTransaction, error)
returns an array of AggregateTransaction's where passed account is signer or cosigner
func (*AccountService) GetAccountInfo ¶
func (a *AccountService) GetAccountInfo(ctx context.Context, address *Address) (*AccountInfo, error)
func (*AccountService) GetAccountNames ¶
func (ref *AccountService) GetAccountNames(ctx context.Context, addr ...*Address) ([]*AccountName, error)
GetAccountNames Returns friendly names for accounts. post @/account/names
func (*AccountService) GetAccountProperties ¶
func (a *AccountService) GetAccountProperties(ctx context.Context, address *Address) (*AccountProperties, error)
func (*AccountService) GetAccountsInfo ¶
func (a *AccountService) GetAccountsInfo(ctx context.Context, addresses ...*Address) ([]*AccountInfo, error)
func (*AccountService) GetAccountsProperties ¶
func (a *AccountService) GetAccountsProperties(ctx context.Context, addresses ...*Address) ([]*AccountProperties, error)
func (*AccountService) GetMultisigAccountGraphInfo ¶
func (a *AccountService) GetMultisigAccountGraphInfo(ctx context.Context, address *Address) (*MultisigAccountGraphInfo, error)
func (*AccountService) GetMultisigAccountInfo ¶
func (a *AccountService) GetMultisigAccountInfo(ctx context.Context, address *Address) (*MultisigAccountInfo, error)
func (*AccountService) IncomingTransactions ¶
func (a *AccountService) IncomingTransactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]Transaction, error)
returns an array of Transaction's for which passed account is receiver
func (*AccountService) OutgoingTransactions ¶
func (a *AccountService) OutgoingTransactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]Transaction, error)
returns an array of Transaction's for which passed account is sender
func (*AccountService) Transactions ¶
func (a *AccountService) Transactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]Transaction, error)
returns an array of confirmed Transaction's for which passed account is sender or receiver.
func (*AccountService) UnconfirmedTransactions ¶
func (a *AccountService) UnconfirmedTransactions(ctx context.Context, account *PublicAccount, opt *AccountTransactionsOption) ([]Transaction, error)
returns an array of confirmed Transaction's for which passed account is sender or receiver. unconfirmed transactions are those transactions that have not yet been included in a block. they are not guaranteed to be included in any block.
type AccountTransactionsOption ¶
type AccountTransactionsOption struct { PageSize int `url:"pageSize,omitempty"` Id string `url:"id,omitempty"` Ordering TransactionOrder `url:"ordering,omitempty"` }
type AccountType ¶
type AccountType uint8
const ( UnlinkedAccount AccountType = iota MainAccount RemoteAccount RemoteUnlinkedAccount )
AccountType enums
type Address ¶
type Address struct { Type NetworkType Address string }
func NewAddress ¶
func NewAddress(address string, networkType NetworkType) *Address
returns Address from passed address string for passed NetworkType
func NewAddressFromBase32 ¶
func NewAddressFromNamespace ¶
func NewAddressFromNamespace(namespaceId *NamespaceId) (*Address, error)
returns new Address from namespace identifier
func NewAddressFromPublicKey ¶
func NewAddressFromPublicKey(pKey string, networkType NetworkType) (*Address, error)
returns an Address from public key for passed NetworkType
func NewAddressFromRaw ¶
returns Address from passed address string
type AddressAliasTransaction ¶
type AddressAliasTransaction struct { AliasTransaction Address *Address }
func NewAddressAliasTransaction ¶
func NewAddressAliasTransaction(deadline *Deadline, address *Address, namespaceId *NamespaceId, actionType AliasActionType, networkType NetworkType) (*AddressAliasTransaction, error)
returns AddressAliasTransaction from passed Address, NamespaceId and AliasActionType
func (*AddressAliasTransaction) Size ¶
func (tx *AddressAliasTransaction) Size() int
func (*AddressAliasTransaction) String ¶
func (tx *AddressAliasTransaction) String() string
type AddressMetadataInfo ¶
type AddressMetadataInfo struct { MetadataInfo Address *Address }
type AggregateTransaction ¶
type AggregateTransaction struct { AbstractTransaction InnerTransactions []Transaction Cosignatures []*AggregateTransactionCosignature }
func NewBondedAggregateTransaction ¶
func NewBondedAggregateTransaction(deadline *Deadline, innerTxs []Transaction, networkType NetworkType) (*AggregateTransaction, error)
returns bounded AggregateTransaction from passed array of transactions to be included in
func NewCompleteAggregateTransaction ¶
func NewCompleteAggregateTransaction(deadline *Deadline, innerTxs []Transaction, networkType NetworkType) (*AggregateTransaction, error)
returns complete AggregateTransaction from passed array of own Transaction's to be included in
func (*AggregateTransaction) GetAbstractTransaction ¶
func (tx *AggregateTransaction) GetAbstractTransaction() *AbstractTransaction
func (*AggregateTransaction) Size ¶
func (tx *AggregateTransaction) Size() int
func (*AggregateTransaction) String ¶
func (tx *AggregateTransaction) String() string
type AggregateTransactionCosignature ¶
type AggregateTransactionCosignature struct { Signature string Signer *PublicAccount }
func (*AggregateTransactionCosignature) String ¶
func (agt *AggregateTransactionCosignature) String() string
type AliasActionType ¶
type AliasActionType uint8
const ( AliasLink AliasActionType = iota AliasUnlink )
AliasActionType enums
type AliasTransaction ¶
type AliasTransaction struct { AbstractTransaction ActionType AliasActionType NamespaceId *NamespaceId }
func (*AliasTransaction) GetAbstractTransaction ¶
func (tx *AliasTransaction) GetAbstractTransaction() *AbstractTransaction
func (*AliasTransaction) Size ¶
func (tx *AliasTransaction) Size() int
func (*AliasTransaction) String ¶
func (tx *AliasTransaction) String() string
type AssetIdType ¶
type AssetIdType uint8
const ( NamespaceAssetIdType AssetIdType = iota MosaicAssetIdType )
AssetIdType enums
type BlockChainVersion ¶
type BlockChainVersion uint64
func NewBlockChainVersion ¶
func NewBlockChainVersion(major uint16, minor uint16, revision uint16, build uint16) BlockChainVersion
func (BlockChainVersion) String ¶
func (m BlockChainVersion) String() string
type BlockInfo ¶
type BlockInfo struct { NetworkType BlockHash *Hash GenerationHash *Hash TotalFee Amount NumTransactions uint64 Signature *Signature Signer *PublicAccount Version EntityVersion Type uint64 Height Height Timestamp *Timestamp Difficulty Difficulty FeeMultiplier uint32 PreviousBlockHash *Hash BlockTransactionsHash *Hash BlockReceiptsHash *Hash StateHash *Hash Beneficiary *PublicAccount FeeInterest uint32 FeeInterestDenominator uint32 }
type BlockMapper ¶
type BlockMapperFn ¶
type BlockchainConfig ¶
type BlockchainConfig struct { StartedHeight Height NetworkConfig *NetworkConfig SupportedEntityVersions *SupportedEntities }
func (BlockchainConfig) String ¶
func (nc BlockchainConfig) String() string
type BlockchainService ¶
type BlockchainService service
func (*BlockchainService) GetBlockByHeight ¶
func (b *BlockchainService) GetBlockByHeight(ctx context.Context, height Height) (*BlockInfo, error)
returns BlockInfo for passed block's height
func (*BlockchainService) GetBlockTransactions ¶
func (b *BlockchainService) GetBlockTransactions(ctx context.Context, height Height) ([]Transaction, error)
returns Transaction's inside of block at passed height
func (*BlockchainService) GetBlockchainHeight ¶
func (b *BlockchainService) GetBlockchainHeight(ctx context.Context) (Height, error)
func (*BlockchainService) GetBlockchainScore ¶
func (b *BlockchainService) GetBlockchainScore(ctx context.Context) (*ChainScore, error)
func (*BlockchainService) GetBlockchainStorage ¶
func (b *BlockchainService) GetBlockchainStorage(ctx context.Context) (*BlockchainStorageInfo, error)
func (*BlockchainService) GetBlocksByHeightWithLimit ¶
func (b *BlockchainService) GetBlocksByHeightWithLimit(ctx context.Context, height Height, limit Amount) ([]*BlockInfo, error)
returns BlockInfo's for range block height - (block height + limit) Example: GetBlocksByHeightWithLimit(ctx, 1, 25) => [BlockInfo25, BlockInfo24, ..., BlockInfo1]
type BlockchainStorageInfo ¶
type BlockchainStorageInfo struct { NumBlocks int `json:"numBlocks"` NumTransactions int `json:"numTransactions"` NumAccounts int `json:"numAccounts"` }
func (*BlockchainStorageInfo) String ¶
func (b *BlockchainStorageInfo) String() string
type BlockchainTimestamp ¶
type BlockchainTimestamp struct {
// contains filtered or unexported fields
}
func NewBlockchainTimestamp ¶
func NewBlockchainTimestamp(milliseconds int64) *BlockchainTimestamp
returns new BlockchainTimestamp from passed milliseconds value
func (*BlockchainTimestamp) ToTimestamp ¶
func (t *BlockchainTimestamp) ToTimestamp() *Timestamp
type BlockchainUpgradeTransaction ¶
type BlockchainUpgradeTransaction struct { AbstractTransaction UpgradePeriod Duration NewBlockChainVersion BlockChainVersion }
func NewBlockchainUpgradeTransaction ¶
func NewBlockchainUpgradeTransaction(deadline *Deadline, upgradePeriod Duration, newBlockChainVersion BlockChainVersion, networkType NetworkType) (*BlockchainUpgradeTransaction, error)
returns NetworkConfigTransaction from passed ApplyHeightDelta, NetworkConfig and SupportedEntityVersions
func (*BlockchainUpgradeTransaction) GetAbstractTransaction ¶
func (tx *BlockchainUpgradeTransaction) GetAbstractTransaction() *AbstractTransaction
func (*BlockchainUpgradeTransaction) Size ¶
func (tx *BlockchainUpgradeTransaction) Size() int
func (*BlockchainUpgradeTransaction) String ¶
func (tx *BlockchainUpgradeTransaction) String() string
type ChainScore ¶
type ChainScore [2]uint64
func NewChainScore ¶
func NewChainScore(scoreLow uint64, scoreHigh uint64) *ChainScore
returns new ChainScore from passed low and high score
func (*ChainScore) String ¶
func (m *ChainScore) String() string
type Client ¶
type Client struct { // Services for communicating to the Catapult REST APIs Blockchain *BlockchainService Mosaic *MosaicService Namespace *NamespaceService Network *NetworkService Transaction *TransactionService Resolve *ResolverService Account *AccountService Contract *ContractService Metadata *MetadataService // contains filtered or unexported fields }
Catapult API Client configuration
func NewClient ¶
returns catapult http.Client from passed existing client and configuration if passed client is nil, http.DefaultClient will be used
func (*Client) AdaptAccount ¶
AdaptAccount returns a new account with the same network type and generation hash like a Client
func (*Client) GenerationHash ¶
func (*Client) NetworkType ¶
func (c *Client) NetworkType() NetworkType
func (*Client) NewAccount ¶
func (*Client) NewAccountFromPrivateKey ¶
func (*Client) NewAccountFromPublicKey ¶
func (c *Client) NewAccountFromPublicKey(pKey string) (*PublicAccount, error)
func (*Client) NewAccountLinkTransaction ¶
func (c *Client) NewAccountLinkTransaction(deadline *Deadline, remoteAccount *PublicAccount, linkAction AccountLinkAction) (*AccountLinkTransaction, error)
func (*Client) NewAccountPropertiesAddressTransaction ¶
func (c *Client) NewAccountPropertiesAddressTransaction(deadline *Deadline, propertyType PropertyType, modifications []*AccountPropertiesAddressModification) (*AccountPropertiesAddressTransaction, error)
func (*Client) NewAccountPropertiesEntityTypeTransaction ¶
func (c *Client) NewAccountPropertiesEntityTypeTransaction(deadline *Deadline, propertyType PropertyType, modifications []*AccountPropertiesEntityTypeModification) (*AccountPropertiesEntityTypeTransaction, error)
func (*Client) NewAccountPropertiesMosaicTransaction ¶
func (c *Client) NewAccountPropertiesMosaicTransaction(deadline *Deadline, propertyType PropertyType, modifications []*AccountPropertiesMosaicModification) (*AccountPropertiesMosaicTransaction, error)
func (*Client) NewAddressAliasTransaction ¶
func (c *Client) NewAddressAliasTransaction(deadline *Deadline, address *Address, namespaceId *NamespaceId, actionType AliasActionType) (*AddressAliasTransaction, error)
func (*Client) NewBlockchainUpgradeTransaction ¶
func (c *Client) NewBlockchainUpgradeTransaction(deadline *Deadline, upgradePeriod Duration, newBlockChainVersion BlockChainVersion) (*BlockchainUpgradeTransaction, error)
func (*Client) NewBondedAggregateTransaction ¶
func (c *Client) NewBondedAggregateTransaction(deadline *Deadline, innerTxs []Transaction) (*AggregateTransaction, error)
func (*Client) NewCompleteAggregateTransaction ¶
func (c *Client) NewCompleteAggregateTransaction(deadline *Deadline, innerTxs []Transaction) (*AggregateTransaction, error)
func (*Client) NewLockFundsTransaction ¶
func (c *Client) NewLockFundsTransaction(deadline *Deadline, mosaic *Mosaic, duration Duration, signedTx *SignedTransaction) (*LockFundsTransaction, error)
func (*Client) NewModifyContractTransaction ¶
func (c *Client) NewModifyContractTransaction( deadline *Deadline, durationDelta Duration, hash *Hash, customers []*MultisigCosignatoryModification, executors []*MultisigCosignatoryModification, verifiers []*MultisigCosignatoryModification) (*ModifyContractTransaction, error)
func (*Client) NewModifyMetadataAddressTransaction ¶
func (c *Client) NewModifyMetadataAddressTransaction(deadline *Deadline, address *Address, modifications []*MetadataModification) (*ModifyMetadataAddressTransaction, error)
func (*Client) NewModifyMetadataMosaicTransaction ¶
func (c *Client) NewModifyMetadataMosaicTransaction(deadline *Deadline, mosaicId *MosaicId, modifications []*MetadataModification) (*ModifyMetadataMosaicTransaction, error)
func (*Client) NewModifyMetadataNamespaceTransaction ¶
func (c *Client) NewModifyMetadataNamespaceTransaction(deadline *Deadline, namespaceId *NamespaceId, modifications []*MetadataModification) (*ModifyMetadataNamespaceTransaction, error)
func (*Client) NewModifyMultisigAccountTransaction ¶
func (c *Client) NewModifyMultisigAccountTransaction(deadline *Deadline, minApprovalDelta int8, minRemovalDelta int8, modifications []*MultisigCosignatoryModification) (*ModifyMultisigAccountTransaction, error)
func (*Client) NewMosaicAliasTransaction ¶
func (c *Client) NewMosaicAliasTransaction(deadline *Deadline, mosaicId *MosaicId, namespaceId *NamespaceId, actionType AliasActionType) (*MosaicAliasTransaction, error)
func (*Client) NewMosaicDefinitionTransaction ¶
func (c *Client) NewMosaicDefinitionTransaction(deadline *Deadline, nonce uint32, ownerPublicKey string, mosaicProps *MosaicProperties) (*MosaicDefinitionTransaction, error)
func (*Client) NewMosaicSupplyChangeTransaction ¶
func (c *Client) NewMosaicSupplyChangeTransaction(deadline *Deadline, assetId AssetId, supplyType MosaicSupplyType, delta Duration) (*MosaicSupplyChangeTransaction, error)
func (*Client) NewNetworkConfigTransaction ¶
func (c *Client) NewNetworkConfigTransaction(deadline *Deadline, delta Duration, config *NetworkConfig, entities *SupportedEntities) (*NetworkConfigTransaction, error)
func (*Client) NewRegisterRootNamespaceTransaction ¶
func (*Client) NewRegisterSubNamespaceTransaction ¶
func (c *Client) NewRegisterSubNamespaceTransaction(deadline *Deadline, namespaceName string, parentId *NamespaceId) (*RegisterNamespaceTransaction, error)
func (*Client) NewSecretLockTransaction ¶
func (*Client) NewSecretProofTransaction ¶
func (*Client) NewTransferTransaction ¶
func (*Client) NewTransferTransactionWithNamespace ¶
func (c *Client) NewTransferTransactionWithNamespace(deadline *Deadline, recipient *NamespaceId, mosaics []*Mosaic, message Message) (*TransferTransaction, error)
type Config ¶
type Config struct { BaseURLs []*url.URL UsedBaseUrl *url.URL WsReconnectionTimeout time.Duration GenerationHash *Hash NetworkType FeeCalculationStrategy // contains filtered or unexported fields }
Provides service configuration
func NewConfig ¶
returns config for HTTP Client from passed node url, filled by information from remote blockchain node
func NewConfigWithReputation ¶
func NewConfigWithReputation( baseUrls []string, networkType NetworkType, repConf *reputationConfig, wsReconnectionTimeout time.Duration, generationHash *Hash, strategy FeeCalculationStrategy) (*Config, error)
type ConfigBag ¶
func NewConfigBag ¶
func NewConfigBag() *ConfigBag
type ConfirmedAddedMapper ¶
type ConfirmedAddedMapper interface {
MapConfirmedAdded(m []byte) (Transaction, error)
}
func NewConfirmedAddedMapper ¶
func NewConfirmedAddedMapper(mapTransactionFunc mapTransactionFunc) ConfirmedAddedMapper
type ContractInfo ¶
type ContractInfo struct { Multisig string MultisigAddress *Address Start Height Duration Duration Content *Hash Customers []string Executors []string Verifiers []string }
func (*ContractInfo) String ¶
func (ref *ContractInfo) String() string
type ContractService ¶
type ContractService service
func (*ContractService) GetContractsByAddress ¶
func (ref *ContractService) GetContractsByAddress(ctx context.Context, address string) ([]*ContractInfo, error)
func (*ContractService) GetContractsInfo ¶
func (ref *ContractService) GetContractsInfo(ctx context.Context, contractPubKeys ...string) ([]*ContractInfo, error)
type CosignatureMapper ¶
type CosignatureMapper interface {
MapCosignature(m []byte) (*SignerInfo, error)
}
type CosignatureMapperFn ¶
type CosignatureMapperFn func(m []byte) (*SignerInfo, error)
func (CosignatureMapperFn) MapCosignature ¶
func (p CosignatureMapperFn) MapCosignature(m []byte) (*SignerInfo, error)
type CosignatureTransaction ¶
type CosignatureTransaction struct {
TransactionToCosign *AggregateTransaction
}
func NewCosignatureTransaction ¶
func NewCosignatureTransaction(txToCosign *AggregateTransaction) (*CosignatureTransaction, error)
returns a CosignatureTransaction from passed AggregateTransaction
func NewCosignatureTransactionFromHash ¶
func NewCosignatureTransactionFromHash(hash *Hash) *CosignatureTransaction
returns a CosignatureTransaction from passed hash of bounded AggregateTransaction
func (*CosignatureTransaction) String ¶
func (tx *CosignatureTransaction) String() string
type Deadline ¶
type Deadline struct {
Timestamp
}
func NewDeadline ¶
returns new Deadline from passed duration
func NewDeadlineFromBlockchainTimestamp ¶
func NewDeadlineFromBlockchainTimestamp(timestamp *BlockchainTimestamp) *Deadline
returns new Deadline from passed BlockchainTimestamp
type Difficulty ¶
type Difficulty = baseInt64
type Entity ¶
type Entity struct { Name string Type EntityType SupportedVersions []EntityVersion }
type EntityType ¶
type EntityType uint16
const ( AccountPropertyAddress EntityType = 0x4150 AccountPropertyMosaic EntityType = 0x4250 AccountPropertyEntityType EntityType = 0x4350 AddressAlias EntityType = 0x424e AggregateBonded EntityType = 0x4241 AggregateCompleted EntityType = 0x4141 Block EntityType = 0x8143 NemesisBlock EntityType = 0x8043 NetworkConfigEntityType EntityType = 0x4159 BlockchainUpgrade EntityType = 0x4158 LinkAccount EntityType = 0x414c Lock EntityType = 0x4148 MetadataAddress EntityType = 0x413d MetadataMosaic EntityType = 0x423d MetadataNamespace EntityType = 0x433d ModifyContract EntityType = 0x4157 ModifyMultisig EntityType = 0x4155 MosaicAlias EntityType = 0x434e MosaicDefinition EntityType = 0x414d MosaicSupplyChange EntityType = 0x424d RegisterNamespace EntityType = 0x414e SecretLock EntityType = 0x4152 SecretProof EntityType = 0x4252 Transfer EntityType = 0x4154 )
func (EntityType) String ¶
func (t EntityType) String() string
type EntityVersion ¶
type EntityVersion uint32
const ( AccountPropertyAddressVersion EntityVersion = 1 AccountPropertyMosaicVersion EntityVersion = 1 AccountPropertyEntityTypeVersion EntityVersion = 1 AddressAliasVersion EntityVersion = 1 AggregateBondedVersion EntityVersion = 2 AggregateCompletedVersion EntityVersion = 2 NetworkConfigVersion EntityVersion = 1 BlockchainUpgradeVersion EntityVersion = 1 LinkAccountVersion EntityVersion = 2 LockVersion EntityVersion = 1 MetadataAddressVersion EntityVersion = 1 MetadataMosaicVersion EntityVersion = 1 MetadataNamespaceVersion EntityVersion = 1 ModifyContractVersion EntityVersion = 3 ModifyMultisigVersion EntityVersion = 3 MosaicAliasVersion EntityVersion = 1 MosaicDefinitionVersion EntityVersion = 3 MosaicSupplyChangeVersion EntityVersion = 2 RegisterNamespaceVersion EntityVersion = 2 SecretLockVersion EntityVersion = 1 SecretProofVersion EntityVersion = 1 TransferVersion EntityVersion = 3 )
func ExtractVersion ¶
func ExtractVersion(version int64) EntityVersion
type FeeCalculationStrategy ¶
type FeeCalculationStrategy uint32
const ( HighCalculationStrategy FeeCalculationStrategy = 2500 MiddleCalculationStrategy FeeCalculationStrategy = 250 LowCalculationStrategy FeeCalculationStrategy = 25 )
FeeCalculationStrategy enums
type LockFundsTransaction ¶
type LockFundsTransaction struct { AbstractTransaction *Mosaic Duration Duration *SignedTransaction }
func NewLockFundsTransaction ¶
func NewLockFundsTransaction(deadline *Deadline, mosaic *Mosaic, duration Duration, signedTx *SignedTransaction, networkType NetworkType) (*LockFundsTransaction, error)
returns a LockFundsTransaction from passed Mosaic, duration in blocks and SignedTransaction
func (*LockFundsTransaction) GetAbstractTransaction ¶
func (tx *LockFundsTransaction) GetAbstractTransaction() *AbstractTransaction
func (*LockFundsTransaction) Size ¶
func (tx *LockFundsTransaction) Size() int
func (*LockFundsTransaction) String ¶
func (tx *LockFundsTransaction) String() string
type Message ¶
type Message interface { Type() MessageType Payload() []byte String() string }
type MessageType ¶
type MessageType uint8
const ( PlainMessageType MessageType = iota SecureMessageType )
type MetadataInfo ¶
type MetadataInfo struct { MetadataType MetadataType Fields map[string]string }
type MetadataModification ¶
type MetadataModification struct { Type MetadataModificationType Key string Value string }
func (*MetadataModification) Size ¶
func (m *MetadataModification) Size() int
func (*MetadataModification) String ¶
func (m *MetadataModification) String() string
type MetadataModificationType ¶
type MetadataModificationType uint8
const ( AddMetadata MetadataModificationType = iota RemoveMetadata )
func (MetadataModificationType) String ¶
func (t MetadataModificationType) String() string
type MetadataService ¶
type MetadataService service
func (*MetadataService) GetAddressMetadatasInfo ¶
func (ref *MetadataService) GetAddressMetadatasInfo(ctx context.Context, addresses ...string) ([]*AddressMetadataInfo, error)
func (*MetadataService) GetMetadataByAddress ¶
func (ref *MetadataService) GetMetadataByAddress(ctx context.Context, address string) (*AddressMetadataInfo, error)
func (*MetadataService) GetMetadataByMosaicId ¶
func (ref *MetadataService) GetMetadataByMosaicId(ctx context.Context, mosaicId *MosaicId) (*MosaicMetadataInfo, error)
func (*MetadataService) GetMetadataByNamespaceId ¶
func (ref *MetadataService) GetMetadataByNamespaceId(ctx context.Context, namespaceId *NamespaceId) (*NamespaceMetadataInfo, error)
func (*MetadataService) GetMosaicMetadatasInfo ¶
func (ref *MetadataService) GetMosaicMetadatasInfo(ctx context.Context, mosaicIds ...*MosaicId) ([]*MosaicMetadataInfo, error)
func (*MetadataService) GetNamespaceMetadatasInfo ¶
func (ref *MetadataService) GetNamespaceMetadatasInfo(ctx context.Context, namespaceIds ...*NamespaceId) ([]*NamespaceMetadataInfo, error)
type MetadataType ¶
type MetadataType uint8
const ( MetadataNone MetadataType = iota MetadataAddressType MetadataMosaicType MetadataNamespaceType )
func (MetadataType) String ¶
func (t MetadataType) String() string
type ModifyContractTransaction ¶
type ModifyContractTransaction struct { AbstractTransaction DurationDelta Duration Hash *Hash Customers []*MultisigCosignatoryModification Executors []*MultisigCosignatoryModification Verifiers []*MultisigCosignatoryModification }
func NewModifyContractTransaction ¶
func NewModifyContractTransaction( deadline *Deadline, durationDelta Duration, hash *Hash, customers []*MultisigCosignatoryModification, executors []*MultisigCosignatoryModification, verifiers []*MultisigCosignatoryModification, networkType NetworkType) (*ModifyContractTransaction, error)
returns ModifyContractTransaction from passed duration delta in blocks, file hash, arrays of customers, replicators and verificators
func (*ModifyContractTransaction) GetAbstractTransaction ¶
func (tx *ModifyContractTransaction) GetAbstractTransaction() *AbstractTransaction
func (*ModifyContractTransaction) Size ¶
func (tx *ModifyContractTransaction) Size() int
func (*ModifyContractTransaction) String ¶
func (tx *ModifyContractTransaction) String() string
type ModifyMetadataAddressTransaction ¶
type ModifyMetadataAddressTransaction struct { ModifyMetadataTransaction Address *Address }
func NewModifyMetadataAddressTransaction ¶
func NewModifyMetadataAddressTransaction(deadline *Deadline, address *Address, modifications []*MetadataModification, networkType NetworkType) (*ModifyMetadataAddressTransaction, error)
returns ModifyMetadataAddressTransaction from passed Address to be modified, and an array of MetadataModification's
func (*ModifyMetadataAddressTransaction) Size ¶
func (tx *ModifyMetadataAddressTransaction) Size() int
func (*ModifyMetadataAddressTransaction) String ¶
func (tx *ModifyMetadataAddressTransaction) String() string
type ModifyMetadataMosaicTransaction ¶
type ModifyMetadataMosaicTransaction struct { ModifyMetadataTransaction MosaicId *MosaicId }
func NewModifyMetadataMosaicTransaction ¶
func NewModifyMetadataMosaicTransaction(deadline *Deadline, mosaicId *MosaicId, modifications []*MetadataModification, networkType NetworkType) (*ModifyMetadataMosaicTransaction, error)
returns ModifyMetadataMosaicTransaction from passed MosaicId to be modified, and an array of MetadataModification's
func (*ModifyMetadataMosaicTransaction) Size ¶
func (tx *ModifyMetadataMosaicTransaction) Size() int
func (*ModifyMetadataMosaicTransaction) String ¶
func (tx *ModifyMetadataMosaicTransaction) String() string
type ModifyMetadataNamespaceTransaction ¶
type ModifyMetadataNamespaceTransaction struct { ModifyMetadataTransaction NamespaceId *NamespaceId }
func NewModifyMetadataNamespaceTransaction ¶
func NewModifyMetadataNamespaceTransaction(deadline *Deadline, namespaceId *NamespaceId, modifications []*MetadataModification, networkType NetworkType) (*ModifyMetadataNamespaceTransaction, error)
returns ModifyMetadataNamespaceTransaction from passed NamespaceId to be modified, and an array of MetadataModification's
func (*ModifyMetadataNamespaceTransaction) Size ¶
func (tx *ModifyMetadataNamespaceTransaction) Size() int
func (*ModifyMetadataNamespaceTransaction) String ¶
func (tx *ModifyMetadataNamespaceTransaction) String() string
type ModifyMetadataTransaction ¶
type ModifyMetadataTransaction struct { AbstractTransaction MetadataType MetadataType Modifications []*MetadataModification }
func (*ModifyMetadataTransaction) GetAbstractTransaction ¶
func (tx *ModifyMetadataTransaction) GetAbstractTransaction() *AbstractTransaction
func (*ModifyMetadataTransaction) Size ¶
func (tx *ModifyMetadataTransaction) Size() int
func (*ModifyMetadataTransaction) String ¶
func (tx *ModifyMetadataTransaction) String() string
type ModifyMultisigAccountTransaction ¶
type ModifyMultisigAccountTransaction struct { AbstractTransaction MinApprovalDelta int8 MinRemovalDelta int8 Modifications []*MultisigCosignatoryModification }
func NewModifyMultisigAccountTransaction ¶
func NewModifyMultisigAccountTransaction(deadline *Deadline, minApprovalDelta int8, minRemovalDelta int8, modifications []*MultisigCosignatoryModification, networkType NetworkType) (*ModifyMultisigAccountTransaction, error)
returns a ModifyMultisigAccountTransaction from passed min approval and removal deltas and array of MultisigCosignatoryModification's
func (*ModifyMultisigAccountTransaction) GetAbstractTransaction ¶
func (tx *ModifyMultisigAccountTransaction) GetAbstractTransaction() *AbstractTransaction
func (*ModifyMultisigAccountTransaction) Size ¶
func (tx *ModifyMultisigAccountTransaction) Size() int
func (*ModifyMultisigAccountTransaction) String ¶
func (tx *ModifyMultisigAccountTransaction) String() string
type MosaicAliasTransaction ¶
type MosaicAliasTransaction struct { AliasTransaction MosaicId *MosaicId }
func NewMosaicAliasTransaction ¶
func NewMosaicAliasTransaction(deadline *Deadline, mosaicId *MosaicId, namespaceId *NamespaceId, actionType AliasActionType, networkType NetworkType) (*MosaicAliasTransaction, error)
returns MosaicAliasTransaction from passed MosaicId, NamespaceId and AliasActionType
func (*MosaicAliasTransaction) Size ¶
func (tx *MosaicAliasTransaction) Size() int
func (*MosaicAliasTransaction) String ¶
func (tx *MosaicAliasTransaction) String() string
type MosaicDefinitionTransaction ¶
type MosaicDefinitionTransaction struct { AbstractTransaction *MosaicProperties MosaicNonce uint32 *MosaicId }
func NewMosaicDefinitionTransaction ¶
func NewMosaicDefinitionTransaction(deadline *Deadline, nonce uint32, ownerPublicKey string, mosaicProps *MosaicProperties, networkType NetworkType) (*MosaicDefinitionTransaction, error)
returns MosaicDefinitionTransaction from passed nonce, public key of announcer and MosaicProperties
func (*MosaicDefinitionTransaction) GetAbstractTransaction ¶
func (tx *MosaicDefinitionTransaction) GetAbstractTransaction() *AbstractTransaction
func (*MosaicDefinitionTransaction) Size ¶
func (tx *MosaicDefinitionTransaction) Size() int
func (*MosaicDefinitionTransaction) String ¶
func (tx *MosaicDefinitionTransaction) String() string
type MosaicId ¶
type MosaicId struct {
// contains filtered or unexported fields
}
func NewMosaicId ¶
returns MosaicId for passed mosaic identifier
func NewMosaicIdFromNonceAndOwner ¶
returns MosaicId for passed nonce and public key of mosaic owner
func (*MosaicId) Type ¶
func (m *MosaicId) Type() AssetIdType
type MosaicInfo ¶
type MosaicInfo struct { MosaicId *MosaicId Supply Amount Height Height Owner *PublicAccount Revision uint32 Properties *MosaicProperties }
func (*MosaicInfo) String ¶
func (m *MosaicInfo) String() string
type MosaicMetadataInfo ¶
type MosaicMetadataInfo struct { MetadataInfo MosaicId *MosaicId }
type MosaicName ¶
func (*MosaicName) String ¶
func (m *MosaicName) String() string
type MosaicProperties ¶
type MosaicProperties struct { MosaicPropertiesHeader OptionalProperties []MosaicProperty }
func NewMosaicProperties ¶
func NewMosaicProperties(supplyMutable bool, transferable bool, divisibility uint8, duration Duration) *MosaicProperties
returns MosaicProperties from actual values
func (*MosaicProperties) Duration ¶
func (mp *MosaicProperties) Duration() Duration
func (*MosaicProperties) String ¶
func (mp *MosaicProperties) String() string
type MosaicPropertiesHeader ¶
structure which includes several properties for defining mosaic `SupplyMutable` - is supply of defined mosaic can be changed in future `Transferable` - if this property is set to "false", only transfer transactions having the creator as sender or as recipient can transfer mosaics of that type. If set to "true" the mosaics can be transferred to and from arbitrary accounts `Divisibility` - divisibility determines up to what decimal place the mosaic can be divided into `Duration` - duration in blocks mosaic will be available. After the renew mosaic is inactive and can be renewed
type MosaicProperty ¶
type MosaicProperty struct { Id MosaicPropertyId Value baseInt64 }
func (*MosaicProperty) String ¶
func (mp *MosaicProperty) String() string
type MosaicPropertyId ¶
type MosaicPropertyId uint8
const ( MosaicPropertyFlagsId MosaicPropertyId = iota MosaicPropertyDivisibilityId MosaicPropertyDurationId )
MosaicPropertyId enums
type MosaicService ¶
type MosaicService service
func (*MosaicService) GetMosaicInfo ¶
func (ref *MosaicService) GetMosaicInfo(ctx context.Context, mosaicId *MosaicId) (*MosaicInfo, error)
func (*MosaicService) GetMosaicInfos ¶
func (ref *MosaicService) GetMosaicInfos(ctx context.Context, mscIds []*MosaicId) ([]*MosaicInfo, error)
func (*MosaicService) GetMosaicsNames ¶
func (ref *MosaicService) GetMosaicsNames(ctx context.Context, mscIds ...*MosaicId) ([]*MosaicName, error)
GetMosaicsNames Get readable names for a set of mosaics post @/mosaic/names
type MosaicSupplyChangeTransaction ¶
type MosaicSupplyChangeTransaction struct { AbstractTransaction MosaicSupplyType AssetId Delta Amount }
func NewMosaicSupplyChangeTransaction ¶
func NewMosaicSupplyChangeTransaction(deadline *Deadline, assetId AssetId, supplyType MosaicSupplyType, delta Duration, networkType NetworkType) (*MosaicSupplyChangeTransaction, error)
returns MosaicSupplyChangeTransaction from passed AssetId, MosaicSupplyTypeand supply delta
func (*MosaicSupplyChangeTransaction) GetAbstractTransaction ¶
func (tx *MosaicSupplyChangeTransaction) GetAbstractTransaction() *AbstractTransaction
func (*MosaicSupplyChangeTransaction) Size ¶
func (tx *MosaicSupplyChangeTransaction) Size() int
func (*MosaicSupplyChangeTransaction) String ¶
func (tx *MosaicSupplyChangeTransaction) String() string
type MosaicSupplyType ¶
type MosaicSupplyType uint8
const ( Decrease MosaicSupplyType = iota Increase )
func (MosaicSupplyType) String ¶
func (tx MosaicSupplyType) 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 }
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 NamespaceAlias ¶
type NamespaceAlias struct { Type AliasType // contains filtered or unexported fields }
NamespaceAlias contains aliased mosaicId or address and type of alias
func (*NamespaceAlias) Address ¶
func (ref *NamespaceAlias) Address() *Address
func (*NamespaceAlias) MosaicId ¶
func (ref *NamespaceAlias) MosaicId() *MosaicId
func (*NamespaceAlias) String ¶
func (ref *NamespaceAlias) String() string
type NamespaceId ¶
type NamespaceId struct {
// contains filtered or unexported fields
}
func GenerateNamespacePath ¶
func GenerateNamespacePath(name string) ([]*NamespaceId, error)
returns an array of big ints representation if namespace ids from passed namespace path to create root namespace pass namespace name in format like 'rootname' to create child namespace pass namespace name in format like 'rootname.childname' to create grand child namespace pass namespace name in format like 'rootname.childname.grandchildname'
func NewNamespaceId ¶
func NewNamespaceId(id uint64) (*NamespaceId, error)
returns new NamespaceId from passed namespace identifier
func NewNamespaceIdFromName ¶
func NewNamespaceIdFromName(namespaceName string) (*NamespaceId, error)
returns namespace id from passed namespace name should be used for creating root, child and grandchild namespace ids to create root namespace pass namespace name in format like 'rootname' to create child namespace pass namespace name in format like 'rootname.childname' to create grand child namespace pass namespace name in format like 'rootname.childname.grandchildname'
func (*NamespaceId) Equals ¶
func (m *NamespaceId) Equals(id AssetId) bool
func (*NamespaceId) Id ¶
func (m *NamespaceId) Id() uint64
func (*NamespaceId) String ¶
func (m *NamespaceId) String() string
func (*NamespaceId) Type ¶
func (m *NamespaceId) Type() AssetIdType
type NamespaceInfo ¶
type NamespaceInfo struct { NamespaceId *NamespaceId Active bool TypeSpace NamespaceType Depth int Levels []*NamespaceId Alias *NamespaceAlias Parent *NamespaceInfo Owner *PublicAccount StartHeight Height EndHeight Height }
func (*NamespaceInfo) String ¶
func (ref *NamespaceInfo) String() string
type NamespaceMetadataInfo ¶
type NamespaceMetadataInfo struct { MetadataInfo NamespaceId *NamespaceId }
type NamespaceName ¶
type NamespaceName struct { NamespaceId *NamespaceId FullName string }
func (*NamespaceName) String ¶
func (n *NamespaceName) String() string
type NamespaceService ¶
type NamespaceService service
NamespaceService provides a set of methods for obtaining information about the namespace
func (*NamespaceService) GetLinkedAddress ¶
func (ref *NamespaceService) GetLinkedAddress(ctx context.Context, namespaceId *NamespaceId) (*Address, error)
GetLinkedAddress @/namespace/%s
func (*NamespaceService) GetLinkedMosaicId ¶
func (ref *NamespaceService) GetLinkedMosaicId(ctx context.Context, namespaceId *NamespaceId) (*MosaicId, error)
GetLinkedMosaicId @/namespace/%s
func (*NamespaceService) GetNamespaceInfo ¶
func (ref *NamespaceService) GetNamespaceInfo(ctx context.Context, nsId *NamespaceId) (*NamespaceInfo, error)
func (*NamespaceService) GetNamespaceInfosFromAccount ¶
func (ref *NamespaceService) GetNamespaceInfosFromAccount(ctx context.Context, address *Address, nsId *NamespaceId, pageSize int) ([]*NamespaceInfo, error)
returns NamespaceInfo's corresponding to passed Address and NamespaceId with maximum limit TODO: fix pagination
func (*NamespaceService) GetNamespaceInfosFromAccounts ¶
func (ref *NamespaceService) GetNamespaceInfosFromAccounts(ctx context.Context, addrs []*Address, nsId *NamespaceId, pageSize int) ([]*NamespaceInfo, error)
returns NamespaceInfo's corresponding to passed Address's and NamespaceId with maximum limit TODO: fix pagination
func (*NamespaceService) GetNamespaceNames ¶
func (ref *NamespaceService) GetNamespaceNames(ctx context.Context, nsIds []*NamespaceId) ([]*NamespaceName, error)
type NetworkConfig ¶
func NewNetworkConfig ¶
func NewNetworkConfig() *NetworkConfig
func (*NetworkConfig) MarshalBinary ¶
func (c *NetworkConfig) MarshalBinary() (data []byte, err error)
func (*NetworkConfig) String ¶
func (c *NetworkConfig) String() string
func (*NetworkConfig) UnmarshalBinary ¶
func (c *NetworkConfig) UnmarshalBinary(data []byte) error
type NetworkConfigTransaction ¶
type NetworkConfigTransaction struct { AbstractTransaction ApplyHeightDelta Duration NetworkConfig *NetworkConfig SupportedEntities *SupportedEntities }
func NewNetworkConfigTransaction ¶
func NewNetworkConfigTransaction(deadline *Deadline, delta Duration, config *NetworkConfig, entities *SupportedEntities, networkType NetworkType) (*NetworkConfigTransaction, error)
returns NetworkConfigTransaction from passed ApplyHeightDelta, NetworkConfig and SupportedEntities
func (*NetworkConfigTransaction) GetAbstractTransaction ¶
func (tx *NetworkConfigTransaction) GetAbstractTransaction() *AbstractTransaction
func (*NetworkConfigTransaction) Size ¶
func (tx *NetworkConfigTransaction) Size() int
func (*NetworkConfigTransaction) String ¶
func (tx *NetworkConfigTransaction) String() string
type NetworkService ¶
type NetworkService struct { BlockchainService *BlockchainService // contains filtered or unexported fields }
func (*NetworkService) GetNetworkConfig ¶
func (ref *NetworkService) GetNetworkConfig(ctx context.Context) (*BlockchainConfig, error)
func (*NetworkService) GetNetworkConfigAtHeight ¶
func (ref *NetworkService) GetNetworkConfigAtHeight(ctx context.Context, height Height) (*BlockchainConfig, error)
func (*NetworkService) GetNetworkType ¶
func (ref *NetworkService) GetNetworkType(ctx context.Context) (NetworkType, error)
func (*NetworkService) GetNetworkVersion ¶
func (ref *NetworkService) GetNetworkVersion(ctx context.Context) (*NetworkVersion, error)
func (*NetworkService) GetNetworkVersionAtHeight ¶
func (ref *NetworkService) GetNetworkVersionAtHeight(ctx context.Context, height Height) (*NetworkVersion, error)
type NetworkType ¶
type NetworkType uint8
const ( Mijin NetworkType = 96 MijinTest NetworkType = 144 Public NetworkType = 184 PublicTest NetworkType = 168 Private NetworkType = 200 PrivateTest NetworkType = 176 NotSupportedNet NetworkType = 0 AliasAddress NetworkType = 145 )
func ExtractNetworkType ¶
func ExtractNetworkType(version int64) NetworkType
func NetworkTypeFromString ¶
func NetworkTypeFromString(networkType string) NetworkType
func (NetworkType) String ¶
func (nt NetworkType) String() string
type NetworkVersion ¶
type NetworkVersion struct { StartedHeight Height BlockChainVersion BlockChainVersion }
func (NetworkVersion) String ¶
func (nv NetworkVersion) String() string
type PartialAddedMapper ¶
type PartialAddedMapper interface {
MapPartialAdded(m []byte) (*AggregateTransaction, error)
}
func NewPartialAddedMapper ¶
func NewPartialAddedMapper(mapTransactionFunc mapTransactionFunc) PartialAddedMapper
type PartialRemovedInfo ¶
type PartialRemovedInfo struct {
Meta *TransactionInfo
}
func MapPartialRemoved ¶
func MapPartialRemoved(m []byte) (*PartialRemovedInfo, error)
type PartialRemovedMapper ¶
type PartialRemovedMapper interface {
MapPartialRemoved(m []byte) (*PartialRemovedInfo, error)
}
type PartialRemovedMapperFn ¶
type PartialRemovedMapperFn func(m []byte) (*PartialRemovedInfo, error)
func (PartialRemovedMapperFn) MapPartialRemoved ¶
func (p PartialRemovedMapperFn) MapPartialRemoved(m []byte) (*PartialRemovedInfo, error)
type PlainMessage ¶
type PlainMessage struct {
// contains filtered or unexported fields
}
func NewPlainMessage ¶
func NewPlainMessage(payload string) *PlainMessage
func NewPlainMessageFromEncodedData ¶
func NewPlainMessageFromEncodedData(encodedData []byte, recipient *xpxcrypto.PrivateKey, sender *xpxcrypto.PublicKey) (*PlainMessage, error)
func (*PlainMessage) Message ¶
func (m *PlainMessage) Message() string
func (*PlainMessage) Payload ¶
func (m *PlainMessage) Payload() []byte
func (*PlainMessage) String ¶
func (m *PlainMessage) String() string
func (*PlainMessage) Type ¶
func (m *PlainMessage) Type() MessageType
type Proof ¶
type Proof struct {
Data []byte
}
func NewProofFromBytes ¶
func NewProofFromHexString ¶
func NewProofFromString ¶
func NewProofFromUint16 ¶
func NewProofFromUint32 ¶
func NewProofFromUint64 ¶
func NewProofFromUint8 ¶
type PropertyModificationType ¶
type PropertyModificationType uint8
const ( AddProperty PropertyModificationType = iota RemoveProperty )
PropertyModificationType enums
type PropertyType ¶
type PropertyType uint8
const ( AllowAddress PropertyType = 0x01 AllowMosaic PropertyType = 0x02 AllowTransaction PropertyType = 0x04 Sentinel PropertyType = 0x05 BlockAddress PropertyType = 0x80 + 0x01 BlockMosaic PropertyType = 0x80 + 0x02 BlockTransaction PropertyType = 0x80 + 0x04 )
Account property type 0x01 The property type is an address. 0x02 The property type is mosaic id. 0x04 The property type is a transaction type. 0x05 Property type sentinel. 0x80 + type The property is interpreted as a blocking operation.
type PublicAccount ¶
func NewAccountFromPublicKey ¶
func NewAccountFromPublicKey(pKey string, networkType NetworkType) (*PublicAccount, error)
returns a PublicAccount from public key for passed NetworkType
func (*PublicAccount) String ¶
func (ref *PublicAccount) String() string
type RegisterNamespaceTransaction ¶
type RegisterNamespaceTransaction struct { AbstractTransaction *NamespaceId NamespaceType NamspaceName string Duration Duration ParentId *NamespaceId }
func NewRegisterRootNamespaceTransaction ¶
func NewRegisterRootNamespaceTransaction(deadline *Deadline, namespaceName string, duration Duration, networkType NetworkType) (*RegisterNamespaceTransaction, error)
returns a RegisterNamespaceTransaction from passed namespace name and duration in blocks
func NewRegisterSubNamespaceTransaction ¶
func NewRegisterSubNamespaceTransaction(deadline *Deadline, namespaceName string, parentId *NamespaceId, networkType NetworkType) (*RegisterNamespaceTransaction, error)
returns a RegisterNamespaceTransaction from passed namespace name and parent NamespaceId
func (*RegisterNamespaceTransaction) GetAbstractTransaction ¶
func (tx *RegisterNamespaceTransaction) GetAbstractTransaction() *AbstractTransaction
func (*RegisterNamespaceTransaction) Size ¶
func (tx *RegisterNamespaceTransaction) Size() int
func (*RegisterNamespaceTransaction) String ¶
func (tx *RegisterNamespaceTransaction) String() string
type ResolverService ¶
type ResolverService struct { NamespaceService *NamespaceService MosaicService *MosaicService // contains filtered or unexported fields }
TODO: Implement resolving namespace to account
func (*ResolverService) GetMosaicInfoByAssetId ¶
func (ref *ResolverService) GetMosaicInfoByAssetId(ctx context.Context, assetId AssetId) (*MosaicInfo, error)
func (*ResolverService) GetMosaicInfosByAssetIds ¶
func (ref *ResolverService) GetMosaicInfosByAssetIds(ctx context.Context, assetIds ...AssetId) ([]*MosaicInfo, error)
type Secret ¶
func NewSecretFromHexString ¶
returns Secret from passed hex string hash and HashType
func (*Secret) HashString ¶
type SecretLockTransaction ¶
type SecretLockTransaction struct { AbstractTransaction *Mosaic Duration Duration Secret *Secret Recipient *Address }
func NewSecretLockTransaction ¶
func NewSecretLockTransaction(deadline *Deadline, mosaic *Mosaic, duration Duration, secret *Secret, recipient *Address, networkType NetworkType) (*SecretLockTransaction, error)
returns a SecretLockTransaction from passed Mosaic, duration in blocks, Secret and mosaic recipient Address
func (*SecretLockTransaction) GetAbstractTransaction ¶
func (tx *SecretLockTransaction) GetAbstractTransaction() *AbstractTransaction
func (*SecretLockTransaction) Size ¶
func (tx *SecretLockTransaction) Size() int
func (*SecretLockTransaction) String ¶
func (tx *SecretLockTransaction) String() string
type SecretProofTransaction ¶
type SecretProofTransaction struct { AbstractTransaction HashType Proof *Proof Recipient *Address }
func NewSecretProofTransaction ¶
func NewSecretProofTransaction(deadline *Deadline, hashType HashType, proof *Proof, recipient *Address, networkType NetworkType) (*SecretProofTransaction, error)
returns a SecretProofTransaction from passed HashType and Proof
func (*SecretProofTransaction) GetAbstractTransaction ¶
func (tx *SecretProofTransaction) GetAbstractTransaction() *AbstractTransaction
func (*SecretProofTransaction) Size ¶
func (tx *SecretProofTransaction) Size() int
func (*SecretProofTransaction) String ¶
func (tx *SecretProofTransaction) String() string
type SecureMessage ¶
type SecureMessage struct {
// contains filtered or unexported fields
}
func NewSecureMessage ¶
func NewSecureMessage(encodedData []byte) *SecureMessage
func NewSecureMessageFromPlaintText ¶
func NewSecureMessageFromPlaintText(plaintText string, sender *xpxcrypto.PrivateKey, recipient *xpxcrypto.PublicKey) (*SecureMessage, error)
func (*SecureMessage) Payload ¶
func (m *SecureMessage) Payload() []byte
func (*SecureMessage) String ¶
func (m *SecureMessage) String() string
func (*SecureMessage) Type ¶
func (m *SecureMessage) Type() MessageType
type SignedTransaction ¶
type SignedTransaction struct { EntityType Payload string Hash *Hash }
type SignerInfo ¶
func MapCosignature ¶
func MapCosignature(m []byte) (*SignerInfo, error)
type StatusInfo ¶
func MapStatus ¶
func MapStatus(m []byte) (*StatusInfo, error)
type StatusMapper ¶
type StatusMapper interface {
MapStatus(m []byte) (*StatusInfo, error)
}
type StatusMapperFn ¶
type StatusMapperFn func(m []byte) (*StatusInfo, error)
func (StatusMapperFn) MapStatus ¶
func (p StatusMapperFn) MapStatus(m []byte) (*StatusInfo, error)
type SupportedEntities ¶
type SupportedEntities struct {
Entities map[EntityType]*Entity
}
func NewSupportedEntities ¶
func NewSupportedEntities() *SupportedEntities
func (*SupportedEntities) MarshalBinary ¶
func (s *SupportedEntities) MarshalBinary() (data []byte, err error)
func (*SupportedEntities) String ¶
func (s *SupportedEntities) String() string
func (*SupportedEntities) UnmarshalBinary ¶
func (s *SupportedEntities) UnmarshalBinary(data []byte) error
type Timestamp ¶
func NewTimestamp ¶
returns new Timestamp from passed milliseconds value
func (*Timestamp) ToBlockchainTimestamp ¶
func (t *Timestamp) ToBlockchainTimestamp() *BlockchainTimestamp
type Transaction ¶
type Transaction interface { GetAbstractTransaction() *AbstractTransaction String() string // number of bytes of serialized transaction Size() int // contains filtered or unexported methods }
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"`
}
type TransactionIdsDTO ¶
type TransactionIdsDTO struct {
Ids []string `json:"transactionIds"`
}
type TransactionInfo ¶
type TransactionInfo struct { Height Height Index uint32 Id string TransactionHash *Hash MerkleComponentHash *Hash AggregateHash *Hash AggregateId string }
func (*TransactionInfo) String ¶
func (ti *TransactionInfo) String() string
type TransactionOrder ¶
type TransactionOrder string
const ( TRANSACTION_ORDER_ASC TransactionOrder = "id" TRANSACTION_ORDER_DESC TransactionOrder = "-id" )
type TransactionService ¶
type TransactionService struct { BlockchainService *BlockchainService // contains filtered or unexported fields }
func (*TransactionService) Announce ¶
func (txs *TransactionService) Announce(ctx context.Context, tx *SignedTransaction) (string, error)
returns transaction hash after announcing passed SignedTransaction
func (*TransactionService) AnnounceAggregateBonded ¶
func (txs *TransactionService) AnnounceAggregateBonded(ctx context.Context, tx *SignedTransaction) (string, error)
returns transaction hash after announcing passed aggregate bounded SignedTransaction
func (*TransactionService) AnnounceAggregateBondedCosignature ¶
func (txs *TransactionService) AnnounceAggregateBondedCosignature(ctx context.Context, c *CosignatureSignedTransaction) (string, error)
returns transaction hash after announcing passed CosignatureSignedTransaction
func (*TransactionService) GetTransaction ¶
func (txs *TransactionService) GetTransaction(ctx context.Context, id string) (Transaction, error)
returns Transaction for passed transaction id or hash
func (*TransactionService) GetTransactionEffectiveFee ¶
func (txs *TransactionService) GetTransactionEffectiveFee(ctx context.Context, transactionId string) (int, error)
Gets a transaction's effective paid fee
func (*TransactionService) GetTransactionStatus ¶
func (txs *TransactionService) GetTransactionStatus(ctx context.Context, id string) (*TransactionStatus, error)
returns TransactionStatus for passed transaction id or hash
func (*TransactionService) GetTransactionStatuses ¶
func (txs *TransactionService) GetTransactionStatuses(ctx context.Context, hashes []string) ([]*TransactionStatus, error)
returns an array of TransactionStatus's for passed transaction ids or hashes
func (*TransactionService) GetTransactions ¶
func (txs *TransactionService) GetTransactions(ctx context.Context, ids []string) ([]Transaction, error)
returns an array of Transaction's for passed array of transaction ids or hashes
type TransactionStatus ¶
type TransactionStatus struct { Deadline *Deadline Group string Status string Hash *Hash Height Height }
func (*TransactionStatus) String ¶
func (ts *TransactionStatus) String() string
type TransferTransaction ¶
type TransferTransaction struct { AbstractTransaction Message Message Mosaics []*Mosaic Recipient *Address }
func NewTransferTransaction ¶
func NewTransferTransaction(deadline *Deadline, recipient *Address, mosaics []*Mosaic, message Message, networkType NetworkType) (*TransferTransaction, error)
returns a TransferTransaction from passed transfer recipient Adderess, array of Mosaic's to transfer and transfer Message
func NewTransferTransactionWithNamespace ¶
func NewTransferTransactionWithNamespace(deadline *Deadline, recipient *NamespaceId, mosaics []*Mosaic, message Message, networkType NetworkType) (*TransferTransaction, error)
returns TransferTransaction from passed recipient NamespaceId, Mosaic's and transfer Message
func (*TransferTransaction) GetAbstractTransaction ¶
func (tx *TransferTransaction) GetAbstractTransaction() *AbstractTransaction
func (*TransferTransaction) MessageSize ¶
func (tx *TransferTransaction) MessageSize() int
func (*TransferTransaction) Size ¶
func (tx *TransferTransaction) Size() int
func (*TransferTransaction) String ¶
func (tx *TransferTransaction) String() string
type UnconfirmedAddedMapper ¶
type UnconfirmedAddedMapper interface {
MapUnconfirmedAdded(m []byte) (Transaction, error)
}
func NewUnconfirmedAddedMapper ¶
func NewUnconfirmedAddedMapper(mapTransactionFunc mapTransactionFunc) UnconfirmedAddedMapper
type UnconfirmedRemoved ¶
type UnconfirmedRemoved struct {
Meta *TransactionInfo
}
func MapUnconfirmedRemoved ¶
func MapUnconfirmedRemoved(m []byte) (*UnconfirmedRemoved, error)
type UnconfirmedRemovedMapper ¶
type UnconfirmedRemovedMapper interface {
MapUnconfirmedRemoved(m []byte) (*UnconfirmedRemoved, error)
}
type UnconfirmedRemovedMapperFn ¶
type UnconfirmedRemovedMapperFn func(m []byte) (*UnconfirmedRemoved, error)
func (UnconfirmedRemovedMapperFn) MapUnconfirmedRemoved ¶
func (p UnconfirmedRemovedMapperFn) MapUnconfirmedRemoved(m []byte) (*UnconfirmedRemoved, error)
type WsMessageInfo ¶
type WsMessageInfoDTO ¶
type WsMessageInfoDTO struct {
Meta wsMessageInfoMetaDTO `json:"meta"`
}
func (*WsMessageInfoDTO) ToStruct ¶
func (dto *WsMessageInfoDTO) ToStruct() (*WsMessageInfo, error)
Source Files
¶
- account.go
- account_internal.go
- account_model.go
- blockchain.go
- blockchain_internal.go
- blockchain_model.go
- consts.go
- contract.go
- contract_internal.go
- contract_model.go
- errors.go
- message.go
- message_processors.go
- metadata.go
- metadata_internal.go
- metadata_model.go
- mosaic.go
- mosaic_internal.go
- mosaic_model.go
- namespace.go
- namespace_internal.go
- namespace_model.go
- network.go
- network_internal.go
- network_model.go
- resolver.go
- sdk.go
- sdk_internal.go
- sdk_model.go
- sdk_schema.go
- secret.go
- transaction.go
- transaction_internal.go
- transaction_model.go
- transaction_schema.go
- util.go
- websocket_model.go