Skip to content

Commit

Permalink
make-sure-instructions-parameters-are-passed-on-optionals
Browse files Browse the repository at this point in the history
  • Loading branch information
crypto-vincent committed Jun 13, 2024
1 parent a1efd78 commit a453b2e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion clients/bolt-sdk/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { PublicKey } from "@solana/web3.js";
import BN from "bn.js";
export * from "./accounts";
export * from "./instructions";
export * from "../transactions/transactions";
export * from "./transactions/transactions";
export * from "./delegation/accounts";
export * from "./delegation/delegate";
export declare const PROGRAM_ADDRESS =
Expand Down
21 changes: 14 additions & 7 deletions clients/bolt-sdk/src/transactions/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ import {
FindWorldRegistryPda,
Registry,
SerializeArgs,
SYSVAR_INSTRUCTIONS_PUBKEY,
World,
} from "../index";
import BN from "bn.js";
import type web3 from "@solana/web3.js";
import { type Connection, type PublicKey, Transaction } from "@solana/web3.js";
import { PROGRAM_ID } from "generated";

const MAX_COMPONENTS = 5;

Expand Down Expand Up @@ -70,11 +72,14 @@ export async function AddEntity({
const entityId = new BN(worldInstance.entities);
const entityPda = FindEntityPda(new BN(worldInstance.id), entityId);

const createEntityIx = createAddEntityInstruction({
world,
payer,
entity: entityPda,
});
const createEntityIx = createAddEntityInstruction(
{
world,
payer,
entity: entityPda,
},
{ extraSeed: null }
);
return {
transaction: new Transaction().add(createEntityIx),
entityPda,
Expand Down Expand Up @@ -113,7 +118,8 @@ export async function InitializeComponent({
entity,
data: componentPda,
componentProgram: componentId,
authority,
authority: authority ?? PROGRAM_ID,
instructionSysvarAccount: SYSVAR_INSTRUCTIONS_PUBKEY,
anchorRemainingAccounts,
});

Expand Down Expand Up @@ -165,8 +171,9 @@ export function createApplySystemInstruction({
}

const instructionArgs = {
authority,
authority: authority ?? PROGRAM_ID,
boltSystem: system,
instructionSysvarAccount: SYSVAR_INSTRUCTIONS_PUBKEY,
anchorRemainingAccounts: extraAccounts,
};

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,5 @@
"eslint-plugin-react": "^7.32.2",
"prettier": "^2.6.2"
},
"license": "MIT",
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
"license": "MIT"
}

0 comments on commit a453b2e

Please sign in to comment.