浏览代码

:construction_worker: Reorganizing templates, using bolt.workspace an… (#95)

Danilo Guanabara 10 月之前
父节点
当前提交
c913c28d43
共有 44 个文件被更改,包括 816 次插入930 次删除
  1. 1 0
      Cargo.toml
  2. 0 4
      cli/Cargo.toml
  3. 13 0
      cli/src/templates/component/lib.rs
  4. 3 18
      cli/src/templates/component/mod.rs
  5. 0 108
      cli/src/templates/program.rs
  6. 4 0
      cli/src/templates/program/constants.rs
  7. 7 0
      cli/src/templates/program/error.rs
  8. 8 0
      cli/src/templates/program/instructions/initialize.rs
  9. 3 0
      cli/src/templates/program/instructions/mod.rs
  10. 45 0
      cli/src/templates/program/mod.rs
  11. 21 0
      cli/src/templates/program/multiple.lib.rs
  12. 15 0
      cli/src/templates/program/single.lib.rs
  13. 0 0
      cli/src/templates/program/state/mod.rs
  14. 0 36
      cli/src/templates/system.rs
  15. 21 0
      cli/src/templates/system/lib.rs
  16. 13 0
      cli/src/templates/system/mod.rs
  17. 0 375
      cli/src/templates/workspace.rs
  18. 26 0
      cli/src/templates/workspace/Cargo.serde.toml
  19. 24 0
      cli/src/templates/workspace/Cargo.toml
  20. 2 0
      cli/src/templates/workspace/Xargo.toml
  21. 8 0
      cli/src/templates/workspace/gitignore
  22. 24 0
      cli/src/templates/workspace/jest.js
  23. 11 0
      cli/src/templates/workspace/jest.package.json
  24. 17 0
      cli/src/templates/workspace/jest.ts.package.json
  25. 21 0
      cli/src/templates/workspace/mocha.js
  26. 86 0
      cli/src/templates/workspace/mocha.ts
  27. 63 0
      cli/src/templates/workspace/mod.rs
  28. 14 0
      cli/src/templates/workspace/package.json
  29. 8 0
      cli/src/templates/workspace/prettierignore
  30. 19 0
      cli/src/templates/workspace/ts.package.json
  31. 13 0
      cli/src/templates/workspace/types.Cargo.toml
  32. 28 0
      cli/src/templates/workspace/workspace.toml
  33. 3 0
      examples/component-position/Cargo.toml
  34. 3 0
      examples/component-velocity/Cargo.toml
  35. 3 0
      examples/system-apply-velocity/Cargo.toml
  36. 3 0
      examples/system-fly/Cargo.toml
  37. 3 0
      examples/system-simple-movement/Cargo.toml
  38. 65 157
      package-lock.json
  39. 0 1
      package.json
  40. 3 0
      programs/bolt-component/Cargo.toml
  41. 3 0
      programs/bolt-system/Cargo.toml
  42. 3 0
      programs/world/Cargo.toml
  43. 1 1
      tests/bolt.ts
  44. 208 230
      yarn.lock

+ 1 - 0
Cargo.toml

@@ -1,4 +1,5 @@
 [workspace]
+resolver = "2"
 members = [
     "cli",
     "programs/*",

+ 0 - 4
cli/Cargo.toml

@@ -13,10 +13,6 @@ edition = { workspace = true }
 name = "bolt"
 path = "src/bin/main.rs"
 
-[profile.release]
-opt-level = 3
-lto = true
-
 [features]
 dev = []
 

+ 13 - 0
cli/src/templates/component/lib.rs

@@ -0,0 +1,13 @@
+use bolt_lang::*;
+
+declare_id!("{program_id}");
+
+#[component]
+#[derive(Default)]
+pub struct {program_name} {{
+    pub x: i64,
+    pub y: i64,
+    pub z: i64,
+    #[max_len(20)]
+    pub description: String,
+}}

+ 3 - 18
cli/src/templates/component.rs → cli/src/templates/component/mod.rs

@@ -8,26 +8,11 @@ use crate::rust_template::convert_idl_type_to_str; // Import the trait
 
 /// Create a component which holds position data.
 pub fn create_component_template_simple(name: &str, program_path: &Path) -> Files {
+    let program_id = anchor_cli::rust_template::get_or_create_program_id(name);
+    let program_name = name.to_upper_camel_case();
     vec![(
         program_path.join("src").join("lib.rs"),
-        format!(
-            r#"use bolt_lang::*;
-
-declare_id!("{}");
-
-#[component]
-#[derive(Default)]
-pub struct {} {{
-    pub x: i64,
-    pub y: i64,
-    pub z: i64,
-    #[max_len(20)]
-    pub description: String,
-}}
-"#,
-            anchor_cli::rust_template::get_or_create_program_id(name),
-            name.to_upper_camel_case(),
-        ),
+        format!(include_str!("lib.rs"), program_id=program_id, program_name=program_name)
     )]
 }
 

+ 0 - 108
cli/src/templates/program.rs

@@ -1,108 +0,0 @@
-use anchor_cli::{rust_template::get_or_create_program_id, Files};
-use heck::ToSnakeCase;
-use std::path::Path; // Import the trait
-
-pub fn create_program_template_single(name: &str, program_path: &Path) -> Files {
-    vec![(
-        program_path.join("src").join("lib.rs"),
-        format!(
-            r#"use anchor_lang::prelude::*;
-
-declare_id!("{}");
-
-#[program]
-pub mod {} {{
-    use super::*;
-
-    pub fn initialize(ctx: Context<Initialize>) -> Result<()> {{
-        Ok(())
-    }}
-}}
-
-#[derive(Accounts)]
-pub struct Initialize {{}}
-"#,
-            get_or_create_program_id(name),
-            name.to_snake_case(),
-        ),
-    )]
-}
-
-/// Create a program with multiple files for instructions, state...
-pub fn create_program_template_multiple(name: &str, program_path: &Path) -> Files {
-    let src_path = program_path.join("src");
-    vec![
-        (
-            src_path.join("lib.rs"),
-            format!(
-                r#"pub mod constants;
-pub mod error;
-pub mod instructions;
-pub mod state;
-
-use anchor_lang::prelude::*;
-
-pub use constants::*;
-pub use instructions::*;
-pub use state::*;
-
-declare_id!("{}");
-
-#[program]
-pub mod {} {{
-    use super::*;
-
-    pub fn initialize(ctx: Context<Initialize>) -> Result<()> {{
-        initialize::handler(ctx)
-    }}
-}}
-"#,
-                get_or_create_program_id(name),
-                name.to_snake_case(),
-            ),
-        ),
-        (
-            src_path.join("constants.rs"),
-            r#"use anchor_lang::prelude::*;
-
-#[constant]
-pub const SEED: &str = "anchor";
-"#
-            .into(),
-        ),
-        (
-            src_path.join("error.rs"),
-            r#"use anchor_lang::prelude::*;
-
-#[error_code]
-pub enum ErrorCode {
-    #[msg("Custom error message")]
-    CustomError,
-}
-"#
-            .into(),
-        ),
-        (
-            src_path.join("instructions").join("mod.rs"),
-            r#"pub mod initialize;
-
-pub use initialize::*;
-"#
-            .into(),
-        ),
-        (
-            src_path.join("instructions").join("initialize.rs"),
-            r#"use anchor_lang::prelude::*;
-
-#[derive(Accounts)]
-pub struct Initialize {}
-
-pub fn handler(ctx: Context<Initialize>) -> Result<()> {
-    Ok(())
-}
-"#
-            .into(),
-        ),
-        (src_path.join("state").join("mod.rs"), r#""#.into()),
-    ]
-}

+ 4 - 0
cli/src/templates/program/constants.rs

@@ -0,0 +1,4 @@
+use anchor_lang::prelude::*;
+
+#[constant]
+pub const SEED: &str = "anchor";

+ 7 - 0
cli/src/templates/program/error.rs

@@ -0,0 +1,7 @@
+use anchor_lang::prelude::*;
+
+#[error_code]
+pub enum ErrorCode {
+    #[msg("Custom error message")]
+    CustomError,
+}

+ 8 - 0
cli/src/templates/program/instructions/initialize.rs

@@ -0,0 +1,8 @@
+use anchor_lang::prelude::*;
+
+#[derive(Accounts)]
+pub struct Initialize {}
+
+pub fn handler(_ctx: Context<Initialize>) -> Result<()> {
+    Ok(())
+}

+ 3 - 0
cli/src/templates/program/instructions/mod.rs

@@ -0,0 +1,3 @@
+pub mod initialize;
+
+pub use initialize::*;

+ 45 - 0
cli/src/templates/program/mod.rs

@@ -0,0 +1,45 @@
+use anchor_cli::Files;
+use heck::ToSnakeCase;
+use std::path::Path; // Import the trait
+
+pub fn create_program_template_single(name: &str, program_path: &Path) -> Files {
+    let program_id = anchor_cli::rust_template::get_or_create_program_id(name);
+    let program_name = name.to_snake_case();
+    vec![(
+        program_path.join("src").join("lib.rs"),
+        format!(include_str!("single.lib.rs"), program_id=program_id, program_name=program_name),
+    )]
+}
+
+/// Create a program with multiple files for instructions, state...
+pub fn create_program_template_multiple(name: &str, program_path: &Path) -> Files {
+    let src_path = program_path.join("src");
+    let program_id = anchor_cli::rust_template::get_or_create_program_id(name);
+    let program_name = name.to_snake_case();
+    vec![
+        (
+            src_path.join("lib.rs"),
+            format!(include_str!("multiple.lib.rs"), program_id=program_id, program_name=program_name),
+        ),
+        (
+            src_path.join("constants.rs"),
+            include_str!("constants.rs").into(),
+        ),
+        (
+            src_path.join("error.rs"),
+            include_str!("error.rs").into(),
+        ),
+        (
+            src_path.join("instructions").join("mod.rs"),
+            include_str!("instructions/mod.rs").into(),
+        ),
+        (
+            src_path.join("instructions").join("initialize.rs"),
+            include_str!("instructions/initialize.rs").into(),
+        ),
+        (
+            src_path.join("state").join("mod.rs"),
+            include_str!("state/mod.rs").into(),
+        ),
+    ]
+}

+ 21 - 0
cli/src/templates/program/multiple.lib.rs

@@ -0,0 +1,21 @@
+pub mod constants;
+pub mod error;
+pub mod instructions;
+pub mod state;
+
+use anchor_lang::prelude::*;
+
+pub use constants::*;
+pub use instructions::*;
+pub use state::*;
+
+declare_id!("{program_id}");
+
+#[program]
+pub mod {program_name} {{
+    use super::*;
+
+    pub fn initialize(ctx: Context<Initialize>) -> Result<()> {{
+        initialize::handler(ctx)
+    }}
+}}

+ 15 - 0
cli/src/templates/program/single.lib.rs

@@ -0,0 +1,15 @@
+use anchor_lang::prelude::*;
+
+declare_id!("{program_id}");
+
+#[program]
+pub mod {program_name} {{
+    use super::*;
+
+    pub fn initialize(_ctx: Context<Initialize>) -> Result<()> {{
+        Ok(())
+    }}
+}}
+
+#[derive(Accounts)]
+pub struct Initialize {{}}

+ 0 - 0
cli/src/templates/program/state/mod.rs


+ 0 - 36
cli/src/templates/system.rs

@@ -1,36 +0,0 @@
-use anchor_cli::Files;
-use heck::ToSnakeCase;
-use std::path::Path;
-
-/// Create a system which operates on a Position component.
-pub fn create_system_template_simple(name: &str, program_path: &Path) -> Files {
-    vec![(
-        program_path.join("src").join("lib.rs"),
-        format!(
-            r#"use bolt_lang::*;
-use position::Position;
-
-declare_id!("{}");
-
-#[system]
-pub mod {} {{
-
-    pub fn execute(ctx: Context<Components>, _args_p: Vec<u8>) -> Result<Components> {{
-        let position = &mut ctx.accounts.position;
-        position.x += 1;
-        position.y += 1;
-        Ok(ctx.accounts)
-    }}
-
-    #[system_input]
-    pub struct Components {{
-        pub position: Position,
-    }}
-
-}}
-"#,
-            anchor_cli::rust_template::get_or_create_program_id(name),
-            name.to_snake_case(),
-        ),
-    )]
-}

+ 21 - 0
cli/src/templates/system/lib.rs

@@ -0,0 +1,21 @@
+use bolt_lang::*;
+use position::Position;
+
+declare_id!("{program_id}");
+
+#[system]
+pub mod {program_name} {{
+
+    pub fn execute(ctx: Context<Components>, _args_p: Vec<u8>) -> Result<Components> {{
+        let position = &mut ctx.accounts.position;
+        position.x += 1;
+        position.y += 1;
+        Ok(ctx.accounts)
+    }}
+
+    #[system_input]
+    pub struct Components {{
+        pub position: Position,
+    }}
+
+}}

+ 13 - 0
cli/src/templates/system/mod.rs

@@ -0,0 +1,13 @@
+use anchor_cli::Files;
+use heck::ToSnakeCase;
+use std::path::Path;
+
+/// Create a system which operates on a Position component.
+pub fn create_system_template_simple(name: &str, program_path: &Path) -> Files {
+    let program_id = anchor_cli::rust_template::get_or_create_program_id(name);
+    let program_name = name.to_snake_case();
+    vec![(
+        program_path.join("src").join("lib.rs"),
+        format!(include_str!("lib.rs"), program_id=program_id, program_name=program_name)
+    )]
+}

+ 0 - 375
cli/src/templates/workspace.rs

@@ -1,375 +0,0 @@
-use crate::VERSION;
-use heck::{ToSnakeCase, ToUpperCamelCase};
-pub const ANCHOR_VERSION: &str = anchor_cli::VERSION;
-
-pub const fn workspace_manifest() -> &'static str {
-    r#"[workspace]
-members = [
-    "programs/*",
-    "programs-ecs/components/*",
-    "programs-ecs/systems/*"
-]
-resolver = "2"
-
-[profile.release]
-overflow-checks = true
-lto = "fat"
-codegen-units = 1
-[profile.release.build-override]
-opt-level = 3
-incremental = false
-codegen-units = 1
-"#
-}
-
-pub fn package_json(jest: bool) -> String {
-    if jest {
-        r#"{
-        "scripts": {
-            "lint:fix": "node_modules/.bin/prettier */*.js \"*/**/*{.js,.ts}\" -w",
-            "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-        },
-        "devDependencies": {
-            "jest": "^29.0.3",
-            "prettier": "^2.6.2",
-            "@magicblock-labs/bolt-sdk": "latest"
-        }
-    }
-    "#
-        .to_string()
-    } else {
-        r#"{
-    "scripts": {
-        "lint:fix": "node_modules/.bin/prettier */*.js \"*/**/*{.js,.ts}\" -w",
-        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-    },
-    "devDependencies": {
-        "chai": "^4.3.4",
-        "mocha": "^9.0.3",
-        "prettier": "^2.6.2",
-        "@metaplex-foundation/beet": "^0.7.1",
-        "@metaplex-foundation/beet-solana": "^0.4.0",
-        "@magicblock-labs/bolt-sdk": "latest"
-    }
-}
-"#
-        .to_string()
-    }
-}
-
-pub fn ts_package_json(jest: bool) -> String {
-    if jest {
-        r#"{
-        "scripts": {
-            "lint:fix": "node_modules/.bin/prettier */*.js \"*/**/*{.js,.ts}\" -w",
-            "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-        },
-        "devDependencies": {
-            "@types/bn.js": "^5.1.0",
-            "@types/jest": "^29.0.3",
-            "jest": "^29.0.3",
-            "prettier": "^2.6.2",
-            "ts-jest": "^29.0.2",
-            "typescript": "^4.3.5",
-            "@metaplex-foundation/beet": "^0.7.1",
-            "@metaplex-foundation/beet-solana": "^0.4.0",
-            "@magicblock-labs/bolt-sdk": "latest"
-        }
-    }
-    "#
-        .to_string()
-    } else {
-        r#"{
-    "scripts": {
-        "lint:fix": "node_modules/.bin/prettier */*.js \"*/**/*{.js,.ts}\" -w",
-        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-    },
-    "devDependencies": {
-        "chai": "^4.3.4",
-        "mocha": "^9.0.3",
-        "ts-mocha": "^10.0.0",
-        "@types/bn.js": "^5.1.0",
-        "@types/chai": "^4.3.0",
-        "@types/mocha": "^9.0.0",
-        "typescript": "^4.3.5",
-        "prettier": "^2.6.2",
-        "@metaplex-foundation/beet": "^0.7.1",
-        "@metaplex-foundation/beet-solana": "^0.4.0",
-        "@magicblock-labs/bolt-sdk": "latest"
-    }
-}
-"#
-        .to_string()
-    }
-}
-
-pub fn mocha(name: &str) -> String {
-    format!(
-        r#"const boltSdk = require("@magicblock-labs/bolt-sdk");
-const {{
-    InitializeNewWorld,
-    anchor,
-}} = boltSdk;
-
-describe("{}", () => {{
-  // Configure the client to use the local cluster.
-  const provider = anchor.AnchorProvider.env();
-  anchor.setProvider(provider);
-
-  it("InitializeNewWorld", async () => {{
-    const initNewWorld = await InitializeNewWorld({{
-      payer: provider.wallet.publicKey,
-      connection: provider.connection,
-    }});
-    const txSign = await provider.sendAndConfirm(initNewWorld.transaction);
-    console.log(`Initialized a new world (ID=${{initNewWorld.worldPda}}). Initialization signature: ${{txSign}}`);
-    }});
-  }});
-}});
-"#,
-        name,
-    )
-}
-
-pub fn jest(name: &str) -> String {
-    format!(
-        r#"const boltSdk = require("@magicblock-labs/bolt-sdk");
-const {{
-    InitializeNewWorld,
-    anchor,
-}} = boltSdk;
-
-describe("{}", () => {{
-  // Configure the client to use the local cluster.
-  const provider = anchor.AnchorProvider.env();
-  anchor.setProvider(provider);
-
-  // Constants used to test the program.
-  let worldPda: PublicKey;
-
-  it("InitializeNewWorld", async () => {{
-    const initNewWorld = await InitializeNewWorld({{
-      payer: provider.wallet.publicKey,
-      connection: provider.connection,
-    }});
-    const txSign = await provider.sendAndConfirm(initNewWorld.transaction);
-    worldPda = initNewWorld.worldPda;
-    console.log(`Initialized a new world (ID=${{worldPda}}). Initialization signature: ${{txSign}}`);
-    }});
-  }});
-"#,
-        name,
-    )
-}
-
-pub fn ts_mocha(name: &str) -> String {
-    format!(
-        r#"import {{ PublicKey }} from "@solana/web3.js";
-import {{ Position }} from "../target/types/position";
-import {{ Movement }} from "../target/types/movement";
-import {{
-    InitializeNewWorld,
-    AddEntity,
-    InitializeComponent,
-    ApplySystem,
-    anchor,
-    Program
-}} from "@magicblock-labs/bolt-sdk"
-import {{expect}} from "chai";
-
-describe("{}", () => {{
-  // Configure the client to use the local cluster.
-  const provider = anchor.AnchorProvider.env();
-  anchor.setProvider(provider);
-
-  // Constants used to test the program.
-  let worldPda: PublicKey;
-  let entityPda: PublicKey;
-  let componentPda: PublicKey;
-
-  const positionComponent = anchor.workspace.Position as Program<Position>;
-  const systemMovement = anchor.workspace.Movement as Program<Movement>;
-
-  it("InitializeNewWorld", async () => {{
-    const initNewWorld = await InitializeNewWorld({{
-      payer: provider.wallet.publicKey,
-      connection: provider.connection,
-    }});
-    const txSign = await provider.sendAndConfirm(initNewWorld.transaction);
-    worldPda = initNewWorld.worldPda;
-    console.log(`Initialized a new world (ID=${{worldPda}}). Initialization signature: ${{txSign}}`);
-  }});
-
-  it("Add an entity", async () => {{
-    const addEntity = await AddEntity({{
-      payer: provider.wallet.publicKey,
-      world: worldPda,
-      connection: provider.connection,
-    }});
-    const txSign = await provider.sendAndConfirm(addEntity.transaction);
-    entityPda = addEntity.entityPda;
-    console.log(`Initialized a new Entity (ID=${{addEntity.entityId}}). Initialization signature: ${{txSign}}`);
-  }});
-
-  it("Add a component", async () => {{
-    const initializeComponent = await InitializeComponent({{
-      payer: provider.wallet.publicKey,
-      entity: entityPda,
-      componentId: positionComponent.programId,
-    }});
-    const txSign = await provider.sendAndConfirm(initializeComponent.transaction);
-    componentPda = initializeComponent.componentPda;
-    console.log(`Initialized the grid component. Initialization signature: ${{txSign}}`);
-  }});
-
-  it("Apply a system", async () => {{
-    // Check that the component has been initialized and x is 0
-    const positionBefore = await positionComponent.account.position.fetch(
-      componentPda
-    );
-    expect(positionBefore.x.toNumber()).to.equal(0);
-
-    // Run the movement system
-    const applySystem = await ApplySystem({{
-      authority: provider.wallet.publicKey,
-      systemId: systemMovement.programId,
-      world: worldPda,
-      entities: [{{
-        entity: entityPda,
-        components: [{{ componentId: positionComponent.programId }}],
-      }}]
-    }});
-    const txSign = await provider.sendAndConfirm(applySystem.transaction);
-    console.log(`Applied a system. Signature: ${{txSign}}`);
-
-    // Check that the system has been applied and x is > 0
-    const positionAfter = await positionComponent.account.position.fetch(
-      componentPda
-    );
-    expect(positionAfter.x.toNumber()).to.gt(0);
-  }});
-
-}});
-"#,
-        name.to_upper_camel_case(),
-    )
-}
-
-pub fn cargo_toml(name: &str) -> String {
-    format!(
-        r#"[package]
-name = "{0}"
-version = "{2}"
-description = "Created with Bolt"
-edition = "2021"
-
-[lib]
-crate-type = ["cdylib", "lib"]
-name = "{1}"
-
-[features]
-no-entrypoint = []
-no-idl = []
-no-log-ix-name = []
-cpi = ["no-entrypoint"]
-default = []
-idl-build = ["anchor-lang/idl-build"]
-
-[dependencies]
-bolt-lang = "{2}"
-anchor-lang = "{3}"
-"#,
-        name,
-        name.to_snake_case(),
-        VERSION,
-        ANCHOR_VERSION
-    )
-}
-
-/// TODO: Remove serde dependency
-pub fn cargo_toml_with_serde(name: &str) -> String {
-    format!(
-        r#"[package]
-name = "{0}"
-version = "{2}"
-description = "Created with Bolt"
-edition = "2021"
-
-[lib]
-crate-type = ["cdylib", "lib"]
-name = "{1}"
-
-[features]
-no-entrypoint = []
-no-idl = []
-no-log-ix-name = []
-cpi = ["no-entrypoint"]
-default = []
-idl-build = ["anchor-lang/idl-build"]
-
-[dependencies]
-bolt-lang = "{2}"
-anchor-lang = "{3}"
-serde = {{ version = "1.0", features = ["derive"] }}
-"#,
-        name,
-        name.to_snake_case(),
-        VERSION,
-        ANCHOR_VERSION
-    )
-}
-
-pub fn xargo_toml() -> &'static str {
-    r#"[target.bpfel-unknown-unknown.dependencies.std]
-features = []
-"#
-}
-pub fn git_ignore() -> &'static str {
-    r#"
-.anchor
-.bolt
-.DS_Store
-target
-**/*.rs.bk
-node_modules
-test-ledger
-.yarn
-"#
-}
-
-pub fn prettier_ignore() -> &'static str {
-    r#"
-.anchor
-.bolt
-.DS_Store
-target
-node_modules
-dist
-build
-test-ledger
-"#
-}
-
-pub(crate) fn types_cargo_toml() -> String {
-    let name = "bolt-types";
-    format!(
-        r#"[package]
-name = "{0}"
-version = "{2}"
-description = "Autogenerate types for the bolt language"
-edition = "2021"
-
-[lib]
-crate-type = ["cdylib", "lib"]
-name = "{1}"
-
-[dependencies]
-bolt-lang = "{2}"
-anchor-lang = "{3}"
-"#,
-        name,
-        name.to_snake_case(),
-        VERSION,
-        ANCHOR_VERSION
-    )
-}

+ 26 - 0
cli/src/templates/workspace/Cargo.serde.toml

@@ -0,0 +1,26 @@
+[package]
+name = "{name}"
+version = "{VERSION}"
+description = "Created with Bolt"
+edition = "2021"
+
+[lib]
+crate-type = ["cdylib", "lib"]
+name = "{snake_case_name}"
+
+[features]
+no-entrypoint = []
+no-idl = []
+no-log-ix-name = []
+cpi = ["no-entrypoint"]
+default = []
+idl-build = ["anchor-lang/idl-build"]
+anchor-debug = ["anchor-lang/anchor-debug"]
+custom-heap = []
+custom-panic = []
+
+
+[dependencies]
+bolt-lang.workspace = true
+anchor-lang.workspace = true
+serde = {{ version = "1.0", features = ["derive"] }}

+ 24 - 0
cli/src/templates/workspace/Cargo.toml

@@ -0,0 +1,24 @@
+[package]
+name = "{name}"
+version = "{VERSION}"
+description = "Created with Bolt"
+edition = "2021"
+
+[lib]
+crate-type = ["cdylib", "lib"]
+name = "{snake_case_name}"
+
+[features]
+no-entrypoint = []
+no-idl = []
+no-log-ix-name = []
+cpi = ["no-entrypoint"]
+default = []
+idl-build = ["anchor-lang/idl-build"]
+anchor-debug = ["anchor-lang/anchor-debug"]
+custom-heap = []
+custom-panic = []
+
+[dependencies]
+bolt-lang.workspace = true
+anchor-lang.workspace = true

+ 2 - 0
cli/src/templates/workspace/Xargo.toml

@@ -0,0 +1,2 @@
+[target.bpfel-unknown-unknown.dependencies.std]
+features = []

+ 8 - 0
cli/src/templates/workspace/gitignore

@@ -0,0 +1,8 @@
+.anchor
+.bolt
+.DS_Store
+target
+**/*.rs.bk
+node_modules
+test-ledger
+.yarn

+ 24 - 0
cli/src/templates/workspace/jest.js

@@ -0,0 +1,24 @@
+const boltSdk = require("@magicblock-labs/bolt-sdk");
+const {{
+    InitializeNewWorld,
+}} = boltSdk;
+const anchor = require("@coral-xyz/anchor");
+
+describe("{}", () => {{
+  // Configure the client to use the local cluster.
+  const provider = anchor.AnchorProvider.env();
+  anchor.setProvider(provider);
+
+  // Constants used to test the program.
+  let worldPda: PublicKey;
+
+  it("InitializeNewWorld", async () => {{
+    const initNewWorld = await InitializeNewWorld({{
+      payer: provider.wallet.publicKey,
+      connection: provider.connection,
+    }});
+    const txSign = await provider.sendAndConfirm(initNewWorld.transaction);
+    worldPda = initNewWorld.worldPda;
+    console.log(`Initialized a new world (ID=${{worldPda}}). Initialization signature: ${{txSign}}`);
+    }});
+  }});

+ 11 - 0
cli/src/templates/workspace/jest.package.json

@@ -0,0 +1,11 @@
+{
+    "scripts": {
+        "lint:fix": "node_modules/.bin/prettier */*.js \"*/**/*{.js,.ts}\" -w",
+        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
+    },
+    "devDependencies": {
+        "jest": "^29.0.3",
+        "prettier": "^2.6.2",
+        "@magicblock-labs/bolt-sdk": "latest"
+    }
+}

+ 17 - 0
cli/src/templates/workspace/jest.ts.package.json

@@ -0,0 +1,17 @@
+{
+    "scripts": {
+        "lint:fix": "node_modules/.bin/prettier */*.js \"*/**/*{.js,.ts}\" -w",
+        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
+    },
+    "devDependencies": {
+        "@types/bn.js": "^5.1.0",
+        "@types/jest": "^29.0.3",
+        "jest": "^29.0.3",
+        "prettier": "^2.6.2",
+        "ts-jest": "^29.0.2",
+        "typescript": "^4.3.5",
+        "@metaplex-foundation/beet": "^0.7.1",
+        "@metaplex-foundation/beet-solana": "^0.4.0",
+        "@magicblock-labs/bolt-sdk": "latest"
+    }
+}

+ 21 - 0
cli/src/templates/workspace/mocha.js

@@ -0,0 +1,21 @@
+const boltSdk = require("@magicblock-labs/bolt-sdk");
+const {{
+    InitializeNewWorld,
+}} = boltSdk;
+const anchor = require("@coral-xyz/anchor");
+
+describe("{}", () => {{
+  // Configure the client to use the local cluster.
+  const provider = anchor.AnchorProvider.env();
+  anchor.setProvider(provider);
+
+  it("InitializeNewWorld", async () => {{
+    const initNewWorld = await InitializeNewWorld({{
+      payer: provider.wallet.publicKey,
+      connection: provider.connection,
+    }});
+    const txSign = await provider.sendAndConfirm(initNewWorld.transaction);
+    console.log(`Initialized a new world (ID=${{initNewWorld.worldPda}}). Initialization signature: ${{txSign}}`);
+    }});
+  }});
+}});

+ 86 - 0
cli/src/templates/workspace/mocha.ts

@@ -0,0 +1,86 @@
+import {{ PublicKey }} from "@solana/web3.js";
+import {{ Position }} from "../target/types/position";
+import {{ Movement }} from "../target/types/movement";
+import {{
+    InitializeNewWorld,
+    AddEntity,
+    InitializeComponent,
+    ApplySystem,
+    Program
+}} from "@magicblock-labs/bolt-sdk"
+import {{expect}} from "chai";
+import * as anchor from "@coral-xyz/anchor";
+
+describe("{}", () => {{
+  // Configure the client to use the local cluster.
+  const provider = anchor.AnchorProvider.env();
+  anchor.setProvider(provider);
+
+  // Constants used to test the program.
+  let worldPda: PublicKey;
+  let entityPda: PublicKey;
+  let componentPda: PublicKey;
+
+  const positionComponent = anchor.workspace.Position as Program<Position>;
+  const systemMovement = anchor.workspace.Movement as Program<Movement>;
+
+  it("InitializeNewWorld", async () => {{
+    const initNewWorld = await InitializeNewWorld({{
+      payer: provider.wallet.publicKey,
+      connection: provider.connection,
+    }});
+    const txSign = await provider.sendAndConfirm(initNewWorld.transaction);
+    worldPda = initNewWorld.worldPda;
+    console.log(`Initialized a new world (ID=${{worldPda}}). Initialization signature: ${{txSign}}`);
+  }});
+
+  it("Add an entity", async () => {{
+    const addEntity = await AddEntity({{
+      payer: provider.wallet.publicKey,
+      world: worldPda,
+      connection: provider.connection,
+    }});
+    const txSign = await provider.sendAndConfirm(addEntity.transaction);
+    entityPda = addEntity.entityPda;
+    console.log(`Initialized a new Entity (ID=${{addEntity.entityId}}). Initialization signature: ${{txSign}}`);
+  }});
+
+  it("Add a component", async () => {{
+    const initializeComponent = await InitializeComponent({{
+      payer: provider.wallet.publicKey,
+      entity: entityPda,
+      componentId: positionComponent.programId,
+    }});
+    const txSign = await provider.sendAndConfirm(initializeComponent.transaction);
+    componentPda = initializeComponent.componentPda;
+    console.log(`Initialized the grid component. Initialization signature: ${{txSign}}`);
+  }});
+
+  it("Apply a system", async () => {{
+    // Check that the component has been initialized and x is 0
+    const positionBefore = await positionComponent.account.position.fetch(
+      componentPda
+    );
+    expect(positionBefore.x.toNumber()).to.equal(0);
+
+    // Run the movement system
+    const applySystem = await ApplySystem({{
+      authority: provider.wallet.publicKey,
+      systemId: systemMovement.programId,
+      world: worldPda,
+      entities: [{{
+        entity: entityPda,
+        components: [{{ componentId: positionComponent.programId }}],
+      }}]
+    }});
+    const txSign = await provider.sendAndConfirm(applySystem.transaction);
+    console.log(`Applied a system. Signature: ${{txSign}}`);
+
+    // Check that the system has been applied and x is > 0
+    const positionAfter = await positionComponent.account.position.fetch(
+      componentPda
+    );
+    expect(positionAfter.x.toNumber()).to.gt(0);
+  }});
+
+}});

+ 63 - 0
cli/src/templates/workspace/mod.rs

@@ -0,0 +1,63 @@
+use crate::VERSION;
+use heck::ToSnakeCase;
+pub const ANCHOR_VERSION: &str = anchor_cli::VERSION;
+
+pub fn workspace_manifest() -> String {
+    format!(include_str!("workspace.toml"), VERSION=VERSION, ANCHOR_VERSION=ANCHOR_VERSION)
+}
+
+pub fn package_json(jest: bool) -> String {
+    if jest {
+        include_str!("jest.package.json").to_string()
+    } else {
+        include_str!("package.json").to_string()
+    }
+}
+
+pub fn ts_package_json(jest: bool) -> String {
+    if jest {
+        include_str!("jest.ts.package.json").to_string()
+    } else {
+        include_str!("ts.package.json").to_string()
+    }
+}
+
+pub fn mocha(name: &str) -> String {
+    format!(include_str!("mocha.js"), name)
+}
+
+pub fn jest(name: &str) -> String {
+    format!(include_str!("jest.js"), name)
+}
+
+pub fn ts_mocha(name: &str) -> String {
+    format!(include_str!("mocha.ts"), name)
+}
+
+pub fn cargo_toml(name: &str) -> String {
+    let snake_case_name = name.to_snake_case();
+    format!(include_str!("Cargo.toml"), name=name, snake_case_name=snake_case_name, VERSION=VERSION)
+}
+
+/// TODO: Remove serde dependency
+pub fn cargo_toml_with_serde(name: &str) -> String {
+    let snake_case_name = name.to_snake_case();
+    format!(include_str!("Cargo.serde.toml"), name=name, snake_case_name=snake_case_name, VERSION=VERSION)
+}
+
+pub fn xargo_toml() -> &'static str {
+    include_str!("Xargo.toml")
+}
+pub fn git_ignore() -> &'static str {
+    include_str!("gitignore")
+}
+
+pub fn prettier_ignore() -> &'static str {
+    include_str!("prettierignore")
+}
+
+pub(crate) fn types_cargo_toml() -> String {
+    let name = "bolt-types";
+    let snake_case_name = name.to_snake_case();
+    format!(include_str!("types.Cargo.toml"), name=name, snake_case_name=snake_case_name, VERSION=VERSION)
+}

+ 14 - 0
cli/src/templates/workspace/package.json

@@ -0,0 +1,14 @@
+{
+    "scripts": {
+        "lint:fix": "node_modules/.bin/prettier */*.js \"*/**/*{.js,.ts}\" -w",
+        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
+    },
+    "devDependencies": {
+        "chai": "^4.3.4",
+        "mocha": "^9.0.3",
+        "prettier": "^2.6.2",
+        "@metaplex-foundation/beet": "^0.7.1",
+        "@metaplex-foundation/beet-solana": "^0.4.0",
+        "@magicblock-labs/bolt-sdk": "latest"
+    }
+}

+ 8 - 0
cli/src/templates/workspace/prettierignore

@@ -0,0 +1,8 @@
+.anchor
+.bolt
+.DS_Store
+target
+node_modules
+dist
+build
+test-ledger

+ 19 - 0
cli/src/templates/workspace/ts.package.json

@@ -0,0 +1,19 @@
+{
+    "scripts": {
+        "lint:fix": "node_modules/.bin/prettier */*.js \"*/**/*{.js,.ts}\" -w",
+        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
+    },
+    "devDependencies": {
+        "chai": "^4.3.4",
+        "mocha": "^9.0.3",
+        "ts-mocha": "^10.0.0",
+        "@types/bn.js": "^5.1.0",
+        "@types/chai": "^4.3.0",
+        "@types/mocha": "^9.0.0",
+        "typescript": "^4.3.5",
+        "prettier": "^2.6.2",
+        "@metaplex-foundation/beet": "^0.7.1",
+        "@metaplex-foundation/beet-solana": "^0.4.0",
+        "@magicblock-labs/bolt-sdk": "latest"
+    }
+}

+ 13 - 0
cli/src/templates/workspace/types.Cargo.toml

@@ -0,0 +1,13 @@
+[package]
+name = "{name}"
+version = "{VERSION}"
+description = "Autogenerate types for the bolt language"
+edition = "2021"
+
+[lib]
+crate-type = ["cdylib", "lib"]
+name = "{snake_case_name}"
+
+[dependencies]
+bolt-lang.workspace = true
+anchor-lang.workspace = true

+ 28 - 0
cli/src/templates/workspace/workspace.toml

@@ -0,0 +1,28 @@
+[workspace]
+members = [
+    "programs/*",
+    "programs-ecs/components/*",
+    "programs-ecs/systems/*"
+]
+resolver = "2"
+
+[workspace.dependencies]
+bolt-lang = "{VERSION}"
+anchor-lang = "{ANCHOR_VERSION}"
+
+[profile.release]
+overflow-checks = true
+lto = "fat"
+codegen-units = 1
+
+[profile.release.build-override]
+opt-level = 3
+incremental = false
+codegen-units = 1
+
+[patch.crates-io]
+# Uncomment this to use the latest in-development version of Bolt
+# bolt-lang = {{ git = "https://github.com/magicblock-labs/bolt.git", branch = "main" }}
+
+# Uncomment this to use a local version of Bolt for development (bolt must be cloned above the current directory)
+# bolt-lang = {{ path = "../bolt/crates/bolt-lang"}}

+ 3 - 0
examples/component-position/Cargo.toml

@@ -19,6 +19,9 @@ no-log-ix-name = []
 cpi = ["no-entrypoint"]
 default = []
 idl-build = ["anchor-lang/idl-build"]
+anchor-debug = ["anchor-lang/anchor-debug"]
+custom-heap = []
+custom-panic = []
 
 [dependencies]
 anchor-lang = { workspace = true }

+ 3 - 0
examples/component-velocity/Cargo.toml

@@ -19,6 +19,9 @@ no-log-ix-name = []
 cpi = ["no-entrypoint"]
 default = []
 idl-build = ["anchor-lang/idl-build"]
+anchor-debug = ["anchor-lang/anchor-debug"]
+custom-heap = []
+custom-panic = []
 
 [dependencies]
 anchor-lang = { workspace = true }

+ 3 - 0
examples/system-apply-velocity/Cargo.toml

@@ -19,6 +19,9 @@ no-log-ix-name = []
 cpi = ["no-entrypoint"]
 default = []
 idl-build = ["anchor-lang/idl-build"]
+anchor-debug = ["anchor-lang/anchor-debug"]
+custom-heap = []
+custom-panic = []
 
 [dependencies]
 anchor-lang = { workspace = true }

+ 3 - 0
examples/system-fly/Cargo.toml

@@ -19,6 +19,9 @@ no-log-ix-name = []
 cpi = ["no-entrypoint"]
 default = []
 idl-build = ["anchor-lang/idl-build"]
+anchor-debug = ["anchor-lang/anchor-debug"]
+custom-heap = []
+custom-panic = []
 
 [dependencies]
 anchor-lang = { workspace = true }

+ 3 - 0
examples/system-simple-movement/Cargo.toml

@@ -19,6 +19,9 @@ no-log-ix-name = []
 cpi = ["no-entrypoint"]
 default = []
 idl-build = ["anchor-lang/idl-build"]
+anchor-debug = ["anchor-lang/anchor-debug"]
+custom-heap = []
+custom-panic = []
 
 [dependencies]
 anchor-lang = { workspace = true }

+ 65 - 157
package-lock.json

@@ -4,11 +4,7 @@
     "requires": true,
     "packages": {
         "": {
-            "name": "bolt",
             "license": "MIT",
-            "dependencies": {
-                "@coral-xyz/anchor": "0.30.1"
-            },
             "devDependencies": {
                 "@metaplex-foundation/beet": "^0.7.1",
                 "@metaplex-foundation/beet-solana": "^0.4.0",
@@ -26,6 +22,7 @@
             "version": "7.25.7",
             "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.7.tgz",
             "integrity": "sha512-FjoyLe754PMiYsFaN5C94ttGiOmBNYTf6pLr4xXHAT5uctHb092PBszndLDR5XA/jghQvn4n7JMHl7dmTgbm9w==",
+            "dev": true,
             "dependencies": {
                 "regenerator-runtime": "^0.14.0"
             },
@@ -33,63 +30,6 @@
                 "node": ">=6.9.0"
             }
         },
-        "node_modules/@coral-xyz/anchor": {
-            "version": "0.30.1",
-            "resolved": "https://registry.npmjs.org/@coral-xyz/anchor/-/anchor-0.30.1.tgz",
-            "integrity": "sha512-gDXFoF5oHgpriXAaLpxyWBHdCs8Awgf/gLHIo6crv7Aqm937CNdY+x+6hoj7QR5vaJV7MxWSQ0NGFzL3kPbWEQ==",
-            "license": "(MIT OR Apache-2.0)",
-            "dependencies": {
-                "@coral-xyz/anchor-errors": "^0.30.1",
-                "@coral-xyz/borsh": "^0.30.1",
-                "@noble/hashes": "^1.3.1",
-                "@solana/web3.js": "^1.68.0",
-                "bn.js": "^5.1.2",
-                "bs58": "^4.0.1",
-                "buffer-layout": "^1.2.2",
-                "camelcase": "^6.3.0",
-                "cross-fetch": "^3.1.5",
-                "crypto-hash": "^1.3.0",
-                "eventemitter3": "^4.0.7",
-                "pako": "^2.0.3",
-                "snake-case": "^3.0.4",
-                "superstruct": "^0.15.4",
-                "toml": "^3.0.0"
-            },
-            "engines": {
-                "node": ">=11"
-            }
-        },
-        "node_modules/@coral-xyz/anchor-errors": {
-            "version": "0.30.1",
-            "resolved": "https://registry.npmjs.org/@coral-xyz/anchor-errors/-/anchor-errors-0.30.1.tgz",
-            "integrity": "sha512-9Mkradf5yS5xiLWrl9WrpjqOrAV+/W2RQHDlbnAZBivoGpOs1ECjoDCkVk4aRG8ZdiFiB8zQEVlxf+8fKkmSfQ==",
-            "license": "Apache-2.0",
-            "engines": {
-                "node": ">=10"
-            }
-        },
-        "node_modules/@coral-xyz/anchor/node_modules/superstruct": {
-            "version": "0.15.5",
-            "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.15.5.tgz",
-            "integrity": "sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ==",
-            "license": "MIT"
-        },
-        "node_modules/@coral-xyz/borsh": {
-            "version": "0.30.1",
-            "resolved": "https://registry.npmjs.org/@coral-xyz/borsh/-/borsh-0.30.1.tgz",
-            "integrity": "sha512-aaxswpPrCFKl8vZTbxLssA2RvwX2zmKLlRCIktJOwW+VpVwYtXRtlWiIP+c2pPRKneiTiWCN2GEMSH9j1zTlWQ==",
-            "license": "Apache-2.0",
-            "dependencies": {
-                "bn.js": "^5.1.2",
-                "buffer-layout": "^1.2.0"
-            },
-            "engines": {
-                "node": ">=10"
-            },
-            "peerDependencies": {
-                "@solana/web3.js": "^1.68.0"
-            }
-        },
         "node_modules/@metaplex-foundation/beet": {
             "version": "0.7.2",
             "resolved": "https://registry.npmjs.org/@metaplex-foundation/beet/-/beet-0.7.2.tgz",
@@ -137,6 +77,7 @@
             "version": "1.6.0",
             "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.6.0.tgz",
             "integrity": "sha512-TlaHRXDehJuRNR9TfZDNQ45mMEd5dwUwmicsafcIX4SsNiqnCHKjE/1alYPd/lDRVhxdhUAlv8uEhMCI5zjIJQ==",
+            "dev": true,
             "dependencies": {
                 "@noble/hashes": "1.5.0"
             },
@@ -151,6 +92,7 @@
             "version": "1.5.0",
             "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.5.0.tgz",
             "integrity": "sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==",
+            "dev": true,
             "engines": {
                 "node": "^14.21.3 || >=16"
             },
@@ -162,6 +104,7 @@
             "version": "4.0.1",
             "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz",
             "integrity": "sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==",
+            "dev": true,
             "license": "MIT",
             "dependencies": {
                 "buffer": "~6.0.3"
@@ -174,6 +117,7 @@
             "version": "1.95.3",
             "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.95.3.tgz",
             "integrity": "sha512-O6rPUN0w2fkNqx/Z3QJMB9L225Ex10PRDH8bTaIUPZXMPV0QP8ZpPvjQnXK+upUczlRgzHzd6SjKIha1p+I6og==",
+            "dev": true,
             "dependencies": {
                 "@babel/runtime": "^7.25.0",
                 "@noble/curves": "^1.4.2",
@@ -196,6 +140,7 @@
             "version": "0.5.13",
             "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.13.tgz",
             "integrity": "sha512-UoKGxQ3r5kYI9dALKJapMmuK+1zWM/H17Z1+iwnNmzcJRnfFuevZs375TA5rW31pu4BS4NoSy1fRsexDXfWn5w==",
+            "dev": true,
             "dependencies": {
                 "tslib": "^2.4.0"
             }
@@ -221,6 +166,7 @@
             "version": "3.4.38",
             "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz",
             "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==",
+            "dev": true,
             "dependencies": {
                 "@types/node": "*"
             }
@@ -244,6 +190,7 @@
             "version": "20.8.8",
             "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.8.tgz",
             "integrity": "sha512-YRsdVxq6OaLfmR9Hy816IMp33xOBjfyOgUd77ehqg96CFywxAPbDbXvAsuN2KVg2HOT8Eh6uAfU+l4WffwPVrQ==",
+            "dev": true,
             "license": "MIT",
             "dependencies": {
                 "undici-types": "~5.25.1"
@@ -252,12 +199,14 @@
         "node_modules/@types/uuid": {
             "version": "8.3.4",
             "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz",
-            "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw=="
+            "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==",
+            "dev": true
         },
         "node_modules/@types/ws": {
             "version": "7.4.7",
             "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz",
             "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==",
+            "dev": true,
             "dependencies": {
                 "@types/node": "*"
             }
@@ -273,6 +222,7 @@
             "version": "4.5.0",
             "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz",
             "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==",
+            "dev": true,
             "license": "MIT",
             "dependencies": {
                 "humanize-ms": "^1.2.1"
@@ -403,6 +353,7 @@
             "version": "3.0.9",
             "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz",
             "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==",
+            "dev": true,
             "license": "MIT",
             "dependencies": {
                 "safe-buffer": "^5.0.1"
@@ -412,6 +363,7 @@
             "version": "1.5.1",
             "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
             "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
+            "dev": true,
             "funding": [
                 {
                     "type": "github",
@@ -432,6 +384,7 @@
             "version": "1.1.5",
             "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz",
             "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==",
+            "dev": true,
             "hasInstallScript": true,
             "license": "Apache-2.0",
             "dependencies": {
@@ -455,6 +408,7 @@
             "version": "1.5.0",
             "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
             "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
+            "dev": true,
             "license": "MIT",
             "dependencies": {
                 "file-uri-to-path": "1.0.0"
@@ -464,12 +418,14 @@
             "version": "5.2.1",
             "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz",
             "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==",
+            "dev": true,
             "license": "MIT"
         },
         "node_modules/borsh": {
             "version": "0.7.0",
             "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz",
             "integrity": "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==",
+            "dev": true,
             "license": "Apache-2.0",
             "dependencies": {
                 "bn.js": "^5.2.0",
@@ -511,6 +467,7 @@
             "version": "4.0.1",
             "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz",
             "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==",
+            "dev": true,
             "license": "MIT",
             "dependencies": {
                 "base-x": "^3.0.2"
@@ -520,6 +477,7 @@
             "version": "6.0.3",
             "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
             "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
+            "dev": true,
             "funding": [
                 {
                     "type": "github",
@@ -547,19 +505,11 @@
             "dev": true,
             "license": "MIT"
         },
-        "node_modules/buffer-layout": {
-            "version": "1.2.2",
-            "resolved": "https://registry.npmjs.org/buffer-layout/-/buffer-layout-1.2.2.tgz",
-            "integrity": "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==",
-            "license": "MIT",
-            "engines": {
-                "node": ">=4.5"
-            }
-        },
         "node_modules/bufferutil": {
             "version": "4.0.8",
             "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.8.tgz",
             "integrity": "sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==",
+            "dev": true,
             "hasInstallScript": true,
             "optional": true,
             "dependencies": {
@@ -588,6 +538,7 @@
             "version": "6.3.0",
             "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
             "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
+            "dev": true,
             "license": "MIT",
             "engines": {
                 "node": ">=10"
@@ -721,7 +672,8 @@
         "node_modules/commander": {
             "version": "2.20.3",
             "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
-            "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
+            "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
+            "dev": true
         },
         "node_modules/concat-map": {
             "version": "0.0.1",
@@ -730,27 +682,6 @@
             "dev": true,
             "license": "MIT"
         },
-        "node_modules/cross-fetch": {
-            "version": "3.1.8",
-            "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz",
-            "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==",
-            "license": "MIT",
-            "dependencies": {
-                "node-fetch": "^2.6.12"
-            }
-        },
-        "node_modules/crypto-hash": {
-            "version": "1.3.0",
-            "resolved": "https://registry.npmjs.org/crypto-hash/-/crypto-hash-1.3.0.tgz",
-            "integrity": "sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg==",
-            "license": "MIT",
-            "engines": {
-                "node": ">=8"
-            },
-            "funding": {
-                "url": "https://github.com/sponsors/sindresorhus"
-            }
-        },
         "node_modules/debug": {
             "version": "4.3.4",
             "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
@@ -832,6 +763,7 @@
             "version": "5.0.0",
             "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz",
             "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==",
+            "dev": true,
             "engines": {
                 "node": ">=10"
             },
@@ -849,16 +781,6 @@
                 "node": ">=0.3.1"
             }
         },
-        "node_modules/dot-case": {
-            "version": "3.0.4",
-            "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz",
-            "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==",
-            "license": "MIT",
-            "dependencies": {
-                "no-case": "^3.0.4",
-                "tslib": "^2.0.3"
-            }
-        },
         "node_modules/emoji-regex": {
             "version": "8.0.0",
             "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
@@ -869,12 +791,14 @@
         "node_modules/es6-promise": {
             "version": "4.2.8",
             "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
-            "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w=="
+            "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==",
+            "dev": true
         },
         "node_modules/es6-promisify": {
             "version": "5.0.0",
             "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz",
             "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==",
+            "dev": true,
             "dependencies": {
                 "es6-promise": "^4.0.3"
             }
@@ -902,16 +826,11 @@
                 "url": "https://github.com/sponsors/sindresorhus"
             }
         },
-        "node_modules/eventemitter3": {
-            "version": "4.0.7",
-            "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
-            "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
-            "license": "MIT"
-        },
         "node_modules/eyes": {
             "version": "0.1.8",
             "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz",
             "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==",
+            "dev": true,
             "engines": {
                 "node": "> 0.1.90"
             }
@@ -920,12 +839,14 @@
             "version": "1.0.0",
             "resolved": "https://registry.npmjs.org/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz",
             "integrity": "sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==",
+            "dev": true,
             "license": "MIT"
         },
         "node_modules/file-uri-to-path": {
             "version": "1.0.0",
             "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
             "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
+            "dev": true,
             "license": "MIT"
         },
         "node_modules/fill-range": {
@@ -1206,6 +1127,7 @@
             "version": "1.2.1",
             "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz",
             "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==",
+            "dev": true,
             "license": "MIT",
             "dependencies": {
                 "ms": "^2.0.0"
@@ -1215,12 +1137,14 @@
             "version": "2.1.3",
             "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
             "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+            "dev": true,
             "license": "MIT"
         },
         "node_modules/ieee754": {
             "version": "1.2.1",
             "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
             "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
+            "dev": true,
             "funding": [
                 {
                     "type": "github",
@@ -1423,6 +1347,7 @@
             "version": "4.0.1",
             "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz",
             "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==",
+            "dev": true,
             "peerDependencies": {
                 "ws": "*"
             }
@@ -1431,6 +1356,7 @@
             "version": "4.1.2",
             "resolved": "https://registry.npmjs.org/jayson/-/jayson-4.1.2.tgz",
             "integrity": "sha512-5nzMWDHy6f+koZOuYsArh2AXs73NfWYVlFyJJuCedr93GpY+Ku8qq10ropSXVfHK+H0T6paA88ww+/dV+1fBNA==",
+            "dev": true,
             "dependencies": {
                 "@types/connect": "^3.4.33",
                 "@types/node": "^12.12.54",
@@ -1455,7 +1381,8 @@
         "node_modules/jayson/node_modules/@types/node": {
             "version": "12.20.55",
             "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz",
-            "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ=="
+            "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==",
+            "dev": true
         },
         "node_modules/js-yaml": {
             "version": "4.1.0",
@@ -1473,7 +1400,8 @@
         "node_modules/json-stringify-safe": {
             "version": "5.0.1",
             "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
-            "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA=="
+            "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==",
+            "dev": true
         },
         "node_modules/json5": {
             "version": "1.0.2",
@@ -1493,6 +1421,7 @@
             "version": "1.3.1",
             "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz",
             "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==",
+            "dev": true,
             "engines": [
                 "node >= 0.2.0"
             ]
@@ -1501,6 +1430,7 @@
             "version": "1.3.5",
             "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz",
             "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==",
+            "dev": true,
             "dependencies": {
                 "jsonparse": "^1.2.0",
                 "through": ">=2.2.7 <3"
@@ -1555,15 +1485,6 @@
                 "get-func-name": "^2.0.1"
             }
         },
-        "node_modules/lower-case": {
-            "version": "2.0.2",
-            "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz",
-            "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==",
-            "license": "MIT",
-            "dependencies": {
-                "tslib": "^2.0.3"
-            }
-        },
         "node_modules/make-error": {
             "version": "1.3.6",
             "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
@@ -1703,20 +1624,11 @@
                 "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
             }
         },
-        "node_modules/no-case": {
-            "version": "3.0.4",
-            "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz",
-            "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==",
-            "license": "MIT",
-            "dependencies": {
-                "lower-case": "^2.0.2",
-                "tslib": "^2.0.3"
-            }
-        },
         "node_modules/node-fetch": {
             "version": "2.7.0",
             "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
             "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
+            "dev": true,
             "license": "MIT",
             "dependencies": {
                 "whatwg-url": "^5.0.0"
@@ -1737,6 +1649,7 @@
             "version": "4.8.2",
             "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.2.tgz",
             "integrity": "sha512-IRUxE4BVsHWXkV/SFOut4qTlagw2aM8T5/vnTsmrHJvVoKueJHRc/JaFND7QDDc61kLYUJ6qlZM3sqTSyx2dTw==",
+            "dev": true,
             "optional": true,
             "bin": {
                 "node-gyp-build": "bin.js",
@@ -1842,12 +1755,6 @@
                 "url": "https://github.com/sponsors/sindresorhus"
             }
         },
-        "node_modules/pako": {
-            "version": "2.1.0",
-            "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz",
-            "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==",
-            "license": "(MIT AND Zlib)"
-        },
         "node_modules/path-exists": {
             "version": "4.0.0",
             "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
@@ -1933,7 +1840,8 @@
         "node_modules/regenerator-runtime": {
             "version": "0.14.1",
             "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
-            "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw=="
+            "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==",
+            "dev": true
         },
         "node_modules/require-directory": {
             "version": "2.1.1",
@@ -1949,6 +1857,7 @@
             "version": "9.0.4",
             "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-9.0.4.tgz",
             "integrity": "sha512-yWZWN0M+bivtoNLnaDbtny4XchdAIF5Q4g/ZsC5UC61Ckbp0QczwO8fg44rV3uYmY4WHd+EZQbn90W1d8ojzqQ==",
+            "dev": true,
             "dependencies": {
                 "@swc/helpers": "^0.5.11",
                 "@types/uuid": "^8.3.4",
@@ -1971,6 +1880,7 @@
             "version": "8.5.12",
             "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.12.tgz",
             "integrity": "sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==",
+            "dev": true,
             "dependencies": {
                 "@types/node": "*"
             }
@@ -1978,12 +1888,14 @@
         "node_modules/rpc-websockets/node_modules/eventemitter3": {
             "version": "5.0.1",
             "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz",
-            "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA=="
+            "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==",
+            "dev": true
         },
         "node_modules/rpc-websockets/node_modules/ws": {
             "version": "8.18.0",
             "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz",
             "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==",
+            "dev": true,
             "engines": {
                 "node": ">=10.0.0"
             },
@@ -2004,6 +1916,7 @@
             "version": "5.2.1",
             "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
             "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+            "dev": true,
             "funding": [
                 {
                     "type": "github",
@@ -2046,16 +1959,6 @@
                 "node": ">= 0.4"
             }
         },
-        "node_modules/snake-case": {
-            "version": "3.0.4",
-            "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz",
-            "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==",
-            "license": "MIT",
-            "dependencies": {
-                "dot-case": "^3.0.4",
-                "tslib": "^2.0.3"
-            }
-        },
         "node_modules/source-map": {
             "version": "0.6.1",
             "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@@ -2133,6 +2036,7 @@
             "version": "2.0.2",
             "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-2.0.2.tgz",
             "integrity": "sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==",
+            "dev": true,
             "engines": {
                 "node": ">=14.0.0"
             }
@@ -2156,12 +2060,14 @@
         "node_modules/text-encoding-utf-8": {
             "version": "1.0.2",
             "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz",
-            "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg=="
+            "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==",
+            "dev": true
         },
         "node_modules/through": {
             "version": "2.3.8",
             "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
-            "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg=="
+            "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==",
+            "dev": true
         },
         "node_modules/to-regex-range": {
             "version": "5.0.1",
@@ -2175,16 +2081,11 @@
                 "node": ">=8.0"
             }
         },
-        "node_modules/toml": {
-            "version": "3.0.0",
-            "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz",
-            "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==",
-            "license": "MIT"
-        },
         "node_modules/tr46": {
             "version": "0.0.3",
             "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
             "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
+            "dev": true,
             "license": "MIT"
         },
         "node_modules/ts-mocha": {
@@ -2260,6 +2161,7 @@
             "version": "2.6.2",
             "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
             "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==",
+            "dev": true,
             "license": "0BSD"
         },
         "node_modules/type-detect": {
@@ -2290,12 +2192,14 @@
             "version": "5.25.3",
             "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz",
             "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==",
+            "dev": true,
             "license": "MIT"
         },
         "node_modules/utf-8-validate": {
             "version": "5.0.10",
             "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz",
             "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==",
+            "dev": true,
             "hasInstallScript": true,
             "optional": true,
             "dependencies": {
@@ -2323,6 +2227,7 @@
             "version": "8.3.2",
             "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
             "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
+            "dev": true,
             "bin": {
                 "uuid": "dist/bin/uuid"
             }
@@ -2331,12 +2236,14 @@
             "version": "3.0.1",
             "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
             "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
+            "dev": true,
             "license": "BSD-2-Clause"
         },
         "node_modules/whatwg-url": {
             "version": "5.0.0",
             "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
             "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
+            "dev": true,
             "license": "MIT",
             "dependencies": {
                 "tr46": "~0.0.3",
@@ -2415,6 +2322,7 @@
             "version": "7.5.10",
             "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz",
             "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==",
+            "dev": true,
             "engines": {
                 "node": ">=8.3.0"
             },

+ 0 - 1
package.json

@@ -3,7 +3,6 @@
         "lint:fix": "node_modules/.bin/prettier */*.js \"*/**/*{.js,.ts}\" -w",
         "lint": "node_modules/.bin/prettier */*.js \"*/**/*{.js,.ts}\" --check"
     },
-    "dependencies": {},
     "devDependencies": {
         "@metaplex-foundation/beet": "^0.7.1",
         "@metaplex-foundation/beet-solana": "^0.4.0",

+ 3 - 0
programs/bolt-component/Cargo.toml

@@ -19,6 +19,9 @@ no-log-ix-name = []
 cpi = ["no-entrypoint"]
 default = []
 idl-build = ["anchor-lang/idl-build"]
+anchor-debug = ["anchor-lang/anchor-debug"]
+custom-heap = []
+custom-panic = []
 
 [dependencies]
 anchor-lang = { workspace = true }

+ 3 - 0
programs/bolt-system/Cargo.toml

@@ -19,6 +19,9 @@ no-log-ix-name = []
 cpi = ["no-entrypoint"]
 default = []
 idl-build = ["anchor-lang/idl-build"]
+anchor-debug = ["anchor-lang/anchor-debug"]
+custom-heap = []
+custom-panic = []
 
 [dependencies]
 anchor-lang = { workspace = true }

+ 3 - 0
programs/world/Cargo.toml

@@ -19,6 +19,9 @@ no-log-ix-name = []
 cpi = ["no-entrypoint"]
 default = []
 idl-build = ["anchor-lang/idl-build"]
+anchor-debug = ["anchor-lang/anchor-debug"]
+custom-heap = []
+custom-panic = []
 
 [dependencies]
 anchor-lang = { workspace = true }

+ 1 - 1
tests/bolt.ts

@@ -21,10 +21,10 @@ import {
   RemoveAuthority,
   ApproveSystem,
   RemoveSystem,
-  anchor,
   type Program,
   web3,
 } from "../clients/bolt-sdk";
+import * as anchor from "@coral-xyz/anchor";
 
 enum Direction {
   Left = "Left",

文件差异内容过多而无法显示
+ 208 - 230
yarn.lock


部分文件因为文件数量过多而无法显示