Skip to content

Commit

Permalink
Add aptos chain
Browse files Browse the repository at this point in the history
  • Loading branch information
gemcoder21 committed Aug 9, 2023
1 parent c950631 commit abca0de
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 6 deletions.
6 changes: 4 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bin/generate/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn main() {
let platform = std::env::args().nth(1).expect("no platform specified");
let platform_directory_path = std::env::args().nth(2).expect("no path specified");

let ignored_files = vec!["lib.rs"];
let ignored_files = vec!["lib.rs", "mod.rs"];

for folder in folders {
let paths = get_paths(folder, format!("{}/src", folder));
Expand Down
4 changes: 3 additions & 1 deletion blockchain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ edition = { workspace = true }
version = { workspace = true }

[dependencies]
typeshare = { workspace = true }
typeshare = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
18 changes: 18 additions & 0 deletions blockchain/src/aptos/aptos_model.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use typeshare::typeshare;
//use serde::{Serialize, Deserialize};

#[typeshare]
struct AptosResource<T> {
r#type: String,
data: T
}

#[typeshare]
struct AptosResourceBalance {
coin: AptosResourceCoin
}

#[typeshare]
struct AptosResourceCoin {
value: String
}
1 change: 1 addition & 0 deletions blockchain/src/aptos/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mod aptos_model;
4 changes: 3 additions & 1 deletion blockchain/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// lib.rs
// lib.rs

mod aptos;
5 changes: 4 additions & 1 deletion primitives/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub enum Chain {
Tron,
Doge,
Optimism,
Aptos
}

impl PartialEq for Chain {
Expand All @@ -44,7 +45,8 @@ impl Chain {
"ton" => Some(Self::Ton),
"tron" => Some(Self::Tron),
"doge" => Some(Self::Doge),
_ => None,
"aptos" => Some(Self::Aptos),
_ => None,
}
}

Expand All @@ -64,6 +66,7 @@ impl Chain {
Self::Ton => "ton",
Self::Tron => "tron",
Self::Doge => "doge",
Self::Aptos => "aptos",
}
}
}
1 change: 1 addition & 0 deletions primitives/src/chain_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ pub enum BlockchainType {
Cosmos,
Ton,
Tron,
Aptos
}

0 comments on commit abca0de

Please sign in to comment.