create-near-app 8.2.0 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +11 -1
- package/dist/make.js +23 -1
- package/dist/messages.js +68 -29
- package/dist/tracking.js +1 -1
- package/dist/types.js +1 -1
- package/dist/user-input.js +1 -0
- package/dist/utils/checkCargoNear.js +15 -0
- package/dist/utils/donwloadFile.js +25 -0
- package/dist/utils/index.js +11 -0
- package/package.json +1 -1
- package/templates/contracts/py/.python-version +1 -0
- package/templates/contracts/py/README.md +74 -0
- package/templates/contracts/py/contract.py +31 -0
- package/templates/contracts/py/pyproject.toml +10 -0
- package/templates/contracts/py/tests/test_mod.py +53 -0
- package/templates/contracts/py/uv.lock +878 -0
- package/templates/contracts/rs/.github/workflows/deploy-production.yml +2 -4
- package/templates/contracts/rs/.github/workflows/deploy-staging.yml +4 -8
- package/templates/contracts/rs/.github/workflows/test.yml +2 -0
- package/templates/contracts/rs/.github/workflows/undeploy-staging.yml +2 -4
- package/templates/contracts/rs/Cargo.toml +15 -9
- package/templates/contracts/rs/README.md +6 -0
- package/templates/contracts/rs/rust-toolchain.toml +2 -2
- package/templates/frontend/next-app/package.json +19 -18
- package/templates/frontend/next-app/src/wallets/web3modal.js +0 -7
- package/templates/frontend/next-page/package.json +19 -18
- package/templates/frontend/next-page/src/wallets/web3modal.js +0 -7
- package/templates/frontend/vite-react/package.json +2 -1
- package/templates/frontend/vite-react/src/wallets/web3modal.js +0 -7
- package/templates/contracts/rs/Cargo.lock +0 -4348
|
@@ -15,13 +15,11 @@ jobs:
|
|
|
15
15
|
- name: Checkout repository
|
|
16
16
|
uses: actions/checkout@v4
|
|
17
17
|
- name: Install cargo-near CLI
|
|
18
|
-
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/download/cargo-near-
|
|
18
|
+
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/latest/download/cargo-near-installer.sh | sh
|
|
19
19
|
- name: Deploy to production
|
|
20
20
|
run: |
|
|
21
21
|
cargo near deploy build-reproducible-wasm "${{ vars.NEAR_CONTRACT_PRODUCTION_ACCOUNT_ID }}" \
|
|
22
22
|
without-init-call \
|
|
23
23
|
network-config "${{ vars.NEAR_CONTRACT_PRODUCTION_NETWORK }}" \
|
|
24
|
-
sign-with-plaintext-private-key \
|
|
25
|
-
--signer-public-key "${{ vars.NEAR_CONTRACT_PRODUCTION_ACCOUNT_PUBLIC_KEY }}" \
|
|
26
|
-
--signer-private-key "${{ secrets.NEAR_CONTRACT_PRODUCTION_ACCOUNT_PRIVATE_KEY }}" \
|
|
24
|
+
sign-with-plaintext-private-key "${{ secrets.NEAR_CONTRACT_PRODUCTION_ACCOUNT_PRIVATE_KEY }}" \
|
|
27
25
|
send
|
|
@@ -20,7 +20,7 @@ jobs:
|
|
|
20
20
|
uses: actions/checkout@v4
|
|
21
21
|
|
|
22
22
|
- name: Install near CLI
|
|
23
|
-
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/download/v0.
|
|
23
|
+
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/download/v0.20.0/near-cli-rs-installer.sh | sh
|
|
24
24
|
- name: Create staging account
|
|
25
25
|
if: github.event.action == 'opened' || github.event.action == 'reopened'
|
|
26
26
|
run: |
|
|
@@ -28,13 +28,11 @@ jobs:
|
|
|
28
28
|
use-manually-provided-public-key "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_PUBLIC_KEY }}" \
|
|
29
29
|
sign-as "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_ID }}" \
|
|
30
30
|
network-config "${{ vars.NEAR_CONTRACT_STAGING_NETWORK }}" \
|
|
31
|
-
sign-with-plaintext-private-key \
|
|
32
|
-
--signer-public-key "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_PUBLIC_KEY }}" \
|
|
33
|
-
--signer-private-key "${{ secrets.NEAR_CONTRACT_STAGING_ACCOUNT_PRIVATE_KEY }}" \
|
|
31
|
+
sign-with-plaintext-private-key "${{ secrets.NEAR_CONTRACT_STAGING_ACCOUNT_PRIVATE_KEY }}" \
|
|
34
32
|
send
|
|
35
33
|
|
|
36
34
|
- name: Install cargo-near CLI
|
|
37
|
-
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/download/cargo-near-
|
|
35
|
+
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/latest/download/cargo-near-installer.sh | sh
|
|
38
36
|
- name: Deploy to staging
|
|
39
37
|
# `--skip-git-remote-check` was used
|
|
40
38
|
# as pull request git refs `refs/pull/NUMBER/merge` are somewhat harder to access and live only as long as PRs do
|
|
@@ -44,9 +42,7 @@ jobs:
|
|
|
44
42
|
cargo near deploy build-reproducible-wasm --skip-git-remote-check "${{ env.NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID }}" \
|
|
45
43
|
without-init-call \
|
|
46
44
|
network-config "${{ vars.NEAR_CONTRACT_STAGING_NETWORK }}" \
|
|
47
|
-
sign-with-plaintext-private-key \
|
|
48
|
-
--signer-public-key "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_PUBLIC_KEY }}" \
|
|
49
|
-
--signer-private-key "${{ secrets.NEAR_CONTRACT_STAGING_ACCOUNT_PRIVATE_KEY }}" \
|
|
45
|
+
sign-with-plaintext-private-key "${{ secrets.NEAR_CONTRACT_STAGING_ACCOUNT_PRIVATE_KEY }}" \
|
|
50
46
|
send
|
|
51
47
|
|
|
52
48
|
- name: Comment on pull request
|
|
@@ -28,5 +28,7 @@ jobs:
|
|
|
28
28
|
steps:
|
|
29
29
|
- name: Checkout repository
|
|
30
30
|
uses: actions/checkout@v4
|
|
31
|
+
- name: Install cargo-near CLI
|
|
32
|
+
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/download/cargo-near-vcargo-near-new-ci-tool-version-self/cargo-near-installer.sh | sh
|
|
31
33
|
- name: Run cargo test
|
|
32
34
|
run: cargo test
|
|
@@ -13,13 +13,11 @@ jobs:
|
|
|
13
13
|
- name: Checkout repository
|
|
14
14
|
uses: actions/checkout@v4
|
|
15
15
|
- name: Install near CLI
|
|
16
|
-
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/download/v0.
|
|
16
|
+
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/download/v0.20.0/near-cli-rs-installer.sh | sh
|
|
17
17
|
- name: Remove staging account
|
|
18
18
|
run: |
|
|
19
19
|
near account delete-account "${{ env.NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID }}" \
|
|
20
20
|
beneficiary "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_ID }}" \
|
|
21
21
|
network-config "${{ vars.NEAR_CONTRACT_STAGING_NETWORK }}" \
|
|
22
|
-
sign-with-plaintext-private-key \
|
|
23
|
-
--signer-public-key "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_PUBLIC_KEY }}" \
|
|
24
|
-
--signer-private-key "${{ secrets.NEAR_CONTRACT_STAGING_ACCOUNT_PRIVATE_KEY }}" \
|
|
22
|
+
sign-with-plaintext-private-key "${{ secrets.NEAR_CONTRACT_STAGING_ACCOUNT_PRIVATE_KEY }}" \
|
|
25
23
|
send
|
|
@@ -11,30 +11,36 @@ repository = "https://github.com/<xxx>/<xxx>"
|
|
|
11
11
|
[lib]
|
|
12
12
|
crate-type = ["cdylib", "rlib"]
|
|
13
13
|
|
|
14
|
-
# fields to configure build with WASM reproducibility, according to specs
|
|
15
|
-
# in https://github.com/near/NEPs/blob/master/neps/nep-0330.md
|
|
14
|
+
# fields to configure build with WASM reproducibility, according to specs
|
|
15
|
+
# in https://github.com/near/NEPs/blob/master/neps/nep-0330.md
|
|
16
16
|
[package.metadata.near.reproducible_build]
|
|
17
17
|
# docker image, descriptor of build environment
|
|
18
|
-
image = "sourcescan/cargo-near:0.
|
|
18
|
+
image = "sourcescan/cargo-near:0.16.0-rust-1.86.0"
|
|
19
19
|
# tag after colon above serves only descriptive purpose; image is identified by digest
|
|
20
|
-
image_digest = "sha256:
|
|
20
|
+
image_digest = "sha256:3220302ebb7036c1942e772810f21edd9381edf9a339983da43487c77fbad488"
|
|
21
21
|
# list of environment variables names, whose values, if set, will be used as external build parameters
|
|
22
22
|
# in a reproducible manner
|
|
23
23
|
# supported by `sourcescan/cargo-near:0.10.1-rust-1.82.0` image or later images
|
|
24
24
|
passed_env = []
|
|
25
|
-
# build command inside of docker container
|
|
25
|
+
# build command inside of docker container
|
|
26
26
|
# if docker image from default gallery is used https://hub.docker.com/r/sourcescan/cargo-near/tags,
|
|
27
27
|
# the command may be any combination of flags of `cargo-near`,
|
|
28
28
|
# supported by respective version of binary inside the container besides `--no-locked` flag
|
|
29
|
-
container_build_command = [
|
|
29
|
+
container_build_command = [
|
|
30
|
+
"cargo",
|
|
31
|
+
"near",
|
|
32
|
+
"build",
|
|
33
|
+
"non-reproducible-wasm",
|
|
34
|
+
"--locked",
|
|
35
|
+
]
|
|
30
36
|
|
|
31
37
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
32
38
|
[dependencies]
|
|
33
|
-
near-sdk = "5.
|
|
39
|
+
near-sdk = "5.14"
|
|
34
40
|
|
|
35
41
|
[dev-dependencies]
|
|
36
|
-
near-sdk = { version = "5.
|
|
37
|
-
near-workspaces = { version = "0.
|
|
42
|
+
near-sdk = { version = "5.14", features = ["unit-testing"] }
|
|
43
|
+
near-workspaces = { version = "0.20", features = ["unstable"] }
|
|
38
44
|
tokio = { version = "1.12.0", features = ["full"] }
|
|
39
45
|
serde_json = "1"
|
|
40
46
|
|
|
@@ -21,6 +21,12 @@ cargo test
|
|
|
21
21
|
Deployment is automated with GitHub Actions CI/CD pipeline.
|
|
22
22
|
To deploy manually, install [`cargo-near`](https://github.com/near/cargo-near) and run:
|
|
23
23
|
|
|
24
|
+
If you deploy for debugging purposes:
|
|
25
|
+
```bash
|
|
26
|
+
cargo near deploy build-non-reproducible-wasm <account-id>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
If you deploy a production ready smart contract:
|
|
24
30
|
```bash
|
|
25
31
|
cargo near deploy build-reproducible-wasm <account-id>
|
|
26
32
|
```
|
|
@@ -12,29 +12,30 @@
|
|
|
12
12
|
"lint": "next lint"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@near-wallet-selector/bitte-wallet": "^9.0.
|
|
16
|
-
"@near-wallet-selector/core": "^9.0.
|
|
17
|
-
"@near-wallet-selector/ethereum-wallets": "^9.0.
|
|
18
|
-
"@near-wallet-selector/here-wallet": "^9.0.
|
|
19
|
-
"@near-wallet-selector/hot-wallet": "^9.0.
|
|
20
|
-
"@near-wallet-selector/ledger": "^9.0.
|
|
21
|
-
"@near-wallet-selector/meteor-wallet": "^9.0.
|
|
22
|
-
"@near-wallet-selector/meteor-wallet-app": "^9.0.
|
|
23
|
-
"@near-wallet-selector/modal-ui": "^9.0.
|
|
24
|
-
"@near-wallet-selector/my-near-wallet": "^9.0.
|
|
25
|
-
"@near-wallet-selector/near-mobile-wallet": "^9.0.
|
|
26
|
-
"@near-wallet-selector/react-hook": "^9.0.
|
|
27
|
-
"@near-wallet-selector/sender": "^9.0.
|
|
28
|
-
"@near-wallet-selector/welldone-wallet": "^9.0.
|
|
29
|
-
"@reown/appkit": "^1.7.
|
|
30
|
-
"@reown/appkit-adapter-wagmi": "^1.7.
|
|
31
|
-
"@wagmi/core": "^2.17.
|
|
15
|
+
"@near-wallet-selector/bitte-wallet": "^9.0.2",
|
|
16
|
+
"@near-wallet-selector/core": "^9.0.2",
|
|
17
|
+
"@near-wallet-selector/ethereum-wallets": "^9.0.2",
|
|
18
|
+
"@near-wallet-selector/here-wallet": "^9.0.2",
|
|
19
|
+
"@near-wallet-selector/hot-wallet": "^9.0.2",
|
|
20
|
+
"@near-wallet-selector/ledger": "^9.0.2",
|
|
21
|
+
"@near-wallet-selector/meteor-wallet": "^9.0.2",
|
|
22
|
+
"@near-wallet-selector/meteor-wallet-app": "^9.0.2",
|
|
23
|
+
"@near-wallet-selector/modal-ui": "^9.0.2",
|
|
24
|
+
"@near-wallet-selector/my-near-wallet": "^9.0.2",
|
|
25
|
+
"@near-wallet-selector/near-mobile-wallet": "^9.0.2",
|
|
26
|
+
"@near-wallet-selector/react-hook": "^9.0.2",
|
|
27
|
+
"@near-wallet-selector/sender": "^9.0.2",
|
|
28
|
+
"@near-wallet-selector/welldone-wallet": "^9.0.2",
|
|
29
|
+
"@reown/appkit": "^1.7.7",
|
|
30
|
+
"@reown/appkit-adapter-wagmi": "^1.7.7",
|
|
31
|
+
"@wagmi/core": "^2.17.2",
|
|
32
32
|
"bootstrap": "^5",
|
|
33
33
|
"bootstrap-icons": "^1.11.3",
|
|
34
34
|
"near-api-js": "^5.0.0",
|
|
35
35
|
"next": "^15",
|
|
36
36
|
"react": "^18",
|
|
37
|
-
"react-dom": "^18"
|
|
37
|
+
"react-dom": "^18",
|
|
38
|
+
"viem": "^2.30.5"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
41
|
"encoding": "^0.1.13",
|
|
@@ -26,10 +26,3 @@ export const web3Modal = createAppKit({
|
|
|
26
26
|
coinbasePreference: "eoaOnly", // Smart accounts (Safe contract) not available on NEAR Protocol, only EOA.
|
|
27
27
|
allWallets: "SHOW",
|
|
28
28
|
});
|
|
29
|
-
|
|
30
|
-
// force reconnecting if the user has already signed in with an ethereum wallet
|
|
31
|
-
// this is a workaround until `ethereum-wallets` supports the `reconnect` method
|
|
32
|
-
if (typeof window !== "undefined") {
|
|
33
|
-
const recentWallets = localStorage.getItem("near-wallet-selector:recentlySignedInWallets");
|
|
34
|
-
recentWallets && recentWallets.includes("ethereum-wallets") && reconnect(wagmiAdapter.wagmiConfig)
|
|
35
|
-
}
|
|
@@ -12,29 +12,30 @@
|
|
|
12
12
|
"lint": "next lint"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@near-wallet-selector/bitte-wallet": "^9.0.
|
|
16
|
-
"@near-wallet-selector/core": "^9.0.
|
|
17
|
-
"@near-wallet-selector/ethereum-wallets": "^9.0.
|
|
18
|
-
"@near-wallet-selector/here-wallet": "^9.0.
|
|
19
|
-
"@near-wallet-selector/hot-wallet": "^9.0.
|
|
20
|
-
"@near-wallet-selector/ledger": "^9.0.
|
|
21
|
-
"@near-wallet-selector/meteor-wallet": "^9.0.
|
|
22
|
-
"@near-wallet-selector/meteor-wallet-app": "^9.0.
|
|
23
|
-
"@near-wallet-selector/modal-ui": "^9.0.
|
|
24
|
-
"@near-wallet-selector/my-near-wallet": "^9.0.
|
|
25
|
-
"@near-wallet-selector/near-mobile-wallet": "^9.0.
|
|
26
|
-
"@near-wallet-selector/react-hook": "^9.0.
|
|
27
|
-
"@near-wallet-selector/sender": "^9.0.
|
|
28
|
-
"@near-wallet-selector/welldone-wallet": "^9.0.
|
|
29
|
-
"@reown/appkit": "^1.7.
|
|
30
|
-
"@reown/appkit-adapter-wagmi": "^1.7.
|
|
31
|
-
"@wagmi/core": "^2.17.
|
|
15
|
+
"@near-wallet-selector/bitte-wallet": "^9.0.2",
|
|
16
|
+
"@near-wallet-selector/core": "^9.0.2",
|
|
17
|
+
"@near-wallet-selector/ethereum-wallets": "^9.0.2",
|
|
18
|
+
"@near-wallet-selector/here-wallet": "^9.0.2",
|
|
19
|
+
"@near-wallet-selector/hot-wallet": "^9.0.2",
|
|
20
|
+
"@near-wallet-selector/ledger": "^9.0.2",
|
|
21
|
+
"@near-wallet-selector/meteor-wallet": "^9.0.2",
|
|
22
|
+
"@near-wallet-selector/meteor-wallet-app": "^9.0.2",
|
|
23
|
+
"@near-wallet-selector/modal-ui": "^9.0.2",
|
|
24
|
+
"@near-wallet-selector/my-near-wallet": "^9.0.2",
|
|
25
|
+
"@near-wallet-selector/near-mobile-wallet": "^9.0.2",
|
|
26
|
+
"@near-wallet-selector/react-hook": "^9.0.2",
|
|
27
|
+
"@near-wallet-selector/sender": "^9.0.2",
|
|
28
|
+
"@near-wallet-selector/welldone-wallet": "^9.0.2",
|
|
29
|
+
"@reown/appkit": "^1.7.7",
|
|
30
|
+
"@reown/appkit-adapter-wagmi": "^1.7.7",
|
|
31
|
+
"@wagmi/core": "^2.17.2",
|
|
32
32
|
"bootstrap": "^5",
|
|
33
33
|
"bootstrap-icons": "^1.11.3",
|
|
34
34
|
"near-api-js": "^5.0.0",
|
|
35
35
|
"next": "^15",
|
|
36
36
|
"react": "^18",
|
|
37
|
-
"react-dom": "^18"
|
|
37
|
+
"react-dom": "^18",
|
|
38
|
+
"viem": "^2.30.5"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
41
|
"encoding": "^0.1.13",
|
|
@@ -26,10 +26,3 @@ export const web3Modal = createAppKit({
|
|
|
26
26
|
coinbasePreference: "eoaOnly", // Smart accounts (Safe contract) not available on NEAR Protocol, only EOA.
|
|
27
27
|
allWallets: "SHOW",
|
|
28
28
|
});
|
|
29
|
-
|
|
30
|
-
// force reconnecting if the user has already signed in with an ethereum wallet
|
|
31
|
-
// this is a workaround until `ethereum-wallets` supports the `reconnect` method
|
|
32
|
-
if (typeof window !== "undefined") {
|
|
33
|
-
const recentWallets = localStorage.getItem("near-wallet-selector:recentlySignedInWallets");
|
|
34
|
-
recentWallets && recentWallets.includes("ethereum-wallets") && reconnect(wagmiAdapter.wagmiConfig)
|
|
35
|
-
}
|
|
@@ -26,10 +26,3 @@ export const web3Modal = createAppKit({
|
|
|
26
26
|
coinbasePreference: "eoaOnly", // Smart accounts (Safe contract) not available on NEAR Protocol, only EOA.
|
|
27
27
|
allWallets: "SHOW",
|
|
28
28
|
});
|
|
29
|
-
|
|
30
|
-
// force reconnecting if the user has already signed in with an ethereum wallet
|
|
31
|
-
// this is a workaround until `ethereum-wallets` supports the `reconnect` method
|
|
32
|
-
if (typeof window !== "undefined") {
|
|
33
|
-
const recentWallets = localStorage.getItem("near-wallet-selector:recentlySignedInWallets");
|
|
34
|
-
recentWallets && recentWallets.includes("ethereum-wallets") && reconnect(wagmiAdapter.wagmiConfig)
|
|
35
|
-
}
|