Skip to content

price table not found #2512

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

Open
daron4ever opened this issue Mar 21, 2025 · 0 comments
Open

price table not found #2512

daron4ever opened this issue Mar 21, 2025 · 0 comments

Comments

@daron4ever
Copy link

/**
   * Fetches the price table object id for the current state id if not cached
   * @returns price table object id
   */
  async getPriceTableInfo(): Promise<{ id: ObjectId; fieldType: ObjectId }> {
    if (this.priceTableInfo === undefined) {
      const result = await this.provider.getDynamicFieldObject({
        parentId: this.pythStateId,
        name: {
          type: "vector<u8>",
          value: "price_info",
        },
      });
      if (!result.data || !result.data.type) {
        throw new Error(
          "Price Table not found, contract may not be initialized"
        );
      }
      let type = result.data.type.replace("0x2::table::Table<", "");
      type = type.replace(
        "::price_identifier::PriceIdentifier, 0x2::object::ID>",
        ""
      );
      this.priceTableInfo = { id: result.data.objectId, fieldType: type };
    }
    return this.priceTableInfo;
  }
if (!result.data || !result.data.type) {
        throw new Error(
          "Price Table not found, contract may not be initialized"
        );
      }

its cause the pyth price object was not found.
i need to get the dynamicObjectField of the pyth State Id, and it doesnt return me the proper one

cause its not able to get the price table info for the pythStateId

I even tested this code, separately outside the package, and the result.data will have value only when I used archive node.

so i testeed with sui public node, which is archived node, and my normal full node. data was returned only using sui archived node.

Is it not possible to use the price feed with a full node? Do we need an archive node for that?

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

No branches or pull requests

2 participants
@daron4ever and others