Skip to content

Commit 9a1cca0

Browse files
authored
fix(target_chains/fuel): update js sdk to properly gen and export types (#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
1 parent 5952b9d commit 9a1cca0

File tree

4 files changed

+76
-28
lines changed

4 files changed

+76
-28
lines changed

pnpm-lock.yaml

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

target_chains/fuel/sdk/js/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pythnetwork/pyth-fuel-js",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Pyth Network Fuel Utils in JS",
55
"homepage": "https://pyth.network",
66
"author": {
@@ -22,29 +22,29 @@
2222
"scripts": {
2323
"test": "jest --passWithNoTests",
2424
"usage-example": "ts-node src/examples/usage.ts",
25-
"build": "tsc && copyfiles -u 1 \"src/**/*.d.ts\" lib",
25+
"build": "pnpm run generate-fuel-types && tsc && copyfiles -u 1 \"src/**/*.d.ts\" lib",
2626
"format": "prettier --write \"src/**/*.ts\"",
2727
"lint": "eslint src/",
2828
"prepublishOnly": "pnpm run build && pnpm run test && pnpm run lint",
2929
"preversion": "pnpm run lint",
3030
"version": "pnpm run format && git add -A src",
31-
"generate-fuel-types": "pnpm fuels typegen -i ../../contracts/pyth-contract/out/release/*-abi.json -o ./src/types"
31+
"generate-fuel-types": "pnpm fuels typegen -i ../../contracts/pyth-contract/out/release/*-abi.json -o ./src/types && prettier --write \"./src/types/**/*.ts\""
3232
},
3333
"keywords": [
3434
"pyth",
3535
"oracle"
3636
],
3737
"license": "Apache-2.0",
3838
"devDependencies": {
39-
"@typescript-eslint/eslint-plugin": "^5.21.0",
40-
"@typescript-eslint/parser": "^5.21.0",
39+
"@typescript-eslint/eslint-plugin": "^7.7.0",
40+
"@typescript-eslint/parser": "^7.7.0",
4141
"copyfiles": "^2.4.1",
4242
"eslint": "^8.14.0",
4343
"jest": "^29.4.1",
4444
"prettier": "^2.6.2",
4545
"ts-jest": "^29.0.5",
4646
"ts-node": "^10.9.2",
47-
"typescript": "^4.6.3"
47+
"typescript": "^5.4.5"
4848
},
4949
"dependencies": {
5050
"fuels": "^0.89.2"

target_chains/fuel/sdk/js/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ export const FUEL_ETH_ASSET_ID =
1010

1111
export { PYTH_CONTRACT_ABI };
1212
export * from "./types";
13-
export * from "./types/PythContractAbi";
13+
export type * from "./types/PythContractAbi";

target_chains/fuel/sdk/js/src/types/factories/PythContractAbi__factory.ts

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,8 +1868,56 @@ const _abi = {
18681868
],
18691869
};
18701870

1871-
const _storageSlots: StorageSlot[] = [];
1872-
1871+
const _storageSlots: StorageSlot[] = [
1872+
{
1873+
key: "6294951dcb0a9111a517be5cf4785670ff4e166fb5ab9c33b17e6881b48e964f",
1874+
value: "0000000000000000000000000000000000000000000000000000000000000000",
1875+
},
1876+
{
1877+
key: "71217a24656901c411894bb65eb78a828dafa5a6844488ef5024eb5ac0cff79c",
1878+
value: "0000000000000000000000000000000000000000000000000000000000000000",
1879+
},
1880+
{
1881+
key: "71217a24656901c411894bb65eb78a828dafa5a6844488ef5024eb5ac0cff79d",
1882+
value: "0000000000000000000000000000000000000000000000000000000000000000",
1883+
},
1884+
{
1885+
key: "7f91d1a929dce734e7f930bbb279ccfccdb5474227502ea8845815c74bd930a7",
1886+
value: "0000000000000000000000000000000000000000000000000000000000000000",
1887+
},
1888+
{
1889+
key: "8a89a0cce819e0426e565819a9a98711329087da5a802fb16edd223c47fa44ef",
1890+
value: "0000000000000000000000000000000000000000000000000000000000000000",
1891+
},
1892+
{
1893+
key: "94b2b70d20da552763c7614981b2a4d984380d7ed4e54c01b28c914e79e44bd5",
1894+
value: "0000000000000000000000000000000000000000000000000000000000000000",
1895+
},
1896+
{
1897+
key: "94b2b70d20da552763c7614981b2a4d984380d7ed4e54c01b28c914e79e44bd6",
1898+
value: "0000000000000000000000000000000000000000000000000000000000000000",
1899+
},
1900+
{
1901+
key: "a9203bbb8366ca9d708705dce980acbb54d44fb753370ffe4c7d351b46b2abbc",
1902+
value: "0000000000000000000000000000000000000000000000000000000000000000",
1903+
},
1904+
{
1905+
key: "b48b753af346966d0d169c0b2e3234611f65d5cfdb57c7b6e7cd6ca93707bee0",
1906+
value: "0000000000000000000000000000000000000000000000000000000000000000",
1907+
},
1908+
{
1909+
key: "c7e08cdde76020f08f4ce5c3257422ae67f9676992689b64b85f35aa58752d9e",
1910+
value: "0000000000000000000000000000000000000000000000000000000000000000",
1911+
},
1912+
{
1913+
key: "c7e08cdde76020f08f4ce5c3257422ae67f9676992689b64b85f35aa58752d9f",
1914+
value: "0000000000000000000000000000000000000000000000000000000000000000",
1915+
},
1916+
{
1917+
key: "d02e07f5a716bd3b6670aaf9a73352164e6b946c24db14f72005b7029e67d96a",
1918+
value: "0000000000000000000000000000000000000000000000000000000000000000",
1919+
},
1920+
];
18731921
export const PythContractAbi__factory = {
18741922
abi: _abi,
18751923

0 commit comments

Comments
 (0)