Skip to main content

HypercallWallet

Struct HypercallWallet 

Source
pub struct HypercallWallet {
    pub address: AccountAddress,
    /* private fields */
}
Expand description

Wallet for signing Hypercall operations with EIP-712.

Fields§

§address: AccountAddress

The wallet address

Implementations§

Source§

impl HypercallWallet

Source

pub async fn sign_create_rfq_v2( &self, terms: RfqV2Terms, nonce: u64, ) -> Result<CreateRfqV2Request>

Source

pub async fn sign_rfq_v2_firm_quote( &self, terms: RfqV2FirmQuoteTerms, nonce: u64, ) -> Result<PublishRfqV2FirmQuoteRequest>

Source

pub async fn sign_rfq_v2_indicative_quote( &self, terms: RfqV2IndicativeQuoteTerms, ) -> Result<PublishRfqV2IndicativeQuoteRequest>

Source

pub async fn sign_rfq_v2_firm_up( &self, rfq_id: Uuid, indicative_quote_id: Uuid, requested_units: u128, auth: RfqV2ActionAuth, ) -> Result<RequestRfqV2FirmQuoteRequest>

Source

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.

Source

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.

Source

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.

Source

pub async fn sign_rfq_v2_invalidation( &self, target: RfqV2InvalidationTarget, auth: RfqV2ActionAuth, ) -> Result<RfqV2InvalidationRequest>

Source

pub async fn sign_rfq_v2_bulk_withdrawal( &self, maker_account: WalletAddress, scope: RfqV2BulkWithdrawalScope, auth: RfqV2ActionAuth, ) -> Result<RfqV2BulkWithdrawalRequest>

Source

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.

Source

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.

Source

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

Source

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.

Source

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.

Source

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 uses 999.
Source

pub fn random(chain_id: u32) -> Self

Create a new random wallet (useful for testing).

Source

pub fn from_bytes(bytes: &[u8; 32], chain_id: u32) -> Result<Self>

Create a wallet from raw private key bytes.

Source

pub fn with_chain_id(self, chain_id: u32) -> Self

Set the chain ID for EIP-712 signing domain.

Source

pub fn with_nonce_provider(self, nonce_provider: Arc<dyn NonceProvider>) -> Self

Return a copy of this wallet that obtains nonces from nonce_provider.

Source

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.

Source

pub fn current_nonce(&self) -> u64

Get the current nonce without incrementing.

Source

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.

Source

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.

Source

pub async fn sign_perp_limit_order_payload( &self, payload: PerpLimitOrderSignature, ) -> Result<String>

Source

pub async fn sign_perp_cancel_by_oid_payload( &self, payload: PerpCancelByOidSignature, ) -> Result<String>

Source

pub async fn sign_perp_cancel_by_cloid_payload( &self, payload: PerpCancelByCloidSignature, ) -> Result<String>

Source

pub async fn sign_set_account_abstraction_payload( &self, payload: SetAccountAbstractionSignature, ) -> Result<String>

Source

pub async fn sign_update_api_wallet_payload( &self, payload: UpdateApiWalletSignature, ) -> Result<String>

Source

pub async fn sign_standard_usdc_withdrawal_payload( &self, payload: StandardUsdcWithdrawalSignature<'_>, ) -> Result<String>

Sign the Standard Margin WithdrawUsdc schema.

Source

pub async fn sign_portfolio_usdc_withdrawal_payload( &self, payload: PortfolioUsdcWithdrawalSignature, ) -> Result<String>

Sign the manager-domain Portfolio Margin HLSendAsset route.

Source

pub async fn sign_place_order_payload( &self, payload: PlaceOrderSignature<'_>, ) -> Result<String>

Sign a PlaceOrder action.

Source

pub async fn sign_cancel_order( &self, order_id: &str, nonce: u64, ) -> Result<String>

Sign a CancelOrder action.

Source

pub async fn sign_cancel_order_payload( &self, payload: CancelOrderSignature<'_>, ) -> Result<String>

Source

pub async fn sign_replace_order_payload( &self, payload: ReplaceOrderSignature<'_>, ) -> Result<String>

Sign a ReplaceOrder action.

Source

pub async fn sign_standard_margin_liquidation_payload( &self, payload: StandardMarginLiquidationSignature<'_>, ) -> Result<String>

Source

pub async fn sign_set_margin_mode( &self, margin_mode: &str, nonce: u64, ) -> Result<String>

Sign a SetMarginMode action.

Source

pub async fn sign_redeem_pool_shares( &self, shares: &str, nonce: u64, ) -> Result<String>

Sign a RedeemPoolShares action. shares must be the exact decimal string sent in the request body.

Source

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).

Source

pub async fn sign_submit_rfq( &self, rfq_id: [u8; 32], legs_hash: [u8; 32], nonce: u64, ) -> Result<String>

Sign a SubmitRFQ action.

Source

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).

Source

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.

Source

pub async fn sign_submit_auto_execute_rfq( &self, rfq_id: [u8; 32], legs_hash: [u8; 32], limit_price: I256, nonce: u64, ) -> Result<String>

Sign a SubmitAutoExecuteRfq action.

Source

pub async fn sign_connect_quote_provider( &self, timestamp: U256, nonce: u64, ) -> Result<String>

Sign a ConnectQuoteProvider action (for QP WebSocket auth).

Trait Implementations§

Source§

impl ApiWalletDirectiveSigner for HypercallWallet

Source§

impl Clone for HypercallWallet

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HypercallWallet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl HypercallSigner for HypercallWallet

Source§

impl ManagerDirectiveSigner for HypercallWallet

Source§

impl PerpDirectiveSigner for HypercallWallet

Source§

impl TeeApiWalletManagerSigner for HypercallWallet

Source§

async fn sign_authentication_payload(&self, timestamp: i64) -> Result<String>

EIP-191 signature over Hypercall’s timestamped authentication message.
Source§

async fn sign_tee_api_wallet_approval_payload( &self, payload: TeeApiWalletApprovalSignature<'_>, ) -> Result<String>

Source§

impl TeePerpSigner for HypercallWallet

Source§

impl UsdcWithdrawalSigner for HypercallWallet

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more