Skip to content

Commit

Permalink
fix(target_chains/fuel): update js sdk to properly gen and export typ…
Browse files Browse the repository at this point in the history
…es (#1703)

* fix(target_chains/fuel): update js sdk to properly gen and export types

This change adds type generation to the build path to have them in the
resulting library and also fixes the issues around type exports by
updating the typescript and using `export type *`. The problem was that
the normal `export *` adds a similar export to the produced js file but
there is no module to be exported from in our case.

* fix: update eslint version
  • Loading branch information
ali-bahjati authored Jun 17, 2024
1 parent 5952b9d commit 9a1cca0
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 28 deletions.
38 changes: 19 additions & 19 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions target_chains/fuel/sdk/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pythnetwork/pyth-fuel-js",
"version": "1.0.0",
"version": "1.0.1",
"description": "Pyth Network Fuel Utils in JS",
"homepage": "https://pyth.network",
"author": {
Expand All @@ -22,29 +22,29 @@
"scripts": {
"test": "jest --passWithNoTests",
"usage-example": "ts-node src/examples/usage.ts",
"build": "tsc && copyfiles -u 1 \"src/**/*.d.ts\" lib",
"build": "pnpm run generate-fuel-types && tsc && copyfiles -u 1 \"src/**/*.d.ts\" lib",
"format": "prettier --write \"src/**/*.ts\"",
"lint": "eslint src/",
"prepublishOnly": "pnpm run build && pnpm run test && pnpm run lint",
"preversion": "pnpm run lint",
"version": "pnpm run format && git add -A src",
"generate-fuel-types": "pnpm fuels typegen -i ../../contracts/pyth-contract/out/release/*-abi.json -o ./src/types"
"generate-fuel-types": "pnpm fuels typegen -i ../../contracts/pyth-contract/out/release/*-abi.json -o ./src/types && prettier --write \"./src/types/**/*.ts\""
},
"keywords": [
"pyth",
"oracle"
],
"license": "Apache-2.0",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.21.0",
"@typescript-eslint/parser": "^5.21.0",
"@typescript-eslint/eslint-plugin": "^7.7.0",
"@typescript-eslint/parser": "^7.7.0",
"copyfiles": "^2.4.1",
"eslint": "^8.14.0",
"jest": "^29.4.1",
"prettier": "^2.6.2",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.2",
"typescript": "^4.6.3"
"typescript": "^5.4.5"
},
"dependencies": {
"fuels": "^0.89.2"
Expand Down
2 changes: 1 addition & 1 deletion target_chains/fuel/sdk/js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export const FUEL_ETH_ASSET_ID =

export { PYTH_CONTRACT_ABI };
export * from "./types";
export * from "./types/PythContractAbi";
export type * from "./types/PythContractAbi";
Original file line number Diff line number Diff line change
Expand Up @@ -1868,8 +1868,56 @@ const _abi = {
],
};

const _storageSlots: StorageSlot[] = [];

const _storageSlots: StorageSlot[] = [
{
key: "6294951dcb0a9111a517be5cf4785670ff4e166fb5ab9c33b17e6881b48e964f",
value: "0000000000000000000000000000000000000000000000000000000000000000",
},
{
key: "71217a24656901c411894bb65eb78a828dafa5a6844488ef5024eb5ac0cff79c",
value: "0000000000000000000000000000000000000000000000000000000000000000",
},
{
key: "71217a24656901c411894bb65eb78a828dafa5a6844488ef5024eb5ac0cff79d",
value: "0000000000000000000000000000000000000000000000000000000000000000",
},
{
key: "7f91d1a929dce734e7f930bbb279ccfccdb5474227502ea8845815c74bd930a7",
value: "0000000000000000000000000000000000000000000000000000000000000000",
},
{
key: "8a89a0cce819e0426e565819a9a98711329087da5a802fb16edd223c47fa44ef",
value: "0000000000000000000000000000000000000000000000000000000000000000",
},
{
key: "94b2b70d20da552763c7614981b2a4d984380d7ed4e54c01b28c914e79e44bd5",
value: "0000000000000000000000000000000000000000000000000000000000000000",
},
{
key: "94b2b70d20da552763c7614981b2a4d984380d7ed4e54c01b28c914e79e44bd6",
value: "0000000000000000000000000000000000000000000000000000000000000000",
},
{
key: "a9203bbb8366ca9d708705dce980acbb54d44fb753370ffe4c7d351b46b2abbc",
value: "0000000000000000000000000000000000000000000000000000000000000000",
},
{
key: "b48b753af346966d0d169c0b2e3234611f65d5cfdb57c7b6e7cd6ca93707bee0",
value: "0000000000000000000000000000000000000000000000000000000000000000",
},
{
key: "c7e08cdde76020f08f4ce5c3257422ae67f9676992689b64b85f35aa58752d9e",
value: "0000000000000000000000000000000000000000000000000000000000000000",
},
{
key: "c7e08cdde76020f08f4ce5c3257422ae67f9676992689b64b85f35aa58752d9f",
value: "0000000000000000000000000000000000000000000000000000000000000000",
},
{
key: "d02e07f5a716bd3b6670aaf9a73352164e6b946c24db14f72005b7029e67d96a",
value: "0000000000000000000000000000000000000000000000000000000000000000",
},
];
export const PythContractAbi__factory = {
abi: _abi,

Expand Down

0 comments on commit 9a1cca0

Please sign in to comment.