Skip to main content

Signer

Struct Signer 

Source
pub struct Signer { /* private fields */ }
Expand description

High-performance signer.

Implementations§

Source§

impl Signer

Source

pub fn new(keypair: Keypair, signature_domain: SignatureDomain) -> Self

Create a signer.

Source

pub fn with_nonce_manager( keypair: Keypair, signature_domain: SignatureDomain, nonce_manager: NonceManager, ) -> Self

Create a signer with nonce management.

Source

pub fn without_order_id(self) -> Self

Disable optional pre-computed order ID generation.

Source

pub fn with_order_id(self) -> Self

Enable optional pre-computed order ID generation.

Source

pub fn computes_order_id(&self) -> bool

Check whether order ID generation is enabled.

Source

pub fn set_order_id(&mut self, enabled: bool)

Set whether single-order ID generation is enabled.

Source

pub fn with_batch_order_ids(self) -> Self

Enable optional pre-computed batch order IDs for multi-order transactions.

When enabled, sign_group() and grouped legacy batch methods include order_ids. Default is disabled to avoid extra hashing work in hot paths.

Source

pub fn without_batch_order_ids(self) -> Self

Disable optional pre-computed batch order IDs.

Source

pub fn computes_batch_order_ids(&self) -> bool

Check whether batch order ID generation is enabled.

Source

pub fn set_batch_order_ids(&mut self, enabled: bool)

Set whether batch order ID generation is enabled.

Source

pub fn pubkey(&self) -> Pubkey

Get signer pubkey.

Source

pub const fn signature_domain(&self) -> SignatureDomain

Network identity committed into every transaction signature.

Source

pub fn sign_bytes(&self, message: &[u8]) -> String

Sign raw bytes and return base58 signature.

Source

pub fn sign_action( &mut self, action: &Action, nonce: u64, account: &Pubkey, ) -> Result<SignedTransaction>

Low-level signing entrypoint.

Source

pub fn sign_action_self( &mut self, action: &Action, nonce: u64, ) -> Result<SignedTransaction>

Sign using signer pubkey as account.

Source

pub fn sign( &mut self, item: OrderItem, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign a single order item.

Source

pub fn sign_all( &self, items: Vec<OrderItem>, base_nonce: Option<u64>, ) -> Result<Vec<SignedTransaction>>

Sign multiple independent items in parallel.

Source

pub fn sign_group( &mut self, items: Vec<OrderItem>, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign multiple items atomically as one transaction.

Source

pub fn sign_faucet(&mut self, nonce: Option<u64>) -> Result<SignedTransaction>

Sign a faucet action.

Source

pub fn sign_agent_wallet( &mut self, agent: Pubkey, delete: bool, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign agent wallet creation/deletion.

Source

pub fn sign_approve_commission_fee( &mut self, to: Pubkey, fee: u8, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign builder-code recipient approval.

Builder codes are encoded as commission fees on the wire.

Source

pub fn sign_approve_builder_code( &mut self, to: Pubkey, fee: u8, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign builder-code recipient approval.

Source

pub fn sign_revoke_commission_fee( &mut self, to: Pubkey, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign builder-code recipient revocation.

Source

pub fn sign_revoke_builder_code( &mut self, to: Pubkey, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign builder-code recipient revocation.

Source

pub fn sign_update_liquidator_config( &mut self, config: LiquidatorConfig, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign a liquidator config update (liq).

Source

pub fn sign_user_settings( &mut self, settings: UserSettings, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign user settings update.

Source

pub fn sign_oracle_prices( &mut self, oracles: Vec<OraclePrice>, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign one or more oracle price updates (px actions).

Source

pub fn sign_pyth_oracle( &mut self, oracles: Vec<PythOraclePrice>, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign a batch Pyth oracle update (o action).

Source

pub fn sign_whitelist_faucet( &mut self, target: Pubkey, whitelist: bool, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign whitelist faucet access update (admin).

Source

pub fn sign_create_sub_account( &mut self, sub_account: CreateSubAccount, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign a sub-account creation (optionally with initial margin transfer).

Source

pub fn sign_remove_sub_account( &mut self, to_remove: Pubkey, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign a sub-account removal.

Source

pub fn sign_rename_sub_account( &mut self, rename: RenameSubAccount, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign a sub-account rename.

Source

pub fn sign_transfer( &mut self, transfer: Transfer, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign a margin transfer between accounts.

Source

pub fn sign_withdraw( &mut self, withdraw: Withdraw, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign a portfolio withdraw.

Source

pub fn sign_withdraw_lock_recover( &mut self, recover: WithdrawLockRecover, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign a withdraw-lock recovery.

Source

pub fn sign_create_multisig( &mut self, create_multisig: CreateMultisig, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign a multisig creation.

Source

pub fn sign_multisig_propose( &mut self, propose: MultisigPropose, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign a multisig proposal.

Source

pub fn sign_multisig_approve( &mut self, approve: MultisigApprove, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign a multisig approval.

Source

pub fn sign_multisig_reject( &mut self, reject: MultisigReject, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign a multisig rejection.

Source

pub fn sign_multisig_cancel( &mut self, cancel: MultisigCancel, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign a multisig cancellation.

Source

pub fn sign_multisig_execute( &mut self, execute: MultisigExecute, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign a multisig execution.

Source

pub fn sign_update_multisig_policy( &mut self, update: UpdateMultisigPolicy, nonce: Option<u64>, ) -> Result<SignedTransaction>

Sign a multisig policy update.

Source

pub fn sign_order( &mut self, orders: Vec<OrderItem>, nonce: Option<u64>, ) -> Result<SignedTransaction>

👎Deprecated since 0.2.0:

Use sign(), sign_all(), or sign_group() instead

Deprecated compatibility alias.

Source

pub fn sign_orders_batch( &self, order_batches: Vec<Vec<OrderItem>>, base_nonce: Option<u64>, ) -> Result<Vec<SignedTransaction>>

👎Deprecated since 0.2.0:

Use sign_all() for simple batches

Deprecated compatibility alias.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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