resp

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExtraFilterDao      ExtraFilterType = "Dao"
	ExtraFilterCellBase                 = "CellBase"
	ExtraFilterFreeze                   = "Freeze"
)

Variables

This section is empty.

Functions

func SignTransaction added in v0.101.1

func SignTransaction(transaction *types.Transaction, scriptGroup *ScriptGroup, privateKey crypto.Key) error

Types

type AccountInfo added in v0.101.5

type AccountInfo struct {
	AccountNumber  uint64      `json:"account_number"`
	AccountAddress string      `json:"account_address"`
	AccountType    AccountType `json:"account_type"`
}

type AccountType added in v0.101.5

type AccountType string
const (
	Acp    AccountType = "Acp"
	PwLock AccountType = "PwLock"
)

type AssetStatus added in v0.43.2

type AssetStatus string
const (
	Claimable AssetStatus = "Claimable"
	Fixed     AssetStatus = "Fixed"
)

type Balance

type Balance struct {
	Ownership *common.Ownership `json:"ownership"`
	AssetInfo *common.AssetInfo `json:"asset_info"`
	Free      *model.U128       `json:"free"`
	Occupied  *model.U128       `json:"occupied"`
	Frozen    *model.U128       `json:"frozen"`
	Claimable *model.U128       `json:"claimable"`
}

type BlockInfo added in v0.101.1

type BlockInfo struct {
	BlockNumber  uint64             `json:"block_number"`
	BlockHash    string             `json:"block_hash"`
	ParentHash   string             `json:"parent_hash"`
	Timestamp    uint64             `json:"timestamp"`
	Transactions []*TransactionInfo `json:"transactions"`
}

type BurnInfo added in v0.101.1

type BurnInfo struct {
	UdtHash string      `json:"udt_hash"`
	Amount  *model.U128 `json:"amount"`
}

type DBDriver added in v0.101.1

type DBDriver string
const (
	PostgreSQL DBDriver = "PostgreSQL"
	MySQL      DBDriver = "MySQL"
	SQLite     DBDriver = "SQLite"
)

type DBInfo added in v0.101.1

type DBInfo struct {
	Version   string   `json:"version"`
	DB        DBDriver `json:"db"`
	ConnSize  uint32   `json:"conn_size"`
	CenterId  int64    `json:"center_id"`
	MachineId int64    `json:"machine_id"`
}

type DaoInfo added in v0.101.1

type DaoInfo struct {
	DepositBlockNumber  uint64   `json:"deposit_block_number,omitempty"`
	WithdrawBlockNumber uint64   `json:"withdraw_block_number,omitempty"`
	DaoState            DaoState `json:"state"`
	Reward              uint64   `json:"reward"`
}

type DaoState added in v0.101.1

type DaoState struct {
	Type  DaoStateType `json:"type"`
	Value []uint64     `json:"value"`
}

func (*DaoState) UnmarshalJSON added in v0.101.1

func (e *DaoState) UnmarshalJSON(bytes []byte) error

type DaoStateType added in v0.101.1

type DaoStateType = string
const (
	DaoStateDeposit  DaoStateType = "Deposit"
	DaoStateWithdraw DaoStateType = "Withdraw"
)

type Extension added in v0.101.1

type Extension struct {
	Name     string          `json:"name"`
	Scripts  []types.Script  `json:"scripts"`
	CellDeps []types.CellDep `json:"cell_deps"`
}

type ExtraFilter added in v0.101.1

type ExtraFilter struct {
	Type  ExtraFilterType `json:"type"`
	Value *DaoInfo        `json:"value"`
}

type ExtraFilterType added in v0.101.1

type ExtraFilterType string

type GetBalanceResponse added in v0.43.0

type GetBalanceResponse struct {
	Balances       []*Balance `json:"balances"`
	TipBlockNumber uint64     `json:"tip_block_number"`
}

type GetTransactionInfoResponse added in v0.101.1

type GetTransactionInfoResponse struct {
	Transaction  *TransactionInfo        `json:"transaction"`
	Status       types.TransactionStatus `json:"status"`
	RejectReason uint8                   `json:"reject_reason"`
}

type HashAlgorithm added in v0.101.1

type HashAlgorithm string
const (
	Blake2b   HashAlgorithm = "Blake2b"
	Keccak256 HashAlgorithm = "Keccak256"
)

type MercuryInfo added in v0.101.1

type MercuryInfo struct {
	MercuryVersion    string      `json:"mercury_version"`
	CkbNodeVersion    string      `json:"ckb_node_version"`
	NetworkType       NetworkType `json:"network_type"`
	EnabledExtensions []Extension `json:"enabled_extensions"`
}

type MercurySyncState added in v0.101.4

type MercurySyncState struct {
	State    SyncState `json:"type"`
	SyncInfo struct {
		Current  uint64 `json:"current"`
		Target   uint64 `json:"target"`
		Progress uint64 `json:"progress"`
	} `json:"sync_info,omitempty"`
}

type NetworkType added in v0.101.1

type NetworkType string
const (
	Mainnet NetworkType = "Mainnet"
	Testnet NetworkType = "Testnet"
	Staging NetworkType = "Staging"
	Dev     NetworkType = "Dev"
)

type PaginationResponseTransactionInfo added in v0.101.1

type PaginationResponseTransactionInfo struct {
	Response   []TransactionInfoWrapper `json:"response"`
	Count      big.Int                  `json:"count"`
	NextCursor []int                    `json:"next_cursor"`
}

type PaginationResponseTransactionView added in v0.101.1

type PaginationResponseTransactionView struct {
	Response   []TransactionViewWrapper `json:"response"`
	Count      big.Int                  `json:"count"`
	NextCursor []int                    `json:"next_cursor"`
}

type QueryGenericTransactionsResponse added in v0.43.0

type QueryGenericTransactionsResponse struct {
	Txs        []*TransactionInfo `json:"txs"`
	TotalCount uint64             `json:"total_count"`
	NextOffset uint64             `json:"next_offset"`
}

type Record added in v0.101.1

type Record struct {
	OutPoint    *common.OutPoint  `json:"out_point"`
	Ownership   *common.Ownership `json:"ownership"`
	Amount      *model.U128       `json:"amount"`
	Occupied    *model.U128       `json:"occupied"`
	AssetInfo   *common.AssetInfo `json:"asset_info"`
	Status      RecordStatus      `json:"status"`
	Extra       ExtraFilter       `json:"extra"`
	BlockNumber uint64            `json:"block_number"`
	EpochNumber uint64            `json:"epoch_number"`
}

type RecordStatus added in v0.101.1

type RecordStatus struct {
	Type  RecordStatusType `json:"type"`
	Value uint64           `json:"value"`
}

type RecordStatusType added in v0.101.1

type RecordStatusType string
const (
	RecordStatusFixed     RecordStatusType = "Fixed"
	RecordStatusClaimable                  = "Claimable"
)

type ScriptGroup

type ScriptGroup struct {
	Action          *SignatureAction
	Transaction     *transactionResp
	OriginalWitness []byte
}

func NewScriptGroup added in v0.101.1

func NewScriptGroup(action *SignatureAction, transaction *transactionResp) *ScriptGroup

func (*ScriptGroup) GetAddress added in v0.101.1

func (g *ScriptGroup) GetAddress() string

func (*ScriptGroup) GetGroupWitnesses added in v0.101.1

func (g *ScriptGroup) GetGroupWitnesses() [][]byte

func (*ScriptGroup) GetOffSet added in v0.101.1

func (g *ScriptGroup) GetOffSet() int

func (*ScriptGroup) GetWitness added in v0.101.1

func (g *ScriptGroup) GetWitness() []byte

func (*ScriptGroup) GetWitnessIndex added in v0.101.1

func (g *ScriptGroup) GetWitnessIndex() int

type SignAlgorithm added in v0.101.1

type SignAlgorithm string
const (
	Secp256k1        SignAlgorithm = "Secp256k1"
	EthereumPersonal SignAlgorithm = "EthereumPersonal"
)

type SignatureAction added in v0.101.1

type SignatureAction struct {
	SignatureLocation   *SignatureLocation `json:"signature_location"`
	SignatureInfo       *SignatureInfo     `json:"signature_info"`
	HashAlgorithm       *HashAlgorithm     `json:"hash_algorithm"`
	OtherIndexesInGroup []int              `json:"other_indexes_in_group"`
}

type SignatureInfo added in v0.101.1

type SignatureInfo struct {
	Algorithm SignAlgorithm `json:"algorithm"`
	Address   string        `json:"address"`
}

type SignatureLocation added in v0.101.1

type SignatureLocation struct {
	Index  int `json:"index"`
	Offset int `json:"offset"`
}

type SyncState added in v0.101.4

type SyncState string
const (
	ReadOnly            SyncState = "ReadOnly"
	Serial              SyncState = "Serial"
	ParallelFirstStage  SyncState = "ParallelFirstStage"
	ParallelSecondStage SyncState = "ParallelSecondStage"
)

type TransactionInfo added in v0.101.1

type TransactionInfo struct {
	TxHash    string      `json:"tx_hash"`
	Records   []Record    `json:"records"`
	Fee       int64       `json:"fee"`
	Burn      []*BurnInfo `json:"burn"`
	Timestamp int64       `json:"timestamp"`
}

type TransactionInfoWrapper added in v0.101.1

type TransactionInfoWrapper struct {
	Type  TransactionType `json:"type"`
	Value TransactionInfo `json:"value"`
}

type TransactionType added in v0.101.1

type TransactionType string
const (
	TransactionTransactionView TransactionType = "TransactionView"
	TransactionTransactionInfo                 = "TransactionInfo"
)

type TransactionViewWrapper added in v0.101.1

type TransactionViewWrapper struct {
	Type  TransactionType                  `json:"type"`
	Value common.TransactionWithRichStatus `json:"value`
}

type TransferCompletionResponse

type TransferCompletionResponse struct {
	TxView           *transactionResp   `json:"tx_view"`
	SignatureActions []*SignatureAction `json:"signature_actions"`
}

func (*TransferCompletionResponse) GetScriptGroup

func (self *TransferCompletionResponse) GetScriptGroup() []*ScriptGroup

func (*TransferCompletionResponse) GetTransaction

func (self *TransferCompletionResponse) GetTransaction() *types.Transaction

Jump to

Keyboard shortcuts

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