Skip to main content

RequestSignedDataOptions

Options for MolphaGateway.requestSignedData and the second argument to MolphaSDK.requestAndSubmit (omit feedId there — it is the first argument):
apiConfig must match the feed’s committed configuration (same shape passed to deriveApiConfigHash). maxAge (seconds) lets the gateway return a cached result when one is fresh enough.

APIConfig

The SDK canonicalizes missing fields (method"GET", headers{}, valueTransform"") before hashing and before posting to the gateway.

RoundContext

Returned by sdk.gateway.prepareContext(feedId) — pass it back via requestSignedData({ ..., context }) so each round is a single gateway POST:
Caching is opt-in. Refresh when the on-chain registry version changes; a stale context produces a result the chain will reject.

DataUpdateResult

A completed gateway round, ready to submit on-chain:

MolphaWallet

Anchor Wallet plus optional gateway auth. Keypair-backed wallets (walletFromKeypairFile) derive auth from Wallet.payer automatically; browser adapters should supply signAuthMessage:

PlanType

The SDK currently exports Basic. On-chain plan IDs remain 0…3.

Derivation helpers

owner and apiConfigHash must be exactly 32 bytes. signaturesRequired is encoded as one byte.

buildEvmVerifierArgs

Converts a DataUpdateResult into the two structs the EVM verifier’s verify() takes — a pure mapping with zero runtime dependency (use the output with ethers, viem, or a raw eth_call). Pass the feedId bytes as the first DataUpdate field. See Verify on EVM for the consumer-contract side.

buildStarknetVerifierArgs

Converts a DataUpdateResult into the Cairo verifier’s calldata structs, with no starknet.js runtime dependency. See Verify on Starknet for the consumer-contract side.