Explorar o código

fix(price-service-sdk): fixed JS build

benduran hai 4 semanas
pai
achega
a8ef5fa4f7
Modificáronse 27 ficheiros con 643 adicións e 1158 borrados
  1. 3 3
      apps/entropy-tester/package.json
  2. 1 1
      apps/entropy-tester/tsconfig.json
  3. 8 0
      packages/build-ts-package/src/build-ts-package.js
  4. 1 0
      price_service/sdk/js/.gitignore
  5. 0 36
      price_service/sdk/js/.tshy-build/esm/AccumulatorUpdateData.d.ts
  6. 0 154
      price_service/sdk/js/.tshy-build/esm/AccumulatorUpdateData.js
  7. 0 1
      price_service/sdk/js/.tshy-build/esm/__tests__/AccumulatorUpdateData.test.d.ts
  8. 0 2
      price_service/sdk/js/.tshy-build/esm/__tests__/AccumulatorUpdateData.test.js
  9. 0 1
      price_service/sdk/js/.tshy-build/esm/__tests__/PriceFeed.test.d.ts
  10. 0 94
      price_service/sdk/js/.tshy-build/esm/__tests__/PriceFeed.test.js
  11. 0 188
      price_service/sdk/js/.tshy-build/esm/index.d.ts
  12. 0 276
      price_service/sdk/js/.tshy-build/esm/index.js
  13. 0 89
      price_service/sdk/js/.tshy-build/esm/schemas/PriceFeed.d.ts
  14. 0 198
      price_service/sdk/js/.tshy-build/esm/schemas/PriceFeed.js
  15. 0 96
      price_service/sdk/js/.tshy-build/esm/schemas/price_feed.json
  16. 18 4
      price_service/sdk/js/package.json
  17. 1 1
      price_service/sdk/js/tsconfig.build.json
  18. 2 10
      target_chains/ethereum/entropy_sdk/solidity/package.json
  19. 29 0
      target_chains/ton/sdk/js/dist/cjs/_virtual/rolldown_runtime.js
  20. 73 0
      target_chains/ton/sdk/js/dist/cjs/index.d.ts
  21. 0 0
      target_chains/ton/sdk/js/dist/cjs/index.d.ts.map
  22. 214 0
      target_chains/ton/sdk/js/dist/cjs/index.js
  23. 73 0
      target_chains/ton/sdk/js/dist/esm/index.d.mts
  24. 0 0
      target_chains/ton/sdk/js/dist/esm/index.d.mts.map
  25. 203 0
      target_chains/ton/sdk/js/dist/esm/index.mjs
  26. 0 0
      target_chains/ton/sdk/js/dist/esm/index.mjs.map
  27. 17 4
      target_chains/ton/sdk/js/package.json

+ 3 - 3
apps/entropy-tester/package.json

@@ -17,14 +17,14 @@
     "cli/**/*"
   ],
   "scripts": {
-    "build": "tsc --project tsconfig.build.json",
+    "build": "tsc",
     "fix:format": "prettier --write .",
     "fix:lint": "eslint --fix .",
     "test:format": "prettier --check .",
     "test:lint": "eslint . --max-warnings 0",
     "test:types": "tsc",
-    "start:dev": "tsc --project tsconfig.build.json && node cli/run.js",
-    "start:prod": "node cli/run.js"
+    "start:dev": "tsx src/index.ts",
+    "start:prod": "tsx src/index.ts"
   },
   "repository": {
     "type": "git",

+ 1 - 1
apps/entropy-tester/tsconfig.json

@@ -1,5 +1,5 @@
 {
-  "extends": "@cprussin/tsconfig/nextjs.json",
+  "extends": "@cprussin/tsconfig/base.json",
   "include": ["**/*.ts"],
   "exclude": ["node_modules"]
 }

+ 8 - 0
packages/build-ts-package/src/build-ts-package.js

@@ -121,14 +121,22 @@ export async function buildTsPackage(argv = process.argv) {
   const numFormats = formats.length;
 
   for (const format of formats) {
+    console.info(`building ${format} variant in ${cwd}`);
+    console.info(`  tsconfig: ${tsconfig}`);
+
     await build({
       clean: false,
+      cwd,
       dts: !noDts,
       entry: [
         "./src/**/*.ts",
         "./src/**/*.tsx",
         // ignore all storybook entrypoints
         "!./src/**/*.stories.ts",
+        "!./src/**/*.test.ts",
+        "!./src/**/*.test.tsx",
+        "!./src/**/*.spec.ts",
+        "!./src/**/*.spec.tsx",
         "!./src/**/*.stories.tsx",
         "!./src/**/*.stories.mdx",
       ],

+ 1 - 0
price_service/sdk/js/.gitignore

@@ -1,2 +1,3 @@
 node_modules
 lib
+dist

+ 0 - 36
price_service/sdk/js/.tshy-build/esm/AccumulatorUpdateData.d.ts

@@ -1,36 +0,0 @@
-import BN from "bn.js";
-export type AccumulatorUpdateData = {
-    vaa: Buffer;
-    updates: {
-        message: Buffer;
-        proof: number[][];
-    }[];
-};
-export type PriceFeedMessage = {
-    feedId: Buffer;
-    price: BN;
-    confidence: BN;
-    exponent: number;
-    publishTime: BN;
-    prevPublishTime: BN;
-    emaPrice: BN;
-    emaConf: BN;
-};
-export type TwapMessage = {
-    feedId: Buffer;
-    cumulativePrice: BN;
-    cumulativeConf: BN;
-    numDownSlots: BN;
-    exponent: number;
-    publishTime: BN;
-    prevPublishTime: BN;
-    publishSlot: BN;
-};
-export declare function isAccumulatorUpdateData(updateBytes: Buffer): boolean;
-export declare function parsePriceFeedMessage(message: Buffer): PriceFeedMessage;
-export declare function parseTwapMessage(message: Buffer): TwapMessage;
-/**
- * An AccumulatorUpdateData contains a VAA and a list of updates. This function returns a new serialized AccumulatorUpdateData with only the updates in the range [start, end).
- */
-export declare function sliceAccumulatorUpdateData(data: Buffer, start?: number, end?: number): Buffer;
-export declare function parseAccumulatorUpdateData(data: Buffer): AccumulatorUpdateData;

+ 0 - 154
price_service/sdk/js/.tshy-build/esm/AccumulatorUpdateData.js

@@ -1,154 +0,0 @@
-import BN from "bn.js";
-const ACCUMULATOR_MAGIC = "504e4155";
-const MAJOR_VERSION = 1;
-const MINOR_VERSION = 0;
-const KECCAK160_HASH_SIZE = 20;
-const PRICE_FEED_MESSAGE_VARIANT = 0;
-const TWAP_MESSAGE_VARIANT = 1;
-export function isAccumulatorUpdateData(updateBytes) {
-    return (updateBytes.toString("hex").slice(0, 8) === ACCUMULATOR_MAGIC &&
-        updateBytes[4] === MAJOR_VERSION &&
-        updateBytes[5] === MINOR_VERSION);
-}
-export function parsePriceFeedMessage(message) {
-    let cursor = 0;
-    const variant = message.readUInt8(cursor);
-    if (variant !== PRICE_FEED_MESSAGE_VARIANT) {
-        throw new Error("Not a price feed message");
-    }
-    cursor += 1;
-    const feedId = message.subarray(cursor, cursor + 32);
-    cursor += 32;
-    const price = new BN(message.subarray(cursor, cursor + 8), "be");
-    cursor += 8;
-    const confidence = new BN(message.subarray(cursor, cursor + 8), "be");
-    cursor += 8;
-    const exponent = message.readInt32BE(cursor);
-    cursor += 4;
-    const publishTime = new BN(message.subarray(cursor, cursor + 8), "be");
-    cursor += 8;
-    const prevPublishTime = new BN(message.subarray(cursor, cursor + 8), "be");
-    cursor += 8;
-    const emaPrice = new BN(message.subarray(cursor, cursor + 8), "be");
-    cursor += 8;
-    const emaConf = new BN(message.subarray(cursor, cursor + 8), "be");
-    cursor += 8;
-    return {
-        feedId,
-        price,
-        confidence,
-        exponent,
-        publishTime,
-        prevPublishTime,
-        emaPrice,
-        emaConf,
-    };
-}
-export function parseTwapMessage(message) {
-    let cursor = 0;
-    const variant = message.readUInt8(cursor);
-    if (variant !== TWAP_MESSAGE_VARIANT) {
-        throw new Error("Not a twap message");
-    }
-    cursor += 1;
-    const feedId = message.subarray(cursor, cursor + 32);
-    cursor += 32;
-    const cumulativePrice = new BN(message.subarray(cursor, cursor + 16), "be");
-    cursor += 16;
-    const cumulativeConf = new BN(message.subarray(cursor, cursor + 16), "be");
-    cursor += 16;
-    const numDownSlots = new BN(message.subarray(cursor, cursor + 8), "be");
-    cursor += 8;
-    const exponent = message.readInt32BE(cursor);
-    cursor += 4;
-    const publishTime = new BN(message.subarray(cursor, cursor + 8), "be");
-    cursor += 8;
-    const prevPublishTime = new BN(message.subarray(cursor, cursor + 8), "be");
-    cursor += 8;
-    const publishSlot = new BN(message.subarray(cursor, cursor + 8), "be");
-    cursor += 8;
-    return {
-        feedId,
-        cumulativePrice,
-        cumulativeConf,
-        numDownSlots,
-        exponent,
-        publishTime,
-        prevPublishTime,
-        publishSlot,
-    };
-}
-/**
- * An AccumulatorUpdateData contains a VAA and a list of updates. This function returns a new serialized AccumulatorUpdateData with only the updates in the range [start, end).
- */
-export function sliceAccumulatorUpdateData(data, start, end) {
-    if (!isAccumulatorUpdateData(data)) {
-        throw new Error("Invalid accumulator message");
-    }
-    let cursor = 6;
-    const trailingPayloadSize = data.readUint8(cursor);
-    cursor += 1 + trailingPayloadSize;
-    // const proofType = data.readUint8(cursor);
-    cursor += 1;
-    const vaaSize = data.readUint16BE(cursor);
-    cursor += 2;
-    cursor += vaaSize;
-    const endOfVaa = cursor;
-    const updates = [];
-    const numUpdates = data.readUInt8(cursor);
-    cursor += 1;
-    for (let i = 0; i < numUpdates; i++) {
-        const updateStart = cursor;
-        const messageSize = data.readUint16BE(cursor);
-        cursor += 2;
-        cursor += messageSize;
-        const numProofs = data.readUInt8(cursor);
-        cursor += 1;
-        cursor += KECCAK160_HASH_SIZE * numProofs;
-        updates.push(data.subarray(updateStart, cursor));
-    }
-    if (cursor !== data.length) {
-        throw new Error("Didn't reach the end of the message");
-    }
-    const sliceUpdates = updates.slice(start, end);
-    return Buffer.concat([
-        data.subarray(0, endOfVaa),
-        Buffer.from([sliceUpdates.length]),
-        ...updates.slice(start, end),
-    ]);
-}
-export function parseAccumulatorUpdateData(data) {
-    if (!isAccumulatorUpdateData(data)) {
-        throw new Error("Invalid accumulator message");
-    }
-    let cursor = 6;
-    const trailingPayloadSize = data.readUint8(cursor);
-    cursor += 1 + trailingPayloadSize;
-    // const proofType = data.readUint8(cursor);
-    cursor += 1;
-    const vaaSize = data.readUint16BE(cursor);
-    cursor += 2;
-    const vaa = data.subarray(cursor, cursor + vaaSize);
-    cursor += vaaSize;
-    const numUpdates = data.readUInt8(cursor);
-    const updates = [];
-    cursor += 1;
-    for (let i = 0; i < numUpdates; i++) {
-        const messageSize = data.readUint16BE(cursor);
-        cursor += 2;
-        const message = data.subarray(cursor, cursor + messageSize);
-        cursor += messageSize;
-        const numProofs = data.readUInt8(cursor);
-        cursor += 1;
-        const proof = [];
-        for (let j = 0; j < numProofs; j++) {
-            proof.push(Array.from(data.subarray(cursor, cursor + KECCAK160_HASH_SIZE)));
-            cursor += KECCAK160_HASH_SIZE;
-        }
-        updates.push({ message, proof });
-    }
-    if (cursor !== data.length) {
-        throw new Error("Didn't reach the end of the message");
-    }
-    return { vaa, updates };
-}

+ 0 - 1
price_service/sdk/js/.tshy-build/esm/__tests__/AccumulatorUpdateData.test.d.ts

@@ -1 +0,0 @@
-export {};

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 2
price_service/sdk/js/.tshy-build/esm/__tests__/AccumulatorUpdateData.test.js


+ 0 - 1
price_service/sdk/js/.tshy-build/esm/__tests__/PriceFeed.test.d.ts

@@ -1 +0,0 @@
-export {};

+ 0 - 94
price_service/sdk/js/.tshy-build/esm/__tests__/PriceFeed.test.js

@@ -1,94 +0,0 @@
-import { Price, PriceFeed, PriceFeedMetadata } from "../index";
-beforeAll(() => {
-    jest.useFakeTimers();
-});
-test("Parsing Price Feed works as expected", () => {
-    const data = {
-        ema_price: {
-            conf: "2",
-            expo: 4,
-            price: "3",
-            publish_time: 11,
-        },
-        id: "abcdef0123456789",
-        price: {
-            conf: "1",
-            expo: 4,
-            price: "10",
-            publish_time: 11,
-        },
-    };
-    const priceFeed = PriceFeed.fromJson(data);
-    expect(priceFeed.id).toBe("abcdef0123456789");
-    const expectedPrice = new Price({
-        conf: "1",
-        expo: 4,
-        price: "10",
-        publishTime: 11,
-    });
-    expect(priceFeed.getPriceUnchecked()).toStrictEqual(expectedPrice);
-    const expectedEmaPrice = new Price({
-        conf: "2",
-        expo: 4,
-        price: "3",
-        publishTime: 11,
-    });
-    expect(priceFeed.getEmaPriceUnchecked()).toStrictEqual(expectedEmaPrice);
-    jest.setSystemTime(20000);
-    expect(priceFeed.getPriceNoOlderThan(15)).toStrictEqual(expectedPrice);
-    expect(priceFeed.getPriceNoOlderThan(5)).toBeUndefined();
-    expect(priceFeed.getEmaPriceNoOlderThan(15)).toStrictEqual(expectedEmaPrice);
-    expect(priceFeed.getEmaPriceNoOlderThan(5)).toBeUndefined();
-    expect(priceFeed.toJson()).toEqual(data);
-});
-test("getMetadata returns PriceFeedMetadata as expected", () => {
-    const data = {
-        ema_price: {
-            conf: "2",
-            expo: 4,
-            price: "3",
-            publish_time: 11,
-        },
-        id: "abcdef0123456789",
-        price: {
-            conf: "1",
-            expo: 4,
-            price: "10",
-            publish_time: 11,
-        },
-        metadata: {
-            attestation_time: 7,
-            emitter_chain: 8,
-            price_service_receive_time: 9,
-            sequence_number: 10,
-            something_else: 11, // Ensuring the code is future compatible.
-        },
-    };
-    const priceFeed = PriceFeed.fromJson(data);
-    expect(priceFeed.getMetadata()).toStrictEqual(PriceFeedMetadata.fromJson({
-        attestation_time: 7,
-        emitter_chain: 8,
-        price_service_receive_time: 9,
-        sequence_number: 10,
-    }));
-});
-test("getVAA returns string as expected", () => {
-    const data = {
-        ema_price: {
-            conf: "2",
-            expo: 4,
-            price: "3",
-            publish_time: 11,
-        },
-        id: "abcdef0123456789",
-        price: {
-            conf: "1",
-            expo: 4,
-            price: "10",
-            publish_time: 11,
-        },
-        vaa: "abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef",
-    };
-    const priceFeed = PriceFeed.fromJson(data);
-    expect(priceFeed.getVAA()).toStrictEqual("abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef");
-});

+ 0 - 188
price_service/sdk/js/.tshy-build/esm/index.d.ts

@@ -1,188 +0,0 @@
-export type UnixTimestamp = number;
-export type DurationInSeconds = number;
-export type HexString = string;
-export { isAccumulatorUpdateData, sliceAccumulatorUpdateData, parseAccumulatorUpdateData, AccumulatorUpdateData, parsePriceFeedMessage, parseTwapMessage, } from "./AccumulatorUpdateData";
-/**
- * A Pyth Price represented as `${price} ± ${conf} * 10^${expo}` published at `publishTime`.
- */
-export declare class Price {
-    conf: string;
-    expo: number;
-    price: string;
-    publishTime: UnixTimestamp;
-    constructor(rawPrice: {
-        conf: string;
-        expo: number;
-        price: string;
-        publishTime: UnixTimestamp;
-    });
-    /**
-     * Get price as number. Warning: this conversion might result in an inaccurate number.
-     * We store price and confidence values in our Oracle at 64-bit precision, but the JavaScript
-     * number type can only represent numbers with 52-bit precision. So if a price or confidence
-     * is larger than 52-bits, the conversion will lose the most insignificant bits.
-     *
-     * @returns a floating point number representing the price
-     */
-    getPriceAsNumberUnchecked(): number;
-    /**
-     * Get price as number. Warning: this conversion might result in an inaccurate number.
-     * Explanation is the same as `priceAsNumberUnchecked()` documentation.
-     *
-     * @returns a floating point number representing the price
-     */
-    getConfAsNumberUnchecked(): number;
-    static fromJson(json: any): Price;
-    toJson(): any;
-}
-/**
- * Metadata about the price
- *
- * Represents metadata of a price feed.
- */
-export declare class PriceFeedMetadata {
-    /**
-     * Attestation time of the price
-     */
-    attestationTime?: number;
-    /**
-     * Chain of the emitter
-     */
-    emitterChain: number;
-    /**
-     * The time that the price service received the price
-     */
-    priceServiceReceiveTime?: number;
-    /**
-     * Sequence number of the price
-     */
-    sequenceNumber?: number;
-    /**
-     * Pythnet slot number of the price
-     */
-    slot?: number;
-    /**
-     * The time that the previous price was published
-     */
-    prevPublishTime?: number;
-    constructor(metadata: {
-        attestationTime?: number;
-        emitterChain: number;
-        receiveTime?: number;
-        sequenceNumber?: number;
-        slot?: number;
-        prevPublishTime?: number;
-    });
-    static fromJson(json: any): PriceFeedMetadata | undefined;
-    toJson(): any;
-}
-/**
- * Pyth Price Feed
- *
- * Represents a current aggregation price from pyth publisher feeds.
- */
-export declare class PriceFeed {
-    /**
-     * Exponentially-weighted moving average Price
-     */
-    private emaPrice;
-    /**
-     * Unique identifier for this price.
-     */
-    id: HexString;
-    /**
-     * Metadata of the price
-     */
-    metadata?: PriceFeedMetadata;
-    /**
-     * VAA of the price
-     */
-    vaa?: string;
-    /**
-     * Price
-     */
-    private price;
-    constructor(rawFeed: {
-        emaPrice: Price;
-        id: HexString;
-        metadata?: PriceFeedMetadata;
-        vaa?: string;
-        price: Price;
-    });
-    static fromJson(json: any): PriceFeed;
-    toJson(): any;
-    /**
-     * Get the price and confidence interval as fixed-point numbers of the form a * 10^e.
-     * This function returns the current best estimate of the price at the time that this `PriceFeed` was
-     * published (`publishTime`). The returned price can be from arbitrarily far in the past; this function
-     * makes no guarantees that the returned price is recent or useful for any particular application.
-     *
-     * Users of this function should check the returned `publishTime` to ensure that the returned price is
-     * sufficiently recent for their application. If you are considering using this function, it may be
-     * safer / easier to use `getPriceNoOlderThan` method.
-     *
-     * @returns a Price that contains the price and confidence interval along with
-     * the exponent for them, and publish time of the price.
-     */
-    getPriceUnchecked(): Price;
-    /**
-     * Get the exponentially-weighted moving average (EMA) price and confidence interval.
-     *
-     * This function returns the current best estimate of the price at the time that this `PriceFeed` was
-     * published (`publishTime`). The returned price can be from arbitrarily far in the past; this function
-     * makes no guarantees that the returned price is recent or useful for any particular application.
-     *
-     * Users of this function should check the returned `publishTime` to ensure that the returned price is
-     * sufficiently recent for their application. If you are considering using this function, it may be
-     * safer / easier to use `getEmaPriceNoOlderThan` method.
-     *
-     * At the moment, the confidence interval returned by this method is computed in
-     * a somewhat questionable way, so we do not recommend using it for high-value applications.
-     *
-     * @returns a Price that contains the EMA price and confidence interval along with
-     * the exponent for them, and publish time of the price.
-     */
-    getEmaPriceUnchecked(): Price;
-    /**
-     * Get the price if it was updated no older than `age` seconds of the current time.
-     *
-     * This function is a sanity-checked version of `getPriceUnchecked` which is useful in
-     * applications that require a sufficiently-recent price. Returns `undefined` if the price
-     * is not recent enough.
-     *
-     * @param age return a price as long as it has been updated within this number of seconds
-     * @returns a Price struct containing the price, confidence interval along with the exponent for
-     * both numbers, and its publish time, or `undefined` if no price update occurred within `age` seconds of the current time.
-     */
-    getPriceNoOlderThan(age: DurationInSeconds): Price | undefined;
-    /**
-     * Get the exponentially-weighted moving average (EMA) price if it was updated no older than
-     * `age` seconds of the current time.
-     *
-     * This function is a sanity-checked version of `getEmaPriceUnchecked` which is useful in
-     * applications that require a sufficiently-recent price. Returns `undefined` if the price
-     * is not recent enough.
-     *
-     * At the moment, the confidence interval returned by this method is computed in
-     * a somewhat questionable way, so we do not recommend using it for high-value applications.
-     *
-     * @param age return a price as long as it has been updated within this number of seconds
-     * @returns a Price struct containing the EMA price, confidence interval along with the exponent for
-     * both numbers, and its publish time, or `undefined` if no price update occurred within `age` seconds of the current time.
-     */
-    getEmaPriceNoOlderThan(age: DurationInSeconds): Price | undefined;
-    /**
-     * Get the price feed metadata.
-     *
-     * @returns a struct containing the attestation time, emitter chain, and the sequence number.
-     * Returns `undefined` if metadata is currently unavailable.
-     */
-    getMetadata(): PriceFeedMetadata | undefined;
-    /**
-     * Get the price feed vaa.
-     *
-     * @returns vaa in base64.
-     * Returns `undefined` if vaa is unavailable.
-     */
-    getVAA(): string | undefined;
-}

+ 0 - 276
price_service/sdk/js/.tshy-build/esm/index.js

@@ -1,276 +0,0 @@
-import { Convert, } from "./schemas/PriceFeed";
-export { isAccumulatorUpdateData, sliceAccumulatorUpdateData, parseAccumulatorUpdateData, AccumulatorUpdateData, parsePriceFeedMessage, parseTwapMessage, } from "./AccumulatorUpdateData";
-/**
- * A Pyth Price represented as `${price} ± ${conf} * 10^${expo}` published at `publishTime`.
- */
-export class Price {
-    conf;
-    expo;
-    price;
-    publishTime;
-    constructor(rawPrice) {
-        this.conf = rawPrice.conf;
-        this.expo = rawPrice.expo;
-        this.price = rawPrice.price;
-        this.publishTime = rawPrice.publishTime;
-    }
-    /**
-     * Get price as number. Warning: this conversion might result in an inaccurate number.
-     * We store price and confidence values in our Oracle at 64-bit precision, but the JavaScript
-     * number type can only represent numbers with 52-bit precision. So if a price or confidence
-     * is larger than 52-bits, the conversion will lose the most insignificant bits.
-     *
-     * @returns a floating point number representing the price
-     */
-    getPriceAsNumberUnchecked() {
-        return Number(this.price) * 10 ** this.expo;
-    }
-    /**
-     * Get price as number. Warning: this conversion might result in an inaccurate number.
-     * Explanation is the same as `priceAsNumberUnchecked()` documentation.
-     *
-     * @returns a floating point number representing the price
-     */
-    getConfAsNumberUnchecked() {
-        return Number(this.conf) * 10 ** this.expo;
-    }
-    static fromJson(json) {
-        const jsonPrice = Convert.toPrice(json);
-        return new Price({
-            conf: jsonPrice.conf,
-            expo: jsonPrice.expo,
-            price: jsonPrice.price,
-            publishTime: jsonPrice.publish_time,
-        });
-    }
-    toJson() {
-        const jsonPrice = {
-            conf: this.conf,
-            expo: this.expo,
-            price: this.price,
-            publish_time: this.publishTime,
-        };
-        // this is done to avoid sending undefined values to the server
-        return Convert.priceToJson(jsonPrice);
-    }
-}
-/**
- * Metadata about the price
- *
- * Represents metadata of a price feed.
- */
-export class PriceFeedMetadata {
-    /**
-     * Attestation time of the price
-     */
-    attestationTime;
-    /**
-     * Chain of the emitter
-     */
-    emitterChain;
-    /**
-     * The time that the price service received the price
-     */
-    priceServiceReceiveTime;
-    /**
-     * Sequence number of the price
-     */
-    sequenceNumber;
-    /**
-     * Pythnet slot number of the price
-     */
-    slot;
-    /**
-     * The time that the previous price was published
-     */
-    prevPublishTime;
-    constructor(metadata) {
-        this.attestationTime = metadata.attestationTime;
-        this.emitterChain = metadata.emitterChain;
-        this.priceServiceReceiveTime = metadata.receiveTime;
-        this.sequenceNumber = metadata.sequenceNumber;
-        this.slot = metadata.slot;
-        this.prevPublishTime = metadata.prevPublishTime;
-    }
-    static fromJson(json) {
-        if (json === undefined) {
-            return undefined;
-        }
-        const jsonFeed = Convert.toPriceFeedMetadata(json);
-        return new PriceFeedMetadata({
-            attestationTime: jsonFeed.attestation_time,
-            emitterChain: jsonFeed.emitter_chain,
-            receiveTime: jsonFeed.price_service_receive_time,
-            sequenceNumber: jsonFeed.sequence_number,
-            slot: jsonFeed.slot,
-            prevPublishTime: jsonFeed.prev_publish_time,
-        });
-    }
-    toJson() {
-        const jsonFeed = {
-            attestation_time: this.attestationTime,
-            emitter_chain: this.emitterChain,
-            price_service_receive_time: this.priceServiceReceiveTime,
-            sequence_number: this.sequenceNumber,
-            slot: this.slot,
-            prev_publish_time: this.prevPublishTime,
-        };
-        // this is done to avoid sending undefined values to the server
-        return Convert.priceFeedMetadataToJson(jsonFeed);
-    }
-}
-/**
- * Pyth Price Feed
- *
- * Represents a current aggregation price from pyth publisher feeds.
- */
-export class PriceFeed {
-    /**
-     * Exponentially-weighted moving average Price
-     */
-    emaPrice;
-    /**
-     * Unique identifier for this price.
-     */
-    id;
-    /**
-     * Metadata of the price
-     */
-    metadata;
-    /**
-     * VAA of the price
-     */
-    vaa;
-    /**
-     * Price
-     */
-    price;
-    constructor(rawFeed) {
-        this.emaPrice = rawFeed.emaPrice;
-        this.id = rawFeed.id;
-        this.metadata = rawFeed.metadata;
-        this.vaa = rawFeed.vaa;
-        this.price = rawFeed.price;
-    }
-    static fromJson(json) {
-        const jsonFeed = Convert.toPriceFeed(json);
-        return new PriceFeed({
-            emaPrice: Price.fromJson(jsonFeed.ema_price),
-            id: jsonFeed.id,
-            metadata: PriceFeedMetadata.fromJson(jsonFeed.metadata),
-            vaa: jsonFeed.vaa,
-            price: Price.fromJson(jsonFeed.price),
-        });
-    }
-    toJson() {
-        const jsonFeed = {
-            ema_price: this.emaPrice.toJson(),
-            id: this.id,
-            metadata: this.metadata?.toJson(),
-            price: this.price.toJson(),
-        };
-        return Convert.priceFeedToJson(jsonFeed);
-    }
-    /**
-     * Get the price and confidence interval as fixed-point numbers of the form a * 10^e.
-     * This function returns the current best estimate of the price at the time that this `PriceFeed` was
-     * published (`publishTime`). The returned price can be from arbitrarily far in the past; this function
-     * makes no guarantees that the returned price is recent or useful for any particular application.
-     *
-     * Users of this function should check the returned `publishTime` to ensure that the returned price is
-     * sufficiently recent for their application. If you are considering using this function, it may be
-     * safer / easier to use `getPriceNoOlderThan` method.
-     *
-     * @returns a Price that contains the price and confidence interval along with
-     * the exponent for them, and publish time of the price.
-     */
-    getPriceUnchecked() {
-        return this.price;
-    }
-    /**
-     * Get the exponentially-weighted moving average (EMA) price and confidence interval.
-     *
-     * This function returns the current best estimate of the price at the time that this `PriceFeed` was
-     * published (`publishTime`). The returned price can be from arbitrarily far in the past; this function
-     * makes no guarantees that the returned price is recent or useful for any particular application.
-     *
-     * Users of this function should check the returned `publishTime` to ensure that the returned price is
-     * sufficiently recent for their application. If you are considering using this function, it may be
-     * safer / easier to use `getEmaPriceNoOlderThan` method.
-     *
-     * At the moment, the confidence interval returned by this method is computed in
-     * a somewhat questionable way, so we do not recommend using it for high-value applications.
-     *
-     * @returns a Price that contains the EMA price and confidence interval along with
-     * the exponent for them, and publish time of the price.
-     */
-    getEmaPriceUnchecked() {
-        return this.emaPrice;
-    }
-    /**
-     * Get the price if it was updated no older than `age` seconds of the current time.
-     *
-     * This function is a sanity-checked version of `getPriceUnchecked` which is useful in
-     * applications that require a sufficiently-recent price. Returns `undefined` if the price
-     * is not recent enough.
-     *
-     * @param age return a price as long as it has been updated within this number of seconds
-     * @returns a Price struct containing the price, confidence interval along with the exponent for
-     * both numbers, and its publish time, or `undefined` if no price update occurred within `age` seconds of the current time.
-     */
-    getPriceNoOlderThan(age) {
-        const price = this.getPriceUnchecked();
-        const currentTime = Math.floor(Date.now() / 1000);
-        // This checks the absolute difference as a sanity check
-        // for the cases that the system time is behind or price
-        // feed timestamp happen to be in the future (a bug).
-        if (Math.abs(currentTime - price.publishTime) > age) {
-            return undefined;
-        }
-        return price;
-    }
-    /**
-     * Get the exponentially-weighted moving average (EMA) price if it was updated no older than
-     * `age` seconds of the current time.
-     *
-     * This function is a sanity-checked version of `getEmaPriceUnchecked` which is useful in
-     * applications that require a sufficiently-recent price. Returns `undefined` if the price
-     * is not recent enough.
-     *
-     * At the moment, the confidence interval returned by this method is computed in
-     * a somewhat questionable way, so we do not recommend using it for high-value applications.
-     *
-     * @param age return a price as long as it has been updated within this number of seconds
-     * @returns a Price struct containing the EMA price, confidence interval along with the exponent for
-     * both numbers, and its publish time, or `undefined` if no price update occurred within `age` seconds of the current time.
-     */
-    getEmaPriceNoOlderThan(age) {
-        const emaPrice = this.getEmaPriceUnchecked();
-        const currentTime = Math.floor(Date.now() / 1000);
-        // This checks the absolute difference as a sanity check
-        // for the cases that the system time is behind or price
-        // feed timestamp happen to be in the future (a bug).
-        if (Math.abs(currentTime - emaPrice.publishTime) > age) {
-            return undefined;
-        }
-        return emaPrice;
-    }
-    /**
-     * Get the price feed metadata.
-     *
-     * @returns a struct containing the attestation time, emitter chain, and the sequence number.
-     * Returns `undefined` if metadata is currently unavailable.
-     */
-    getMetadata() {
-        return this.metadata;
-    }
-    /**
-     * Get the price feed vaa.
-     *
-     * @returns vaa in base64.
-     * Returns `undefined` if vaa is unavailable.
-     */
-    getVAA() {
-        return this.vaa;
-    }
-}

+ 0 - 89
price_service/sdk/js/.tshy-build/esm/schemas/PriceFeed.d.ts

@@ -1,89 +0,0 @@
-/**
- * Represents an aggregate price from Pyth publisher feeds.
- */
-export interface PriceFeed {
-    /**
-     * Exponentially-weighted moving average Price
-     */
-    ema_price: Price;
-    /**
-     * Unique identifier for this price.
-     */
-    id: string;
-    /**
-     * Metadata of the price
-     */
-    metadata?: PriceFeedMetadata;
-    /**
-     * Price
-     */
-    price: Price;
-    /**
-     * VAA of the price
-     */
-    vaa?: string;
-}
-/**
- * Exponentially-weighted moving average Price
- *
- * Represents a Pyth price
- *
- * Price
- */
-export interface Price {
-    /**
-     * Confidence interval around the price.
-     */
-    conf: string;
-    /**
-     * Price exponent.
-     */
-    expo: number;
-    /**
-     * Price.
-     */
-    price: string;
-    /**
-     * Publish Time of the price
-     */
-    publish_time: number;
-}
-/**
- * Metadata of the price
- *
- * Represents metadata of a price feed.
- */
-export interface PriceFeedMetadata {
-    /**
-     * Attestation time of the price
-     */
-    attestation_time?: number;
-    /**
-     * Chain of the emitter
-     */
-    emitter_chain: number;
-    /**
-     * The time that the previous price was published
-     */
-    prev_publish_time?: number;
-    /**
-     * The time that the price service received the price
-     */
-    price_service_receive_time?: number;
-    /**
-     * Sequence number of the price
-     */
-    sequence_number?: number;
-    /**
-     * Pythnet slot number of the price
-     */
-    slot?: number;
-}
-export declare class Convert {
-    static toPriceFeed(json: any): PriceFeed;
-    static priceFeedToJson(value: PriceFeed): any;
-    static toPrice(json: any): Price;
-    static priceToJson(value: Price): any;
-    static toPriceFeedMetadata(json: any): PriceFeedMetadata;
-    static priceFeedMetadataToJson(value: PriceFeedMetadata): any;
-}

+ 0 - 198
price_service/sdk/js/.tshy-build/esm/schemas/PriceFeed.js

@@ -1,198 +0,0 @@
-// To parse this data:
-//
-//   import { Convert, PriceFeed } from "./file";
-//
-//   const priceFeed = Convert.toPriceFeed(json);
-//
-// These functions will throw an error if the JSON doesn't
-// match the expected interface, even if the JSON is valid.
-// Converts JSON types to/from your types
-// and asserts the results at runtime
-export class Convert {
-    static toPriceFeed(json) {
-        return cast(json, r("PriceFeed"));
-    }
-    static priceFeedToJson(value) {
-        return uncast(value, r("PriceFeed"));
-    }
-    static toPrice(json) {
-        return cast(json, r("Price"));
-    }
-    static priceToJson(value) {
-        return uncast(value, r("Price"));
-    }
-    static toPriceFeedMetadata(json) {
-        return cast(json, r("PriceFeedMetadata"));
-    }
-    static priceFeedMetadataToJson(value) {
-        return uncast(value, r("PriceFeedMetadata"));
-    }
-}
-function invalidValue(typ, val, key = "") {
-    if (key) {
-        throw Error(`Invalid value for key "${key}". Expected type ${JSON.stringify(typ)} but got ${JSON.stringify(val)}`);
-    }
-    throw Error(`Invalid value ${JSON.stringify(val)} for type ${JSON.stringify(typ)}`);
-}
-function jsonToJSProps(typ) {
-    if (typ.jsonToJS === undefined) {
-        const map = {};
-        typ.props.forEach((p) => (map[p.json] = { key: p.js, typ: p.typ }));
-        typ.jsonToJS = map;
-    }
-    return typ.jsonToJS;
-}
-function jsToJSONProps(typ) {
-    if (typ.jsToJSON === undefined) {
-        const map = {};
-        typ.props.forEach((p) => (map[p.js] = { key: p.json, typ: p.typ }));
-        typ.jsToJSON = map;
-    }
-    return typ.jsToJSON;
-}
-function transform(val, typ, getProps, key = "") {
-    function transformPrimitive(typ, val) {
-        if (typeof typ === typeof val)
-            return val;
-        return invalidValue(typ, val, key);
-    }
-    function transformUnion(typs, val) {
-        // val must validate against one typ in typs
-        const l = typs.length;
-        for (let i = 0; i < l; i++) {
-            const typ = typs[i];
-            try {
-                return transform(val, typ, getProps);
-            }
-            catch (_) { }
-        }
-        return invalidValue(typs, val);
-    }
-    function transformEnum(cases, val) {
-        if (cases.indexOf(val) !== -1)
-            return val;
-        return invalidValue(cases, val);
-    }
-    function transformArray(typ, val) {
-        // val must be an array with no invalid elements
-        if (!Array.isArray(val))
-            return invalidValue("array", val);
-        return val.map((el) => transform(el, typ, getProps));
-    }
-    function transformDate(val) {
-        if (val === null) {
-            return null;
-        }
-        const d = new Date(val);
-        if (isNaN(d.valueOf())) {
-            return invalidValue("Date", val);
-        }
-        return d;
-    }
-    function transformObject(props, additional, val) {
-        if (val === null || typeof val !== "object" || Array.isArray(val)) {
-            return invalidValue("object", val);
-        }
-        const result = {};
-        Object.getOwnPropertyNames(props).forEach((key) => {
-            const prop = props[key];
-            const v = Object.prototype.hasOwnProperty.call(val, key)
-                ? val[key]
-                : undefined;
-            result[prop.key] = transform(v, prop.typ, getProps, prop.key);
-        });
-        Object.getOwnPropertyNames(val).forEach((key) => {
-            if (!Object.prototype.hasOwnProperty.call(props, key)) {
-                result[key] = transform(val[key], additional, getProps, key);
-            }
-        });
-        return result;
-    }
-    if (typ === "any")
-        return val;
-    if (typ === null) {
-        if (val === null)
-            return val;
-        return invalidValue(typ, val);
-    }
-    if (typ === false)
-        return invalidValue(typ, val);
-    while (typeof typ === "object" && typ.ref !== undefined) {
-        typ = typeMap[typ.ref];
-    }
-    if (Array.isArray(typ))
-        return transformEnum(typ, val);
-    if (typeof typ === "object") {
-        return typ.hasOwnProperty("unionMembers")
-            ? transformUnion(typ.unionMembers, val)
-            : typ.hasOwnProperty("arrayItems")
-                ? transformArray(typ.arrayItems, val)
-                : typ.hasOwnProperty("props")
-                    ? transformObject(getProps(typ), typ.additional, val)
-                    : invalidValue(typ, val);
-    }
-    // Numbers can be parsed by Date but shouldn't be.
-    if (typ === Date && typeof val !== "number")
-        return transformDate(val);
-    return transformPrimitive(typ, val);
-}
-function cast(val, typ) {
-    return transform(val, typ, jsonToJSProps);
-}
-function uncast(val, typ) {
-    return transform(val, typ, jsToJSONProps);
-}
-function a(typ) {
-    return { arrayItems: typ };
-}
-function u(...typs) {
-    return { unionMembers: typs };
-}
-function o(props, additional) {
-    return { props, additional };
-}
-function m(additional) {
-    return { props: [], additional };
-}
-function r(name) {
-    return { ref: name };
-}
-const typeMap = {
-    PriceFeed: o([
-        { json: "ema_price", js: "ema_price", typ: r("Price") },
-        { json: "id", js: "id", typ: "" },
-        {
-            json: "metadata",
-            js: "metadata",
-            typ: u(undefined, r("PriceFeedMetadata")),
-        },
-        { json: "price", js: "price", typ: r("Price") },
-        { json: "vaa", js: "vaa", typ: u(undefined, "") },
-    ], "any"),
-    Price: o([
-        { json: "conf", js: "conf", typ: "" },
-        { json: "expo", js: "expo", typ: 0 },
-        { json: "price", js: "price", typ: "" },
-        { json: "publish_time", js: "publish_time", typ: 0 },
-    ], "any"),
-    PriceFeedMetadata: o([
-        {
-            json: "attestation_time",
-            js: "attestation_time",
-            typ: u(undefined, 0),
-        },
-        { json: "emitter_chain", js: "emitter_chain", typ: 0 },
-        {
-            json: "prev_publish_time",
-            js: "prev_publish_time",
-            typ: u(undefined, 0),
-        },
-        {
-            json: "price_service_receive_time",
-            js: "price_service_receive_time",
-            typ: u(undefined, 0),
-        },
-        { json: "sequence_number", js: "sequence_number", typ: u(undefined, 0) },
-        { json: "slot", js: "slot", typ: u(undefined, 0) },
-    ], "any"),
-};

+ 0 - 96
price_service/sdk/js/.tshy-build/esm/schemas/price_feed.json

@@ -1,96 +0,0 @@
-{
-    "$schema": "http://json-schema.org/draft-07/schema#",
-    "title": "PriceFeed",
-    "description": "Represents an aggregate price from Pyth publisher feeds.",
-    "type": "object",
-    "required": ["id", "price", "ema_price"],
-    "properties": {
-        "id": {
-            "description": "Unique identifier for this price.",
-            "$ref": "#/definitions/Identifier"
-        },
-        "price": {
-            "description": "Price",
-            "$ref": "#/definitions/Price"
-        },
-        "ema_price": {
-            "description": "Exponentially-weighted moving average Price",
-            "$ref": "#/definitions/Price"
-        },
-        "metadata": {
-            "description": "Metadata of the price",
-            "$ref": "#/definitions/PriceFeedMetadata"
-        },
-        "vaa": {
-            "description": "VAA of the price",
-            "$ref": "#/definitions/Identifier"
-        }
-    },
-    "definitions": {
-        "Identifier": {
-            "type": "string"
-        },
-        "Price": {
-            "description": "Represents a Pyth price",
-            "type": "object",
-            "required": ["conf", "expo", "price", "publish_time"],
-            "properties": {
-                "conf": {
-                    "description": "Confidence interval around the price.",
-                    "type": "string"
-                },
-                "expo": {
-                    "description": "Price exponent.",
-                    "type": "integer",
-                    "format": "int32"
-                },
-                "price": {
-                    "description": "Price.",
-                    "type": "string"
-                },
-                "publish_time": {
-                    "description": "Publish Time of the price",
-                    "type": "integer",
-                    "format": "int64"
-                }
-            }
-        },
-        "PriceFeedMetadata": {
-            "description": "Represents metadata of a price feed.",
-            "type": "object",
-            "required": ["emitter_chain"],
-            "properties": {
-                "attestation_time": {
-                    "description": "Attestation time of the price",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "emitter_chain": {
-                    "description": "Chain of the emitter",
-                    "type": "integer",
-                    "format": "int16"
-                },
-                "price_service_receive_time": {
-                    "description": "The time that the price service received the price",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "sequence_number": {
-                    "description": "Sequence number of the price",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "slot": {
-                    "description": "Pythnet slot number of the price",
-                    "type": "integer",
-                    "format": "int64"
-                },
-                "prev_publish_time": {
-                    "description": "The time that the previous price was published",
-                    "type": "integer",
-                    "format": "int64"
-                }
-            }
-        }
-    }
-}

+ 18 - 4
price_service/sdk/js/package.json

@@ -3,8 +3,8 @@
   "version": "1.8.0",
   "description": "Pyth price service SDK",
   "homepage": "https://pyth.network",
-  "main": "lib/index.js",
-  "types": "lib/index.d.ts",
+  "main": "./dist/esm/index.mjs",
+  "types": "./dist/esm/index.d.mts",
   "files": [
     "lib/**/*",
     "dist/**/*"
@@ -15,10 +15,17 @@
     "directory": "price_service/sdk/js"
   },
   "publishConfig": {
-    "access": "public"
+    "access": "public",
+    "exports": {
+      ".": "./dist/esm/index.mjs",
+      "./AccumulatorUpdateData": "./dist/esm/AccumulatorUpdateData.mjs",
+      "./schemas/PriceFeed": "./dist/esm/schemas/PriceFeed.mjs",
+      "./package.json": "./package.json"
+    }
   },
   "scripts": {
     "build": "build-ts-package",
+    "clean": "rm -rf ./dist",
     "gen-ts-schema": "quicktype --src-lang schema src/schemas/price_feed.json -o src/schemas/PriceFeed.ts --raw-type any --converters all-objects && prettier --write \"src/schemas/*.ts\"",
     "test:unit": "jest",
     "test:lint": "eslint src/ --max-warnings 0",
@@ -53,5 +60,12 @@
     "node": ">=22",
     "pnpm": ">=10.19.0"
   },
-  "packageManager": "pnpm@10.19.0"
+  "packageManager": "pnpm@10.19.0",
+  "module": "./dist/esm/index.mjs",
+  "exports": {
+    ".": "./src/index.ts",
+    "./AccumulatorUpdateData": "./src/AccumulatorUpdateData.ts",
+    "./schemas/PriceFeed": "./src/schemas/PriceFeed.ts",
+    "./package.json": "./package.json"
+  }
 }

+ 1 - 1
price_service/sdk/js/tsconfig.build.json

@@ -1,5 +1,5 @@
 {
-  "extends": "tsconfig.json",
+  "extends": "./tsconfig.json",
   "compilerOptions": {
     "noEmit": false,
     "declaration": true,

+ 2 - 10
target_chains/ethereum/entropy_sdk/solidity/package.json

@@ -14,7 +14,7 @@
   "scripts": {
     "test:format": "prettier --check .",
     "fix:format": "prettier --write .",
-    "build": "build-ts-package",
+    "build": "generate-abis IEntropy IEntropyV2 IEntropyConsumer EntropyErrors EntropyEvents EntropyEventsV2 EntropyStructs EntropyStructsV2 EntropyStatusConstants PRNG",
     "test": "git diff --exit-code abis"
   },
   "keywords": [
@@ -32,13 +32,5 @@
     "abi_generator": "workspace:*",
     "prettier": "catalog:",
     "prettier-plugin-solidity": "catalog:"
-  },
-  "engines": {
-    "node": ">=22",
-    "pnpm": ">=10.19.0"
-  },
-  "packageManager": "pnpm@10.19.0",
-  "files": [
-    "dist/**/*"
-  ]
+  }
 }

+ 29 - 0
target_chains/ton/sdk/js/dist/cjs/_virtual/rolldown_runtime.js

@@ -0,0 +1,29 @@
+//#region rolldown:runtime
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __commonJS = (cb, mod) => function() {
+	return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
+};
+var __copyProps = (to, from, except, desc) => {
+	if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
+		key = keys[i];
+		if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
+			get: ((k) => from[k]).bind(null, key),
+			enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
+		});
+	}
+	return to;
+};
+var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
+	value: mod,
+	enumerable: true
+}) : target, mod));
+
+//#endregion
+
+exports.__commonJS = __commonJS;
+exports.__toESM = __toESM;

+ 73 - 0
target_chains/ton/sdk/js/dist/cjs/index.d.ts

@@ -0,0 +1,73 @@
+import { Address, Cell, Contract, Sender } from "@ton/core";
+import { ContractProvider } from "@ton/ton";
+
+//#region src/index.d.ts
+declare const PYTH_CONTRACT_ADDRESS_MAINNET = "EQBgtfuGIzWLiOzpZO48_psYvco4xRtkAbdbmTwy0_o95LtZ";
+declare const PYTH_CONTRACT_ADDRESS_TESTNET = "EQB4ZnrI5qsP_IUJgVJNwEGKLzZWsQOFhiaqDbD7pTt_f9oU";
+declare const UPDATE_PRICE_FEEDS_BASE_GAS = 300000n;
+declare const UPDATE_PRICE_FEEDS_PER_UPDATE_GAS = 90000n;
+declare const GAS_PRICE_FACTOR = 400n;
+interface DataSource {
+  emitterChain: number;
+  emitterAddress: string;
+}
+declare class PythContract implements Contract {
+  readonly address: Address;
+  readonly init?: {
+    code: Cell;
+    data: Cell;
+  } | undefined;
+  constructor(address: Address, init?: {
+    code: Cell;
+    data: Cell;
+  } | undefined);
+  static createFromAddress(address: Address): PythContract;
+  getCurrentGuardianSetIndex(provider: ContractProvider): Promise<number>;
+  sendUpdateGuardianSet(provider: ContractProvider, via: Sender, vm: Buffer): Promise<void>;
+  sendUpdatePriceFeeds(provider: ContractProvider, via: Sender, updateData: Buffer, updateFee: bigint): Promise<void>;
+  sendExecuteGovernanceAction(provider: ContractProvider, via: Sender, governanceAction: Buffer): Promise<void>;
+  sendUpgradeContract(provider: ContractProvider, via: Sender, newCode: Cell): Promise<void>;
+  getPriceUnsafe(provider: ContractProvider, priceFeedId: string): Promise<{
+    price: number;
+    conf: number;
+    expo: number;
+    publishTime: number;
+  }>;
+  getPriceNoOlderThan(provider: ContractProvider, timePeriod: number, priceFeedId: string): Promise<{
+    price: number;
+    conf: number;
+    expo: number;
+    publishTime: number;
+  }>;
+  getEmaPriceUnsafe(provider: ContractProvider, priceFeedId: string): Promise<{
+    price: number;
+    conf: number;
+    expo: number;
+    publishTime: number;
+  }>;
+  getEmaPriceNoOlderThan(provider: ContractProvider, timePeriod: number, priceFeedId: string): Promise<{
+    price: number;
+    conf: number;
+    expo: number;
+    publishTime: number;
+  }>;
+  getUpdateFee(provider: ContractProvider, vm: Buffer): Promise<number>;
+  getSingleUpdateFee(provider: ContractProvider): Promise<number>;
+  getLastExecutedGovernanceSequence(provider: ContractProvider): Promise<number>;
+  getChainId(provider: ContractProvider): Promise<number>;
+  getDataSources(provider: ContractProvider): Promise<DataSource[]>;
+  getGovernanceDataSource(provider: ContractProvider): Promise<DataSource | null>;
+  getGuardianSet(provider: ContractProvider, index: number): Promise<{
+    expirationTime: number;
+    keys: string[];
+    keyCount: number;
+  }>;
+}
+declare function createCellChain(buffer: Buffer): Cell;
+declare function parseDataSources(cell: Cell): DataSource[];
+declare function parseDataSource(cell: Cell): DataSource | null;
+declare function parseGuardianSetKeys(cell: Cell): string[];
+declare function calculateUpdatePriceFeedsFee(numUpdates: bigint): bigint;
+//#endregion
+export { DataSource, GAS_PRICE_FACTOR, PYTH_CONTRACT_ADDRESS_MAINNET, PYTH_CONTRACT_ADDRESS_TESTNET, PythContract, UPDATE_PRICE_FEEDS_BASE_GAS, UPDATE_PRICE_FEEDS_PER_UPDATE_GAS, calculateUpdatePriceFeedsFee, createCellChain, parseDataSource, parseDataSources, parseGuardianSetKeys };
+//# sourceMappingURL=index.d.ts.map

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
target_chains/ton/sdk/js/dist/cjs/index.d.ts.map


+ 214 - 0
target_chains/ton/sdk/js/dist/cjs/index.js

@@ -0,0 +1,214 @@
+const require_rolldown_runtime = require('./_virtual/rolldown_runtime.js');
+const require_index = require('./node_modules/.pnpm/@ton_core@0.59.1_@ton_crypto@3.3.0/node_modules/@ton/core/dist/index.js');
+
+//#region src/index.ts
+var import_dist = /* @__PURE__ */ require_rolldown_runtime.__toESM(require_index.require_dist());
+const PYTH_CONTRACT_ADDRESS_MAINNET = "EQBgtfuGIzWLiOzpZO48_psYvco4xRtkAbdbmTwy0_o95LtZ";
+const PYTH_CONTRACT_ADDRESS_TESTNET = "EQB4ZnrI5qsP_IUJgVJNwEGKLzZWsQOFhiaqDbD7pTt_f9oU";
+const UPDATE_PRICE_FEEDS_BASE_GAS = 300000n;
+const UPDATE_PRICE_FEEDS_PER_UPDATE_GAS = 90000n;
+const GAS_PRICE_FACTOR = 400n;
+var PythContract = class PythContract {
+	constructor(address, init) {
+		this.address = address;
+		this.init = init;
+	}
+	static createFromAddress(address) {
+		return new PythContract(address);
+	}
+	async getCurrentGuardianSetIndex(provider) {
+		return (await provider.get("get_current_guardian_set_index", [])).stack.readNumber();
+	}
+	async sendUpdateGuardianSet(provider, via, vm) {
+		const messageBody = (0, import_dist.beginCell)().storeUint(1, 32).storeRef(createCellChain(vm)).endCell();
+		await provider.internal(via, {
+			value: (0, import_dist.toNano)("0.1"),
+			sendMode: import_dist.SendMode.PAY_GAS_SEPARATELY,
+			body: messageBody
+		});
+	}
+	async sendUpdatePriceFeeds(provider, via, updateData, updateFee) {
+		const messageBody = (0, import_dist.beginCell)().storeUint(2, 32).storeRef(createCellChain(updateData)).endCell();
+		await provider.internal(via, {
+			value: updateFee,
+			sendMode: import_dist.SendMode.PAY_GAS_SEPARATELY,
+			body: messageBody
+		});
+	}
+	async sendExecuteGovernanceAction(provider, via, governanceAction) {
+		const messageBody = (0, import_dist.beginCell)().storeUint(3, 32).storeRef(createCellChain(governanceAction)).endCell();
+		await provider.internal(via, {
+			value: (0, import_dist.toNano)("0.1"),
+			sendMode: import_dist.SendMode.PAY_GAS_SEPARATELY,
+			body: messageBody
+		});
+	}
+	async sendUpgradeContract(provider, via, newCode) {
+		const messageBody = (0, import_dist.beginCell)().storeUint(4, 32).storeRef(newCode).endCell();
+		await provider.internal(via, {
+			value: (0, import_dist.toNano)("0.1"),
+			sendMode: import_dist.SendMode.PAY_GAS_SEPARATELY,
+			body: messageBody
+		});
+	}
+	async getPriceUnsafe(provider, priceFeedId) {
+		const result = await provider.get("get_price_unsafe", [{
+			type: "int",
+			value: BigInt(priceFeedId)
+		}]);
+		return {
+			price: result.stack.readNumber(),
+			conf: result.stack.readNumber(),
+			expo: result.stack.readNumber(),
+			publishTime: result.stack.readNumber()
+		};
+	}
+	async getPriceNoOlderThan(provider, timePeriod, priceFeedId) {
+		const result = await provider.get("get_price_no_older_than", [{
+			type: "int",
+			value: BigInt(timePeriod)
+		}, {
+			type: "int",
+			value: BigInt(priceFeedId)
+		}]);
+		return {
+			price: result.stack.readNumber(),
+			conf: result.stack.readNumber(),
+			expo: result.stack.readNumber(),
+			publishTime: result.stack.readNumber()
+		};
+	}
+	async getEmaPriceUnsafe(provider, priceFeedId) {
+		const result = await provider.get("get_ema_price_unsafe", [{
+			type: "int",
+			value: BigInt(priceFeedId)
+		}]);
+		return {
+			price: result.stack.readNumber(),
+			conf: result.stack.readNumber(),
+			expo: result.stack.readNumber(),
+			publishTime: result.stack.readNumber()
+		};
+	}
+	async getEmaPriceNoOlderThan(provider, timePeriod, priceFeedId) {
+		const result = await provider.get("get_ema_price_no_older_than", [{
+			type: "int",
+			value: BigInt(timePeriod)
+		}, {
+			type: "int",
+			value: BigInt(priceFeedId)
+		}]);
+		return {
+			price: result.stack.readNumber(),
+			conf: result.stack.readNumber(),
+			expo: result.stack.readNumber(),
+			publishTime: result.stack.readNumber()
+		};
+	}
+	async getUpdateFee(provider, vm) {
+		return (await provider.get("get_update_fee", [{
+			type: "slice",
+			cell: createCellChain(vm)
+		}])).stack.readNumber();
+	}
+	async getSingleUpdateFee(provider) {
+		return (await provider.get("get_single_update_fee", [])).stack.readNumber();
+	}
+	async getLastExecutedGovernanceSequence(provider) {
+		return (await provider.get("get_last_executed_governance_sequence", [])).stack.readNumber();
+	}
+	async getChainId(provider) {
+		return (await provider.get("get_chain_id", [])).stack.readNumber();
+	}
+	async getDataSources(provider) {
+		return parseDataSources((await provider.get("get_data_sources", [])).stack.readCell());
+	}
+	async getGovernanceDataSource(provider) {
+		return parseDataSource((await provider.get("get_governance_data_source", [])).stack.readCell());
+	}
+	async getGuardianSet(provider, index) {
+		const result = await provider.get("get_guardian_set", [{
+			type: "int",
+			value: BigInt(index)
+		}]);
+		return {
+			expirationTime: result.stack.readNumber(),
+			keys: parseGuardianSetKeys(result.stack.readCell()),
+			keyCount: result.stack.readNumber()
+		};
+	}
+};
+function createCellChain(buffer) {
+	const chunks = bufferToChunks(buffer, 127);
+	let lastCell = null;
+	for (let i = chunks.length - 1; i >= 0; i--) {
+		const chunk = chunks[i];
+		const cellBuilder = (0, import_dist.beginCell)();
+		const buffer$1 = Buffer.from(chunk);
+		cellBuilder.storeBuffer(buffer$1);
+		if (lastCell) cellBuilder.storeRef(lastCell);
+		lastCell = cellBuilder.endCell();
+	}
+	if (!lastCell) throw new Error("Failed to create cell chain");
+	return lastCell;
+}
+function bufferToChunks(buff, chunkSizeBytes = 127) {
+	const chunks = [];
+	const uint8Array = new Uint8Array(buff.buffer, buff.byteOffset, buff.byteLength);
+	for (let offset = 0; offset < uint8Array.length; offset += chunkSizeBytes) {
+		const remainingBytes = Math.min(chunkSizeBytes, uint8Array.length - offset);
+		const chunk = uint8Array.subarray(offset, offset + remainingBytes);
+		chunks.push(chunk);
+	}
+	return chunks;
+}
+function parseDataSources(cell) {
+	const dataSources = [];
+	const dict = cell.beginParse().loadDictDirect(import_dist.Dictionary.Keys.Uint(8), import_dist.Dictionary.Values.Cell());
+	for (const [, value] of dict) {
+		const dataSource = parseDataSource(value);
+		if (dataSource) dataSources.push(dataSource);
+	}
+	return dataSources;
+}
+function parseDataSource(cell) {
+	const slice = cell.beginParse();
+	if (slice.remainingBits === 0) return null;
+	return {
+		emitterChain: slice.loadUint(16),
+		emitterAddress: slice.loadUintBig(256).toString(16).padStart(64, "0")
+	};
+}
+function parseGuardianSetKeys(cell) {
+	const keys = [];
+	function parseCell(c) {
+		let slice = c.beginParse();
+		while (slice.remainingRefs > 0 || slice.remainingBits >= 160) {
+			if (slice.remainingBits >= 160) {
+				const bitsToSkip = slice.remainingBits - 160;
+				slice = slice.skip(bitsToSkip);
+				const key = slice.loadBits(160);
+				keys.push("0x" + key.toString());
+			}
+			if (slice.remainingRefs > 0) parseCell(slice.loadRef());
+		}
+	}
+	parseCell(cell);
+	return keys;
+}
+function calculateUpdatePriceFeedsFee(numUpdates) {
+	return (UPDATE_PRICE_FEEDS_BASE_GAS + UPDATE_PRICE_FEEDS_PER_UPDATE_GAS * numUpdates) * GAS_PRICE_FACTOR;
+}
+
+//#endregion
+exports.GAS_PRICE_FACTOR = GAS_PRICE_FACTOR;
+exports.PYTH_CONTRACT_ADDRESS_MAINNET = PYTH_CONTRACT_ADDRESS_MAINNET;
+exports.PYTH_CONTRACT_ADDRESS_TESTNET = PYTH_CONTRACT_ADDRESS_TESTNET;
+exports.PythContract = PythContract;
+exports.UPDATE_PRICE_FEEDS_BASE_GAS = UPDATE_PRICE_FEEDS_BASE_GAS;
+exports.UPDATE_PRICE_FEEDS_PER_UPDATE_GAS = UPDATE_PRICE_FEEDS_PER_UPDATE_GAS;
+exports.calculateUpdatePriceFeedsFee = calculateUpdatePriceFeedsFee;
+exports.createCellChain = createCellChain;
+exports.parseDataSource = parseDataSource;
+exports.parseDataSources = parseDataSources;
+exports.parseGuardianSetKeys = parseGuardianSetKeys;

+ 73 - 0
target_chains/ton/sdk/js/dist/esm/index.d.mts

@@ -0,0 +1,73 @@
+import { Address, Cell, Contract, Sender } from "@ton/core";
+import { ContractProvider } from "@ton/ton";
+
+//#region src/index.d.ts
+declare const PYTH_CONTRACT_ADDRESS_MAINNET = "EQBgtfuGIzWLiOzpZO48_psYvco4xRtkAbdbmTwy0_o95LtZ";
+declare const PYTH_CONTRACT_ADDRESS_TESTNET = "EQB4ZnrI5qsP_IUJgVJNwEGKLzZWsQOFhiaqDbD7pTt_f9oU";
+declare const UPDATE_PRICE_FEEDS_BASE_GAS = 300000n;
+declare const UPDATE_PRICE_FEEDS_PER_UPDATE_GAS = 90000n;
+declare const GAS_PRICE_FACTOR = 400n;
+interface DataSource {
+  emitterChain: number;
+  emitterAddress: string;
+}
+declare class PythContract implements Contract {
+  readonly address: Address;
+  readonly init?: {
+    code: Cell;
+    data: Cell;
+  } | undefined;
+  constructor(address: Address, init?: {
+    code: Cell;
+    data: Cell;
+  } | undefined);
+  static createFromAddress(address: Address): PythContract;
+  getCurrentGuardianSetIndex(provider: ContractProvider): Promise<number>;
+  sendUpdateGuardianSet(provider: ContractProvider, via: Sender, vm: Buffer): Promise<void>;
+  sendUpdatePriceFeeds(provider: ContractProvider, via: Sender, updateData: Buffer, updateFee: bigint): Promise<void>;
+  sendExecuteGovernanceAction(provider: ContractProvider, via: Sender, governanceAction: Buffer): Promise<void>;
+  sendUpgradeContract(provider: ContractProvider, via: Sender, newCode: Cell): Promise<void>;
+  getPriceUnsafe(provider: ContractProvider, priceFeedId: string): Promise<{
+    price: number;
+    conf: number;
+    expo: number;
+    publishTime: number;
+  }>;
+  getPriceNoOlderThan(provider: ContractProvider, timePeriod: number, priceFeedId: string): Promise<{
+    price: number;
+    conf: number;
+    expo: number;
+    publishTime: number;
+  }>;
+  getEmaPriceUnsafe(provider: ContractProvider, priceFeedId: string): Promise<{
+    price: number;
+    conf: number;
+    expo: number;
+    publishTime: number;
+  }>;
+  getEmaPriceNoOlderThan(provider: ContractProvider, timePeriod: number, priceFeedId: string): Promise<{
+    price: number;
+    conf: number;
+    expo: number;
+    publishTime: number;
+  }>;
+  getUpdateFee(provider: ContractProvider, vm: Buffer): Promise<number>;
+  getSingleUpdateFee(provider: ContractProvider): Promise<number>;
+  getLastExecutedGovernanceSequence(provider: ContractProvider): Promise<number>;
+  getChainId(provider: ContractProvider): Promise<number>;
+  getDataSources(provider: ContractProvider): Promise<DataSource[]>;
+  getGovernanceDataSource(provider: ContractProvider): Promise<DataSource | null>;
+  getGuardianSet(provider: ContractProvider, index: number): Promise<{
+    expirationTime: number;
+    keys: string[];
+    keyCount: number;
+  }>;
+}
+declare function createCellChain(buffer: Buffer): Cell;
+declare function parseDataSources(cell: Cell): DataSource[];
+declare function parseDataSource(cell: Cell): DataSource | null;
+declare function parseGuardianSetKeys(cell: Cell): string[];
+declare function calculateUpdatePriceFeedsFee(numUpdates: bigint): bigint;
+//#endregion
+export { DataSource, GAS_PRICE_FACTOR, PYTH_CONTRACT_ADDRESS_MAINNET, PYTH_CONTRACT_ADDRESS_TESTNET, PythContract, UPDATE_PRICE_FEEDS_BASE_GAS, UPDATE_PRICE_FEEDS_PER_UPDATE_GAS, calculateUpdatePriceFeedsFee, createCellChain, parseDataSource, parseDataSources, parseGuardianSetKeys };
+//# sourceMappingURL=index.d.mts.map

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
target_chains/ton/sdk/js/dist/esm/index.d.mts.map


+ 203 - 0
target_chains/ton/sdk/js/dist/esm/index.mjs

@@ -0,0 +1,203 @@
+import { Dictionary, SendMode, beginCell, toNano } from "@ton/core";
+
+//#region src/index.ts
+const PYTH_CONTRACT_ADDRESS_MAINNET = "EQBgtfuGIzWLiOzpZO48_psYvco4xRtkAbdbmTwy0_o95LtZ";
+const PYTH_CONTRACT_ADDRESS_TESTNET = "EQB4ZnrI5qsP_IUJgVJNwEGKLzZWsQOFhiaqDbD7pTt_f9oU";
+const UPDATE_PRICE_FEEDS_BASE_GAS = 300000n;
+const UPDATE_PRICE_FEEDS_PER_UPDATE_GAS = 90000n;
+const GAS_PRICE_FACTOR = 400n;
+var PythContract = class PythContract {
+	constructor(address, init) {
+		this.address = address;
+		this.init = init;
+	}
+	static createFromAddress(address) {
+		return new PythContract(address);
+	}
+	async getCurrentGuardianSetIndex(provider) {
+		return (await provider.get("get_current_guardian_set_index", [])).stack.readNumber();
+	}
+	async sendUpdateGuardianSet(provider, via, vm) {
+		const messageBody = beginCell().storeUint(1, 32).storeRef(createCellChain(vm)).endCell();
+		await provider.internal(via, {
+			value: toNano("0.1"),
+			sendMode: SendMode.PAY_GAS_SEPARATELY,
+			body: messageBody
+		});
+	}
+	async sendUpdatePriceFeeds(provider, via, updateData, updateFee) {
+		const messageBody = beginCell().storeUint(2, 32).storeRef(createCellChain(updateData)).endCell();
+		await provider.internal(via, {
+			value: updateFee,
+			sendMode: SendMode.PAY_GAS_SEPARATELY,
+			body: messageBody
+		});
+	}
+	async sendExecuteGovernanceAction(provider, via, governanceAction) {
+		const messageBody = beginCell().storeUint(3, 32).storeRef(createCellChain(governanceAction)).endCell();
+		await provider.internal(via, {
+			value: toNano("0.1"),
+			sendMode: SendMode.PAY_GAS_SEPARATELY,
+			body: messageBody
+		});
+	}
+	async sendUpgradeContract(provider, via, newCode) {
+		const messageBody = beginCell().storeUint(4, 32).storeRef(newCode).endCell();
+		await provider.internal(via, {
+			value: toNano("0.1"),
+			sendMode: SendMode.PAY_GAS_SEPARATELY,
+			body: messageBody
+		});
+	}
+	async getPriceUnsafe(provider, priceFeedId) {
+		const result = await provider.get("get_price_unsafe", [{
+			type: "int",
+			value: BigInt(priceFeedId)
+		}]);
+		return {
+			price: result.stack.readNumber(),
+			conf: result.stack.readNumber(),
+			expo: result.stack.readNumber(),
+			publishTime: result.stack.readNumber()
+		};
+	}
+	async getPriceNoOlderThan(provider, timePeriod, priceFeedId) {
+		const result = await provider.get("get_price_no_older_than", [{
+			type: "int",
+			value: BigInt(timePeriod)
+		}, {
+			type: "int",
+			value: BigInt(priceFeedId)
+		}]);
+		return {
+			price: result.stack.readNumber(),
+			conf: result.stack.readNumber(),
+			expo: result.stack.readNumber(),
+			publishTime: result.stack.readNumber()
+		};
+	}
+	async getEmaPriceUnsafe(provider, priceFeedId) {
+		const result = await provider.get("get_ema_price_unsafe", [{
+			type: "int",
+			value: BigInt(priceFeedId)
+		}]);
+		return {
+			price: result.stack.readNumber(),
+			conf: result.stack.readNumber(),
+			expo: result.stack.readNumber(),
+			publishTime: result.stack.readNumber()
+		};
+	}
+	async getEmaPriceNoOlderThan(provider, timePeriod, priceFeedId) {
+		const result = await provider.get("get_ema_price_no_older_than", [{
+			type: "int",
+			value: BigInt(timePeriod)
+		}, {
+			type: "int",
+			value: BigInt(priceFeedId)
+		}]);
+		return {
+			price: result.stack.readNumber(),
+			conf: result.stack.readNumber(),
+			expo: result.stack.readNumber(),
+			publishTime: result.stack.readNumber()
+		};
+	}
+	async getUpdateFee(provider, vm) {
+		return (await provider.get("get_update_fee", [{
+			type: "slice",
+			cell: createCellChain(vm)
+		}])).stack.readNumber();
+	}
+	async getSingleUpdateFee(provider) {
+		return (await provider.get("get_single_update_fee", [])).stack.readNumber();
+	}
+	async getLastExecutedGovernanceSequence(provider) {
+		return (await provider.get("get_last_executed_governance_sequence", [])).stack.readNumber();
+	}
+	async getChainId(provider) {
+		return (await provider.get("get_chain_id", [])).stack.readNumber();
+	}
+	async getDataSources(provider) {
+		return parseDataSources((await provider.get("get_data_sources", [])).stack.readCell());
+	}
+	async getGovernanceDataSource(provider) {
+		return parseDataSource((await provider.get("get_governance_data_source", [])).stack.readCell());
+	}
+	async getGuardianSet(provider, index) {
+		const result = await provider.get("get_guardian_set", [{
+			type: "int",
+			value: BigInt(index)
+		}]);
+		return {
+			expirationTime: result.stack.readNumber(),
+			keys: parseGuardianSetKeys(result.stack.readCell()),
+			keyCount: result.stack.readNumber()
+		};
+	}
+};
+function createCellChain(buffer) {
+	const chunks = bufferToChunks(buffer, 127);
+	let lastCell = null;
+	for (let i = chunks.length - 1; i >= 0; i--) {
+		const chunk = chunks[i];
+		const cellBuilder = beginCell();
+		const buffer$1 = Buffer.from(chunk);
+		cellBuilder.storeBuffer(buffer$1);
+		if (lastCell) cellBuilder.storeRef(lastCell);
+		lastCell = cellBuilder.endCell();
+	}
+	if (!lastCell) throw new Error("Failed to create cell chain");
+	return lastCell;
+}
+function bufferToChunks(buff, chunkSizeBytes = 127) {
+	const chunks = [];
+	const uint8Array = new Uint8Array(buff.buffer, buff.byteOffset, buff.byteLength);
+	for (let offset = 0; offset < uint8Array.length; offset += chunkSizeBytes) {
+		const remainingBytes = Math.min(chunkSizeBytes, uint8Array.length - offset);
+		const chunk = uint8Array.subarray(offset, offset + remainingBytes);
+		chunks.push(chunk);
+	}
+	return chunks;
+}
+function parseDataSources(cell) {
+	const dataSources = [];
+	const dict = cell.beginParse().loadDictDirect(Dictionary.Keys.Uint(8), Dictionary.Values.Cell());
+	for (const [, value] of dict) {
+		const dataSource = parseDataSource(value);
+		if (dataSource) dataSources.push(dataSource);
+	}
+	return dataSources;
+}
+function parseDataSource(cell) {
+	const slice = cell.beginParse();
+	if (slice.remainingBits === 0) return null;
+	return {
+		emitterChain: slice.loadUint(16),
+		emitterAddress: slice.loadUintBig(256).toString(16).padStart(64, "0")
+	};
+}
+function parseGuardianSetKeys(cell) {
+	const keys = [];
+	function parseCell(c) {
+		let slice = c.beginParse();
+		while (slice.remainingRefs > 0 || slice.remainingBits >= 160) {
+			if (slice.remainingBits >= 160) {
+				const bitsToSkip = slice.remainingBits - 160;
+				slice = slice.skip(bitsToSkip);
+				const key = slice.loadBits(160);
+				keys.push("0x" + key.toString());
+			}
+			if (slice.remainingRefs > 0) parseCell(slice.loadRef());
+		}
+	}
+	parseCell(cell);
+	return keys;
+}
+function calculateUpdatePriceFeedsFee(numUpdates) {
+	return (UPDATE_PRICE_FEEDS_BASE_GAS + UPDATE_PRICE_FEEDS_PER_UPDATE_GAS * numUpdates) * GAS_PRICE_FACTOR;
+}
+
+//#endregion
+export { GAS_PRICE_FACTOR, PYTH_CONTRACT_ADDRESS_MAINNET, PYTH_CONTRACT_ADDRESS_TESTNET, PythContract, UPDATE_PRICE_FEEDS_BASE_GAS, UPDATE_PRICE_FEEDS_PER_UPDATE_GAS, calculateUpdatePriceFeedsFee, createCellChain, parseDataSource, parseDataSources, parseGuardianSetKeys };
+//# sourceMappingURL=index.mjs.map

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
target_chains/ton/sdk/js/dist/esm/index.mjs.map


+ 17 - 4
target_chains/ton/sdk/js/package.json

@@ -6,8 +6,8 @@
   "author": {
     "name": "Pyth Data Association"
   },
-  "main": "lib/index.js",
-  "types": "lib/index.d.ts",
+  "main": "./dist/cjs/index.mjs",
+  "types": "./dist/esm/index.d.mts",
   "files": [
     "lib/**/*",
     "dist/**/*"
@@ -18,7 +18,15 @@
     "directory": "target_chains/ton/sdk/js"
   },
   "publishConfig": {
-    "access": "public"
+    "access": "public",
+    "exports": {
+      ".": {
+        "import": "./dist/esm/index.mjs",
+        "require": "./dist/cjs/index.cjs",
+        "types": "./dist/esm/index.d.ts"
+      },
+      "./package.json": "./package.json"
+    }
   },
   "scripts": {
     "build": "build-ts-package",
@@ -53,5 +61,10 @@
     "node": ">=22",
     "pnpm": ">=10.19.0"
   },
-  "packageManager": "pnpm@10.19.0"
+  "packageManager": "pnpm@10.19.0",
+  "module": "./dist/esm/index.mjs",
+  "exports": {
+    ".": "./src/index.ts",
+    "./package.json": "./package.json"
+  }
 }

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio