- Retrieve allowance data from an RPC - Encode approvals: - Create PermitSingle (and PermitDetails) - Use alloy eip712 to get signing hash on typed data - Sign data - Add chrono and alloy eip712 and signer-local to Cargo.toml --- don't change below this line --- ENG-4063 Took 1 hour 58 minutes Took 18 seconds Took 32 seconds Took 9 seconds Took 1 minute Took 32 minutes
18 lines
388 B
Rust
18 lines
388 B
Rust
use num_bigint::BigUint;
|
|
use tycho_core::Bytes;
|
|
|
|
use crate::encoding::errors::EncodingError;
|
|
|
|
#[allow(dead_code)]
|
|
pub struct Approval {
|
|
pub spender: Bytes,
|
|
pub owner: Bytes,
|
|
pub token: Bytes,
|
|
pub amount: BigUint,
|
|
}
|
|
|
|
pub trait UserApprovalsManager {
|
|
#[allow(dead_code)]
|
|
fn encode_approvals(&self, approvals: Vec<Approval>) -> Result<Vec<Vec<u8>>, EncodingError>;
|
|
}
|