pub struct ExternalSparkSignerAdapter { /* private fields */ }Expand description
Wraps a foreign ExternalSparkSigner and implements the native
spark_wallet::SparkSigner over it.
Implementations§
Source§impl ExternalSparkSignerAdapter
impl ExternalSparkSignerAdapter
pub fn new(inner: Arc<dyn ExternalSparkSigner>) -> Self
Trait Implementations§
Source§impl SparkSigner for ExternalSparkSignerAdapter
impl SparkSigner for ExternalSparkSignerAdapter
Source§fn get_identity_public_key<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PublicKey, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_identity_public_key<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<PublicKey, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the wallet’s identity public key.
Source§fn get_public_key_for_leaf<'life0, 'life1, 'async_trait>(
&'life0 self,
leaf_id: &'life1 TreeNodeId,
) -> Pin<Box<dyn Future<Output = Result<PublicKey, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_public_key_for_leaf<'life0, 'life1, 'async_trait>(
&'life0 self,
leaf_id: &'life1 TreeNodeId,
) -> Pin<Box<dyn Future<Output = Result<PublicKey, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns the signing public key for a tree leaf. Needed by callers that
must construct transactions (refunds, etc.) before signing them.
Source§fn is_remote(&self) -> bool
fn is_remote(&self) -> bool
Whether this signer is backed by a remote service, so its operations
(deriving a leaf’s public key, signing) are network round-trips rather
than local computation. When true, callers should avoid redundant signer
calls, e.g. re-deriving keys for leaves whose ownership is already
verified in storage. Defaults to false: most signers are local.
Source§fn get_static_deposit_public_key<'life0, 'async_trait>(
&'life0 self,
index: u32,
) -> Pin<Box<dyn Future<Output = Result<PublicKey, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_static_deposit_public_key<'life0, 'async_trait>(
&'life0 self,
index: u32,
) -> Pin<Box<dyn Future<Output = Result<PublicKey, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the static-deposit public key at
index. The wallet hands this
to the operators to derive a static-deposit address. Analogous to
get_public_key_for_leaf.Source§fn sign_authentication_challenge<'life0, 'life1, 'async_trait>(
&'life0 self,
challenge: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Signature, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sign_authentication_challenge<'life0, 'life1, 'async_trait>(
&'life0 self,
challenge: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Signature, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Signs a server authentication challenge with the wallet identity key
(ECDSA). Used for Spark operator (gRPC) and SSP session authentication.
Source§fn sign_message<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Signature, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sign_message<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Signature, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Signs an arbitrary user message with the wallet identity key (ECDSA).
Distinct from
sign_authentication_challenge
so a policy-enforcing signer can gate user-facing message signing
separately from session authentication.Source§fn sign_leaf_refund_spend<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
leaf_id: &'life1 TreeNodeId,
sighash: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<Signature, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn sign_leaf_refund_spend<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
leaf_id: &'life1 TreeNodeId,
sighash: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<Signature, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Schnorr-sign
sighash to spend a tree leaf’s P2TR refund output as a
BIP341 key-path spend, with the leaf key as sole signer.Source§fn sign_frost<'life0, 'async_trait>(
&'life0 self,
jobs: Vec<FrostJob>,
) -> Pin<Box<dyn Future<Output = Result<Vec<FrostShareResult>, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sign_frost<'life0, 'async_trait>(
&'life0 self,
jobs: Vec<FrostJob>,
) -> Pin<Box<dyn Future<Output = Result<Vec<FrostShareResult>, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Produce FROST shares for a batch of jobs (maps to
SPARK_SIGN_FROST).
Used directly by deposit tree creation, transfer/coop-exit refund
signing, timelock renewal, static-deposit refund, lightning send, and
swap (with adaptor). Results are returned in the same order as jobs.Source§fn prepare_transfer<'life0, 'async_trait>(
&'life0 self,
request: PrepareTransferRequest,
) -> Pin<Box<dyn Future<Output = Result<PreparedTransfer, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prepare_transfer<'life0, 'async_trait>(
&'life0 self,
request: PrepareTransferRequest,
) -> Pin<Box<dyn Future<Output = Result<PreparedTransfer, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prepare an outbound transfer. Returns the per-operator key-tweak
packages, the new per-leaf keys, and the transfer-package signature
(see [
PreparedTransfer]). Refund signing is a separate
sign_frost call. Maps to SPARK_PREPARE_TRANSFER.Source§fn prepare_claim<'life0, 'async_trait>(
&'life0 self,
request: PrepareClaimRequest,
) -> Pin<Box<dyn Future<Output = Result<PreparedClaim, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prepare_claim<'life0, 'async_trait>(
&'life0 self,
request: PrepareClaimRequest,
) -> Pin<Box<dyn Future<Output = Result<PreparedClaim, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prepare the key-tweak step for claiming an inbound transfer. Returns one
key-tweak package per operator that re-keys each claimed leaf to the
receiver (see [
PreparedClaim]). Refund signing is a separate
sign_frost call. Maps to SPARK_CLAIM_TRANSFER.Source§fn prepare_lightning_receive<'life0, 'async_trait>(
&'life0 self,
request: PrepareLightningReceiveRequest,
) -> Pin<Box<dyn Future<Output = Result<PreparedLightningReceive, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prepare_lightning_receive<'life0, 'async_trait>(
&'life0 self,
request: PrepareLightningReceiveRequest,
) -> Pin<Box<dyn Future<Output = Result<PreparedLightningReceive, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prepare a Lightning receive. Returns the payment hash for the BOLT11
invoice and one preimage-share package per operator (see
[
PreparedLightningReceive]). Maps to SPARK_PREPARE_LIGHTNING_RECEIVE.Source§fn prepare_static_deposit<'life0, 'async_trait>(
&'life0 self,
request: PrepareStaticDepositRequest,
) -> Pin<Box<dyn Future<Output = Result<PreparedStaticDeposit, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prepare_static_deposit<'life0, 'async_trait>(
&'life0 self,
request: PrepareStaticDepositRequest,
) -> Pin<Box<dyn Future<Output = Result<PreparedStaticDeposit, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prepare a static deposit. Returns the static-deposit secret encrypted
for the SSP and the FROST shares for the deposit tree transactions
(see [
PreparedStaticDeposit]).Source§fn start_static_deposit_refund<'life0, 'async_trait>(
&'life0 self,
request: StartStaticDepositRefundRequest,
) -> Pin<Box<dyn Future<Output = Result<StartedStaticDepositRefund, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start_static_deposit_refund<'life0, 'async_trait>(
&'life0 self,
request: StartStaticDepositRefundRequest,
) -> Pin<Box<dyn Future<Output = Result<StartedStaticDepositRefund, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Begin a static-deposit refund: return the static-deposit signing public
key, a fresh user FROST nonce commitment, and the identity-key ECDSA
signature over the refund user-statement. See
[
StartStaticDepositRefundRequest] for why this is split from
sign_static_deposit_refund.Source§fn sign_static_deposit_refund<'life0, 'async_trait>(
&'life0 self,
request: SignStaticDepositRefundRequest,
) -> Pin<Box<dyn Future<Output = Result<Signature, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sign_static_deposit_refund<'life0, 'async_trait>(
&'life0 self,
request: SignStaticDepositRefundRequest,
) -> Pin<Box<dyn Future<Output = Result<Signature, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Finish a static-deposit refund. Returns the final aggregated refund
signature; the user’s contribution is bound to the nonce committed by
start_static_deposit_refund.Source§fn sign_spark_invoice<'life0, 'async_trait>(
&'life0 self,
request: SignSparkInvoiceRequest,
) -> Pin<Box<dyn Future<Output = Result<SignedSparkInvoice, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sign_spark_invoice<'life0, 'async_trait>(
&'life0 self,
request: SignSparkInvoiceRequest,
) -> Pin<Box<dyn Future<Output = Result<SignedSparkInvoice, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Schnorr-sign a Spark invoice (sats or tokens) with the identity key.
Spark invoices are unrelated to Lightning.
Source§fn prepare_token_transaction<'life0, 'async_trait>(
&'life0 self,
request: PrepareTokenTransactionRequest,
) -> Pin<Box<dyn Future<Output = Result<PreparedTokenTransaction, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prepare_token_transaction<'life0, 'async_trait>(
&'life0 self,
request: PrepareTokenTransactionRequest,
) -> Pin<Box<dyn Future<Output = Result<PreparedTokenTransaction, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prepare a token transaction (freeze / partial / final). Returns the
identity-key signature over the request digest (see
[
PreparedTokenTransaction]).Source§fn prepare_static_deposit_claim<'life0, 'async_trait>(
&'life0 self,
request: PrepareStaticDepositClaimRequest,
) -> Pin<Box<dyn Future<Output = Result<PreparedStaticDepositClaim, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prepare_static_deposit_claim<'life0, 'async_trait>(
&'life0 self,
request: PrepareStaticDepositClaimRequest,
) -> Pin<Box<dyn Future<Output = Result<PreparedStaticDepositClaim, SignerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prepare a static-deposit claim. Returns the static-deposit secret in the
clear (the SSP co-signs the claim and needs it) and the identity-key
signature over the claim user-statement (see
[
PreparedStaticDepositClaim]).Auto Trait Implementations§
impl Freeze for ExternalSparkSignerAdapter
impl !RefUnwindSafe for ExternalSparkSignerAdapter
impl Send for ExternalSparkSignerAdapter
impl Sync for ExternalSparkSignerAdapter
impl Unpin for ExternalSparkSignerAdapter
impl UnsafeUnpin for ExternalSparkSignerAdapter
impl !UnwindSafe for ExternalSparkSignerAdapter
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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 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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request