Skip to content

Commit

Permalink
Merge pull request #280 from JoE11-y/testnet
Browse files Browse the repository at this point in the history
feat: Add GET Route /defi/rewards to Centralize DeFi Spring Reward Collection
  • Loading branch information
Marchand-Nicolas authored Oct 13, 2024
2 parents 53d651e + df7945e commit 704749a
Show file tree
Hide file tree
Showing 19 changed files with 613 additions and 18 deletions.
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ tokio = { version = "1.26.0", features = ["macros", "rt-multi-thread"] }
tower-http = { version = "0.4.0", features = ["cors"] }
mongodb = "2.4.0"
futures = "0.3.28"
reqwest = { version = "0.11.17", features = ["json"] }
reqwest = { version = "0.12.0", features = ["rustls-tls", "json"] }
reqwest-middleware = { version = "0.3", features = ["json"] }
reqwest-retry = "0.5"
reqwest-tracing = "0.5"
rand = "0.8.5"
async-trait = "0.1.68"
percent-encoding = "2.3.1"
Expand Down
10 changes: 10 additions & 0 deletions config.template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,16 @@ contract = "0xFFFFFFFFFFFF"
[quests.sithswap_2]
api_endpoint = "xxxxxxx"

[rewards]
[rewards.nimbora]
contract = "0x07ed46700bd12bb1ee8a33a8594791003f9710a1ab18edd958aed86a8f82d3d1"

[tokens]
[tokens.strk]
contract = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"
symbol = "STRK"
decimals = 18

[twitter]
oauth2_clientid = "xxxxxx"
oauth2_secret = "xxxxxx"
Expand Down
16 changes: 16 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,20 @@ pub_struct!(Clone, Deserialize; ProtocolStats {
alt_protocols_api_endpoint: String,
});

pub_struct!(Clone, Deserialize; Rewards {
nimbora: Contract,
});

pub_struct!(Clone, Deserialize; Token {
contract: FieldElement,
symbol: String,
decimals: i64
});

pub_struct!(Clone, Deserialize; Tokens {
strk: Token,
});

pub_struct!(Clone, Deserialize; Config {
server: Server,
database: Database,
Expand All @@ -212,6 +226,8 @@ pub_struct!(Clone, Deserialize; Config {
rango: Api,
pyramid: ApiEndpoint,
auth:AuthSetup,
rewards: Rewards,
tokens: Tokens
});

pub fn load() -> Config {
Expand Down
1 change: 1 addition & 0 deletions src/endpoints/defi/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod rewards;
Loading

0 comments on commit 704749a

Please sign in to comment.