pub struct InjectedProvider { /* private fields */ }Expand description
Explicit adapter for an application-selected Quai EIP-1193 provider object.
The configured endpoint is an exact routing identity, not a fetched URL. The encoded shard is included in every request as in pinned quais.js. Construction never requests accounts or signatures. Generic Transport is read-only; explicit methods are the only route to supported permission-sensitive wallet requests.
Implementations§
Source§impl InjectedProvider
impl InjectedProvider
Sourcepub fn signed_submission_transport(&self) -> InjectedSubmissionTransport
pub fn signed_submission_transport(&self) -> InjectedSubmissionTransport
Opt into forwarding verified signed bytes through this wallet’s RPC.
Construction performs no network requests or permission/signing prompts.
The original InjectedProvider transport retains its read-only allowlist.
Source§impl InjectedProvider
impl InjectedProvider
Sourcepub async fn send_quai_transaction(
&self,
address: QuaiAddress,
transaction: &QuaiTransaction,
) -> Result<WalletSendAcknowledgement, WalletSendError>
pub async fn send_quai_transaction( &self, address: QuaiAddress, transaction: &QuaiTransaction, ) -> Result<WalletSendAcknowledgement, WalletSendError>
Explicitly ask the selected wallet to authorize, sign and send a populated
type-0 request using quai_sendTransaction. No offline-signing support is
required. Retain account/nonce/digest before awaiting in case of cancellation.
Wallets may alter fields in their approval flow: the returned acknowledgement
does not assert exact signing; call observe to verify and compare the result.
Source§impl InjectedProvider
impl InjectedProvider
Sourcepub fn new(
provider: JsValue,
endpoint: Endpoint,
shard: Shard,
expected_chain: U256,
config: BrowserConfig,
) -> Result<Self, BrowserError>
pub fn new( provider: JsValue, endpoint: Endpoint, shard: Shard, expected_chain: U256, config: BrowserConfig, ) -> Result<Self, BrowserError>
Bind an explicitly selected JS provider, endpoint identity, shard and expected chain. No global provider discovery or wallet prompt occurs.
Sourcepub fn context_revision(&self) -> u32
pub fn context_revision(&self) -> u32
Monotonic account/chain/disconnect revision shared by adapter clones. Applications can invalidate displayed balances and cached authorization on change.
Sourcepub fn monitors_context_events(&self) -> bool
pub fn monitors_context_events(&self) -> bool
Whether this provider exposes removable EIP-1193 event listeners.
Sourcepub async fn read(
&self,
endpoint: &Endpoint,
method: &str,
params: Value,
) -> Result<Value, BrowserError>
pub async fn read( &self, endpoint: &Endpoint, method: &str, params: Value, ) -> Result<Value, BrowserError>
Read through the fixed injected wallet after a fresh chain check. Account/signing/sending permission methods cannot pass this allowlist.
Sourcepub async fn request_accounts(&self) -> Result<Vec<QuaiAddress>, BrowserError>
pub async fn request_accounts(&self) -> Result<Vec<QuaiAddress>, BrowserError>
Request wallet account access explicitly. Call only in the application’s user-approved flow. User rejection preserves numeric EIP-1193 code 4001. No retry occurs.
Sourcepub async fn accounts(&self) -> Result<Vec<QuaiAddress>, BrowserError>
pub async fn accounts(&self) -> Result<Vec<QuaiAddress>, BrowserError>
Read accounts already exposed by the wallet; never requests additional permission.
Sourcepub async fn personal_sign(
&self,
address: QuaiAddress,
message: &[u8],
) -> Result<[u8; 65], BrowserError>
pub async fn personal_sign( &self, address: QuaiAddress, message: &[u8], ) -> Result<[u8; 65], BrowserError>
Explicitly ask the wallet to sign these bytes with personal_sign.
Checks the configured chain, account exposure and sender zone before calling. Recovers the exact message signature and requires the requested account. Dropping this future cannot dismiss or revoke a wallet approval already presented by the injected provider.
Sourcepub async fn sign_typed_data(
&self,
address: QuaiAddress,
data: &TypedData,
policy: DomainPolicy,
) -> Result<[u8; 65], BrowserError>
pub async fn sign_typed_data( &self, address: QuaiAddress, data: &TypedData, policy: DomainPolicy, ) -> Result<[u8; 65], BrowserError>
Explicitly request EIP-712 v4 signing after domain, chain and account checks. The immutable document determines both the serialized request and recovered signature hash. No implicit permission request or automatic retry occurs.
Sourcepub async fn sign_quai_transaction(
&self,
address: QuaiAddress,
transaction: &QuaiTransaction,
) -> Result<SignedQuaiTransaction, BrowserError>
pub async fn sign_quai_transaction( &self, address: QuaiAddress, transaction: &QuaiTransaction, ) -> Result<SignedQuaiTransaction, BrowserError>
Explicitly request signing of an exact, fully populated type-0 Quai transaction. Does not estimate, fill fields, request accounts or broadcast. Canonical returned protobuf must recover the requested exposed account and match every unsigned field, including ordered access-list entries. Dropping the future cannot retract an already displayed wallet approval.