near-jsonrpc-client 1.0.23__py3-none-any.whl → 1.0.25__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- near_jsonrpc_client/api_methods_async.py +0 -22
- near_jsonrpc_client/api_methods_sync.py +0 -22
- {near_jsonrpc_client-1.0.23.dist-info → near_jsonrpc_client-1.0.25.dist-info}/METADATA +1 -1
- {near_jsonrpc_client-1.0.23.dist-info → near_jsonrpc_client-1.0.25.dist-info}/RECORD +27 -25
- {near_jsonrpc_client-1.0.23.dist-info → near_jsonrpc_client-1.0.25.dist-info}/WHEEL +1 -1
- near_jsonrpc_models/__init__.py +57 -84
- near_jsonrpc_models/access_key_permission.py +14 -1
- near_jsonrpc_models/access_key_permission_view.py +19 -1
- near_jsonrpc_models/action_error_kind.py +8 -4
- near_jsonrpc_models/action_view.py +8 -17
- near_jsonrpc_models/actions_validation_error.py +12 -8
- near_jsonrpc_models/block_header_view.py +4 -0
- near_jsonrpc_models/epoch_sync_config.py +0 -11
- near_jsonrpc_models/gas_key_info.py +8 -0
- near_jsonrpc_models/non_delegate_action.py +5 -9
- near_jsonrpc_models/receipt_view.py +1 -0
- near_jsonrpc_models/rpc_query_request.py +7 -22
- near_jsonrpc_models/rpc_query_response.py +2 -11
- near_jsonrpc_models/rpc_receipt_response.py +1 -0
- near_jsonrpc_models/rpc_state_changes_in_block_by_type_request.py +1 -31
- near_jsonrpc_models/runtime_config_view.py +0 -4
- near_jsonrpc_models/signed_transaction_view.py +2 -0
- near_jsonrpc_models/state_change_with_cause_view.py +1 -21
- near_jsonrpc_models/transfer_to_gas_key_action.py +4 -0
- near_jsonrpc_models/withdraw_from_gas_key_action.py +12 -0
- {near_jsonrpc_client-1.0.23.dist-info → near_jsonrpc_client-1.0.25.dist-info}/licenses/LICENSE +0 -0
- {near_jsonrpc_client-1.0.23.dist-info → near_jsonrpc_client-1.0.25.dist-info}/top_level.txt +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"""Describes the error for validating a list of actions."""
|
|
2
2
|
|
|
3
|
-
from near_jsonrpc_models.access_key_permission import AccessKeyPermission
|
|
4
3
|
from near_jsonrpc_models.account_id import AccountId
|
|
5
4
|
from near_jsonrpc_models.near_gas import NearGas
|
|
5
|
+
from near_jsonrpc_models.near_token import NearToken
|
|
6
6
|
from near_jsonrpc_models.public_key import PublicKey
|
|
7
7
|
from near_jsonrpc_models.strict_model import StrictBaseModel
|
|
8
8
|
from pydantic import BaseModel
|
|
@@ -132,12 +132,6 @@ class ActionsValidationErrorDeterministicStateInitValueLengthExceededPayload(Bas
|
|
|
132
132
|
class ActionsValidationErrorDeterministicStateInitValueLengthExceeded(StrictBaseModel):
|
|
133
133
|
DeterministicStateInitValueLengthExceeded: ActionsValidationErrorDeterministicStateInitValueLengthExceededPayload
|
|
134
134
|
|
|
135
|
-
class ActionsValidationErrorGasKeyPermissionInvalidPayload(BaseModel):
|
|
136
|
-
permission: AccessKeyPermission
|
|
137
|
-
|
|
138
|
-
class ActionsValidationErrorGasKeyPermissionInvalid(StrictBaseModel):
|
|
139
|
-
GasKeyPermissionInvalid: ActionsValidationErrorGasKeyPermissionInvalidPayload
|
|
140
|
-
|
|
141
135
|
class ActionsValidationErrorGasKeyTooManyNoncesRequestedPayload(BaseModel):
|
|
142
136
|
limit: conint(ge=0, le=4294967295)
|
|
143
137
|
requested_nonces: conint(ge=0, le=4294967295)
|
|
@@ -145,6 +139,16 @@ class ActionsValidationErrorGasKeyTooManyNoncesRequestedPayload(BaseModel):
|
|
|
145
139
|
class ActionsValidationErrorGasKeyTooManyNoncesRequested(StrictBaseModel):
|
|
146
140
|
GasKeyTooManyNoncesRequested: ActionsValidationErrorGasKeyTooManyNoncesRequestedPayload
|
|
147
141
|
|
|
148
|
-
class
|
|
142
|
+
class ActionsValidationErrorAddGasKeyWithNonZeroBalancePayload(BaseModel):
|
|
143
|
+
balance: NearToken
|
|
144
|
+
|
|
145
|
+
class ActionsValidationErrorAddGasKeyWithNonZeroBalance(StrictBaseModel):
|
|
146
|
+
AddGasKeyWithNonZeroBalance: ActionsValidationErrorAddGasKeyWithNonZeroBalancePayload
|
|
147
|
+
|
|
148
|
+
"""Gas keys with FunctionCall permission cannot have an allowance set."""
|
|
149
|
+
class ActionsValidationErrorGasKeyFunctionCallAllowanceNotAllowed(RootModel[Literal['GasKeyFunctionCallAllowanceNotAllowed']]):
|
|
150
|
+
pass
|
|
151
|
+
|
|
152
|
+
class ActionsValidationError(RootModel[Union[ActionsValidationErrorDeleteActionMustBeFinal, ActionsValidationErrorTotalPrepaidGasExceeded, ActionsValidationErrorTotalNumberOfActionsExceeded, ActionsValidationErrorAddKeyMethodNamesNumberOfBytesExceeded, ActionsValidationErrorAddKeyMethodNameLengthExceeded, ActionsValidationErrorIntegerOverflow, ActionsValidationErrorInvalidAccountId, ActionsValidationErrorContractSizeExceeded, ActionsValidationErrorFunctionCallMethodNameLengthExceeded, ActionsValidationErrorFunctionCallArgumentsLengthExceeded, ActionsValidationErrorUnsuitableStakingKey, ActionsValidationErrorFunctionCallZeroAttachedGas, ActionsValidationErrorDelegateActionMustBeOnlyOne, ActionsValidationErrorUnsupportedProtocolFeature, ActionsValidationErrorInvalidDeterministicStateInitReceiver, ActionsValidationErrorDeterministicStateInitKeyLengthExceeded, ActionsValidationErrorDeterministicStateInitValueLengthExceeded, ActionsValidationErrorGasKeyTooManyNoncesRequested, ActionsValidationErrorAddGasKeyWithNonZeroBalance, ActionsValidationErrorGasKeyFunctionCallAllowanceNotAllowed]]):
|
|
149
153
|
pass
|
|
150
154
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"""Contains main info about the block."""
|
|
2
2
|
|
|
3
|
+
from near_jsonrpc_models.account_id import AccountId
|
|
3
4
|
from near_jsonrpc_models.crypto_hash import CryptoHash
|
|
4
5
|
from near_jsonrpc_models.near_token import NearToken
|
|
6
|
+
from near_jsonrpc_models.shard_id import ShardId
|
|
5
7
|
from near_jsonrpc_models.signature import Signature
|
|
6
8
|
from near_jsonrpc_models.slashed_validator import SlashedValidator
|
|
7
9
|
from near_jsonrpc_models.validator_stake_view import ValidatorStakeView
|
|
@@ -9,6 +11,7 @@ from pydantic import BaseModel
|
|
|
9
11
|
from pydantic import Field
|
|
10
12
|
from pydantic import conint
|
|
11
13
|
from typing import List
|
|
14
|
+
from typing import Tuple
|
|
12
15
|
|
|
13
16
|
|
|
14
17
|
class BlockHeaderView(BaseModel):
|
|
@@ -42,6 +45,7 @@ class BlockHeaderView(BaseModel):
|
|
|
42
45
|
random_value: CryptoHash
|
|
43
46
|
# TODO(2271): deprecated.
|
|
44
47
|
rent_paid: NearToken = Field(default_factory=lambda: NearToken('0'))
|
|
48
|
+
shard_split: Tuple[ShardId, AccountId] | None = None
|
|
45
49
|
# Signature of the block producer.
|
|
46
50
|
signature: Signature
|
|
47
51
|
# Legacy json number. Should not be used.
|
|
@@ -4,22 +4,11 @@ from pydantic import conint
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class EpochSyncConfig(BaseModel):
|
|
7
|
-
# If true, even if the node started from genesis, it will not perform epoch sync.
|
|
8
|
-
# There should be no reason to set this flag in production, because on both mainnet
|
|
9
|
-
# and testnet it would be infeasible to catch up from genesis without epoch sync.
|
|
10
|
-
disable_epoch_sync_for_bootstrapping: bool = False
|
|
11
7
|
# This serves as two purposes: (1) the node will not epoch sync and instead resort to
|
|
12
8
|
# header sync, if the genesis block is within this many blocks from the current block;
|
|
13
9
|
# (2) the node will reject an epoch sync proof if the provided proof is for an epoch
|
|
14
10
|
# that is more than this many blocks behind the current block.
|
|
15
11
|
epoch_sync_horizon: conint(ge=0, le=18446744073709551615) = None
|
|
16
|
-
# If true, the node will ignore epoch sync requests from the network. It is strongly
|
|
17
|
-
# recommended not to set this flag, because it will prevent other nodes from
|
|
18
|
-
# bootstrapping. This flag is only included as a kill-switch and may be removed in a
|
|
19
|
-
# future release. Please note that epoch sync requests are heavily rate limited and
|
|
20
|
-
# cached, and therefore should not affect the performance of the node or introduce
|
|
21
|
-
# any non-negligible increase in network traffic.
|
|
22
|
-
ignore_epoch_sync_network_requests: bool = False
|
|
23
12
|
# Timeout for epoch sync requests. The node will continue retrying indefinitely even
|
|
24
13
|
# if this timeout is exceeded.
|
|
25
14
|
timeout_for_epoch_sync: DurationAsStdSchemaProvider = None
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"""An Action that can be included in a transaction or receipt, excluding delegate actions. This type represents all possible action types except DelegateAction to prevent infinite recursion in meta-transactions."""
|
|
2
2
|
|
|
3
|
-
from near_jsonrpc_models.add_gas_key_action import AddGasKeyAction
|
|
4
3
|
from near_jsonrpc_models.add_key_action import AddKeyAction
|
|
5
4
|
from near_jsonrpc_models.create_account_action import CreateAccountAction
|
|
6
5
|
from near_jsonrpc_models.delete_account_action import DeleteAccountAction
|
|
7
|
-
from near_jsonrpc_models.delete_gas_key_action import DeleteGasKeyAction
|
|
8
6
|
from near_jsonrpc_models.delete_key_action import DeleteKeyAction
|
|
9
7
|
from near_jsonrpc_models.deploy_contract_action import DeployContractAction
|
|
10
8
|
from near_jsonrpc_models.deploy_global_contract_action import DeployGlobalContractAction
|
|
@@ -15,6 +13,7 @@ from near_jsonrpc_models.strict_model import StrictBaseModel
|
|
|
15
13
|
from near_jsonrpc_models.transfer_action import TransferAction
|
|
16
14
|
from near_jsonrpc_models.transfer_to_gas_key_action import TransferToGasKeyAction
|
|
17
15
|
from near_jsonrpc_models.use_global_contract_action import UseGlobalContractAction
|
|
16
|
+
from near_jsonrpc_models.withdraw_from_gas_key_action import WithdrawFromGasKeyAction
|
|
18
17
|
from pydantic import BaseModel
|
|
19
18
|
from pydantic import RootModel
|
|
20
19
|
from typing import Union
|
|
@@ -57,15 +56,12 @@ class NonDelegateActionUseGlobalContract(StrictBaseModel):
|
|
|
57
56
|
class NonDelegateActionDeterministicStateInit(StrictBaseModel):
|
|
58
57
|
DeterministicStateInit: DeterministicStateInitAction
|
|
59
58
|
|
|
60
|
-
class NonDelegateActionAddGasKey(StrictBaseModel):
|
|
61
|
-
AddGasKey: AddGasKeyAction
|
|
62
|
-
|
|
63
|
-
class NonDelegateActionDeleteGasKey(StrictBaseModel):
|
|
64
|
-
DeleteGasKey: DeleteGasKeyAction
|
|
65
|
-
|
|
66
59
|
class NonDelegateActionTransferToGasKey(StrictBaseModel):
|
|
67
60
|
TransferToGasKey: TransferToGasKeyAction
|
|
68
61
|
|
|
69
|
-
class
|
|
62
|
+
class NonDelegateActionWithdrawFromGasKey(StrictBaseModel):
|
|
63
|
+
WithdrawFromGasKey: WithdrawFromGasKeyAction
|
|
64
|
+
|
|
65
|
+
class NonDelegateAction(RootModel[Union[NonDelegateActionCreateAccount, NonDelegateActionDeployContract, NonDelegateActionFunctionCall, NonDelegateActionTransfer, NonDelegateActionStake, NonDelegateActionAddKey, NonDelegateActionDeleteKey, NonDelegateActionDeleteAccount, NonDelegateActionDeployGlobalContract, NonDelegateActionUseGlobalContract, NonDelegateActionDeterministicStateInit, NonDelegateActionTransferToGasKey, NonDelegateActionWithdrawFromGasKey]]):
|
|
70
66
|
pass
|
|
71
67
|
|
|
@@ -40,16 +40,11 @@ class RpcQueryRequestViewAccessKeyListByBlockId(BaseModel):
|
|
|
40
40
|
account_id: AccountId
|
|
41
41
|
request_type: Literal['view_access_key_list']
|
|
42
42
|
|
|
43
|
-
class
|
|
43
|
+
class RpcQueryRequestViewGasKeyNoncesByBlockId(BaseModel):
|
|
44
44
|
block_id: BlockId
|
|
45
45
|
account_id: AccountId
|
|
46
46
|
public_key: PublicKey
|
|
47
|
-
request_type: Literal['
|
|
48
|
-
|
|
49
|
-
class RpcQueryRequestViewGasKeyListByBlockId(BaseModel):
|
|
50
|
-
block_id: BlockId
|
|
51
|
-
account_id: AccountId
|
|
52
|
-
request_type: Literal['view_gas_key_list']
|
|
47
|
+
request_type: Literal['view_gas_key_nonces']
|
|
53
48
|
|
|
54
49
|
class RpcQueryRequestCallFunctionByBlockId(BaseModel):
|
|
55
50
|
block_id: BlockId
|
|
@@ -96,16 +91,11 @@ class RpcQueryRequestViewAccessKeyListByFinality(BaseModel):
|
|
|
96
91
|
account_id: AccountId
|
|
97
92
|
request_type: Literal['view_access_key_list']
|
|
98
93
|
|
|
99
|
-
class
|
|
94
|
+
class RpcQueryRequestViewGasKeyNoncesByFinality(BaseModel):
|
|
100
95
|
finality: Finality
|
|
101
96
|
account_id: AccountId
|
|
102
97
|
public_key: PublicKey
|
|
103
|
-
request_type: Literal['
|
|
104
|
-
|
|
105
|
-
class RpcQueryRequestViewGasKeyListByFinality(BaseModel):
|
|
106
|
-
finality: Finality
|
|
107
|
-
account_id: AccountId
|
|
108
|
-
request_type: Literal['view_gas_key_list']
|
|
98
|
+
request_type: Literal['view_gas_key_nonces']
|
|
109
99
|
|
|
110
100
|
class RpcQueryRequestCallFunctionByFinality(BaseModel):
|
|
111
101
|
finality: Finality
|
|
@@ -152,16 +142,11 @@ class RpcQueryRequestViewAccessKeyListBySyncCheckpoint(BaseModel):
|
|
|
152
142
|
account_id: AccountId
|
|
153
143
|
request_type: Literal['view_access_key_list']
|
|
154
144
|
|
|
155
|
-
class
|
|
145
|
+
class RpcQueryRequestViewGasKeyNoncesBySyncCheckpoint(BaseModel):
|
|
156
146
|
sync_checkpoint: SyncCheckpoint
|
|
157
147
|
account_id: AccountId
|
|
158
148
|
public_key: PublicKey
|
|
159
|
-
request_type: Literal['
|
|
160
|
-
|
|
161
|
-
class RpcQueryRequestViewGasKeyListBySyncCheckpoint(BaseModel):
|
|
162
|
-
sync_checkpoint: SyncCheckpoint
|
|
163
|
-
account_id: AccountId
|
|
164
|
-
request_type: Literal['view_gas_key_list']
|
|
149
|
+
request_type: Literal['view_gas_key_nonces']
|
|
165
150
|
|
|
166
151
|
class RpcQueryRequestCallFunctionBySyncCheckpoint(BaseModel):
|
|
167
152
|
sync_checkpoint: SyncCheckpoint
|
|
@@ -180,6 +165,6 @@ class RpcQueryRequestViewGlobalContractCodeByAccountIdBySyncCheckpoint(BaseModel
|
|
|
180
165
|
account_id: AccountId
|
|
181
166
|
request_type: Literal['view_global_contract_code_by_account_id']
|
|
182
167
|
|
|
183
|
-
class RpcQueryRequest(RootModel[Union[RpcQueryRequestViewAccountByBlockId, RpcQueryRequestViewCodeByBlockId, RpcQueryRequestViewStateByBlockId, RpcQueryRequestViewAccessKeyByBlockId, RpcQueryRequestViewAccessKeyListByBlockId,
|
|
168
|
+
class RpcQueryRequest(RootModel[Union[RpcQueryRequestViewAccountByBlockId, RpcQueryRequestViewCodeByBlockId, RpcQueryRequestViewStateByBlockId, RpcQueryRequestViewAccessKeyByBlockId, RpcQueryRequestViewAccessKeyListByBlockId, RpcQueryRequestViewGasKeyNoncesByBlockId, RpcQueryRequestCallFunctionByBlockId, RpcQueryRequestViewGlobalContractCodeByBlockId, RpcQueryRequestViewGlobalContractCodeByAccountIdByBlockId, RpcQueryRequestViewAccountByFinality, RpcQueryRequestViewCodeByFinality, RpcQueryRequestViewStateByFinality, RpcQueryRequestViewAccessKeyByFinality, RpcQueryRequestViewAccessKeyListByFinality, RpcQueryRequestViewGasKeyNoncesByFinality, RpcQueryRequestCallFunctionByFinality, RpcQueryRequestViewGlobalContractCodeByFinality, RpcQueryRequestViewGlobalContractCodeByAccountIdByFinality, RpcQueryRequestViewAccountBySyncCheckpoint, RpcQueryRequestViewCodeBySyncCheckpoint, RpcQueryRequestViewStateBySyncCheckpoint, RpcQueryRequestViewAccessKeyBySyncCheckpoint, RpcQueryRequestViewAccessKeyListBySyncCheckpoint, RpcQueryRequestViewGasKeyNoncesBySyncCheckpoint, RpcQueryRequestCallFunctionBySyncCheckpoint, RpcQueryRequestViewGlobalContractCodeBySyncCheckpoint, RpcQueryRequestViewGlobalContractCodeByAccountIdBySyncCheckpoint]]):
|
|
184
169
|
pass
|
|
185
170
|
|
|
@@ -4,12 +4,11 @@ from near_jsonrpc_models.account_view import AccountView
|
|
|
4
4
|
from near_jsonrpc_models.call_result import CallResult
|
|
5
5
|
from near_jsonrpc_models.contract_code_view import ContractCodeView
|
|
6
6
|
from near_jsonrpc_models.crypto_hash import CryptoHash
|
|
7
|
-
from near_jsonrpc_models.gas_key_list import GasKeyList
|
|
8
|
-
from near_jsonrpc_models.gas_key_view import GasKeyView
|
|
9
7
|
from near_jsonrpc_models.view_state_result import ViewStateResult
|
|
10
8
|
from pydantic import BaseModel
|
|
11
9
|
from pydantic import RootModel
|
|
12
10
|
from pydantic import conint
|
|
11
|
+
from typing import Any
|
|
13
12
|
from typing import Union
|
|
14
13
|
|
|
15
14
|
|
|
@@ -37,14 +36,6 @@ class RpcQueryResponseAccessKeyList(AccessKeyList):
|
|
|
37
36
|
block_hash: CryptoHash
|
|
38
37
|
block_height: conint(ge=0, le=18446744073709551615)
|
|
39
38
|
|
|
40
|
-
class
|
|
41
|
-
block_hash: CryptoHash
|
|
42
|
-
block_height: conint(ge=0, le=18446744073709551615)
|
|
43
|
-
|
|
44
|
-
class RpcQueryResponseGasKeyList(GasKeyList):
|
|
45
|
-
block_hash: CryptoHash
|
|
46
|
-
block_height: conint(ge=0, le=18446744073709551615)
|
|
47
|
-
|
|
48
|
-
class RpcQueryResponse(RootModel[Union[RpcQueryResponseAccountView, RpcQueryResponseContractCodeView, RpcQueryResponseViewStateResult, RpcQueryResponseCallResult, RpcQueryResponseAccessKeyView, RpcQueryResponseAccessKeyList, RpcQueryResponseGasKeyView, RpcQueryResponseGasKeyList]]):
|
|
39
|
+
class RpcQueryResponse(RootModel[Union[RpcQueryResponseAccountView, RpcQueryResponseContractCodeView, RpcQueryResponseViewStateResult, RpcQueryResponseCallResult, RpcQueryResponseAccessKeyView, RpcQueryResponseAccessKeyList, Any]]):
|
|
49
40
|
pass
|
|
50
41
|
|
|
@@ -26,21 +26,11 @@ class RpcStateChangesInBlockByTypeRequestSingleAccessKeyChangesByBlockId(BaseMod
|
|
|
26
26
|
changes_type: Literal['single_access_key_changes']
|
|
27
27
|
keys: List[AccountWithPublicKey]
|
|
28
28
|
|
|
29
|
-
class RpcStateChangesInBlockByTypeRequestSingleGasKeyChangesByBlockId(BaseModel):
|
|
30
|
-
block_id: BlockId
|
|
31
|
-
changes_type: Literal['single_gas_key_changes']
|
|
32
|
-
keys: List[AccountWithPublicKey]
|
|
33
|
-
|
|
34
29
|
class RpcStateChangesInBlockByTypeRequestAllAccessKeyChangesByBlockId(BaseModel):
|
|
35
30
|
block_id: BlockId
|
|
36
31
|
account_ids: List[AccountId]
|
|
37
32
|
changes_type: Literal['all_access_key_changes']
|
|
38
33
|
|
|
39
|
-
class RpcStateChangesInBlockByTypeRequestAllGasKeyChangesByBlockId(BaseModel):
|
|
40
|
-
block_id: BlockId
|
|
41
|
-
account_ids: List[AccountId]
|
|
42
|
-
changes_type: Literal['all_gas_key_changes']
|
|
43
|
-
|
|
44
34
|
class RpcStateChangesInBlockByTypeRequestContractCodeChangesByBlockId(BaseModel):
|
|
45
35
|
block_id: BlockId
|
|
46
36
|
account_ids: List[AccountId]
|
|
@@ -62,21 +52,11 @@ class RpcStateChangesInBlockByTypeRequestSingleAccessKeyChangesByFinality(BaseMo
|
|
|
62
52
|
changes_type: Literal['single_access_key_changes']
|
|
63
53
|
keys: List[AccountWithPublicKey]
|
|
64
54
|
|
|
65
|
-
class RpcStateChangesInBlockByTypeRequestSingleGasKeyChangesByFinality(BaseModel):
|
|
66
|
-
finality: Finality
|
|
67
|
-
changes_type: Literal['single_gas_key_changes']
|
|
68
|
-
keys: List[AccountWithPublicKey]
|
|
69
|
-
|
|
70
55
|
class RpcStateChangesInBlockByTypeRequestAllAccessKeyChangesByFinality(BaseModel):
|
|
71
56
|
finality: Finality
|
|
72
57
|
account_ids: List[AccountId]
|
|
73
58
|
changes_type: Literal['all_access_key_changes']
|
|
74
59
|
|
|
75
|
-
class RpcStateChangesInBlockByTypeRequestAllGasKeyChangesByFinality(BaseModel):
|
|
76
|
-
finality: Finality
|
|
77
|
-
account_ids: List[AccountId]
|
|
78
|
-
changes_type: Literal['all_gas_key_changes']
|
|
79
|
-
|
|
80
60
|
class RpcStateChangesInBlockByTypeRequestContractCodeChangesByFinality(BaseModel):
|
|
81
61
|
finality: Finality
|
|
82
62
|
account_ids: List[AccountId]
|
|
@@ -98,21 +78,11 @@ class RpcStateChangesInBlockByTypeRequestSingleAccessKeyChangesBySyncCheckpoint(
|
|
|
98
78
|
changes_type: Literal['single_access_key_changes']
|
|
99
79
|
keys: List[AccountWithPublicKey]
|
|
100
80
|
|
|
101
|
-
class RpcStateChangesInBlockByTypeRequestSingleGasKeyChangesBySyncCheckpoint(BaseModel):
|
|
102
|
-
sync_checkpoint: SyncCheckpoint
|
|
103
|
-
changes_type: Literal['single_gas_key_changes']
|
|
104
|
-
keys: List[AccountWithPublicKey]
|
|
105
|
-
|
|
106
81
|
class RpcStateChangesInBlockByTypeRequestAllAccessKeyChangesBySyncCheckpoint(BaseModel):
|
|
107
82
|
sync_checkpoint: SyncCheckpoint
|
|
108
83
|
account_ids: List[AccountId]
|
|
109
84
|
changes_type: Literal['all_access_key_changes']
|
|
110
85
|
|
|
111
|
-
class RpcStateChangesInBlockByTypeRequestAllGasKeyChangesBySyncCheckpoint(BaseModel):
|
|
112
|
-
sync_checkpoint: SyncCheckpoint
|
|
113
|
-
account_ids: List[AccountId]
|
|
114
|
-
changes_type: Literal['all_gas_key_changes']
|
|
115
|
-
|
|
116
86
|
class RpcStateChangesInBlockByTypeRequestContractCodeChangesBySyncCheckpoint(BaseModel):
|
|
117
87
|
sync_checkpoint: SyncCheckpoint
|
|
118
88
|
account_ids: List[AccountId]
|
|
@@ -124,6 +94,6 @@ class RpcStateChangesInBlockByTypeRequestDataChangesBySyncCheckpoint(BaseModel):
|
|
|
124
94
|
changes_type: Literal['data_changes']
|
|
125
95
|
key_prefix_base64: StoreKey
|
|
126
96
|
|
|
127
|
-
class RpcStateChangesInBlockByTypeRequest(RootModel[Union[RpcStateChangesInBlockByTypeRequestAccountChangesByBlockId, RpcStateChangesInBlockByTypeRequestSingleAccessKeyChangesByBlockId,
|
|
97
|
+
class RpcStateChangesInBlockByTypeRequest(RootModel[Union[RpcStateChangesInBlockByTypeRequestAccountChangesByBlockId, RpcStateChangesInBlockByTypeRequestSingleAccessKeyChangesByBlockId, RpcStateChangesInBlockByTypeRequestAllAccessKeyChangesByBlockId, RpcStateChangesInBlockByTypeRequestContractCodeChangesByBlockId, RpcStateChangesInBlockByTypeRequestDataChangesByBlockId, RpcStateChangesInBlockByTypeRequestAccountChangesByFinality, RpcStateChangesInBlockByTypeRequestSingleAccessKeyChangesByFinality, RpcStateChangesInBlockByTypeRequestAllAccessKeyChangesByFinality, RpcStateChangesInBlockByTypeRequestContractCodeChangesByFinality, RpcStateChangesInBlockByTypeRequestDataChangesByFinality, RpcStateChangesInBlockByTypeRequestAccountChangesBySyncCheckpoint, RpcStateChangesInBlockByTypeRequestSingleAccessKeyChangesBySyncCheckpoint, RpcStateChangesInBlockByTypeRequestAllAccessKeyChangesBySyncCheckpoint, RpcStateChangesInBlockByTypeRequestContractCodeChangesBySyncCheckpoint, RpcStateChangesInBlockByTypeRequestDataChangesBySyncCheckpoint]]):
|
|
128
98
|
pass
|
|
129
99
|
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
from near_jsonrpc_models.account_creation_config_view import AccountCreationConfigView
|
|
4
4
|
from near_jsonrpc_models.congestion_control_config_view import CongestionControlConfigView
|
|
5
|
-
from near_jsonrpc_models.dynamic_resharding_config_view import DynamicReshardingConfigView
|
|
6
5
|
from near_jsonrpc_models.near_token import NearToken
|
|
7
6
|
from near_jsonrpc_models.runtime_fees_config_view import RuntimeFeesConfigView
|
|
8
7
|
from near_jsonrpc_models.vmconfig_view import VMConfigView
|
|
9
8
|
from near_jsonrpc_models.witness_config_view import WitnessConfigView
|
|
10
9
|
from pydantic import BaseModel
|
|
11
|
-
from pydantic import Field
|
|
12
10
|
|
|
13
11
|
|
|
14
12
|
class RuntimeConfigView(BaseModel):
|
|
@@ -16,8 +14,6 @@ class RuntimeConfigView(BaseModel):
|
|
|
16
14
|
account_creation_config: AccountCreationConfigView = None
|
|
17
15
|
# The configuration for congestion control.
|
|
18
16
|
congestion_control_config: CongestionControlConfigView = None
|
|
19
|
-
# Configuration for dynamic resharding feature.
|
|
20
|
-
dynamic_resharding_config: DynamicReshardingConfigView = Field(default_factory=lambda: DynamicReshardingConfigView(**{'block_split_shards': [], 'force_split_shards': [], 'max_number_of_shards': 999999999999999, 'memory_usage_threshold': 999999999999999, 'min_child_memory_usage': 999999999999999, 'min_epochs_between_resharding': 999999999999999}))
|
|
21
17
|
# Amount of yN per byte required to have on the account. See
|
|
22
18
|
# <https://nomicon.io/Economics/Economics.html#state-stake> for details.
|
|
23
19
|
storage_amount_per_byte: NearToken = None
|
|
@@ -12,6 +12,8 @@ class SignedTransactionView(BaseModel):
|
|
|
12
12
|
actions: List[ActionView]
|
|
13
13
|
hash: CryptoHash
|
|
14
14
|
nonce: conint(ge=0, le=18446744073709551615)
|
|
15
|
+
nonce_index: conint(ge=0, le=4294967295) | None = None
|
|
16
|
+
# Deprecated, retained for backward compatibility.
|
|
15
17
|
priority_fee: conint(ge=0, le=18446744073709551615) = 0
|
|
16
18
|
public_key: PublicKey
|
|
17
19
|
receiver_id: AccountId
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from near_jsonrpc_models.access_key_view import AccessKeyView
|
|
2
2
|
from near_jsonrpc_models.account_id import AccountId
|
|
3
3
|
from near_jsonrpc_models.crypto_hash import CryptoHash
|
|
4
|
-
from near_jsonrpc_models.gas_key import GasKey
|
|
5
4
|
from near_jsonrpc_models.near_token import NearToken
|
|
6
5
|
from near_jsonrpc_models.public_key import PublicKey
|
|
7
6
|
from near_jsonrpc_models.state_change_cause_view import StateChangeCauseView
|
|
@@ -58,16 +57,6 @@ class StateChangeWithCauseViewAccessKeyDeletion(BaseModel):
|
|
|
58
57
|
change: StateChangeWithCauseViewAccessKeyDeletionChange
|
|
59
58
|
type: Literal['access_key_deletion']
|
|
60
59
|
|
|
61
|
-
class StateChangeWithCauseViewGasKeyUpdateChange(BaseModel):
|
|
62
|
-
account_id: AccountId
|
|
63
|
-
gas_key: GasKey
|
|
64
|
-
public_key: PublicKey
|
|
65
|
-
|
|
66
|
-
class StateChangeWithCauseViewGasKeyUpdate(BaseModel):
|
|
67
|
-
cause: StateChangeCauseView
|
|
68
|
-
change: StateChangeWithCauseViewGasKeyUpdateChange
|
|
69
|
-
type: Literal['gas_key_update']
|
|
70
|
-
|
|
71
60
|
class StateChangeWithCauseViewGasKeyNonceUpdateChange(BaseModel):
|
|
72
61
|
account_id: AccountId
|
|
73
62
|
index: conint(ge=0, le=4294967295)
|
|
@@ -79,15 +68,6 @@ class StateChangeWithCauseViewGasKeyNonceUpdate(BaseModel):
|
|
|
79
68
|
change: StateChangeWithCauseViewGasKeyNonceUpdateChange
|
|
80
69
|
type: Literal['gas_key_nonce_update']
|
|
81
70
|
|
|
82
|
-
class StateChangeWithCauseViewGasKeyDeletionChange(BaseModel):
|
|
83
|
-
account_id: AccountId
|
|
84
|
-
public_key: PublicKey
|
|
85
|
-
|
|
86
|
-
class StateChangeWithCauseViewGasKeyDeletion(BaseModel):
|
|
87
|
-
cause: StateChangeCauseView
|
|
88
|
-
change: StateChangeWithCauseViewGasKeyDeletionChange
|
|
89
|
-
type: Literal['gas_key_deletion']
|
|
90
|
-
|
|
91
71
|
class StateChangeWithCauseViewDataUpdateChange(BaseModel):
|
|
92
72
|
account_id: AccountId
|
|
93
73
|
key_base64: StoreKey
|
|
@@ -124,6 +104,6 @@ class StateChangeWithCauseViewContractCodeDeletion(BaseModel):
|
|
|
124
104
|
change: StateChangeWithCauseViewContractCodeDeletionChange
|
|
125
105
|
type: Literal['contract_code_deletion']
|
|
126
106
|
|
|
127
|
-
class StateChangeWithCauseView(RootModel[Union[StateChangeWithCauseViewAccountUpdate, StateChangeWithCauseViewAccountDeletion, StateChangeWithCauseViewAccessKeyUpdate, StateChangeWithCauseViewAccessKeyDeletion,
|
|
107
|
+
class StateChangeWithCauseView(RootModel[Union[StateChangeWithCauseViewAccountUpdate, StateChangeWithCauseViewAccountDeletion, StateChangeWithCauseViewAccessKeyUpdate, StateChangeWithCauseViewAccessKeyDeletion, StateChangeWithCauseViewGasKeyNonceUpdate, StateChangeWithCauseViewDataUpdate, StateChangeWithCauseViewDataDeletion, StateChangeWithCauseViewContractCodeUpdate, StateChangeWithCauseViewContractCodeDeletion]]):
|
|
128
108
|
pass
|
|
129
109
|
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
"""Transfer NEAR to a gas key's balance"""
|
|
2
|
+
|
|
1
3
|
from near_jsonrpc_models.near_token import NearToken
|
|
2
4
|
from near_jsonrpc_models.public_key import PublicKey
|
|
3
5
|
from pydantic import BaseModel
|
|
4
6
|
|
|
5
7
|
|
|
6
8
|
class TransferToGasKeyAction(BaseModel):
|
|
9
|
+
# Amount of NEAR to transfer to the gas key
|
|
7
10
|
deposit: NearToken
|
|
11
|
+
# The public key of the gas key to fund
|
|
8
12
|
public_key: PublicKey
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""Withdraw NEAR from a gas key's balance to the account"""
|
|
2
|
+
|
|
3
|
+
from near_jsonrpc_models.near_token import NearToken
|
|
4
|
+
from near_jsonrpc_models.public_key import PublicKey
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class WithdrawFromGasKeyAction(BaseModel):
|
|
9
|
+
# Amount of NEAR to transfer from the gas key
|
|
10
|
+
amount: NearToken
|
|
11
|
+
# The public key of the gas key to withdraw from
|
|
12
|
+
public_key: PublicKey
|
{near_jsonrpc_client-1.0.23.dist-info → near_jsonrpc_client-1.0.25.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|