diff --git a/clients/bolt-sdk/.crates/.crates.toml b/clients/bolt-sdk/.crates/.crates.toml deleted file mode 100644 index 172c78a..0000000 --- a/clients/bolt-sdk/.crates/.crates.toml +++ /dev/null @@ -1,2 +0,0 @@ -[v1] -"anchor-cli 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)" = ["anchor"] diff --git a/clients/bolt-sdk/.crates/.crates2.json b/clients/bolt-sdk/.crates/.crates2.json deleted file mode 100644 index 6c42b61..0000000 --- a/clients/bolt-sdk/.crates/.crates2.json +++ /dev/null @@ -1 +0,0 @@ -{"installs":{"anchor-cli 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)":{"version_req":"0.29.0","bins":["anchor"],"features":[],"all_features":false,"no_default_features":false,"profile":"release","target":"aarch64-apple-darwin","rustc":"rustc 1.73.0 (cc66ad468 2023-10-03)\nbinary: rustc\ncommit-hash: cc66ad468955717ab92600c770da8c1601a4ff33\ncommit-date: 2023-10-03\nhost: aarch64-apple-darwin\nrelease: 1.73.0\nLLVM version: 17.0.2\n"}}} \ No newline at end of file diff --git a/clients/bolt-sdk/.crates/bin/anchor b/clients/bolt-sdk/.crates/bin/anchor deleted file mode 100755 index 5fd3197..0000000 Binary files a/clients/bolt-sdk/.crates/bin/anchor and /dev/null differ diff --git a/clients/bolt-sdk/.gitignore b/clients/bolt-sdk/.gitignore index a65b417..57d4a65 100644 --- a/clients/bolt-sdk/.gitignore +++ b/clients/bolt-sdk/.gitignore @@ -1 +1,2 @@ lib +.crates diff --git a/clients/bolt-sdk/src/index.ts b/clients/bolt-sdk/src/index.ts index 08dc890..5dc313c 100644 --- a/clients/bolt-sdk/src/index.ts +++ b/clients/bolt-sdk/src/index.ts @@ -41,13 +41,12 @@ export function FindEntityPda( worldId = CastToBN(worldId); entityId = CastToBN(entityId); const worldIdBuffer = Buffer.from(worldId.toArrayLike(Buffer, "be", 8)); - const entityIdBuffer = Buffer.from(entityId.toArrayLike(Buffer, "be", 8)); const seeds = [Buffer.from("entity"), worldIdBuffer]; if (extraSeed != null) { seeds.push(Buffer.from(new Uint8Array(8))); seeds.push(Buffer.from(extraSeed)); } else { - seeds.push(entityIdBuffer); + seeds.push(Buffer.from(entityId.toArrayLike(Buffer, "be", 8))); } return PublicKey.findProgramAddressSync(seeds, programId)[0]; } diff --git a/clients/bolt-sdk/src/world/transactions.ts b/clients/bolt-sdk/src/world/transactions.ts index 58d767e..4c17eb4 100644 --- a/clients/bolt-sdk/src/world/transactions.ts +++ b/clients/bolt-sdk/src/world/transactions.ts @@ -71,7 +71,8 @@ export async function AddEntity({ const worldInstance = await World.fromAccountAddress(connection, world); const entityPda = FindEntityPda( new BN(worldInstance.id), - new BN(worldInstance.entities) + new BN(worldInstance.entities), + seed ); const createEntityIx = createAddEntityInstruction( { @@ -121,6 +122,7 @@ export async function InitializeComponent({ authority: authority ?? PROGRAM_ID, instructionSysvarAccount: SYSVAR_INSTRUCTIONS_PUBKEY, anchorRemainingAccounts, + instructionSysvarAccount: SYSVAR_INSTRUCTIONS_PUBKEY, }); return { @@ -170,7 +172,7 @@ function createApplySystemInstruction({ } const instructionArgs = { - authority, + authority: authority ?? PROGRAM_ID, boltSystem: systemId, instructionSysvarAccount: SYSVAR_INSTRUCTIONS_PUBKEY, anchorRemainingAccounts: extraAccounts,