pub enum SdkError {
ContractNotConfigured,
ContractNotDeployed {
address: Address,
chain_id: u64,
},
DomainChainIdMismatch {
domain: String,
client: u64,
},
DomainVerifyingContractMismatch {
domain: Address,
configured: Address,
},
InvalidValidTimeWindow {
valid_after: U256,
valid_before: U256,
},
EmptyTransferDetails,
FromSignerMismatch {
from: Address,
signer: Address,
},
AuthorizerSignerMismatch {
authorizer: Address,
signer: Address,
},
EventNotFound,
ReceiptNotFound,
Alloy(String),
Signer(Error),
}Expand description
SDK 全体で返すエラー型(RPC・コントラクト・署名・検証の失敗をまとめる)。
Variants§
ContractNotConfigured
crate::config::transfer_with_commitment_address がゼロアドレスのまま API を呼んだ。
ContractNotDeployed
期待する TWC アドレスにコントラクトコードが無い。
DomainChainIdMismatch
署名済みデータの domain.chainId が RPC のチェーン ID と一致しない。
DomainVerifyingContractMismatch
署名済みデータの domain.verifyingContract が設定アドレスと一致しない。
InvalidValidTimeWindow
EIP-712 メッセージの validAfter が validBefore より大きい(有効期間が空)。
EmptyTransferDetails
crate::sign::uni_commit_transfers / crate::sign::batch_transfer_with_commit、および crate::send_transaction::self_transfer::unified_transfer / crate::send_transaction::self_transfer::batch_transfer で明細配列が空(コントラクトは revert する)。
FromSignerMismatch
EIP-712 メッセージの from が Signer::address と一致しない(オンチェーン検証で署名が通らないため、署名前に拒否する)。
AuthorizerSignerMismatch
CancelAuthorization の authorizer が Signer::address と一致しない。
EventNotFound
crate::verify::verify で、条件に合致する TransferWithCommitmentSent ログが 1 件もなかった。
ReceiptNotFound
指定ハッシュのトランザクションレシートが RPC から返らなかった(crate::verify::verify・crate::verify::get_transfer_with_commitment_sent_event_logs)。
Alloy(String)
RPC 呼び出しまたはコントラクトエンコード/デコードの失敗。
Signer(Error)
[alloy::signers::Signer] によるハッシュ署名の失敗。
Trait Implementations§
Source§impl Error for SdkError
impl Error for SdkError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for SdkError
impl !RefUnwindSafe for SdkError
impl Send for SdkError
impl Sync for SdkError
impl Unpin for SdkError
impl !UnwindSafe for SdkError
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<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>
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§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.