Skip to content

Commit 7c39112

Browse files
chore: regenerate client from OpenAPI
1 parent d20a547 commit 7c39112

File tree

324 files changed

+25873
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

324 files changed

+25873
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package io.github.hosseinkarami_dev.near.rpc.models
2+
3+
import kotlin.ULong
4+
import kotlinx.serialization.SerialName
5+
import kotlinx.serialization.Serializable
6+
7+
/**
8+
* * Access key provides limited access to an account. Each access key belongs to some account and
9+
* is identified by a unique (within the account) public key. One account may have large number of
10+
* access keys. Access keys allow to act on behalf of the account by restricting transactions
11+
* that can be issued.
12+
* `account_id,public_key` is a key in the state
13+
*/
14+
@Serializable
15+
public data class AccessKey(
16+
/**
17+
* * Nonce for this access key, used for tx nonce generation. When access key is created, nonce
18+
* is set to `(block_height - 1) * 1e6` to avoid tx hash collision on access key re-creation.
19+
* See <https://github.com/near/nearcore/issues/3779> for more details.
20+
* * Minimum: 0.0
21+
* * Format: uint64
22+
*/
23+
@SerialName("nonce")
24+
public val nonce: ULong,
25+
/**
26+
* * Defines permissions for this access key.
27+
*/
28+
@SerialName("permission")
29+
public val permission: AccessKeyPermission,
30+
)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package io.github.hosseinkarami_dev.near.rpc.models
2+
3+
import kotlinx.serialization.SerialName
4+
import kotlinx.serialization.Serializable
5+
6+
/**
7+
* * Describes the cost of creating an access key.
8+
*/
9+
@Serializable
10+
public data class AccessKeyCreationConfigView(
11+
/**
12+
* * Base cost of creating a full access access-key.
13+
*/
14+
@SerialName("full_access_cost")
15+
public val fullAccessCost: Fee,
16+
/**
17+
* * Base cost of creating an access-key restricted to specific functions.
18+
*/
19+
@SerialName("function_call_cost")
20+
public val functionCallCost: Fee,
21+
/**
22+
* * Cost per byte of method_names of creating a restricted access-key.
23+
*/
24+
@SerialName("function_call_cost_per_byte")
25+
public val functionCallCostPerByte: Fee,
26+
)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package io.github.hosseinkarami_dev.near.rpc.models
2+
3+
import kotlinx.serialization.SerialName
4+
import kotlinx.serialization.Serializable
5+
6+
/**
7+
* * Describes information about an access key including the public key.
8+
*/
9+
@Serializable
10+
public data class AccessKeyInfoView(
11+
@SerialName("access_key")
12+
public val accessKey: AccessKeyView,
13+
@SerialName("public_key")
14+
public val publicKey: PublicKey,
15+
)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package io.github.hosseinkarami_dev.near.rpc.models
2+
3+
import kotlin.collections.List
4+
import kotlinx.serialization.SerialName
5+
import kotlinx.serialization.Serializable
6+
7+
/**
8+
* * Lists access keys
9+
*/
10+
@Serializable
11+
public data class AccessKeyList(
12+
@SerialName("keys")
13+
public val keys: List<AccessKeyInfoView>,
14+
)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package io.github.hosseinkarami_dev.near.rpc.models
2+
3+
import io.github.hosseinkarami_dev.near.rpc.serializers.AccessKeyPermissionSerializer
4+
import kotlinx.serialization.SerialName
5+
import kotlinx.serialization.Serializable
6+
7+
/**
8+
* * Defines permissions for AccessKey
9+
*/
10+
@Serializable(with = AccessKeyPermissionSerializer::class)
11+
public sealed class AccessKeyPermission {
12+
@Serializable
13+
public data class FunctionCall(
14+
@SerialName("FunctionCall")
15+
public val functionCall: FunctionCallPermission,
16+
) : AccessKeyPermission()
17+
18+
/**
19+
* * Grants full access to the account.
20+
* NOTE: It's used to replace account-level public keys.
21+
* * Possible values: FullAccess
22+
*/
23+
@Serializable
24+
@SerialName("FullAccess")
25+
public object FullAccess : AccessKeyPermission()
26+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package io.github.hosseinkarami_dev.near.rpc.models
2+
3+
import io.github.hosseinkarami_dev.near.rpc.serializers.AccessKeyPermissionViewSerializer
4+
import kotlin.String
5+
import kotlin.collections.List
6+
import kotlinx.serialization.SerialName
7+
import kotlinx.serialization.Serializable
8+
9+
/**
10+
* * Describes the permission scope for an access key. Whether it is a function call or a full access key.
11+
*/
12+
@Serializable(with = AccessKeyPermissionViewSerializer::class)
13+
public sealed class AccessKeyPermissionView {
14+
/**
15+
* * Possible values: FullAccess
16+
*/
17+
@Serializable
18+
@SerialName("FullAccess")
19+
public object FullAccess : AccessKeyPermissionView()
20+
21+
@Serializable
22+
public data class FunctionCall(
23+
@SerialName("FunctionCall")
24+
public val functionCall: FunctionCallPayload,
25+
) : AccessKeyPermissionView() {
26+
@Serializable
27+
public data class FunctionCallPayload(
28+
@SerialName("allowance")
29+
public val allowance: NearToken? = null,
30+
@SerialName("method_names")
31+
public val methodNames: List<String>,
32+
@SerialName("receiver_id")
33+
public val receiverId: String,
34+
)
35+
}
36+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package io.github.hosseinkarami_dev.near.rpc.models
2+
3+
import kotlin.ULong
4+
import kotlinx.serialization.SerialName
5+
import kotlinx.serialization.Serializable
6+
7+
/**
8+
* * Describes access key permission scope and nonce.
9+
*/
10+
@Serializable
11+
public data class AccessKeyView(
12+
/**
13+
* * Minimum: 0.0
14+
* * Format: uint64
15+
*/
16+
@SerialName("nonce")
17+
public val nonce: ULong,
18+
@SerialName("permission")
19+
public val permission: AccessKeyPermissionView,
20+
)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package io.github.hosseinkarami_dev.near.rpc.models
2+
3+
import kotlin.UByte
4+
import kotlinx.serialization.SerialName
5+
import kotlinx.serialization.Serializable
6+
7+
/**
8+
* * The structure describes configuration for creation of new accounts.
9+
*/
10+
@Serializable
11+
public data class AccountCreationConfigView(
12+
/**
13+
* * The minimum length of the top-level account ID that is allowed to be created by any account.
14+
* * Minimum: 0.0
15+
* * Maximum: 255.0
16+
* * Format: uint8
17+
*/
18+
@SerialName("min_allowed_top_level_account_length")
19+
public val minAllowedTopLevelAccountLength: UByte,
20+
/**
21+
* * The account ID of the account registrar. This account ID allowed to create top-level
22+
* accounts of any valid length.
23+
*/
24+
@SerialName("registrar_account_id")
25+
public val registrarAccountId: AccountId,
26+
)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package io.github.hosseinkarami_dev.near.rpc.models
2+
3+
import kotlin.String
4+
import kotlin.collections.List
5+
import kotlinx.serialization.SerialName
6+
import kotlinx.serialization.Serializable
7+
8+
/**
9+
* * AccountData is a piece of global state that a validator
10+
* signs and broadcasts to the network.
11+
*
12+
* It is essentially the data that a validator wants to share with the network.
13+
* All the nodes in the network are collecting the account data
14+
* broadcasted by the validators.
15+
* Since the number of the validators is bounded and their
16+
* identity is known (and the maximal size of allowed AccountData is bounded)
17+
* the global state that is distributed in the form of AccountData is bounded
18+
* as well.
19+
* Find more information in the docs [here](https://github.com/near/nearcore/blob/560f7fc8f4b3106e0d5d46050688610b1f104ac6/chain/client/src/client.rs#L2232)
20+
*/
21+
@Serializable
22+
public data class AccountDataView(
23+
/**
24+
* * Account key of the validator signing this AccountData.
25+
*/
26+
@SerialName("account_key")
27+
public val accountKey: PublicKey,
28+
/**
29+
* * ID of the node that handles the account key (aka validator key).
30+
*/
31+
@SerialName("peer_id")
32+
public val peerId: PublicKey,
33+
/**
34+
* * Proxy nodes that are directly connected to the validator node
35+
* (this list may include the validator node itself).
36+
* TIER1 nodes should connect to one of the proxies to sent TIER1
37+
* messages to the validator.
38+
*/
39+
@SerialName("proxies")
40+
public val proxies: List<Tier1ProxyView>,
41+
/**
42+
* * UTC timestamp of when the AccountData has been signed.
43+
*/
44+
@SerialName("timestamp")
45+
public val timestamp: String,
46+
)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package io.github.hosseinkarami_dev.near.rpc.models
2+
3+
import kotlin.String
4+
import kotlin.jvm.JvmInline
5+
import kotlinx.serialization.Serializable
6+
7+
/**
8+
* * NEAR Account Identifier.
9+
*
10+
* This is a unique, syntactically valid, human-readable account identifier on the NEAR network.
11+
*
12+
* [See the crate-level docs for information about validation.](index.html#account-id-rules)
13+
*
14+
* Also see [Error kind precedence](AccountId#error-kind-precedence).
15+
*
16+
* ## Examples
17+
*
18+
* ```
19+
* use near_account_id::AccountId;
20+
*
21+
* let alice: AccountId = "alice.near".parse().unwrap();
22+
*
23+
* assert!("ƒelicia.near".parse::<AccountId>().is_err()); // (ƒ is not f)
24+
* ```
25+
* * Schema: https://json-schema.org/draft/2020-12/schema
26+
*/
27+
@Serializable
28+
@JvmInline
29+
public value class AccountId(
30+
public val `value`: String,
31+
)

0 commit comments

Comments
 (0)