@caatinga/cli 0.2.3 → 2.0.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/README.md +6 -7
- package/dist/index.js +220 -157
- package/package.json +3 -2
- package/templates/marketplace-with-token/README.md +21 -0
- package/templates/marketplace-with-token/caatinga.artifacts.json +10 -0
- package/templates/marketplace-with-token/caatinga.config.ts +30 -0
- package/templates/marketplace-with-token/caatinga.template.json +21 -0
- package/templates/marketplace-with-token/contracts/marketplace/Cargo.lock +1731 -0
- package/templates/marketplace-with-token/contracts/marketplace/Cargo.toml +24 -0
- package/templates/marketplace-with-token/contracts/marketplace/src/lib.rs +43 -0
- package/templates/marketplace-with-token/contracts/marketplace/test_snapshots/test/stores_token_contract_id_in_constructor.1.json +86 -0
- package/templates/marketplace-with-token/contracts/token/Cargo.lock +1731 -0
- package/templates/marketplace-with-token/contracts/token/Cargo.toml +24 -0
- package/templates/marketplace-with-token/contracts/token/src/lib.rs +13 -0
- package/templates/marketplace-with-token/index.html +12 -0
- package/templates/marketplace-with-token/package.json +28 -0
- package/templates/marketplace-with-token/src/App.tsx +57 -0
- package/templates/marketplace-with-token/src/main.ts +12 -0
- package/templates/marketplace-with-token/src/main.tsx +10 -0
- package/templates/marketplace-with-token/src/styles.css +157 -0
- package/templates/marketplace-with-token/tsconfig.json +21 -0
- package/templates/marketplace-with-token/vite.config.ts +6 -0
- package/templates/react-vite-counter/.env.example +5 -0
- package/templates/react-vite-counter/README.md +83 -0
- package/templates/react-vite-counter/caatinga.artifacts.json +10 -0
- package/templates/react-vite-counter/caatinga.config.ts +26 -0
- package/templates/react-vite-counter/caatinga.template.json +21 -0
- package/templates/react-vite-counter/contracts/counter/Cargo.lock +1731 -0
- package/templates/react-vite-counter/contracts/counter/Cargo.toml +24 -0
- package/templates/react-vite-counter/contracts/counter/src/lib.rs +100 -0
- package/templates/react-vite-counter/contracts/counter/test_snapshots/test/get_returns_zero_before_increment.1.json +76 -0
- package/templates/react-vite-counter/contracts/counter/test_snapshots/test/increment_returns_overflow_error.1.json +91 -0
- package/templates/react-vite-counter/contracts/counter/test_snapshots/test/increments_counter.1.json +91 -0
- package/templates/react-vite-counter/contracts/counter/test_snapshots/test/repeated_increments_preserve_state.1.json +92 -0
- package/templates/react-vite-counter/index.html +12 -0
- package/templates/react-vite-counter/package.json +30 -0
- package/templates/react-vite-counter/pnpm-workspace.yaml +12 -0
- package/templates/react-vite-counter/public/.gitkeep +1 -0
- package/templates/react-vite-counter/src/App.tsx +18 -0
- package/templates/react-vite-counter/src/caatinga.ts +20 -0
- package/templates/react-vite-counter/src/components/CounterCard.tsx +86 -0
- package/templates/react-vite-counter/src/components/WalletButton.tsx +69 -0
- package/templates/react-vite-counter/src/contracts/generated/counter.ts +58 -0
- package/templates/react-vite-counter/src/hooks/useStellarWallet.ts +70 -0
- package/templates/react-vite-counter/src/main.tsx +10 -0
- package/templates/react-vite-counter/src/styles.css +206 -0
- package/templates/react-vite-counter/src/wallet.ts +29 -0
- package/templates/react-vite-counter/tsconfig.json +22 -0
- package/templates/react-vite-counter/vite.config.ts +18 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# __PROJECT_NAME__
|
|
2
|
+
|
|
3
|
+
Experimental Caatinga multi-contract template with a real constructor dependency.
|
|
4
|
+
|
|
5
|
+
## Deploy
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install
|
|
9
|
+
npx caatinga build token
|
|
10
|
+
npx caatinga build marketplace
|
|
11
|
+
npx caatinga deploy --network testnet --source alice
|
|
12
|
+
npx caatinga generate token
|
|
13
|
+
npx caatinga generate marketplace
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Deploy order:
|
|
17
|
+
|
|
18
|
+
1. `token`
|
|
19
|
+
2. `marketplace`
|
|
20
|
+
|
|
21
|
+
`marketplace.deployArgs.tokenContractId` resolves from `${contracts.token.contractId}` after the token deploy writes `caatinga.artifacts.json`. Caatinga passes that value to the contract `__constructor` as `--token_contract_id`.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineConfig } from "@caatinga/core";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
project: "__PROJECT_NAME__",
|
|
5
|
+
defaultNetwork: "testnet",
|
|
6
|
+
contracts: {
|
|
7
|
+
token: {
|
|
8
|
+
path: "./contracts/token",
|
|
9
|
+
wasm: "./contracts/token/target/wasm32v1-none/release/token.wasm"
|
|
10
|
+
},
|
|
11
|
+
marketplace: {
|
|
12
|
+
path: "./contracts/marketplace",
|
|
13
|
+
wasm: "./contracts/marketplace/target/wasm32v1-none/release/marketplace.wasm",
|
|
14
|
+
dependsOn: ["token"],
|
|
15
|
+
deployArgs: {
|
|
16
|
+
tokenContractId: "${contracts.token.contractId}"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
networks: {
|
|
21
|
+
testnet: {
|
|
22
|
+
rpcUrl: "https://soroban-testnet.stellar.org",
|
|
23
|
+
networkPassphrase: "Test SDF Network ; September 2015"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
frontend: {
|
|
27
|
+
framework: "vite-react",
|
|
28
|
+
bindingsOutput: "./src/contracts/generated"
|
|
29
|
+
}
|
|
30
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "marketplace-with-token",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Experimental multi-contract Soroban template with token dependency injection.",
|
|
5
|
+
"caatinga": {
|
|
6
|
+
"compatibleCore": "^2.0.0",
|
|
7
|
+
"templateVersion": 1
|
|
8
|
+
},
|
|
9
|
+
"frontend": {
|
|
10
|
+
"framework": "vite-react",
|
|
11
|
+
"packageManager": "npm"
|
|
12
|
+
},
|
|
13
|
+
"contracts": {
|
|
14
|
+
"path": "contracts",
|
|
15
|
+
"default": "marketplace"
|
|
16
|
+
},
|
|
17
|
+
"files": {
|
|
18
|
+
"config": "caatinga.config.ts",
|
|
19
|
+
"artifacts": "caatinga.artifacts.json"
|
|
20
|
+
}
|
|
21
|
+
}
|