diff --git a/Cargo.lock b/Cargo.lock index 52d20b88..dcbcd56a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3408,7 +3408,7 @@ dependencies = [ [[package]] name = "race-cli" -version = "0.0.9" +version = "0.0.10" dependencies = [ "anyhow", "base64 0.21.0", @@ -3426,14 +3426,14 @@ dependencies = [ [[package]] name = "race-client" -version = "0.0.9" +version = "0.0.10" dependencies = [ "race-core", ] [[package]] name = "race-core" -version = "0.0.9" +version = "0.0.10" dependencies = [ "anyhow", "async-trait", @@ -3445,7 +3445,7 @@ dependencies = [ [[package]] name = "race-encryptor" -version = "0.0.9" +version = "0.0.10" dependencies = [ "aes 0.8.2", "anyhow", @@ -3462,7 +3462,7 @@ dependencies = [ [[package]] name = "race-env" -version = "0.0.9" +version = "0.0.10" dependencies = [ "serde", "shellexpand", @@ -3513,7 +3513,7 @@ dependencies = [ [[package]] name = "race-facade" -version = "0.0.9" +version = "0.0.10" dependencies = [ "anyhow", "async-trait", @@ -3537,7 +3537,7 @@ dependencies = [ [[package]] name = "race-proc-macro" -version = "0.0.9" +version = "0.0.10" dependencies = [ "borsh", "quote 1.0.26", @@ -3547,7 +3547,7 @@ dependencies = [ [[package]] name = "race-solana-types" -version = "0.0.9" +version = "0.0.10" dependencies = [ "anyhow", "borsh", @@ -3560,7 +3560,7 @@ dependencies = [ [[package]] name = "race-test" -version = "0.0.9" +version = "0.0.10" dependencies = [ "anyhow", "async-trait", @@ -3578,7 +3578,7 @@ dependencies = [ [[package]] name = "race-transactor" -version = "0.0.9" +version = "0.0.10" dependencies = [ "anyhow", "arrayref", @@ -3612,7 +3612,7 @@ dependencies = [ [[package]] name = "race-transport" -version = "0.0.9" +version = "0.0.10" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index a6db9627..b499b41e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,14 +23,14 @@ members = [ ] [workspace.dependencies] -race-core = { path = "core", version = ">=0.0.9" } -race-proc-macro = { path = "proc-macro", version = ">=0.0.9" } -race-client = { path = "client", version = ">=0.0.9" } -race-encryptor = { path = "encryptor", version = ">=0.0.9" } -race-env = { path = "env", version = ">=0.0.9" } -race-test = { path = "test", version = ">=0.0.9" } -race-solana-types = { path = "contracts/solana-types", version = ">=0.0.9", default-features = false } -race-transport = { path = "transport", version = ">=0.0.9" } +race-core = { path = "core", version = ">=0.0.10" } +race-proc-macro = { path = "proc-macro", version = ">=0.0.10" } +race-client = { path = "client", version = ">=0.0.10" } +race-encryptor = { path = "encryptor", version = ">=0.0.10" } +race-env = { path = "env", version = ">=0.0.10" } +race-test = { path = "test", version = ">=0.0.10" } +race-solana-types = { path = "contracts/solana-types", version = ">=0.0.10", default-features = false } +race-transport = { path = "transport", version = ">=0.0.10" } uuid = { version = "1.1.2", features = ["v4", "fast-rng"] } syn = "1.0.107" quote = "1.0.23" @@ -79,7 +79,7 @@ regex = "1" [workspace.package] authors = ["RACE Foundation "] -version = "0.0.9" +version = "0.0.10" edition = "2021" rust-version = "1.65.0" license = "MPL-2.0" diff --git a/core/src/engine.rs b/core/src/engine.rs index cc8e86a6..4e000a07 100644 --- a/core/src/engine.rs +++ b/core/src/engine.rs @@ -22,6 +22,9 @@ pub struct InitAccount { pub data: Vec, pub access_version: u64, pub settle_version: u64, + pub max_players: u16, + pub min_deposit: u64, + pub max_deposit: u64, } impl InitAccount { @@ -38,6 +41,9 @@ impl InitAccount { data: game_account.data.clone(), access_version, settle_version, + max_players: game_account.max_players, + min_deposit: game_account.min_deposit, + max_deposit: game_account.min_deposit, } } @@ -64,6 +70,9 @@ impl InitAccount { data: game_account.data.clone(), access_version: transactor_access_version, settle_version: transactor_settle_version, + max_players: game_account.max_players, + min_deposit: game_account.min_deposit, + max_deposit: game_account.min_deposit, } } @@ -105,6 +114,9 @@ impl Default for InitAccount { data: Vec::new(), access_version: 0, settle_version: 0, + max_players: 10, + min_deposit: 0, + max_deposit: 9999, } } } diff --git a/js/borsh/package-lock.json b/js/borsh/package-lock.json index b06de115..0e1e6d94 100644 --- a/js/borsh/package-lock.json +++ b/js/borsh/package-lock.json @@ -1,12 +1,12 @@ { "name": "@race-foundation/borsh", - "version": "0.0.26", + "version": "0.0.27", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@race-foundation/borsh", - "version": "0.0.26", + "version": "0.0.27", "license": "ISC", "devDependencies": { "@types/chai": "^4.3.4", diff --git a/js/borsh/package.json b/js/borsh/package.json index 528d32d5..0ee9e101 100644 --- a/js/borsh/package.json +++ b/js/borsh/package.json @@ -1,6 +1,6 @@ { "name": "@race-foundation/borsh", - "version": "0.0.26", + "version": "0.0.27", "description": "A borsh implementation with decorator support", "repository": { "type": "git", diff --git a/js/package-lock.json b/js/package-lock.json index e1663560..b0387e46 100644 --- a/js/package-lock.json +++ b/js/package-lock.json @@ -15,7 +15,7 @@ }, "borsh": { "name": "@race-foundation/borsh", - "version": "0.0.26", + "version": "0.0.27", "license": "ISC", "devDependencies": { "@swc/register": "^0.1.10", @@ -6637,7 +6637,7 @@ }, "sdk-core": { "name": "@race-foundation/sdk-core", - "version": "0.0.26", + "version": "0.0.27", "license": "ISC", "devDependencies": { "@types/chai": "^4.3.4", @@ -6657,7 +6657,7 @@ }, "sdk-facade": { "name": "@race-foundation/sdk-facade", - "version": "0.0.26", + "version": "0.0.27", "license": "ISC", "devDependencies": { "@types/chai": "^4.3.4", @@ -6677,7 +6677,7 @@ }, "sdk-solana": { "name": "@race-foundation/sdk-solana", - "version": "0.0.26", + "version": "0.0.27", "license": "ISC", "devDependencies": { "@types/bn.js": "^5.1.1", diff --git a/js/sdk-core/package-lock.json b/js/sdk-core/package-lock.json index 6061c99e..e9ba6116 100644 --- a/js/sdk-core/package-lock.json +++ b/js/sdk-core/package-lock.json @@ -1,12 +1,12 @@ { "name": "race-sdk-core", - "version": "0.0.26", + "version": "0.0.27", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "race-sdk-core", - "version": "0.0.26", + "version": "0.0.27", "license": "ISC", "devDependencies": { "@types/chai": "^4.3.4", diff --git a/js/sdk-core/package.json b/js/sdk-core/package.json index 494e85dc..b40298fd 100644 --- a/js/sdk-core/package.json +++ b/js/sdk-core/package.json @@ -1,6 +1,6 @@ { "name": "@race-foundation/sdk-core", - "version": "0.0.26", + "version": "0.0.27", "description": "The type definitions for Race SDK", "scripts": { "test": "jest", diff --git a/js/sdk-core/src/handler.ts b/js/sdk-core/src/handler.ts index 964f69f4..de8c70b6 100644 --- a/js/sdk-core/src/handler.ts +++ b/js/sdk-core/src/handler.ts @@ -17,6 +17,9 @@ export interface IInitAccount { data: Uint8Array; accessVersion: bigint; settleVersion: bigint; + maxPlayers: number; + minDeposit: bigint; + maxDeposit: bigint; } export class InitAccount { @@ -32,6 +35,13 @@ export class InitAccount { readonly accessVersion: bigint; @field('u64') readonly settleVersion: bigint; + @field('u16') + readonly maxPlayers: number; + @field('u64') + readonly minDeposit: bigint; + @field('u64') + readonly maxDeposit: bigint; + constructor(fields: IInitAccount) { this.addr = fields.addr; this.accessVersion = fields.accessVersion; @@ -39,6 +49,9 @@ export class InitAccount { this.data = fields.data; this.players = fields.players; this.servers = fields.servers; + this.maxPlayers = fields.maxPlayers; + this.minDeposit = fields.minDeposit; + this.maxDeposit = fields.maxDeposit; } static createFromGameAccount( gameAccount: GameAccount, @@ -55,6 +68,9 @@ export class InitAccount { servers, accessVersion: transactorAccessVersion, settleVersion: transactorSettleVersion, + maxPlayers: gameAccount.maxPlayers, + minDeposit: gameAccount.minDeposit, + maxDeposit: gameAccount.maxDeposit, }); } serialize(): Uint8Array { diff --git a/js/sdk-facade/package.json b/js/sdk-facade/package.json index fba2f040..467d956b 100644 --- a/js/sdk-facade/package.json +++ b/js/sdk-facade/package.json @@ -1,6 +1,6 @@ { "name": "@race-foundation/sdk-facade", - "version": "0.0.26", + "version": "0.0.27", "description": "The Facade integration for Race SDK", "main": "lib/cjs/index.ts", "module": "lib/esm/index.js", diff --git a/js/sdk-solana/package-lock.json b/js/sdk-solana/package-lock.json index 94ad0bca..222b7fcb 100644 --- a/js/sdk-solana/package-lock.json +++ b/js/sdk-solana/package-lock.json @@ -1,12 +1,12 @@ { "name": "race-sdk-solana", - "version": "0.0.26", + "version": "0.0.27", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "race-sdk-solana", - "version": "0.0.26", + "version": "0.0.27", "license": "ISC", "dependencies": { "@solana/spl-token": "^0.3.7", diff --git a/js/sdk-solana/package.json b/js/sdk-solana/package.json index 09d5f22e..6230189c 100644 --- a/js/sdk-solana/package.json +++ b/js/sdk-solana/package.json @@ -1,6 +1,6 @@ { "name": "@race-foundation/sdk-solana", - "version": "0.0.26", + "version": "0.0.27", "description": "The Solana support for Race SDK", "scripts": { "test": "jest",