Skip to content

Commit

Permalink
✨ Improve Bolt typescript SDK (#41)
Browse files Browse the repository at this point in the history
* ✨ Improve ts sdk

* ♻️ Code Refactor

* 🐛 Fix generated example
  • Loading branch information
GabrielePicco authored Apr 6, 2024
1 parent 9e96112 commit fcd0b4b
Show file tree
Hide file tree
Showing 19 changed files with 265 additions and 165 deletions.
8 changes: 4 additions & 4 deletions cli/src/rust_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ describe("{}", () => {{
it("Add an entity", async () => {{
const addEntity = await AddEntity({{
payer: provider.wallet.publicKey,
worldPda: worldPda,
world: worldPda,
connection: provider.connection,
}});
const txSign = await provider.sendAndConfirm(addEntity.transaction);
Expand All @@ -454,7 +454,7 @@ describe("{}", () => {{
it("Add a component", async () => {{
const initComponent = await InitializeComponent({{
payer: provider.wallet.publicKey,
entityPda,
entity: entityPda,
componentId: positionComponent.programId,
}});
const txSign = await provider.sendAndConfirm(initComponent.transaction);
Expand All @@ -470,8 +470,8 @@ describe("{}", () => {{
const applySystem = await ApplySystem({{
authority: provider.wallet.publicKey,
boltSystem: systemMovement.programId,
entityPda,
system: systemMovement.programId,
entity: entityPda,
components: [positionComponent.programId],
}});
const txSign = await provider.sendAndConfirm(applySystem.transaction);
Expand Down
11 changes: 7 additions & 4 deletions clients/bolt-sdk/lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="node" />
import { PublicKey } from "@solana/web3.js";
import type BN from "bn.js";
import BN from "bn.js";
export * from "./accounts";
export * from "./instructions";
export * from "./transactions/transactions";
Expand All @@ -9,10 +9,13 @@ export declare const PROGRAM_ADDRESS =
export declare const SYSVAR_INSTRUCTIONS_PUBKEY: PublicKey;
export declare const PROGRAM_ID: PublicKey;
export declare function FindWorldRegistryPda(programId?: PublicKey): PublicKey;
export declare function FindWorldPda(id: BN, programId?: PublicKey): PublicKey;
export declare function FindWorldPda(
id: BN | string | number | Uint8Array,
programId?: PublicKey
): PublicKey;
export declare function FindEntityPda(
worldId: BN,
entityId: BN,
worldId: BN | string | number | Uint8Array,
entityId: BN | string | number | Uint8Array,
extraSeed?: string,
programId?: PublicKey
): PublicKey;
Expand Down
2 changes: 1 addition & 1 deletion clients/bolt-sdk/lib/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 21 additions & 3 deletions clients/bolt-sdk/lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion clients/bolt-sdk/lib/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion clients/bolt-sdk/lib/instructions/apply5.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion clients/bolt-sdk/lib/instructions/apply5.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion clients/bolt-sdk/lib/instructions/initializeComponent.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export declare const initializeComponentStruct: beet.BeetArgsStruct<{
}>;
export interface InitializeComponentInstructionAccounts {
payer: web3.PublicKey;
data: web3.PublicKey;
data?: web3.PublicKey;
entity: web3.PublicKey;
componentProgram: web3.PublicKey;
authority?: web3.PublicKey;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 16 additions & 10 deletions clients/bolt-sdk/lib/instructions/initializeComponent.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fcd0b4b

Please sign in to comment.