diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 0aacbff6..5e10af21 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -26,7 +26,7 @@ jobs: - run: cargo install_soroban - uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 18.14.2 cache: 'npm' - run: | mkdir -p .soroban-example-dapp diff --git a/.nvmrc b/.nvmrc index 3c032078..bac88e32 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18 +>=18.14.2 diff --git a/package-lock.json b/package-lock.json index f0439ef0..0f1ca97a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,8 +11,10 @@ "dependencies": { "@radix-ui/react-dialog": "1.0.2", "@stellar/freighter-api": "^1.5.1", + "abundance-token": "file:./.soroban-example-dapp/abundance-client", "axios": "^0.27.2", "bigint-conversion": "^2.4.1", + "crowdfund-contract": "file:./.soroban-example-dapp/crowdfund-client", "humanize-duration": "^3.27.3", "moment": "^2.29.4", "next": "^13.4.4", @@ -28,14 +30,65 @@ "eslint": "^8.14.0", "eslint-config-next": "^13.3.1", "typescript": "5.1.3" + } + }, + ".soroban-example-dapp/abundance-client": { + "name": "abundance-token", + "version": "0.0.0", + "dependencies": { + "@stellar/freighter-api": "1.5.1", + "buffer": "6.0.3", + "soroban-client": "0.9.2" + }, + "devDependencies": { + "typescript": "5.1.6" + } + }, + ".soroban-example-dapp/abundance-client/node_modules/@stellar/freighter-api": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@stellar/freighter-api/-/freighter-api-1.5.1.tgz", + "integrity": "sha512-WEnKEqd+xVLnOq6bJv+fLXod8JQyPjzpOKTpH4g7tG9MM1fmXzD3y2SXJlpCIw8kVqtiC4ynWOlSWX+TKO7KiQ==" + }, + ".soroban-example-dapp/abundance-client/node_modules/typescript": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" }, "engines": { - "node": ">=17", - "npm": ">=8" + "node": ">=14.17" + } + }, + ".soroban-example-dapp/crowdfund-client": { + "version": "0.0.0", + "dependencies": { + "@stellar/freighter-api": "1.5.1", + "buffer": "6.0.3", + "soroban-client": "0.9.2" }, - "optionalDependencies": { - "abundance-token": "*", - "crowdfund-contract": "*" + "devDependencies": { + "typescript": "5.1.6" + } + }, + ".soroban-example-dapp/crowdfund-client/node_modules/@stellar/freighter-api": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@stellar/freighter-api/-/freighter-api-1.5.1.tgz", + "integrity": "sha512-WEnKEqd+xVLnOq6bJv+fLXod8JQyPjzpOKTpH4g7tG9MM1fmXzD3y2SXJlpCIw8kVqtiC4ynWOlSWX+TKO7KiQ==" + }, + ".soroban-example-dapp/crowdfund-client/node_modules/typescript": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -48,11 +101,11 @@ } }, "node_modules/@babel/runtime": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.6.tgz", - "integrity": "sha512-wDb5pWm4WDdF6LFUde3Jl8WzPA+3ZbxYqkC6xAXuD3irdEHN1k0NfTRrJD8ZD378SJ61miMLCqIOXYhd8x+AJQ==", + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.10.tgz", + "integrity": "sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==", "dependencies": { - "regenerator-runtime": "^0.13.11" + "regenerator-runtime": "^0.14.0" }, "engines": { "node": ">=6.9.0" @@ -566,9 +619,9 @@ } }, "node_modules/@rushstack/eslint-patch": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.3.2.tgz", - "integrity": "sha512-V+MvGwaHH03hYhY+k6Ef/xKd6RYlc4q8WBx+2ANmipHJcKuktNcI/NgEsJgdSUF6Lw32njT6OnrRsKYCdgHjYw==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.3.3.tgz", + "integrity": "sha512-0xd7qez0AQ+MbHatZTlI1gu5vkG8r7MYRUJAHPAHJBmGLs16zpkrpAVLvjQKQOqaXPDUBwOiJzNc00znHSCVBw==", "dev": true }, "node_modules/@stellar/freighter-api": { @@ -635,15 +688,15 @@ "devOptional": true }, "node_modules/@typescript-eslint/parser": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.2.1.tgz", - "integrity": "sha512-Ld+uL1kYFU8e6btqBFpsHkwQ35rw30IWpdQxgOqOh4NfxSDH6uCkah1ks8R/RgQqI5hHPXMaLy9fbFseIe+dIg==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.3.0.tgz", + "integrity": "sha512-ibP+y2Gr6p0qsUkhs7InMdXrwldjxZw66wpcQq9/PzAroM45wdwyu81T+7RibNCh8oc0AgrsyCwJByncY0Ongg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.2.1", - "@typescript-eslint/types": "6.2.1", - "@typescript-eslint/typescript-estree": "6.2.1", - "@typescript-eslint/visitor-keys": "6.2.1", + "@typescript-eslint/scope-manager": "6.3.0", + "@typescript-eslint/types": "6.3.0", + "@typescript-eslint/typescript-estree": "6.3.0", + "@typescript-eslint/visitor-keys": "6.3.0", "debug": "^4.3.4" }, "engines": { @@ -663,13 +716,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.2.1.tgz", - "integrity": "sha512-UCqBF9WFqv64xNsIEPfBtenbfodPXsJ3nPAr55mGPkQIkiQvgoWNo+astj9ZUfJfVKiYgAZDMnM6dIpsxUMp3Q==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.3.0.tgz", + "integrity": "sha512-WlNFgBEuGu74ahrXzgefiz/QlVb+qg8KDTpknKwR7hMH+lQygWyx0CQFoUmMn1zDkQjTBBIn75IxtWss77iBIQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.2.1", - "@typescript-eslint/visitor-keys": "6.2.1" + "@typescript-eslint/types": "6.3.0", + "@typescript-eslint/visitor-keys": "6.3.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -680,9 +733,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.2.1.tgz", - "integrity": "sha512-528bGcoelrpw+sETlyM91k51Arl2ajbNT9L4JwoXE2dvRe1yd8Q64E4OL7vHYw31mlnVsf+BeeLyAZUEQtqahQ==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.3.0.tgz", + "integrity": "sha512-K6TZOvfVyc7MO9j60MkRNWyFSf86IbOatTKGrpTQnzarDZPYPVy0oe3myTMq7VjhfsUAbNUW8I5s+2lZvtx1gg==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -693,13 +746,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.2.1.tgz", - "integrity": "sha512-G+UJeQx9AKBHRQBpmvr8T/3K5bJa485eu+4tQBxFq0KoT22+jJyzo1B50JDT9QdC1DEmWQfdKsa8ybiNWYsi0Q==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.3.0.tgz", + "integrity": "sha512-Xh4NVDaC4eYKY4O3QGPuQNp5NxBAlEvNQYOqJquR2MePNxO11E5K3t5x4M4Mx53IZvtpW+mBxIT0s274fLUocg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.2.1", - "@typescript-eslint/visitor-keys": "6.2.1", + "@typescript-eslint/types": "6.3.0", + "@typescript-eslint/visitor-keys": "6.3.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -720,12 +773,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.2.1.tgz", - "integrity": "sha512-iTN6w3k2JEZ7cyVdZJTVJx2Lv7t6zFA8DCrJEHD2mwfc16AEvvBWVhbFh34XyG2NORCd0viIgQY1+u7kPI0WpA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.3.0.tgz", + "integrity": "sha512-kEhRRj7HnvaSjux1J9+7dBen15CdWmDnwrpyiHsFX6Qx2iW5LOBUgNefOFeh2PjWPlNwN8TOn6+4eBU3J/gupw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.2.1", + "@typescript-eslint/types": "6.3.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -736,6 +789,10 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/abundance-token": { + "resolved": ".soroban-example-dapp/abundance-client", + "link": true + }, "node_modules/acorn": { "version": "8.10.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", @@ -1408,6 +1465,10 @@ "node": ">= 8" } }, + "node_modules/crowdfund-contract": { + "resolved": ".soroban-example-dapp/crowdfund-client", + "link": true + }, "node_modules/crypto-browserify": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", @@ -1830,9 +1891,9 @@ } }, "node_modules/eslint-import-resolver-node": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.8.tgz", - "integrity": "sha512-tEe+Pok22qIGaK3KoMP+N96GVDS66B/zreoVVmiavLvRUEmGRtvb4B8wO9jwnb8d2lvHtrkhZ7UD73dWBVnf/Q==", + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "dev": true, "dependencies": { "debug": "^3.2.7", @@ -4042,9 +4103,9 @@ } }, "node_modules/regenerator-runtime": { - "version": "0.13.11", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" }, "node_modules/regexp.prototype.flags": { "version": "1.5.0", @@ -5008,6 +5069,9 @@ "funding": { "url": "https://github.com/sponsors/colinhacks" } + }, + "soroban-example-dapp/crowdfund-client": { + "extraneous": true } } } diff --git a/package.json b/package.json index d8d7c061..b6d0eef2 100644 --- a/package.json +++ b/package.json @@ -10,13 +10,15 @@ "setup": "./initialize.sh ${NETWORK:-futurenet} && npm install", "clean": "rm -rf .next .soroban .soroban-example-dapp", "reset": "npm run clean && npm run setup", - "postinstall": "cargo build --target wasm32-unknown-unknown --release && ./target/bin/soroban contract bindings typescript --wasm ./target/wasm32-unknown-unknown/release/soroban_crowdfund_contract.wasm --id $(cat ./.soroban-example-dapp/crowdfund_id) --output-dir ./node_modules/crowdfund-contract --network $(cat ./.soroban-example-dapp/network) --contract-name crowdfund-contract && ./target/bin/soroban contract bindings typescript --wasm ./target/wasm32-unknown-unknown/release/abundance_token.wasm --id $(cat ./.soroban-example-dapp/abundance_token_id) --output-dir ./node_modules/abundance-token --network $(cat ./.soroban-example-dapp/network) --contract-name abundance-token" + "preinstall": "cargo build --target wasm32-unknown-unknown --release && ./target/bin/soroban contract bindings typescript --wasm ./target/wasm32-unknown-unknown/release/soroban_crowdfund_contract.wasm --id $(cat ./.soroban-example-dapp/crowdfund_id) --output-dir ./.soroban-example-dapp/crowdfund-client --network $(cat ./.soroban-example-dapp/network) --contract-name crowdfund-contract && ./target/bin/soroban contract bindings typescript --wasm ./target/wasm32-unknown-unknown/release/abundance_token.wasm --id $(cat ./.soroban-example-dapp/abundance_token_id) --output-dir ./.soroban-example-dapp/abundance-client --network $(cat ./.soroban-example-dapp/network) --contract-name abundance-token" }, "dependencies": { "@radix-ui/react-dialog": "1.0.2", "@stellar/freighter-api": "^1.5.1", + "abundance-token": "file:./.soroban-example-dapp/abundance-client", "axios": "^0.27.2", "bigint-conversion": "^2.4.1", + "crowdfund-contract": "file:./.soroban-example-dapp/crowdfund-client", "humanize-duration": "^3.27.3", "moment": "^2.29.4", "next": "^13.4.4", @@ -33,12 +35,8 @@ "eslint-config-next": "^13.3.1", "typescript": "5.1.3" }, - "optionalDependencies": { - "crowdfund-contract": "*", - "abundance-token": "*" - }, "engines": { - "node": ">=17", - "npm": ">=8" + "node": ">=18.14.2", + "npm": ">=9.5.0" } }