Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add PoolCreated event #109

Open
wants to merge 31 commits into
base: staging
Choose a base branch
from
Open

Conversation

quangkeu95
Copy link
Collaborator

@quangkeu95 quangkeu95 commented Jan 4, 2024

Attempt to add PoolCreated event into the SDK IDL types

Tasks:

  • Add PoolCreated event type.
  • Add test and example how to subscribe to events from a program.

@quangkeu95 quangkeu95 force-pushed the feat/pool-created-event branch from 3de5ba7 to 75b4066 Compare January 10, 2024 08:11
@quangkeu95 quangkeu95 changed the base branch from master to staging January 10, 2024 08:26
@quangkeu95 quangkeu95 force-pushed the feat/pool-created-event branch from bc7cfa7 to 15ef218 Compare January 12, 2024 13:53
@quangkeu95 quangkeu95 force-pushed the feat/pool-created-event branch from 15ef218 to d351ada Compare January 15, 2024 07:40
@@ -63,7 +63,7 @@ type Opt = {
};

const getAllPoolState = async (poolMints: Array<PublicKey>, program: AmmProgram) => {
const poolStates = (await chunkedFetchMultiplePoolAccount(program, poolMints)) as Array<PoolState>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to convert to any first?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like an outdated thing i added to bypass typescript compile error. It's not happened again then i'm gonna remove it.

@00xSam
Copy link
Collaborator

00xSam commented Jan 17, 2024

Screenshot 2024-01-17 at 11 40 40 AM

running pnpm run generate throw me error. Did you forgot to commit something?

@00xSam
Copy link
Collaborator

00xSam commented Jan 17, 2024

pnpm run anchor-test failed as well for me.

error: failed to run custom build command for `blake3 v1.5.0`

Caused by:
  process didn't exit successfully: `/Users/mcsam/Development/mercurial-dynamic-amm-sdk/target/release/build/blake3-18f03ff94989d032/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=CARGO_FEATURE_PURE
  cargo:rerun-if-env-changed=CARGO_FEATURE_NO_NEON
  cargo:rerun-if-env-changed=CARGO_FEATURE_NEON
  cargo:rerun-if-env-changed=CARGO_FEATURE_NEON
  cargo:rerun-if-env-changed=CARGO_FEATURE_NO_NEON
  cargo:rerun-if-env-changed=CARGO_FEATURE_PURE
  cargo:rustc-cfg=blake3_neon
  TARGET = Some("aarch64-apple-darwin")
  OPT_LEVEL = Some("0")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_aarch64-apple-darwin
  CC_aarch64-apple-darwin = None
  cargo:rerun-if-env-changed=CC_aarch64_apple_darwin
  CC_aarch64_apple_darwin = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/Users/mcsam/.local/share/solana/install/releases/1.16.1/solana-release/bin/sdk/sbf/dependencies/platform-tools/llvm/bin/clang")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-apple-darwin
  CFLAGS_aarch64-apple-darwin = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_apple_darwin
  CFLAGS_aarch64_apple_darwin = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  running: "/Users/mcsam/.local/share/solana/install/releases/1.16.1/solana-release/bin/sdk/sbf/dependencies/platform-tools/llvm/bin/clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=arm64-apple-darwin" "-Wall" "-Wextra" "-std=c11" "-o" "/Users/mcsam/Development/mercurial-dynamic-amm-sdk/target/release/build/blake3-5478e16ff4b3f7e8/out/c/blake3_neon.o" "-c" "c/blake3_neon.c"
  cargo:warning=In file included from c/blake3_neon.c:1:

  cargo:warning=c/blake3_impl.h:4:10: fatal error: 'assert.h' file not found

  cargo:warning=#include <assert.h>

  cargo:warning=         ^~~~~~~~~~

  cargo:warning=1 error generated.

  exit status: 1

  --- stderr


  error occurred: Command "/Users/mcsam/.local/share/solana/install/releases/1.16.1/solana-release/bin/sdk/sbf/dependencies/platform-tools/llvm/bin/clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=arm64-apple-darwin" "-Wall" "-Wextra" "-std=c11" "-o" "/Users/mcsam/Development/mercurial-dynamic-amm-sdk/target/release/build/blake3-5478e16ff4b3f7e8/out/c/blake3_neon.o" "-c" "c/blake3_neon.c" with args "clang" did not execute successfully (status code exit status: 1).


warning: build failed, waiting for other jobs to finish...
 ELIFECYCLE  Command failed with exit code 1.
 ```

@quangkeu95
Copy link
Collaborator Author

Screenshot 2024-01-17 at 11 40 40 AM running `pnpm run generate` throw me error. Did you forgot to commit something?

I think we don't need to use the generated types so i'm gonna remove this command with the achor-client-gen dependency.

@quangkeu95
Copy link
Collaborator Author

pnpm run anchor-test failed as well for me.

error: failed to run custom build command for `blake3 v1.5.0`

Caused by:
  process didn't exit successfully: `/Users/mcsam/Development/mercurial-dynamic-amm-sdk/target/release/build/blake3-18f03ff94989d032/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=CARGO_FEATURE_PURE
  cargo:rerun-if-env-changed=CARGO_FEATURE_NO_NEON
  cargo:rerun-if-env-changed=CARGO_FEATURE_NEON
  cargo:rerun-if-env-changed=CARGO_FEATURE_NEON
  cargo:rerun-if-env-changed=CARGO_FEATURE_NO_NEON
  cargo:rerun-if-env-changed=CARGO_FEATURE_PURE
  cargo:rustc-cfg=blake3_neon
  TARGET = Some("aarch64-apple-darwin")
  OPT_LEVEL = Some("0")
  HOST = Some("aarch64-apple-darwin")
  cargo:rerun-if-env-changed=CC_aarch64-apple-darwin
  CC_aarch64-apple-darwin = None
  cargo:rerun-if-env-changed=CC_aarch64_apple_darwin
  CC_aarch64_apple_darwin = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some("/Users/mcsam/.local/share/solana/install/releases/1.16.1/solana-release/bin/sdk/sbf/dependencies/platform-tools/llvm/bin/clang")
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-apple-darwin
  CFLAGS_aarch64-apple-darwin = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_apple_darwin
  CFLAGS_aarch64_apple_darwin = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  running: "/Users/mcsam/.local/share/solana/install/releases/1.16.1/solana-release/bin/sdk/sbf/dependencies/platform-tools/llvm/bin/clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=arm64-apple-darwin" "-Wall" "-Wextra" "-std=c11" "-o" "/Users/mcsam/Development/mercurial-dynamic-amm-sdk/target/release/build/blake3-5478e16ff4b3f7e8/out/c/blake3_neon.o" "-c" "c/blake3_neon.c"
  cargo:warning=In file included from c/blake3_neon.c:1:

  cargo:warning=c/blake3_impl.h:4:10: fatal error: 'assert.h' file not found

  cargo:warning=#include <assert.h>

  cargo:warning=         ^~~~~~~~~~

  cargo:warning=1 error generated.

  exit status: 1

  --- stderr


  error occurred: Command "/Users/mcsam/.local/share/solana/install/releases/1.16.1/solana-release/bin/sdk/sbf/dependencies/platform-tools/llvm/bin/clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=arm64-apple-darwin" "-Wall" "-Wextra" "-std=c11" "-o" "/Users/mcsam/Development/mercurial-dynamic-amm-sdk/target/release/build/blake3-5478e16ff4b3f7e8/out/c/blake3_neon.o" "-c" "c/blake3_neon.c" with args "clang" did not execute successfully (status code exit status: 1).


warning: build failed, waiting for other jobs to finish...
 ELIFECYCLE  Command failed with exit code 1.
 ```

would you mind running cargo clean and rerun the command, make sure you run in inside the ts-client dir. I'm not sure about this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants