pub struct HypercallWallet {
pub address: AccountAddress,
/* private fields */
}Expand description
Wallet for signing Hypercall operations with EIP-712.
Fields§
§address: AccountAddressThe wallet address
Implementations§
Source§impl HypercallWallet
impl HypercallWallet
Sourcepub async fn sign_repay_pm_loan(
&self,
account: AccountAddress,
underlying: &str,
amount: &str,
nonce: u64,
) -> Result<String>
pub async fn sign_repay_pm_loan( &self, account: AccountAddress, underlying: &str, amount: &str, nonce: u64, ) -> Result<String>
Sign a RepayPmLoan action. amount must be the exact string the
request sends (see RepayAmount::signed_amount).
Source§impl HypercallWallet
impl HypercallWallet
Sourcepub async fn sign_create_rfq_v2(
&self,
terms: RfqV2Terms,
nonce: u64,
) -> Result<CreateRfqV2Request>
pub async fn sign_create_rfq_v2( &self, terms: RfqV2Terms, nonce: u64, ) -> Result<CreateRfqV2Request>
Sign RFQ terms for crate::HypercallClient::create_rfq_v2.
Sourcepub async fn sign_rfq_v2_firm_quote(
&self,
terms: RfqV2FirmQuoteTerms,
nonce: u64,
) -> Result<PublishRfqV2FirmQuoteRequest>
pub async fn sign_rfq_v2_firm_quote( &self, terms: RfqV2FirmQuoteTerms, nonce: u64, ) -> Result<PublishRfqV2FirmQuoteRequest>
Sign a firm quote for
crate::HypercallClient::publish_rfq_v2_firm_quote.
Sourcepub async fn sign_rfq_v2_indicative_quote(
&self,
terms: RfqV2IndicativeQuoteTerms,
) -> Result<PublishRfqV2IndicativeQuoteRequest>
pub async fn sign_rfq_v2_indicative_quote( &self, terms: RfqV2IndicativeQuoteTerms, ) -> Result<PublishRfqV2IndicativeQuoteRequest>
Sign an indicative quote for
crate::HypercallClient::publish_rfq_v2_indicative_quote.
Sourcepub async fn sign_rfq_v2_firm_up(
&self,
rfq_id: Uuid,
indicative_quote_id: Uuid,
requested_units: u128,
auth: RfqV2ActionAuth,
) -> Result<RequestRfqV2FirmQuoteRequest>
pub async fn sign_rfq_v2_firm_up( &self, rfq_id: Uuid, indicative_quote_id: Uuid, requested_units: u128, auth: RfqV2ActionAuth, ) -> Result<RequestRfqV2FirmQuoteRequest>
Sign a firm-up request for
crate::HypercallClient::request_rfq_v2_firm_quote.
Sourcepub async fn sign_rfq_v2_decline(
&self,
rfq_id: Uuid,
maker_account: WalletAddress,
auth: RfqV2ActionAuth,
) -> Result<DeclineRfqV2Request>
pub async fn sign_rfq_v2_decline( &self, rfq_id: Uuid, maker_account: WalletAddress, auth: RfqV2ActionAuth, ) -> Result<DeclineRfqV2Request>
Sign a maker decline for crate::HypercallClient::decline_rfq_v2.
Sourcepub async fn sign_rfq_v2_execution(
&self,
rfq_id: Uuid,
quote_id: Uuid,
package_units: u128,
max_fee_micros: u128,
auth: RfqV2ActionAuth,
) -> Result<RfqV2ExecutionRequest>
pub async fn sign_rfq_v2_execution( &self, rfq_id: Uuid, quote_id: Uuid, package_units: u128, max_fee_micros: u128, auth: RfqV2ActionAuth, ) -> Result<RfqV2ExecutionRequest>
Sign one execution against one firm quote for
crate::HypercallClient::execute_rfq_v2.
Sourcepub async fn sign_rfq_v2_sweep(
&self,
rfq_id: Uuid,
allocations: Vec<RfqV2SweepAllocation>,
max_fee_micros: u128,
auth: RfqV2ActionAuth,
) -> Result<RfqV2SweepRequest>
pub async fn sign_rfq_v2_sweep( &self, rfq_id: Uuid, allocations: Vec<RfqV2SweepAllocation>, max_fee_micros: u128, auth: RfqV2ActionAuth, ) -> Result<RfqV2SweepRequest>
Sign an ordered, atomic sweep for
crate::HypercallClient::sweep_rfq_v2.
Sourcepub async fn sign_rfq_v2_invalidation(
&self,
target: RfqV2InvalidationTarget,
auth: RfqV2ActionAuth,
) -> Result<RfqV2InvalidationRequest>
pub async fn sign_rfq_v2_invalidation( &self, target: RfqV2InvalidationTarget, auth: RfqV2ActionAuth, ) -> Result<RfqV2InvalidationRequest>
Sign a taker cancel for crate::HypercallClient::cancel_rfq_v2 or a
maker withdrawal for crate::HypercallClient::withdraw_rfq_v2_quote.
Sourcepub async fn sign_rfq_v2_bulk_withdrawal(
&self,
maker_account: WalletAddress,
scope: RfqV2BulkWithdrawalScope,
auth: RfqV2ActionAuth,
) -> Result<RfqV2BulkWithdrawalRequest>
pub async fn sign_rfq_v2_bulk_withdrawal( &self, maker_account: WalletAddress, scope: RfqV2BulkWithdrawalScope, auth: RfqV2ActionAuth, ) -> Result<RfqV2BulkWithdrawalRequest>
Sign a bulk withdrawal for
crate::HypercallClient::withdraw_rfq_v2_quotes.
Sourcepub async fn sign_rfq_v2_quote_cancel_schedule(
&self,
maker_account: WalletAddress,
cancel_at_ms: Option<u64>,
auth: RfqV2ActionAuth,
) -> Result<RfqV2ScheduledQuoteCancelRequest>
pub async fn sign_rfq_v2_quote_cancel_schedule( &self, maker_account: WalletAddress, cancel_at_ms: Option<u64>, auth: RfqV2ActionAuth, ) -> Result<RfqV2ScheduledQuoteCancelRequest>
Sign the maker dead-man switch for
crate::HypercallClient::schedule_rfq_v2_quote_cancel. None
removes the schedule.
Sourcepub async fn sign_rfq_v2_replacement(
&self,
rfq_id: Uuid,
replacement: CreateRfqV2Request,
auth: RfqV2ActionAuth,
) -> Result<RfqV2ReplacementRequest<CreateRfqV2Request>>
pub async fn sign_rfq_v2_replacement( &self, rfq_id: Uuid, replacement: CreateRfqV2Request, auth: RfqV2ActionAuth, ) -> Result<RfqV2ReplacementRequest<CreateRfqV2Request>>
Sign the replacement of rfq_id by an already signed successor RFQ,
for crate::HypercallClient::replace_rfq_v2.
Sourcepub async fn sign_rfq_v2_quote_replacement(
&self,
rfq_id: Uuid,
quote_id: Uuid,
replacement: RfqV2QuoteReplacement,
auth: RfqV2ActionAuth,
) -> Result<RfqV2ReplacementRequest<RfqV2QuoteReplacement>>
pub async fn sign_rfq_v2_quote_replacement( &self, rfq_id: Uuid, quote_id: Uuid, replacement: RfqV2QuoteReplacement, auth: RfqV2ActionAuth, ) -> Result<RfqV2ReplacementRequest<RfqV2QuoteReplacement>>
Sign the replacement of quote quote_id by an already signed
successor quote, for crate::HypercallClient::replace_rfq_v2_quote.
Source§impl HypercallWallet
impl HypercallWallet
Sourcepub async fn sign_create_vault(
&self,
salt: u64,
config: &VaultConfigParams,
nonce: u64,
) -> Result<String>
pub async fn sign_create_vault( &self, salt: u64, config: &VaultConfigParams, nonce: u64, ) -> Result<String>
Sign a CreateVault for this wallet as owner.
Source§impl HypercallWallet
impl HypercallWallet
Sourcepub async fn sign_authentication_message(
&self,
timestamp: i64,
) -> Result<String>
pub async fn sign_authentication_message( &self, timestamp: i64, ) -> Result<String>
Sign Hypercall’s timestamped EIP-191 authentication message
(Sign this message to authenticate for Hypercall\nTimestamp: {timestamp}),
as the manager-authenticated routes such as TEE API wallet enrollment
require. timestamp is Unix seconds.
Sourcepub async fn sign_rfq_v2_read_grant(
&self,
account: WalletAddress,
issued_at_ms: u64,
expires_at_ms: u64,
nonce: u64,
) -> Result<RfqV2ReadGrant>
pub async fn sign_rfq_v2_read_grant( &self, account: WalletAddress, issued_at_ms: u64, expires_at_ms: u64, nonce: u64, ) -> Result<RfqV2ReadGrant>
Sign a short-lived private RFQ read grant for an account this wallet owns or currently represents as an authorized agent. The service verifies the agent relationship on every read.
Sourcepub fn from_private_key(private_key: &str, chain_id: u32) -> Result<Self>
pub fn from_private_key(private_key: &str, chain_id: u32) -> Result<Self>
Create a new wallet from a private key.
§Arguments
private_key- Hex-encoded private key (with or without 0x prefix)chain_id- Chain ID for the EIP-712 signing domain. Production uses999.
Sourcepub fn from_bytes(bytes: &[u8; 32], chain_id: u32) -> Result<Self>
pub fn from_bytes(bytes: &[u8; 32], chain_id: u32) -> Result<Self>
Create a wallet from raw private key bytes.
Sourcepub fn with_chain_id(self, chain_id: u32) -> Self
pub fn with_chain_id(self, chain_id: u32) -> Self
Set the chain ID for EIP-712 signing domain.
Sourcepub fn with_nonce_provider(self, nonce_provider: Arc<dyn NonceProvider>) -> Self
pub fn with_nonce_provider(self, nonce_provider: Arc<dyn NonceProvider>) -> Self
Return a copy of this wallet that obtains nonces from nonce_provider.
Sourcepub fn next_nonce(&self) -> u64
pub fn next_nonce(&self) -> u64
Get the next nonce for signing. Clamps to at least the current epoch millisecond so long-lived processes don’t drift outside the engine’s time bounds.
Sourcepub fn current_nonce(&self) -> u64
pub fn current_nonce(&self) -> u64
Get the current nonce without incrementing.
Sourcepub fn try_private_key_hex(&self) -> Result<String>
pub fn try_private_key_hex(&self) -> Result<String>
Try to get the private key as a hex string.
This only succeeds for local private-key wallets. AWS KMS wallets never expose private key material.
Sourcepub fn private_key_hex(&self) -> String
pub fn private_key_hex(&self) -> String
Get the private key as a hex string for local private-key wallets.
Panics when called on non-local wallets because private key material is
unavailable. Prefer Self::try_private_key_hex when wallet backend is
not statically known.
pub async fn sign_perp_limit_order_payload( &self, payload: PerpLimitOrderSignature, ) -> Result<String>
pub async fn sign_perp_cancel_by_oid_payload( &self, payload: PerpCancelByOidSignature, ) -> Result<String>
pub async fn sign_perp_cancel_by_cloid_payload( &self, payload: PerpCancelByCloidSignature, ) -> Result<String>
pub async fn sign_set_account_abstraction_payload( &self, payload: SetAccountAbstractionSignature, ) -> Result<String>
pub async fn sign_update_api_wallet_payload( &self, payload: UpdateApiWalletSignature, ) -> Result<String>
Sourcepub async fn sign_standard_usdc_withdrawal_payload(
&self,
payload: StandardUsdcWithdrawalSignature<'_>,
) -> Result<String>
pub async fn sign_standard_usdc_withdrawal_payload( &self, payload: StandardUsdcWithdrawalSignature<'_>, ) -> Result<String>
Sign the Standard Margin WithdrawUsdc schema.
Sourcepub async fn sign_portfolio_usdc_withdrawal_payload(
&self,
payload: PortfolioUsdcWithdrawalSignature,
) -> Result<String>
pub async fn sign_portfolio_usdc_withdrawal_payload( &self, payload: PortfolioUsdcWithdrawalSignature, ) -> Result<String>
Sign the manager-domain Portfolio Margin HLSendAsset route.
Sourcepub async fn sign_place_order_payload(
&self,
payload: PlaceOrderSignature<'_>,
) -> Result<String>
pub async fn sign_place_order_payload( &self, payload: PlaceOrderSignature<'_>, ) -> Result<String>
Sign a PlaceOrder action.
Sourcepub async fn sign_cancel_order(
&self,
order_id: &str,
nonce: u64,
) -> Result<String>
pub async fn sign_cancel_order( &self, order_id: &str, nonce: u64, ) -> Result<String>
Sign a CancelOrder action.
pub async fn sign_cancel_order_payload( &self, payload: CancelOrderSignature<'_>, ) -> Result<String>
Sourcepub async fn sign_replace_order_payload(
&self,
payload: ReplaceOrderSignature<'_>,
) -> Result<String>
pub async fn sign_replace_order_payload( &self, payload: ReplaceOrderSignature<'_>, ) -> Result<String>
Sign a ReplaceOrder action.
pub async fn sign_standard_margin_liquidation_payload( &self, payload: StandardMarginLiquidationSignature<'_>, ) -> Result<String>
Sourcepub async fn sign_set_margin_mode(
&self,
margin_mode: &str,
nonce: u64,
) -> Result<String>
pub async fn sign_set_margin_mode( &self, margin_mode: &str, nonce: u64, ) -> Result<String>
Sign a SetMarginMode action.
Sign a RedeemPoolShares action. shares must be the exact decimal
string sent in the request body.
Sourcepub async fn sign_cancel_pool_redemptions(
&self,
request_ids: &[&str],
nonce: u64,
) -> Result<String>
pub async fn sign_cancel_pool_redemptions( &self, request_ids: &[&str], nonce: u64, ) -> Result<String>
Sign a CancelPoolRedemptions action over request_ids in the order
the request sends them (lowercase hyphenated UUIDs).
Sourcepub async fn sign_submit_rfq(
&self,
rfq_id: [u8; 32],
legs_hash: [u8; 32],
nonce: u64,
) -> Result<String>
pub async fn sign_submit_rfq( &self, rfq_id: [u8; 32], legs_hash: [u8; 32], nonce: u64, ) -> Result<String>
Sign a SubmitRFQ action.
Sourcepub async fn sign_submit_rfq_response(
&self,
rfq_id: [u8; 32],
legs_hash: [u8; 32],
net_premium: I256,
valid_for_ms: U256,
nonce: u64,
) -> Result<String>
pub async fn sign_submit_rfq_response( &self, rfq_id: [u8; 32], legs_hash: [u8; 32], net_premium: I256, valid_for_ms: U256, nonce: u64, ) -> Result<String>
Sign a SubmitRFQResponse action (for quote providers).
Sourcepub async fn sign_accept_rfq_quote(
&self,
rfq_id: [u8; 32],
quote_id: [u8; 32],
net_premium: I256,
nonce: u64,
) -> Result<String>
pub async fn sign_accept_rfq_quote( &self, rfq_id: [u8; 32], quote_id: [u8; 32], net_premium: I256, nonce: u64, ) -> Result<String>
Sign an AcceptRFQQuote action.
Trait Implementations§
Source§impl ApiWalletDirectiveSigner for HypercallWallet
impl ApiWalletDirectiveSigner for HypercallWallet
async fn sign_update_api_wallet_payload( &self, payload: UpdateApiWalletSignature, ) -> Result<String>
Source§impl Clone for HypercallWallet
impl Clone for HypercallWallet
Source§impl Debug for HypercallWallet
impl Debug for HypercallWallet
Source§impl HypercallSigner for HypercallWallet
impl HypercallSigner for HypercallWallet
fn address(&self) -> AccountAddress
fn next_nonce(&self) -> u64
async fn sign_place_order_payload( &self, payload: PlaceOrderSignature<'_>, ) -> Result<String>
async fn sign_cancel_order_payload( &self, payload: CancelOrderSignature<'_>, ) -> Result<String>
async fn sign_replace_order_payload( &self, payload: ReplaceOrderSignature<'_>, ) -> Result<String>
async fn sign_set_margin_mode_payload( &self, margin_mode: &str, nonce: u64, ) -> Result<String>
async fn sign_standard_margin_liquidation_payload( &self, payload: StandardMarginLiquidationSignature<'_>, ) -> Result<String>
Source§impl ManagerDirectiveSigner for HypercallWallet
impl ManagerDirectiveSigner for HypercallWallet
async fn sign_set_account_abstraction_payload( &self, payload: SetAccountAbstractionSignature, ) -> Result<String>
Source§impl PerpDirectiveSigner for HypercallWallet
impl PerpDirectiveSigner for HypercallWallet
async fn sign_perp_limit_order_payload( &self, payload: PerpLimitOrderSignature, ) -> Result<String>
async fn sign_perp_cancel_by_oid_payload( &self, payload: PerpCancelByOidSignature, ) -> Result<String>
async fn sign_perp_cancel_by_cloid_payload( &self, payload: PerpCancelByCloidSignature, ) -> Result<String>
Source§impl TeeApiWalletManagerSigner for HypercallWallet
impl TeeApiWalletManagerSigner for HypercallWallet
Source§async fn sign_authentication_payload(&self, timestamp: i64) -> Result<String>
async fn sign_authentication_payload(&self, timestamp: i64) -> Result<String>
async fn sign_tee_api_wallet_approval_payload( &self, payload: TeeApiWalletApprovalSignature<'_>, ) -> Result<String>
Source§impl TeePerpSigner for HypercallWallet
impl TeePerpSigner for HypercallWallet
async fn sign_tee_perp_trigger_order_payload( &self, payload: TeePerpTriggerOrderSignature, ) -> Result<String>
async fn sign_tee_perp_order_batch_payload( &self, payload: TeePerpOrderBatchSignature<'_>, ) -> Result<String>
async fn sign_tee_perp_leverage_payload( &self, payload: TeePerpLeverageSignature, ) -> Result<String>
async fn sign_tee_perp_modify_payload( &self, payload: TeePerpModifySignature, ) -> Result<String>
async fn sign_tee_perp_batch_modify_payload( &self, payload: TeePerpBatchModifySignature<'_>, ) -> Result<String>
async fn sign_tee_perp_twap_payload( &self, payload: TeePerpTwapSignature, ) -> Result<String>
async fn sign_tee_perp_twap_cancel_payload( &self, payload: TeePerpTwapCancelSignature, ) -> Result<String>
Source§impl TeeSpotSigner for HypercallWallet
impl TeeSpotSigner for HypercallWallet
async fn sign_tee_spot_order_payload( &self, payload: TeeSpotOrderSignature, ) -> Result<String>
async fn sign_tee_spot_cancel_payload( &self, payload: TeeSpotCancelSignature, ) -> Result<String>
Source§impl UsdcWithdrawalSigner for HypercallWallet
impl UsdcWithdrawalSigner for HypercallWallet
async fn sign_standard_usdc_withdrawal_payload( &self, payload: StandardUsdcWithdrawalSignature<'_>, ) -> Result<String>
async fn sign_portfolio_usdc_withdrawal_payload( &self, payload: PortfolioUsdcWithdrawalSignature, ) -> Result<String>
Auto Trait Implementations§
impl !RefUnwindSafe for HypercallWallet
impl !UnwindSafe for HypercallWallet
impl Forget for HypercallWallet
impl Freeze for HypercallWallet
impl Move for HypercallWallet
impl Send for HypercallWallet
impl Sync for HypercallWallet
impl Unpin for HypercallWallet
impl UnsafeUnpin for HypercallWallet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more