We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 069ef5e commit 1d736e6Copy full SHA for 1d736e6
Cargo.lock
Cargo.toml
@@ -1,7 +1,12 @@
1
[workspace]
2
resolver = "2"
3
members = ["bots", "common", "contract/*", "mock/*", "test-utils"]
4
-package.license = "MIT"
+
5
+[workspace.package]
6
+license = "MIT"
7
+repository = "https://github.com/Templar-Protocol/contracts"
8
+edition = "2021"
9
+version = "1.0.0"
10
11
[workspace.dependencies]
12
anyhow = "1.0.95"
bots/Cargo.toml
@@ -1,8 +1,9 @@
[package]
+edition.workspace = true
+license.workspace = true
name = "templar-bots"
+repository.workspace = true
version = "0.1.0"
-edition = "2024"
-license.workspace = true
[[bin]]
name = "liquidator"
bots/src/accumulator.rs
@@ -9,12 +9,12 @@ use near_primitives::{
hash::CryptoHash,
transaction::{Transaction, TransactionV0},
};
-use near_sdk::{AccountId, serde_json::json};
+use near_sdk::{serde_json::json, AccountId};
13
use tracing::{error, info, instrument};
14
15
use crate::{
16
- BorrowPositions, DEFAULT_GAS, Network,
17
near::{get_access_key_data, send_tx, serialize_and_encode, view},
+ BorrowPositions, Network, DEFAULT_GAS,
18
19
20
#[derive(Debug, Clone, Parser)]
bots/src/bin/accumulator-bot.rs
@@ -4,7 +4,7 @@ use clap::Parser;
use templar_bots::accumulator::{Accumulator, Args};
use tokio::time::sleep;
use tracing::info;
-use tracing_subscriber::{EnvFilter, fmt, layer::SubscriberExt, util::SubscriberInitExt};
+use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
bots/src/bin/liquidator-bot.rs
@@ -1,10 +1,10 @@
use std::time::Duration;
use clap::Parser;
-use templar_bots::liquidator::{Args, LiquidatorResult, setup_liquidators};
+use templar_bots::liquidator::{setup_liquidators, Args, LiquidatorResult};
async fn main() -> LiquidatorResult {
bots/src/lib.rs
@@ -2,7 +2,7 @@ use std::collections::HashMap;
use clap::ValueEnum;
use near_jsonrpc_client::{NEAR_MAINNET_RPC_URL, NEAR_TESTNET_RPC_URL};
-use near_sdk::{AccountId, Gas, near};
+use near_sdk::{near, AccountId, Gas};
use templar_common::borrow::BorrowPosition;
pub mod accumulator;
bots/src/liquidator.rs
@@ -10,21 +10,21 @@ use near_primitives::{
use near_sdk::{
- AccountId, NearToken,
json_types::U128,
serde_json::{self, json},
+ AccountId, NearToken,
use templar_common::{
borrow::{BorrowPosition, BorrowStatus},
- market::{DepositMsg, LiquidateMsg, MarketConfiguration, error::RetrievalError},
+ market::{error::RetrievalError, DepositMsg, LiquidateMsg, MarketConfiguration},
oracle::pyth::{OracleResponse, PriceIdentifier},
21
22
23
24
25
26
- near::{RpcError, get_access_key_data, send_tx, serialize_and_encode, view},
+ near::{get_access_key_data, send_tx, serialize_and_encode, view, RpcError},
27
swap::{RheaSwap, Swap, SwapType},
28
29
30
/// Errors that can occur during liquidation operations.
bots/src/near.rs
@@ -3,13 +3,13 @@ use std::time::Duration;
use base64::Engine;
use near_crypto::InMemorySigner;
use near_jsonrpc_client::{
- JsonRpcClient,
errors::JsonRpcError,
methods::{
query::{RpcQueryError, RpcQueryRequest},
send_tx::RpcSendTransactionRequest,
tx::{RpcTransactionError, RpcTransactionStatusRequest, TransactionInfo},
},
+ JsonRpcClient,
use near_jsonrpc_primitives::types::query::QueryResponseKind;
use near_primitives::{
@@ -19,7 +19,7 @@ use near_primitives::{
views::{FinalExecutionStatus, QueryRequest, TxExecutionStatus},
- serde::{Serialize, de::DeserializeOwned},
+ serde::{de::DeserializeOwned, Serialize},
serde_json,
use tokio::time::Instant;
bots/src/swap.rs
@@ -6,11 +6,11 @@ use near_primitives::{
views::FinalExecutionStatus,
-use near_sdk::{AccountId, NearToken, json_types::U128, near, serde_json::json};
+use near_sdk::{json_types::U128, near, serde_json::json, AccountId, NearToken};
- DEFAULT_GAS, Network,
- near::{RpcResult, get_access_key_data, send_tx, serialize_and_encode, view},
+ near::{get_access_key_data, send_tx, serialize_and_encode, view, RpcResult},
+ Network, DEFAULT_GAS,
#[async_trait::async_trait]
0 commit comments