Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Casper 2.0.0 #103

Closed
wants to merge 95 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
8465b70
Implement QueryBalanceDetails RPC method
ZhmakAS May 14, 2024
a4c11fd
Update info get status method
ZhmakAS May 15, 2024
0fee624
Refactor chain_get_block method
ZhmakAS May 15, 2024
c934191
Merge pull request #87 from make-software/CSDK-158/update_get_info_ge…
ZhmakAS May 16, 2024
c3461d6
Updated chain_get_block_transfers_method
ZhmakAS May 17, 2024
508bfa2
Implement new global Key types
ZhmakAS May 20, 2024
161a54a
Merge pull request #89 from make-software/CSDK-169/updated_get_block_…
ZhmakAS May 23, 2024
c4fa229
Refactor after review
ZhmakAS May 23, 2024
026422d
CSDK-180/added_support_rpc_state_get_entity
ZhmakAS May 23, 2024
77b26a8
Implement backward compatibility for V1
ZhmakAS May 24, 2024
e24b149
Added backward compatibility to query_global_state
ZhmakAS May 24, 2024
c584cbf
Fixed imports
ZhmakAS May 24, 2024
8337cd6
CSDK-169/make_get_block_transfers_compatible
ZhmakAS May 28, 2024
1d81cab
Actualize info_get_deploy method
ZhmakAS May 28, 2024
211f6b7
Remove commented code
ZhmakAS May 28, 2024
ea94a32
Fixed version check
ZhmakAS May 29, 2024
1bb136d
Merge branch 'casper-2.0.0' into CSDK-160/refactor_chain_get_block_re…
ZhmakAS May 29, 2024
296114a
Updated QueryBalanceDetails method signature
ZhmakAS May 29, 2024
86c654c
Merge pull request #90 from make-software/CSDK-173/implement_new_glob…
ZhmakAS May 30, 2024
b1903ba
Merge pull request #88 from make-software/CSDK-160/refactor_chain_get…
ZhmakAS Jun 3, 2024
00e60b9
Implement info_get_transaction RPC method
ZhmakAS Jun 3, 2024
99a8cc3
Fixed conflicts
ZhmakAS Jun 4, 2024
15c69c0
CSDK/added_info_get_transaction
ZhmakAS Jun 5, 2024
3c0f139
Added test cases
ZhmakAS Jun 5, 2024
e767b21
Actualize chain_get_block RPC re rc2
ZhmakAS Jun 19, 2024
d73668d
NO-JIRA/update_sse_events_to_condor
ZhmakAS Jun 20, 2024
82bc71d
NO-JIRA/update_sse_events_to_condor
ZhmakAS Jun 24, 2024
4854166
update/actualize_chain_get_block_rc2
ZhmakAS Jun 26, 2024
a14724b
update/actualize_chain_get_block_rc2
ZhmakAS Jun 26, 2024
713c004
update/actualize_chain_get_block_rc2
ZhmakAS Jun 27, 2024
2d9a97e
Merge pull request #95 from make-software/update/actualize_chain_get_…
ZhmakAS Jun 27, 2024
b4fc8fa
Merge branch 'casper-2.0.0' into NO-JIRA/update_sse_events_to_condor
ZhmakAS Jun 27, 2024
355bdb3
NO-JIRA/update_sse_events_to_condor
ZhmakAS Jun 27, 2024
c3d4fdf
Merge pull request #96 from make-software/NO-JIRA/update_sse_events_t…
ZhmakAS Jun 27, 2024
a7bc19f
Actualize and make get_auction_info V1 compatible
ZhmakAS Jul 1, 2024
aea4aa4
Merge branch 'casper-2.0.0' into CSDK-180/added_support_rpc_state_get…
ZhmakAS Jul 1, 2024
e0ba591
CSDK-180/added_support_rpc_state_get_entity
ZhmakAS Jul 1, 2024
6a11708
Merge branch 'casper-2.0.0' into CSDK-169/make_get_block_transfers_co…
ZhmakAS Jul 1, 2024
573cff0
Merge branch 'casper-2.0.0' into CSDK-150/added_query_balance_details…
ZhmakAS Jul 2, 2024
0dbb616
Adjust query_balance and query_balance_details RPC method interfaces
ZhmakAS Jul 3, 2024
69c64ad
CSDK-180/added_support_rpc_state_get_entity
ZhmakAS Jul 3, 2024
0854104
CSDK-169/make_get_block_transfers_compatible
ZhmakAS Jul 3, 2024
b9bd053
CSDK-180/added_support_rpc_state_get_entity
ZhmakAS Jul 3, 2024
04463db
Merge pull request #91 from make-software/CSDK-180/added_support_rpc_…
ZhmakAS Jul 3, 2024
b1decab
CSDK-150/added_query_balance_details_rpc_endpoint
ZhmakAS Jul 3, 2024
a1d231a
Merge pull request #86 from make-software/CSDK-150/added_query_balanc…
ZhmakAS Jul 3, 2024
a7f04b3
Extend StoredValue type with new options
ZhmakAS Jul 8, 2024
29e4fd4
Fixed commented tests
ZhmakAS Jul 8, 2024
20da381
Fixed imports
ZhmakAS Jul 8, 2024
6233300
Merge branch 'casper-2.0.0' into NO-JIRA/actualize_get_auction_info
ZhmakAS Jul 8, 2024
c8ff677
Merge pull request #97 from make-software/NO-JIRA/actualize_get_aucti…
ZhmakAS Jul 8, 2024
63c1a71
Merge branch 'casper-2.0.0' into NO-JIRA/extend_stored_value_type
ZhmakAS Jul 8, 2024
bf5a876
NO-JIRA/extend_stored_value_type
ZhmakAS Jul 8, 2024
add3fe9
NO-JIRA/extend_stored_value_type
ZhmakAS Jul 9, 2024
eb9da4f
Merge pull request #98 from make-software/NO-JIRA/extend_stored_value…
ZhmakAS Jul 9, 2024
2c3a377
Merge branch 'casper-2.0.0' into CSDK-169/make_get_block_transfers_co…
ZhmakAS Jul 9, 2024
1709cb0
CSDK-169/make_get_block_transfers_compatible
ZhmakAS Jul 9, 2024
304938b
CSDK-169/make_get_block_transfers_compatible
ZhmakAS Jul 9, 2024
9e5c9c0
Merge pull request #92 from make-software/CSDK-169/make_get_block_tra…
ZhmakAS Jul 9, 2024
a21dcf2
Merge branch 'casper-2.0.0' into CSDK/added_info_get_transaction
ZhmakAS Jul 9, 2024
2149b6a
CSDK/added_info_get_transaction
ZhmakAS Jul 10, 2024
45341c8
Merge branch 'casper-2.0.0' into CSDK/added_info_get_transaction
ZhmakAS Jul 10, 2024
f64cc5a
Merge branch 'casper-2.0.0' into csdk-118/actualize_info_get_deploy_rpc
ZhmakAS Jul 10, 2024
cac6e75
csdk-118/actualize_info_get_deploy_rpc
ZhmakAS Jul 10, 2024
a48cd89
CSDK/added_info_get_transaction
ZhmakAS Jul 10, 2024
d06481b
CSDK/added_info_get_transaction
ZhmakAS Jul 10, 2024
0a4d64a
Merge pull request #94 from make-software/CSDK/added_info_get_transac…
ZhmakAS Jul 11, 2024
d1bd856
CSDK/update_get_transactions_method
ZhmakAS Jul 11, 2024
46348d4
Merge pull request #99 from make-software/CSDK/update_get_transaction…
ZhmakAS Jul 12, 2024
638e063
CSDK/added_sse_transaction_events
ZhmakAS Jul 12, 2024
78624fa
Merge branch 'casper-2.0.0' into csdk-118/actualize_info_get_deploy_rpc
ZhmakAS Jul 12, 2024
c7ab08e
csdk-118/actualize_info_get_deploy_rpc
ZhmakAS Jul 12, 2024
707d53b
csdk-118/actualize_info_get_deploy_rpc
ZhmakAS Jul 12, 2024
76c9aa9
Merge pull request #100 from make-software/CSDK/added_sse_transaction…
ZhmakAS Jul 12, 2024
52ba0e3
Merge pull request #93 from make-software/csdk-118/actualize_info_get…
ZhmakAS Jul 12, 2024
fb5c19e
CSDK/implement_account_put_transaction
ZhmakAS Jul 17, 2024
41bb034
CSDK/implement_account_put_transaction
ZhmakAS Jul 17, 2024
f25b1af
CSDK/implement_info_get_reward_rpc
ZhmakAS Jul 17, 2024
6243805
CSDK/implement_account_put_transaction
ZhmakAS Jul 17, 2024
d4ce72a
CSDK/implement_info_get_reward_rpc
ZhmakAS Jul 17, 2024
5b7f5ca
CSDK/implement_info_get_reward_rpc
ZhmakAS Jul 17, 2024
fef2274
CSDK/implement_info_get_reward_rpc
ZhmakAS Jul 17, 2024
803350e
Merge pull request #102 from make-software/CSDK/implement_info_get_re…
ZhmakAS Jul 17, 2024
cf99376
CSDK/implement_account_put_transaction
ZhmakAS Jul 17, 2024
a23f140
CSDK/implement_info_get_reward_rpc
ZhmakAS Jul 17, 2024
abd4b0d
CSDK/implement_account_put_transaction
ZhmakAS Jul 17, 2024
722d5c6
Merge pull request #101 from make-software/CSDK/implement_account_put…
ZhmakAS Jul 17, 2024
debd6ca
CSDK/added_missing_updates
ZhmakAS Jul 18, 2024
c55d84c
CSDK/added_missing_updates
ZhmakAS Jul 18, 2024
ffb2321
CSDK/added_missing_updates
ZhmakAS Jul 18, 2024
2996fd1
CSDK/added_missing_updates
ZhmakAS Jul 18, 2024
0e69769
Merge pull request #104 from make-software/CSDK/added_missing_updates
ZhmakAS Jul 18, 2024
6cf86bf
Fixed linter issues
ZhmakAS Jul 18, 2024
26b34fe
Bump linter version
ZhmakAS Jul 18, 2024
94d0a7b
Remove commented code
ZhmakAS Jul 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/quality-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: |
go mod vendor
go install -v github.com/incu6us/goimports-reviser/[email protected]
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1

- name: Format
run: go fmt ./...
Expand Down
20 changes: 12 additions & 8 deletions casper/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,29 @@ type (
AuctionState = types.AuctionState
Args = types.Args
ValidatorBid = types.ValidatorBid
AuctionBid = types.AuctionBid
Block = types.Block
BlockHeader = types.BlockHeader
BlockBody = types.BlockBody
Bid = types.Bid
BlockV1 = types.BlockV1
BlockHeaderV1 = types.BlockHeaderV1
BlockBodyV1 = types.BlockBodyV1
BlockV2 = types.BlockV2
BlockHeaderV2 = types.BlockHeaderV2
BlockBodyV2 = types.BlockBodyV2
ContractPackage = types.ContractPackage
ContractVersion = types.ContractVersion
Contract = types.Contract
Deploy = types.Deploy
DeployHeader = types.DeployHeader
DeployApproval = types.Approval
Entrypoint = types.EntryPoint
ExecutionResult = types.ExecutionResultStatus
EntryPointV1 = types.EntryPointV1
EntryPointV2 = types.EntryPointV2
ExecutionResult = types.ExecutionResult
NamedKeys = types.NamedKeys
NamedKey = types.NamedKey
TransformKey = types.TransformKey
Transform = types.Transform
Argument = types.Argument
Account = types.Account
Reward = types.Reward
Reward = types.EraReward
WriteTransfer = types.WriteTransfer
UnbondingPurse = types.UnbondingPurse
)
Expand All @@ -39,7 +43,7 @@ type (
)

var (
DefaultHeader = types.DefaultHeader
DefaultHeader = types.DefaultDeployHeader
MakeDeploy = types.MakeDeploy
StandardPayment = types.StandardPayment
)
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
module github.com/make-software/casper-go-sdk

go 1.19
go 1.21

require (
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1
github.com/shopspring/decimal v1.3.1
github.com/stretchr/testify v1.8.2
golang.org/x/crypto v0.18.0
golang.org/x/crypto v0.23.0
golang.org/x/sync v0.6.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/sys v0.20.0 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
14 changes: 4 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,12 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g=
golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc=
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
80 changes: 67 additions & 13 deletions rpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
// They return information related to auctions, bids and validators.
// This information is necessary for users involved with node operations and validation.
type ClientPOS interface {
// GetAuctionInfoLatest returns the types.ValidatorBid and types.EraValidators from the most recent Block.
GetAuctionInfoLatest(ctx context.Context) (StateGetAuctionInfoResult, error)
// GetLatestAuctionInfo returns the types.ValidatorBid and types.EraValidators from the most recent Block.
GetLatestAuctionInfo(ctx context.Context) (StateGetAuctionInfoResult, error)
// GetAuctionInfoByHash returns the types.ValidatorBid and types.EraValidators of either a specific Block by hash
GetAuctionInfoByHash(ctx context.Context, blockHash string) (StateGetAuctionInfoResult, error)
// GetAuctionInfoByHeight returns the types.ValidatorBid and types.EraValidators of either a specific Block by height
Expand Down Expand Up @@ -45,14 +45,24 @@ type ClientPOS interface {
// The response should be identical, regardless of the node queried,
// as the information in question is objective and common to all nodes within a network.
type ClientInformational interface {
// GetAccountBalance returns a purse's balance from a network.
// GetLatestBalance returns a purse's balance from a network.
// The request takes in the formatted representation of a purse URef as a parameter.
// If the param stateRootHash is nil, the client will make an additional RPC call to retrieve the latest stateRootHash.
GetAccountBalance(ctx context.Context, stateRootHash *string, purseURef string) (StateGetBalanceResult, error)
// The client will make an additional RPC call to retrieve the latest stateRootHash.
GetLatestBalance(ctx context.Context, purseURef string) (StateGetBalanceResult, error)
// GetBalanceByStateRootHash returns a purse's balance and state root hash from a network.
GetBalanceByStateRootHash(ctx context.Context, purseURef string, stateRootHash string) (StateGetBalanceResult, error)
// GetDeploy retrieves a Deploy from a network. It requires a deploy_hash to query the Deploy.
GetDeploy(ctx context.Context, hash string) (InfoGetDeployResult, error)
// GetDeployFinalizedApproval returns Deploy with the finalized approvals substituted.
GetDeployFinalizedApproval(ctx context.Context, hash string) (InfoGetDeployResult, error)
// GetTransactionByTransactionHash returns a Transaction from the network
GetTransactionByTransactionHash(ctx context.Context, transactionHash string) (InfoGetTransactionResult, error)
// GetTransactionByDeployHash returns a Deploy as Transaction from the network
GetTransactionByDeployHash(ctx context.Context, deployHash string) (InfoGetTransactionResult, error)
// GetTransactionFinalizedApprovalByTransactionHash return the Transaction with the finalized approvals substituted.
GetTransactionFinalizedApprovalByTransactionHash(ctx context.Context, transactionHash string) (InfoGetTransactionResult, error)
// GetTransactionFinalizedApprovalByDeployHash return the Deploy as Transaction with the finalized approvals substituted.
GetTransactionFinalizedApprovalByDeployHash(ctx context.Context, deployHash string) (InfoGetTransactionResult, error)
// GetDictionaryItem returns an item from a Dictionary.
// The address of a stored value is the blake2b hash of the seed URef and the byte representation of the dictionary key.
// If the param stateRootHash is nil, the client will make an additional RPC call to retrieve the latest stateRootHash.
Expand All @@ -65,6 +75,8 @@ type ClientInformational interface {
// Deprecated: use QueryGlobalStateByStateHash instead
GetStateItem(ctx context.Context, stateRootHash *string, key string, path []string) (StateGetItemResult, error)

// QueryLatestGlobalState allows for you to query for the latest value stored under certain keys in global state.
QueryLatestGlobalState(ctx context.Context, key string, path []string) (QueryGlobalStateResult, error)
// QueryGlobalStateByBlockHash allows for you to query for a value stored under certain keys in global state.
QueryGlobalStateByBlockHash(ctx context.Context, blockHash, key string, path []string) (QueryGlobalStateResult, error)
// QueryGlobalStateByBlockHeight allows for you to query for a value stored under certain keys in global state.
Expand All @@ -83,15 +95,22 @@ type ClientInformational interface {
// This is the most generic interface.
GetAccountInfo(ctx context.Context, blockIdentifier *ParamBlockIdentifier, accountIdentifier AccountIdentifier) (StateGetAccountInfo, error)

// GetBlockLatest returns the latest types.Block from the network.
GetBlockLatest(ctx context.Context) (ChainGetBlockResult, error)
// GetLatestEntity returns latest AddressableEntity from the network.
GetLatestEntity(ctx context.Context, entityIdentifier EntityIdentifier) (StateGetEntity, error)
// GetEntityByHash returns an AddressableEntity by block hash from the network.
GetEntityByBlockHash(ctx context.Context, entityIdentifier EntityIdentifier, hash string) (StateGetEntity, error)
// GetEntityByHeight returns an AddressableEntity by block height from the network.
GetEntityByBlockHeight(ctx context.Context, entityIdentifier EntityIdentifier, height uint64) (StateGetEntity, error)

// GetLatestBlock returns the latest types.Block from the network.
GetLatestBlock(ctx context.Context) (ChainGetBlockResult, error)
// GetBlockByHash returns the types.Block from the network the requested block hash.
GetBlockByHash(ctx context.Context, hash string) (ChainGetBlockResult, error)
// GetBlockByHeight returns the types.Block from the network the requested block height.
GetBlockByHeight(ctx context.Context, height uint64) (ChainGetBlockResult, error)

// GetBlockTransfersLatest returns all native transfers within a lasted Block from a network.
GetBlockTransfersLatest(ctx context.Context) (ChainGetBlockTransfersResult, error)
// GetLatestBlockTransfers returns all native transfers within a lasted Block from a network.
GetLatestBlockTransfers(ctx context.Context) (ChainGetBlockTransfersResult, error)
// GetBlockTransfersByHash returns all native transfers within a given Block from a network the requested block hash.
GetBlockTransfersByHash(ctx context.Context, blockHash string) (ChainGetBlockTransfersResult, error)
// GetBlockTransfersByHeight returns all native transfers within a given Block from a network the requested block height.
Expand All @@ -117,16 +136,51 @@ type ClientInformational interface {
// GetPeers return a list of peers connected to the node on a Casper network.
// The responses return information specific to the queried node, and as such, will vary.
GetPeers(ctx context.Context) (InfoGetPeerResult, error)
// QueryBalance queries for balances under a given PurseIdentifier
QueryBalance(ctx context.Context, identifier PurseIdentifier) (QueryBalanceResult, error)

// QueryLatestBalance queries for balances under a given PurseIdentifier
QueryLatestBalance(ctx context.Context, identifier PurseIdentifier) (QueryBalanceResult, error)
// QueryBalanceByBlockHeight query for balance information using a purse identifier and block height
QueryBalanceByBlockHeight(ctx context.Context, purseIdentifier PurseIdentifier, height uint64) (QueryBalanceResult, error)
// QueryBalanceByBlockHash query for balance information using a purse identifier and block hash
QueryBalanceByBlockHash(ctx context.Context, purseIdentifier PurseIdentifier, blockHash string) (QueryBalanceResult, error)
// QueryBalanceByStateRootHash query for full balance information using a purse identifier and state root hash
QueryBalanceByStateRootHash(ctx context.Context, purseIdentifier PurseIdentifier, stateRootHash string) (QueryBalanceResult, error)

// QueryLatestBalanceDetails query for full balance information using a purse identifier
QueryLatestBalanceDetails(ctx context.Context, purseIdentifier PurseIdentifier) (QueryBalanceDetailsResult, error)
// QueryBalanceDetailsByBlockHeight query for full balance information using a purse identifier and block height
QueryBalanceDetailsByBlockHeight(ctx context.Context, purseIdentifier PurseIdentifier, height uint64) (QueryBalanceDetailsResult, error)
// QueryBalanceDetailsByBlockHash query for full balance information using a purse identifier and block hash
QueryBalanceDetailsByBlockHash(ctx context.Context, purseIdentifier PurseIdentifier, blockHash string) (QueryBalanceDetailsResult, error)
// QueryBalanceDetailsByStateRootHash query for full balance information using a purse identifier and state root hash
QueryBalanceDetailsByStateRootHash(ctx context.Context, purseIdentifier PurseIdentifier, stateRootHash string) (QueryBalanceDetailsResult, error)

// GetChainspec returns the raw bytes of the chainspec.toml, accounts.toml and global_state.toml files as read at node startup.
GetChainspec(ctx context.Context) (InfoGetChainspecResult, error)

// GetLatestValidatorReward returns the latest reward for a given validator
GetLatestValidatorReward(ctx context.Context, validator keypair.PublicKey) (InfoGetRewardResult, error)
// GetValidatorRewardByEraID returns the reward for a given era and a validator
GetValidatorRewardByEraID(ctx context.Context, validator keypair.PublicKey, eraID uint64) (InfoGetRewardResult, error)
// GetValidatorRewardByBlockHash returns the reward for a given block hash and a validator
GetValidatorRewardByBlockHash(ctx context.Context, validator keypair.PublicKey, blockHash string) (InfoGetRewardResult, error)
// GetValidatorRewardByBlockHeight returns the reward for a given block height and a validator
GetValidatorRewardByBlockHeight(ctx context.Context, validator keypair.PublicKey, height uint64) (InfoGetRewardResult, error)
// GetLatestDelegatorReward returns the latest delegator reward for a given validator
GetLatestDelegatorReward(ctx context.Context, validator, delegator keypair.PublicKey) (InfoGetRewardResult, error)
// GetDelegatorRewardByEraID returns the delegator reward for a given era and a validator
GetDelegatorRewardByEraID(ctx context.Context, validator, delegator keypair.PublicKey, eraID uint64) (InfoGetRewardResult, error)
// GetDelegatorRewardByBlockHash returns the delegator reward for a given block hash and a validator
GetDelegatorRewardByBlockHash(ctx context.Context, validator, delegator keypair.PublicKey, blockHash string) (InfoGetRewardResult, error)
// GetDelegatorRewardByBlockHeight returns the delegator reward for a given block height and a validator
GetDelegatorRewardByBlockHeight(ctx context.Context, validator, delegator keypair.PublicKey, height uint64) (InfoGetRewardResult, error)
}

// ClientTransactional contains the description of account_put_deploy,
// the only means by which users can send their compiled Wasm (as part of a Deploy) to a node on a Casper network.
// ClientTransactional contains the description of account_put_deploy, account_put_transaction
// the only means by which users can send their compiled Wasm (as part of a Deploy or TransactionV1) to a node on a Casper network.
type ClientTransactional interface {
PutDeploy(ctx context.Context, deploy types.Deploy) (PutDeployResult, error)
PutTransactionV1(ctx context.Context, transaction types.TransactionV1) (PutTransactionResult, error)
}

// Client interface represent full RPC client that includes all possible queries.
Expand Down
Loading
Loading