@caatinga/cli 0.2.3 → 0.2.4
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/index.js +23 -8
- package/package.json +2 -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/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 +67 -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 +36 -0
- package/templates/react-vite-counter/index.html +12 -0
- package/templates/react-vite-counter/package.json +30 -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 +82 -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 +28 -0
- package/templates/react-vite-counter/tsconfig.json +22 -0
- package/templates/react-vite-counter/vite.config.ts +16 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "marketplace"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
rust-version = "1.84.0"
|
|
5
|
+
edition = "2021"
|
|
6
|
+
|
|
7
|
+
[lib]
|
|
8
|
+
crate-type = ["cdylib"]
|
|
9
|
+
|
|
10
|
+
[dependencies]
|
|
11
|
+
soroban-sdk = "22.0.1"
|
|
12
|
+
|
|
13
|
+
[dev-dependencies]
|
|
14
|
+
soroban-sdk = { version = "22.0.1", features = ["testutils"] }
|
|
15
|
+
|
|
16
|
+
[profile.release]
|
|
17
|
+
opt-level = "z"
|
|
18
|
+
overflow-checks = true
|
|
19
|
+
debug = 0
|
|
20
|
+
strip = "symbols"
|
|
21
|
+
debug-assertions = false
|
|
22
|
+
panic = "abort"
|
|
23
|
+
codegen-units = 1
|
|
24
|
+
lto = true
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#![no_std]
|
|
2
|
+
|
|
3
|
+
use soroban_sdk::{contract, contractimpl, symbol_short, Address, Env, Symbol};
|
|
4
|
+
|
|
5
|
+
const TOKEN_CONTRACT_ID: Symbol = symbol_short!("TOKEN");
|
|
6
|
+
|
|
7
|
+
#[contract]
|
|
8
|
+
pub struct MarketplaceContract;
|
|
9
|
+
|
|
10
|
+
#[contractimpl]
|
|
11
|
+
impl MarketplaceContract {
|
|
12
|
+
pub fn __constructor(env: Env, token_contract_id: Address) {
|
|
13
|
+
env.storage().instance().set(&TOKEN_CONTRACT_ID, &token_contract_id);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
pub fn token_contract_id(env: Env) -> Address {
|
|
17
|
+
env.storage().instance().get(&TOKEN_CONTRACT_ID).unwrap()
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
pub fn version(_env: Env) -> u32 {
|
|
21
|
+
1
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
#[cfg(test)]
|
|
26
|
+
mod test {
|
|
27
|
+
use super::*;
|
|
28
|
+
use soroban_sdk::testutils::Address as _;
|
|
29
|
+
|
|
30
|
+
#[test]
|
|
31
|
+
fn stores_token_contract_id_in_constructor() {
|
|
32
|
+
let env = Env::default();
|
|
33
|
+
let token_contract_id = Address::generate(&env);
|
|
34
|
+
let contract_id = env.register(
|
|
35
|
+
MarketplaceContract,
|
|
36
|
+
MarketplaceContractArgs::__constructor(&token_contract_id),
|
|
37
|
+
);
|
|
38
|
+
let client = MarketplaceContractClient::new(&env, &contract_id);
|
|
39
|
+
|
|
40
|
+
assert_eq!(client.token_contract_id(), token_contract_id);
|
|
41
|
+
assert_eq!(client.version(), 1);
|
|
42
|
+
}
|
|
43
|
+
}
|