Skip to content

Commit fcd0b4b

Browse files
✨ Improve Bolt typescript SDK (#41)
* ✨ Improve ts sdk * ♻️ Code Refactor * 🐛 Fix generated example
1 parent 9e96112 commit fcd0b4b

19 files changed

+265
-165
lines changed

cli/src/rust_template.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ describe("{}", () => {{
443443
it("Add an entity", async () => {{
444444
const addEntity = await AddEntity({{
445445
payer: provider.wallet.publicKey,
446-
worldPda: worldPda,
446+
world: worldPda,
447447
connection: provider.connection,
448448
}});
449449
const txSign = await provider.sendAndConfirm(addEntity.transaction);
@@ -454,7 +454,7 @@ describe("{}", () => {{
454454
it("Add a component", async () => {{
455455
const initComponent = await InitializeComponent({{
456456
payer: provider.wallet.publicKey,
457-
entityPda,
457+
entity: entityPda,
458458
componentId: positionComponent.programId,
459459
}});
460460
const txSign = await provider.sendAndConfirm(initComponent.transaction);
@@ -470,8 +470,8 @@ describe("{}", () => {{
470470
471471
const applySystem = await ApplySystem({{
472472
authority: provider.wallet.publicKey,
473-
boltSystem: systemMovement.programId,
474-
entityPda,
473+
system: systemMovement.programId,
474+
entity: entityPda,
475475
components: [positionComponent.programId],
476476
}});
477477
const txSign = await provider.sendAndConfirm(applySystem.transaction);

clients/bolt-sdk/lib/index.d.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="node" />
22
import { PublicKey } from "@solana/web3.js";
3-
import type BN from "bn.js";
3+
import BN from "bn.js";
44
export * from "./accounts";
55
export * from "./instructions";
66
export * from "./transactions/transactions";
@@ -9,10 +9,13 @@ export declare const PROGRAM_ADDRESS =
99
export declare const SYSVAR_INSTRUCTIONS_PUBKEY: PublicKey;
1010
export declare const PROGRAM_ID: PublicKey;
1111
export declare function FindWorldRegistryPda(programId?: PublicKey): PublicKey;
12-
export declare function FindWorldPda(id: BN, programId?: PublicKey): PublicKey;
12+
export declare function FindWorldPda(
13+
id: BN | string | number | Uint8Array,
14+
programId?: PublicKey
15+
): PublicKey;
1316
export declare function FindEntityPda(
14-
worldId: BN,
15-
entityId: BN,
17+
worldId: BN | string | number | Uint8Array,
18+
entityId: BN | string | number | Uint8Array,
1619
extraSeed?: string,
1720
programId?: PublicKey
1821
): PublicKey;

clients/bolt-sdk/lib/index.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/bolt-sdk/lib/index.js

Lines changed: 21 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/bolt-sdk/lib/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/bolt-sdk/lib/instructions/apply5.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/bolt-sdk/lib/instructions/apply5.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/bolt-sdk/lib/instructions/initializeComponent.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export declare const initializeComponentStruct: beet.BeetArgsStruct<{
55
}>;
66
export interface InitializeComponentInstructionAccounts {
77
payer: web3.PublicKey;
8-
data: web3.PublicKey;
8+
data?: web3.PublicKey;
99
entity: web3.PublicKey;
1010
componentProgram: web3.PublicKey;
1111
authority?: web3.PublicKey;

clients/bolt-sdk/lib/instructions/initializeComponent.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/bolt-sdk/lib/instructions/initializeComponent.js

Lines changed: 16 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)