Procházet zdrojové kódy

chore(target_chains/fuel): update sdk to use the latest abi (#1795)

* update fuel js sdk

* remove strict engine
Daniel Chew před 1 rokem
rodič
revize
63e528b7d2

+ 0 - 1
.npmrc

@@ -1,2 +1 @@
-engine-strict=true
 package-manager-strict=true

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 532 - 5
pnpm-lock.yaml


+ 2 - 4
target_chains/fuel/sdk/js/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@pythnetwork/pyth-fuel-js",
-  "version": "1.0.1",
+  "version": "1.0.2",
   "description": "Pyth Network Fuel Utils in JS",
   "homepage": "https://pyth.network",
   "author": {
@@ -20,7 +20,6 @@
     "access": "public"
   },
   "scripts": {
-    "test": "jest --passWithNoTests",
     "usage-example": "ts-node src/examples/usage.ts",
     "build": "pnpm run generate-fuel-types && tsc && copyfiles -u 1 \"src/**/*.d.ts\" lib",
     "format": "prettier --write \"src/**/*.ts\"",
@@ -42,11 +41,10 @@
     "eslint": "^8.14.0",
     "jest": "^29.4.1",
     "prettier": "^2.6.2",
-    "ts-jest": "^29.0.5",
     "ts-node": "^10.9.2",
     "typescript": "^5.4.5"
   },
   "dependencies": {
-    "fuels": "^0.89.2"
+    "fuels": "^0.92.1"
   }
 }

+ 1 - 1
target_chains/fuel/sdk/js/src/abi/pyth-contract-abi.json

@@ -1838,7 +1838,7 @@
         "type": 6,
         "typeArguments": []
       },
-      "offset": 129616
+      "offset": 117008
     }
   ]
 }

+ 1 - 1
target_chains/fuel/sdk/js/src/index.ts

@@ -2,7 +2,7 @@ import PYTH_CONTRACT_ABI from "./abi/pyth-contract-abi.json";
 
 /** Address of the Pyth contract on Fuel Sepolia (testnet). */
 export const PYTH_CONTRACT_ADDRESS_SEPOLIA =
-  "0xdf202803b7a452a1ed2e09291731dbac5ceb13d036de3a9a31f74e6057c909af";
+  "0x1ab91bc1402a187055d3e827017ace566a103ce2a4126517da5d656d6a436aea";
 
 /** Asset ID of ETH on Fuel. */
 export const FUEL_ETH_ASSET_ID =

+ 4 - 223
target_chains/fuel/sdk/js/src/types/PythContractAbi.d.ts

@@ -4,9 +4,9 @@
 /* eslint-disable */
 
 /*
-  Fuels version: 0.89.2
-  Forc version: 0.60.0
-  Fuel-Core version: 0.27.0
+  Fuels version: 0.92.1
+  Forc version: 0.61.2
+  Fuel-Core version: 0.31.0
 */
 
 import type {
@@ -19,6 +19,7 @@ import type {
   FunctionFragment,
   Interface,
   InvokeFunction,
+  StrSlice,
 } from "fuels";
 
 import type { Enum, Vec } from "./common";
@@ -383,226 +384,6 @@ interface PythContractAbiInterface extends Interface {
     execute_governance_instruction: FunctionFragment;
     governance_data_source: FunctionFragment;
   };
-
-  encodeFunctionData(functionFragment: "owner", values: []): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "ema_price",
-    values: [string]
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "ema_price_no_older_than",
-    values: [BigNumberish, string]
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "ema_price_unsafe",
-    values: [string]
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "parse_price_feed_updates",
-    values: [BigNumberish, BigNumberish, Vec<string>, Vec<Bytes>]
-  ): Uint8Array;
-  encodeFunctionData(functionFragment: "price", values: [string]): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "price_no_older_than",
-    values: [BigNumberish, string]
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "price_unsafe",
-    values: [string]
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "update_fee",
-    values: [Vec<Bytes>]
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "update_price_feeds",
-    values: [Vec<Bytes>]
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "update_price_feeds_if_necessary",
-    values: [Vec<string>, Vec<BigNumberish>, Vec<Bytes>]
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "valid_time_period",
-    values: []
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "constructor",
-    values: [
-      Vec<DataSourceInput>,
-      DataSourceInput,
-      DataSourceInput,
-      BigNumberish,
-      BigNumberish,
-      Vec<string>,
-      BigNumberish,
-      BigNumberish
-    ]
-  ): Uint8Array;
-  encodeFunctionData(functionFragment: "chain_id", values: []): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "is_valid_data_source",
-    values: [DataSourceInput]
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "last_executed_governance_sequence",
-    values: []
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "latest_publish_time",
-    values: [string]
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "price_feed_exists",
-    values: [string]
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "price_feed_unsafe",
-    values: [string]
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "single_update_fee",
-    values: []
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "valid_data_sources",
-    values: []
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "current_guardian_set_index",
-    values: []
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "current_wormhole_provider",
-    values: []
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "governance_action_is_consumed",
-    values: [string]
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "guardian_set",
-    values: [BigNumberish]
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "submit_new_guardian_set",
-    values: [Bytes]
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "execute_governance_instruction",
-    values: [Bytes]
-  ): Uint8Array;
-  encodeFunctionData(
-    functionFragment: "governance_data_source",
-    values: []
-  ): Uint8Array;
-
-  decodeFunctionData(functionFragment: "owner", data: BytesLike): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "ema_price",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "ema_price_no_older_than",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "ema_price_unsafe",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "parse_price_feed_updates",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(functionFragment: "price", data: BytesLike): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "price_no_older_than",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "price_unsafe",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "update_fee",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "update_price_feeds",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "update_price_feeds_if_necessary",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "valid_time_period",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "constructor",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "chain_id",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "is_valid_data_source",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "last_executed_governance_sequence",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "latest_publish_time",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "price_feed_exists",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "price_feed_unsafe",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "single_update_fee",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "valid_data_sources",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "current_guardian_set_index",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "current_wormhole_provider",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "governance_action_is_consumed",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "guardian_set",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "submit_new_guardian_set",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "execute_governance_instruction",
-    data: BytesLike
-  ): DecodedValue;
-  decodeFunctionData(
-    functionFragment: "governance_data_source",
-    data: BytesLike
-  ): DecodedValue;
 }
 
 export class PythContractAbi extends Contract {

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 3 - 3
target_chains/fuel/sdk/js/src/types/PythContractAbi.hex.ts


+ 3 - 3
target_chains/fuel/sdk/js/src/types/common.d.ts

@@ -4,9 +4,9 @@
 /* eslint-disable */
 
 /*
-  Fuels version: 0.89.2
-  Forc version: 0.60.0
-  Fuel-Core version: 0.27.0
+  Fuels version: 0.92.1
+  Forc version: 0.61.2
+  Fuel-Core version: 0.31.0
 */
 
 /**

+ 19 - 20
target_chains/fuel/sdk/js/src/types/factories/PythContractAbi__factory.ts

@@ -4,9 +4,9 @@
 /* eslint-disable */
 
 /*
-  Fuels version: 0.89.2
-  Forc version: 0.60.0
-  Fuel-Core version: 0.27.0
+  Fuels version: 0.92.1
+  Forc version: 0.61.2
+  Fuel-Core version: 0.31.0
 */
 
 import { Interface, Contract, ContractFactory } from "fuels";
@@ -17,6 +17,7 @@ import type {
   BytesLike,
   DeployContractOptions,
   StorageSlot,
+  DeployContractResult,
 } from "fuels";
 import type {
   PythContractAbi,
@@ -1863,58 +1864,58 @@ const _abi = {
         type: 6,
         typeArguments: [],
       },
-      offset: 129616,
+      offset: 117008,
     },
   ],
 };
 
 const _storageSlots: StorageSlot[] = [
   {
-    key: "6294951dcb0a9111a517be5cf4785670ff4e166fb5ab9c33b17e6881b48e964f",
+    key: "11672498f6e54d64f7c94ceafab63ce9c33b957b083d82f9301e18c4bbcdd43e",
     value: "0000000000000000000000000000000000000000000000000000000000000000",
   },
   {
-    key: "71217a24656901c411894bb65eb78a828dafa5a6844488ef5024eb5ac0cff79c",
+    key: "1fea2a1870fafe58b3f658d2a10d75f7d4b599036bb925958e3650097753f03f",
     value: "0000000000000000000000000000000000000000000000000000000000000000",
   },
   {
-    key: "71217a24656901c411894bb65eb78a828dafa5a6844488ef5024eb5ac0cff79d",
+    key: "1fea2a1870fafe58b3f658d2a10d75f7d4b599036bb925958e3650097753f040",
     value: "0000000000000000000000000000000000000000000000000000000000000000",
   },
   {
-    key: "7f91d1a929dce734e7f930bbb279ccfccdb5474227502ea8845815c74bd930a7",
+    key: "1feab27058c4ed60cb36c15c123efafc983fdbc10f4cfac4f1b23fdb8c36fb7d",
     value: "0000000000000000000000000000000000000000000000000000000000000000",
   },
   {
-    key: "8a89a0cce819e0426e565819a9a98711329087da5a802fb16edd223c47fa44ef",
+    key: "1feab27058c4ed60cb36c15c123efafc983fdbc10f4cfac4f1b23fdb8c36fb7e",
     value: "0000000000000000000000000000000000000000000000000000000000000000",
   },
   {
-    key: "94b2b70d20da552763c7614981b2a4d984380d7ed4e54c01b28c914e79e44bd5",
+    key: "2978ac0e4bdc20e0a96c04e8adb0639e5efdff01601aa4f7887421e795e4b96a",
     value: "0000000000000000000000000000000000000000000000000000000000000000",
   },
   {
-    key: "94b2b70d20da552763c7614981b2a4d984380d7ed4e54c01b28c914e79e44bd6",
+    key: "357565afd3b58fa5509545cd95377655dcb331b733af6f4439699d27dcf450eb",
     value: "0000000000000000000000000000000000000000000000000000000000000000",
   },
   {
-    key: "a9203bbb8366ca9d708705dce980acbb54d44fb753370ffe4c7d351b46b2abbc",
+    key: "358560d9e39bf0d62ad9ffeba18c167b0e4e6722c6eb24f55cbc64054c51b905",
     value: "0000000000000000000000000000000000000000000000000000000000000000",
   },
   {
-    key: "b48b753af346966d0d169c0b2e3234611f65d5cfdb57c7b6e7cd6ca93707bee0",
+    key: "358560d9e39bf0d62ad9ffeba18c167b0e4e6722c6eb24f55cbc64054c51b906",
     value: "0000000000000000000000000000000000000000000000000000000000000000",
   },
   {
-    key: "c7e08cdde76020f08f4ce5c3257422ae67f9676992689b64b85f35aa58752d9e",
+    key: "480744474aef380dda93aae5f17de10f991ca301c7ae8a925ab40229da966cf8",
     value: "0000000000000000000000000000000000000000000000000000000000000000",
   },
   {
-    key: "c7e08cdde76020f08f4ce5c3257422ae67f9676992689b64b85f35aa58752d9f",
+    key: "d16fb5609ac0a5d5c45145524cbd88ae218f3be85b76bb42239b7eb916305d6d",
     value: "0000000000000000000000000000000000000000000000000000000000000000",
   },
   {
-    key: "d02e07f5a716bd3b6670aaf9a73352164e6b946c24db14f72005b7029e67d96a",
+    key: "f9e12c6c1c57daf9e6a5ff000b582628bec999880e26917559121db757ba5653",
     value: "0000000000000000000000000000000000000000000000000000000000000000",
   },
 ];
@@ -1942,14 +1943,12 @@ export const PythContractAbi__factory = {
     bytecode: BytesLike,
     wallet: Account,
     options: DeployContractOptions = {}
-  ): Promise<PythContractAbi> {
+  ): Promise<DeployContractResult<PythContractAbi>> {
     const factory = new ContractFactory(bytecode, _abi, wallet);
 
-    const contract = await factory.deployContract({
+    return factory.deployContract<PythContractAbi>({
       storageSlots: _storageSlots,
       ...options,
     });
-
-    return contract as unknown as PythContractAbi;
   },
 };

+ 3 - 3
target_chains/fuel/sdk/js/src/types/index.ts

@@ -4,9 +4,9 @@
 /* eslint-disable */
 
 /*
-  Fuels version: 0.89.2
-  Forc version: 0.60.0
-  Fuel-Core version: 0.27.0
+  Fuels version: 0.92.1
+  Forc version: 0.61.2
+  Fuel-Core version: 0.31.0
 */
 
 export type { PythContractAbi } from "./PythContractAbi";

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů