Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Feat: update klay sdks #624

Merged
merged 10 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 15 additions & 8 deletions documentation/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,6 @@ paths:
$ref: ../web3rpc/rpc-specs/paths/klay/configuration/chainID.yaml#/paths/~1klay~1configuration~1chainID
/klay/configuration/clientVersion:
$ref: ../web3rpc/rpc-specs/paths/klay/configuration/clientVersion.yaml#/paths/~1klay~1configuration~1clientVersion
/klay/configuration/gasPrice:
$ref: ../web3rpc/rpc-specs/paths/klay/configuration/gasPrice.yaml#/paths/~1klay~1configuration~1gasPrice
/klay/configuration/gasPriceAt:
$ref: ../web3rpc/rpc-specs/paths/klay/configuration/gasPriceAt.yaml#/paths/~1klay~1configuration~1gasPriceAt
/klay/configuration/getChainConfig:
$ref: ../web3rpc/rpc-specs/paths/klay/configuration/getChainConfig.yaml#/paths/~1klay~1configuration~1getChainConfig
/klay/configuration/isParallelDBWrite:
Expand Down Expand Up @@ -184,7 +180,10 @@ paths:
$ref: ../web3rpc/rpc-specs/paths/klay/gas/maxPriorityFeePerGas.yaml#/paths/~1klay~1gas~1maxPriorityFeePerGas
/klay/gas/upperBoundGasPrice:
$ref: ../web3rpc/rpc-specs/paths/klay/gas/upperBoundGasPrice.yaml#/paths/~1klay~1gas~1upperBoundGasPrice

/klay/gas/gasPrice:
$ref: ../web3rpc/rpc-specs/paths/klay/gas/gasPrice.yaml#/paths/~1klay~1gas~1gasPrice
/klay/gas/gasPriceAt:
$ref: ../web3rpc/rpc-specs/paths/klay/gas/gasPriceAt.yaml#/paths/~1klay~1gas~1gasPriceAt
# klay/miscellaneous
/klay/miscellaneous/getStakingInfo:
$ref: ../web3rpc/rpc-specs/paths/klay/miscellaneous/getStakingInfo.yaml#/paths/~1klay~1miscellaneous~1getStakingInfo
Expand All @@ -198,6 +197,14 @@ paths:
$ref: ../web3rpc/rpc-specs/paths/klay/miscellaneous/sha3.yaml#/paths/~1klay~1miscellaneous~1sha3
/klay/miscellaneous/getProof:
$ref: ../web3rpc/rpc-specs/paths/klay/miscellaneous/getProof.yaml#/paths/~1klay~1miscellaneous~1getProof
/klay/miscellaneous/getBlsInfos:
$ref: ../web3rpc/rpc-specs/paths/klay/miscellaneous/getBlsInfos.yaml#/paths/~1klay~1miscellaneous~1getBlsInfos
/klay/miscellaneous/getActiveAddressFromRegistry:
$ref: ../web3rpc/rpc-specs/paths/klay/miscellaneous/getActiveAddressFromRegistry.yaml#/paths/~1klay~1miscellaneous~1getActiveAddressFromRegistry
/klay/miscellaneous/getAllRecordsFromRegistry:
$ref: ../web3rpc/rpc-specs/paths/klay/miscellaneous/getAllRecordsFromRegistry.yaml#/paths/~1klay~1miscellaneous~1getAllRecordsFromRegistry
/klay/miscellaneous/getTotalSupply:
$ref: ../web3rpc/rpc-specs/paths/klay/miscellaneous/getTotalSupply.yaml#/paths/~1klay~1miscellaneous~1getTotalSupply

# eth/account
/eth/account/accounts:
Expand Down Expand Up @@ -285,8 +292,7 @@ paths:
$ref: ../web3rpc/rpc-specs/paths/eth/config/coinbase.yaml#/paths/~1eth~1config~1coinbase
/eth/config/etherbase:
$ref: ../web3rpc/rpc-specs/paths/eth/config/etherbase.yaml#/paths/~1eth~1config~1etherbase
/eth/config/gasPrice:
$ref: ../web3rpc/rpc-specs/paths/eth/config/gasPrice.yaml#/paths/~1eth~1config~1gasPrice

/eth/protocolVersion:
$ref: ../web3rpc/rpc-specs/paths/eth/config/protocolVersion.yaml#/paths/~1eth~1config~1protocolVersion

Expand All @@ -295,7 +301,8 @@ paths:
$ref: ../web3rpc/rpc-specs/paths/eth/gas/feeHistory.yaml#/paths/~1eth~1gas~1feeHistory
/eth/gas/maxPriorityFeePerGas:
$ref: ../web3rpc/rpc-specs/paths/eth/gas/maxPriorityFeePerGas.yaml#/paths/~1eth~1gas~1maxPriorityFeePerGas

/eth/gas/gasPrice:
$ref: ../web3rpc/rpc-specs/paths/eth/gas/gasPrice.yaml#/paths/~1eth~1gas~1gasPrice
# eth/filter
/eth/filter/getFilterChanges:
$ref: ../web3rpc/rpc-specs/paths/eth/filter/getFilterChanges.yaml#/paths/~1eth~1filter~1getFilterChanges
Expand Down
5 changes: 2 additions & 3 deletions documentation/namespaces/eth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ paths:
# eth/config
/eth/config/chainID:
$ref: ../../web3rpc/rpc-specs/paths/eth/config/chainId.yaml#/paths/~1eth~1config~1chainId
/eth/config/gasPrice:
$ref: ../../web3rpc/rpc-specs/paths/eth/config/gasPrice.yaml#/paths/~1eth~1config~1gasPrice
/eth/config/coinbase:
$ref: ../../web3rpc/rpc-specs/paths/eth/config/coinbase.yaml#/paths/~1eth~1config~1coinbase
/eth/config/etherbase:
Expand All @@ -112,7 +110,8 @@ paths:
$ref: ../../web3rpc/rpc-specs/paths/eth/transaction/estimateGas.yaml#/paths/~1eth~1transaction~1estimateGas
/eth/gas/maxPriorityFeePerGas:
$ref: ../../web3rpc/rpc-specs/paths/eth/gas/maxPriorityFeePerGas.yaml#/paths/~1eth~1gas~1maxPriorityFeePerGas

/eth/gas/gasPrice:
$ref: ../../web3rpc/rpc-specs/paths/eth/gas/gasPrice.yaml#/paths/~1eth~1gas~1gasPrice
# eth/filter
/eth/filter/getFilterLogs:
$ref: ../../web3rpc/rpc-specs/paths/eth/filter/getFilterLogs.yaml#/paths/~1eth~1filter~1getFilterLogs
Expand Down
20 changes: 14 additions & 6 deletions documentation/namespaces/klay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@ paths:
$ref: ../../web3rpc/rpc-specs/paths/klay/configuration/chainID.yaml#/paths/~1klay~1configuration~1chainID
/klay/configuration/clientVersion:
$ref: ../../web3rpc/rpc-specs/paths/klay/configuration/clientVersion.yaml#/paths/~1klay~1configuration~1clientVersion
/klay/configuration/gasPriceAt:
$ref: ../../web3rpc/rpc-specs/paths/klay/configuration/gasPriceAt.yaml#/paths/~1klay~1configuration~1gasPriceAt
/klay/configuration/gasPrice:
$ref: ../../web3rpc/rpc-specs/paths/klay/configuration/gasPrice.yaml#/paths/~1klay~1configuration~1gasPrice
/klay/configuration/isParallelDBWrite:
$ref: ../../web3rpc/rpc-specs/paths/klay/configuration/isParallelDBWrite.yaml#/paths/~1klay~1configuration~1isParallelDBWrite
/klay/configuration/isSenderTxHashIndexingEnabled:
Expand Down Expand Up @@ -175,7 +171,10 @@ paths:
$ref: ../../web3rpc/rpc-specs/paths/klay/gas/upperBoundGasPrice.yaml#/paths/~1klay~1gas~1upperBoundGasPrice
/klay/gas/maxPriorityFeePerGas:
$ref: ../../web3rpc/rpc-specs/paths/klay/gas/maxPriorityFeePerGas.yaml#/paths/~1klay~1gas~1maxPriorityFeePerGas

/klay/gas/gasPriceAt:
$ref: ../../web3rpc/rpc-specs/paths/klay/gas/gasPriceAt.yaml#/paths/~1klay~1gas~1gasPriceAt
/klay/gas/gasPrice:
$ref: ../../web3rpc/rpc-specs/paths/klay/gas/gasPrice.yaml#/paths/~1klay~1gas~1gasPrice
# klay/miscellaneous
/klay/miscellaneous/sha3:
$ref: ../../web3rpc/rpc-specs/paths/klay/miscellaneous/sha3.yaml#/paths/~1klay~1miscellaneous~1sha3
Expand All @@ -188,4 +187,13 @@ paths:
/klay/miscellaneous/getProof:
$ref: ../../web3rpc/rpc-specs/paths/klay/miscellaneous/getProof.yaml#/paths/~1klay~1miscellaneous~1getProof
/klay/miscellaneous/nodeAddress:
$ref: ../../web3rpc/rpc-specs/paths/klay/miscellaneous/nodeAddress.yaml#/paths/~1klay~1miscellaneous~1nodeAddress
$ref: ../../web3rpc/rpc-specs/paths/klay/miscellaneous/nodeAddress.yaml#/paths/~1klay~1miscellaneous~1nodeAddress

/klay/miscellaneous/getBlsInfos:
$ref: ../../web3rpc/rpc-specs/paths/klay/miscellaneous/getBlsInfos.yaml#/paths/~1klay~1miscellaneous~1getBlsInfos
/klay/miscellaneous/getActiveAddressFromRegistry:
$ref: ../../web3rpc/rpc-specs/paths/klay/miscellaneous/getActiveAddressFromRegistry.yaml#/paths/~1klay~1miscellaneous~1getActiveAddressFromRegistry
/klay/miscellaneous/getAllRecordsFromRegistry:
$ref: ../../web3rpc/rpc-specs/paths/klay/miscellaneous/getAllRecordsFromRegistry.yaml#/paths/~1klay~1miscellaneous~1getAllRecordsFromRegistry
/klay/miscellaneous/getTotalSupply:
$ref: ../../web3rpc/rpc-specs/paths/klay/miscellaneous/getTotalSupply.yaml#/paths/~1klay~1miscellaneous~1getTotalSupply
16 changes: 8 additions & 8 deletions web3py-ext/web3py_ext/web3rpc/admin_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ def node_config(self, *args) -> Any:
return self._node_config(*args)


_node_information: Method[Callable[..., Any]] = Method(
namespace + "_nodeInformation".replace("Ws", "WS"), mungers=[default_root_munger]
_node_info: Method[Callable[..., Any]] = Method(
namespace + "_nodeInfo".replace("Ws", "WS"), mungers=[default_root_munger]
)

def node_information(self, *args) -> Any:
return self._node_information(*args)
def node_info(self, *args) -> Any:
return self._node_info(*args)


_remove_peer: Method[Callable[..., Any]] = Method(
Expand Down Expand Up @@ -269,12 +269,12 @@ async def node_config(self, *args) -> Any:
return await self._node_config(*args)


_node_information: Method[Callable[..., Awaitable[Any]]] = Method(
namespace + "_nodeInformation", mungers=[default_root_munger]
_node_info: Method[Callable[..., Awaitable[Any]]] = Method(
namespace + "_nodeInfo", mungers=[default_root_munger]
)

async def node_information(self, *args) -> Any:
return await self._node_information(*args)
async def node_info(self, *args) -> Any:
return await self._node_info(*args)


_remove_peer: Method[Callable[..., Awaitable[Any]]] = Method(
Expand Down
64 changes: 64 additions & 0 deletions web3py-ext/web3py_ext/web3rpc/klay_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,22 @@ def get_account_key(self, *args) -> Any:
return self._get_account_key(*args)


_get_active_address_from_registry: Method[Callable[..., Any]] = Method(
namespace + "_getActiveAddressFromRegistry", mungers=[default_root_munger]
)

def get_active_address_from_registry(self, *args) -> Any:
return self._get_active_address_from_registry(*args)


_get_all_records_from_registry: Method[Callable[..., Any]] = Method(
namespace + "_getAllRecordsFromRegistry", mungers=[default_root_munger]
)

def get_all_records_from_registry(self, *args) -> Any:
return self._get_all_records_from_registry(*args)


_get_balance: Method[Callable[..., Any]] = Method(
namespace + "_getBalance", mungers=[default_root_munger]
)
Expand Down Expand Up @@ -233,6 +249,14 @@ def get_block_with_consensus_info_by_number_range(self, *args) -> Any:
return self._get_block_with_consensus_info_by_number_range(*args)


_get_bls_infos: Method[Callable[..., Any]] = Method(
namespace + "_getBlsInfos", mungers=[default_root_munger]
)

def get_bls_infos(self, *args) -> Any:
return self._get_bls_infos(*args)


_get_code: Method[Callable[..., Any]] = Method(
namespace + "_getCode", mungers=[default_root_munger]
)
Expand Down Expand Up @@ -377,6 +401,14 @@ def get_storage_at(self, *args) -> Any:
return self._get_storage_at(*args)


_get_total_supply: Method[Callable[..., Any]] = Method(
namespace + "_getTotalSupply", mungers=[default_root_munger]
)

def get_total_supply(self, *args) -> Any:
return self._get_total_supply(*args)


_get_transaction_by_block_hash_and_index: Method[Callable[..., Any]] = Method(
namespace + "_getTransactionByBlockHashAndIndex", mungers=[default_root_munger]
)
Expand Down Expand Up @@ -798,6 +830,22 @@ async def get_account_key(self, *args) -> Any:
return await self._get_account_key(*args)


_get_active_address_from_registry: Method[Callable[..., Awaitable[Any]]] = Method(
namespace + "_getActiveAddressFromRegistry", mungers=[default_root_munger]
)

async def get_active_address_from_registry(self, *args) -> Any:
return await self._get_active_address_from_registry(*args)


_get_all_records_from_registry: Method[Callable[..., Awaitable[Any]]] = Method(
namespace + "_getAllRecordsFromRegistry", mungers=[default_root_munger]
)

async def get_all_records_from_registry(self, *args) -> Any:
return await self._get_all_records_from_registry(*args)


_get_balance: Method[Callable[..., Awaitable[Any]]] = Method(
namespace + "_getBalance", mungers=[default_root_munger]
)
Expand Down Expand Up @@ -870,6 +918,14 @@ async def get_block_with_consensus_info_by_number_range(self, *args) -> Any:
return await self._get_block_with_consensus_info_by_number_range(*args)


_get_bls_infos: Method[Callable[..., Awaitable[Any]]] = Method(
namespace + "_getBlsInfos", mungers=[default_root_munger]
)

async def get_bls_infos(self, *args) -> Any:
return await self._get_bls_infos(*args)


_get_code: Method[Callable[..., Awaitable[Any]]] = Method(
namespace + "_getCode", mungers=[default_root_munger]
)
Expand Down Expand Up @@ -1014,6 +1070,14 @@ async def get_storage_at(self, *args) -> Any:
return await self._get_storage_at(*args)


_get_total_supply: Method[Callable[..., Awaitable[Any]]] = Method(
namespace + "_getTotalSupply", mungers=[default_root_munger]
)

async def get_total_supply(self, *args) -> Any:
return await self._get_total_supply(*args)


_get_transaction_by_block_hash_and_index: Method[Callable[..., Awaitable[Any]]] = Method(
namespace + "_getTransactionByBlockHashAndIndex", mungers=[default_root_munger]
)
Expand Down
48 changes: 24 additions & 24 deletions web3py-ext/web3py_ext/web3rpc/mainbridge_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ class MainbridgeApi(Module):
namespace = "mainbridge"


_add_peer_from_url: Method[Callable[..., Any]] = Method(
namespace + "_addPeerFromUrl", mungers=[default_root_munger]
_add_peer: Method[Callable[..., Any]] = Method(
namespace + "_addPeer", mungers=[default_root_munger]
)

def add_peer_from_url(self, *args) -> Any:
return self._add_peer_from_url(*args)
def add_peer(self, *args) -> Any:
return self._add_peer(*args)


_convert_child_chain_block_hash_to_parent_chain_tx_hash: Method[Callable[..., Any]] = Method(
Expand All @@ -41,33 +41,33 @@ def get_child_chain_indexing_enabled(self, *args) -> Any:
return self._get_child_chain_indexing_enabled(*args)


_get_node_info: Method[Callable[..., Any]] = Method(
namespace + "_getNodeInfo", mungers=[default_root_munger]
_node_info: Method[Callable[..., Any]] = Method(
namespace + "_nodeInfo", mungers=[default_root_munger]
)

def get_node_info(self, *args) -> Any:
return self._get_node_info(*args)
def node_info(self, *args) -> Any:
return self._node_info(*args)


_remove_peer_from_url: Method[Callable[..., Any]] = Method(
namespace + "_removePeerFromUrl", mungers=[default_root_munger]
_remove_peer: Method[Callable[..., Any]] = Method(
namespace + "_removePeer", mungers=[default_root_munger]
)

def remove_peer_from_url(self, *args) -> Any:
return self._remove_peer_from_url(*args)
def remove_peer(self, *args) -> Any:
return self._remove_peer(*args)


class AsyncMainbridgeApi(Module):
is_async = True
namespace = "mainbridge"


_add_peer_from_url: Method[Callable[..., Awaitable[Any]]] = Method(
namespace + "_addPeerFromUrl", mungers=[default_root_munger]
_add_peer: Method[Callable[..., Awaitable[Any]]] = Method(
namespace + "_addPeer", mungers=[default_root_munger]
)

async def add_peer_from_url(self, *args) -> Any:
return await self._add_peer_from_url(*args)
async def add_peer(self, *args) -> Any:
return await self._add_peer(*args)


_convert_child_chain_block_hash_to_parent_chain_tx_hash: Method[Callable[..., Awaitable[Any]]] = Method(
Expand All @@ -86,18 +86,18 @@ async def get_child_chain_indexing_enabled(self, *args) -> Any:
return await self._get_child_chain_indexing_enabled(*args)


_get_node_info: Method[Callable[..., Awaitable[Any]]] = Method(
namespace + "_getNodeInfo", mungers=[default_root_munger]
_node_info: Method[Callable[..., Awaitable[Any]]] = Method(
namespace + "_nodeInfo", mungers=[default_root_munger]
)

async def get_node_info(self, *args) -> Any:
return await self._get_node_info(*args)
async def node_info(self, *args) -> Any:
return await self._node_info(*args)


_remove_peer_from_url: Method[Callable[..., Awaitable[Any]]] = Method(
namespace + "_removePeerFromUrl", mungers=[default_root_munger]
_remove_peer: Method[Callable[..., Awaitable[Any]]] = Method(
namespace + "_removePeer", mungers=[default_root_munger]
)

async def remove_peer_from_url(self, *args) -> Any:
return await self._remove_peer_from_url(*args)
async def remove_peer(self, *args) -> Any:
return await self._remove_peer(*args)

Loading
Loading