Skip to content

Commit

Permalink
remove world id from public api
Browse files Browse the repository at this point in the history
  • Loading branch information
crypto-vincent committed Jun 18, 2024
1 parent 21007d6 commit 651beb5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clients/bolt-sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function FindEntityPda({
seeds.push(Buffer.from(new Uint8Array(8)));
seeds.push(Buffer.from(seed));
} else if (entityId !== undefined) {
const entityIdBuffer = Buffer.from(entityId.toArrayLike(Buffer, "be", 8));
const entityIdBuffer = entityId.toArrayLike(Buffer, "be", 8);
seeds.push(entityIdBuffer);
} else {
throw new Error("An entity must have either an Id or a Seed");
Expand Down
6 changes: 3 additions & 3 deletions clients/bolt-sdk/src/world/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function InitializeNewWorld({
}: {
payer: PublicKey;
connection: Connection;
}): Promise<{ transaction: Transaction; worldPda: PublicKey; worldId: BN }> {
}): Promise<{ transaction: Transaction; worldPda: PublicKey }> {
const registryPda = FindRegistryPda({});
const registry = await Registry.fromAccountAddress(connection, registryPda);
const worldId = new BN(registry.worlds);
Expand All @@ -48,7 +48,6 @@ export async function InitializeNewWorld({
return {
transaction: new Transaction().add(initializeWorldIx),
worldPda,
worldId,
};
}

Expand All @@ -75,7 +74,8 @@ export async function AddEntity({
entityPda = FindEntityPda({ world, seed });
} else {
const worldData = await World.fromAccountAddress(connection, world);
entityPda = FindEntityPda({ world, entityId: new BN(worldData.entities) });
const entityId = new BN(worldData.entities);
entityPda = FindEntityPda({ world, entityId });
}
const addEntityIx = createAddEntityInstruction(
{
Expand Down

0 comments on commit 651beb5

Please sign in to comment.