web1337

package module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

README

Wellcome to Web1337

cover


Intro

This SDK is designed to work with the KLY network. Currently the functionality includes:

  1. Generating key pairs for 4 types of accounts
  2. Creation of all types of transactions
  3. Interaction with smart contracts
  4. Interaction with system components of the network (staking, aliases and much more)
  5. Interaction with CRUD API endpoints

Note

Currently supports only dev_tachyon workflow

Installation

go get -u github.com/KlyntarNetwork/Web1337Golang

Usage

To fully understand the capabilities of the SDK, please refer to our documentation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainInfo

type ChainInfo struct {
	NodeURL         string
	WorkflowVersion uint
}

type Options

type Options struct {
	ChainID         string
	WorkflowVersion uint
	NodeURL         string
	ProxyURL        string
}

type TransactionTemplate

type TransactionTemplate struct {
	V       uint                   `json:"v"`
	Creator string                 `json:"creator"`
	Type    string                 `json:"type"`
	Nonce   uint                   `json:"nonce"`
	Fee     string                 `json:"fee"`
	Payload map[string]interface{} `json:"payload"` // might be various - depends on transaction type
	SigType string                 `json:"sigType"`
	Sig     string                 `json:"sig"`
}

type Web1337

type Web1337 struct {
	Chains       map[string]ChainInfo
	CurrentChain string
	Proxy        http.RoundTripper
}

func NewWeb1337

func NewWeb1337(options Options) (*Web1337, error)

func (*Web1337) BuildPartialSignatureWithTxData

func (web1337 *Web1337) BuildPartialSignatureWithTxData(txType, hexID string, sharedPayload []string, nonce uint, fee string, payload map[string]interface{}) (string, error)

func (*Web1337) CreateEd25519Transaction

func (web1337 *Web1337) CreateEd25519Transaction(txType, yourAddress, base64PrivateKey string, nonce uint, fee string, payload map[string]interface{}) (TransactionTemplate, error)

func (*Web1337) CreateMultisigTransaction

func (web1337 *Web1337) CreateMultisigTransaction(txType, rootPubKey, aggregatedSignatureOfActive string, nonce uint, fee string, payload map[string]interface{}) TransactionTemplate

func (*Web1337) CreatePostQuantumTransaction

func (sdk *Web1337) CreatePostQuantumTransaction(txType, pqcAlgorithm, yourAddress, yourPrivateKeyAsHex string, nonce uint, fee string, payload map[string]interface{}) (TransactionTemplate, error)

func (*Web1337) CreateThresholdTransaction

func (sdk *Web1337) CreateThresholdTransaction(txType, tblsRootPubkey string, partialSignatures, idsOfSigners []string, nonce uint, fee string, payload map[string]interface{}) TransactionTemplate

func (*Web1337) GetAccountFromState

func (sdk *Web1337) GetAccountFromState(accountID string) ([]byte, error)

func (*Web1337) GetAggregatedEpochFinalizationProof

func (sdk *Web1337) GetAggregatedEpochFinalizationProof(epochIndex uint) ([]byte, error)

func (*Web1337) GetAggregatedFinalizationProof

func (sdk *Web1337) GetAggregatedFinalizationProof(blockID string) ([]byte, error)

Consensus related

func (*Web1337) GetBlockByBlockID

func (sdk *Web1337) GetBlockByBlockID(blockID string) ([]byte, error)

Blocks

func (*Web1337) GetBlockBySID

func (sdk *Web1337) GetBlockBySID(index uint) ([]byte, error)

func (*Web1337) GetChainInfo

func (sdk *Web1337) GetChainInfo() ([]byte, error)

func (*Web1337) GetCheckpointByEpochIndex

func (sdk *Web1337) GetCheckpointByEpochIndex(epochIndex uint) ([]byte, error)

func (*Web1337) GetCurrentEpochOnThreads

func (sdk *Web1337) GetCurrentEpochOnThreads(threadID string) ([]byte, error)

Epochs

func (*Web1337) GetCurrentLeader

func (sdk *Web1337) GetCurrentLeader() ([]byte, error)

func (*Web1337) GetDataFromState

func (sdk *Web1337) GetDataFromState(cellID string) ([]byte, error)

State

func (*Web1337) GetEpochByIndex

func (sdk *Web1337) GetEpochByIndex(epochIndex uint) ([]byte, error)

func (*Web1337) GetHistoricalStatsPerEpoch

func (sdk *Web1337) GetHistoricalStatsPerEpoch(startIndex uint, limit uint) ([]byte, error)

func (*Web1337) GetInfrastructureInfo

func (sdk *Web1337) GetInfrastructureInfo() ([]byte, error)

Misc

func (*Web1337) GetKlyEVMMetadata

func (sdk *Web1337) GetKlyEVMMetadata() ([]byte, error)

func (*Web1337) GetLatestNBlocks

func (sdk *Web1337) GetLatestNBlocks(startIndex uint, limit uint) ([]byte, error)

func (*Web1337) GetPoolStats

func (sdk *Web1337) GetPoolStats(poolID string) ([]byte, error)

func (*Web1337) GetQuorumUrlsAndPubkeys

func (sdk *Web1337) GetQuorumUrlsAndPubkeys() ([]byte, error)

func (*Web1337) GetSynchronizationStats

func (sdk *Web1337) GetSynchronizationStats() ([]byte, error)

func (*Web1337) GetTransactionReceipt

func (sdk *Web1337) GetTransactionReceipt(txID string) ([]byte, error)

Transactions

func (*Web1337) GetTransactionTemplate

func (web1337 *Web1337) GetTransactionTemplate(workflowVersion uint, creator, txType, sigType string, nonce uint, fee string, payload map[string]interface{}) TransactionTemplate

func (*Web1337) GetTransactionsWithAccount

func (sdk *Web1337) GetTransactionsWithAccount(accountID string) ([]byte, error)

func (*Web1337) GetVerificationThreadStats

func (sdk *Web1337) GetVerificationThreadStats() ([]byte, error)

func (*Web1337) GetVerificationThreadStatsPerEpoch

func (sdk *Web1337) GetVerificationThreadStatsPerEpoch(epochIndex uint) ([]byte, error)

func (*Web1337) SignDataForMultisigTransaction

func (web1337 *Web1337) SignDataForMultisigTransaction(txType, blsPrivateKey string, nonce uint, fee string, payload map[string]interface{}) string

Directories

Path Synopsis
bls
pqc

Jump to

Keyboard shortcuts

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