Info Methods
InfoClient provides read-only access to exchange, market, account, resolution, and agent data through the Exchange HTTP API.
These methods do not require a wallet or signature.
import { createInfoClient } from "@gammaswap/v2-exchange-sdk";
const info = createInfoClient({
apiUrl: "https://exchange-api.gammaswap.com/api",
});getAsset
Returns registered metadata for the current state of an asset.
const asset = await info.getAsset(
"261336857817713630688382311349658711122006440411137",
);Endpoint:
GET /asset/:assetIdResponse:
{
"assetId": "261336857817713630688382311349658711122006440411137",
"epoch": "12",
"registered": true,
"expiration": "1730000000",
"assetType": "2",
"strikePrice": "999000",
"ledger": "0x1111111111111111111111111111111111111111"
}getResolutionPrice
Returns the stored resolution price for a specific asset and epoch.
Endpoint:
Response:
getLastResolutionPrice
Returns the latest stored resolution price for an asset.
Endpoint:
Response:
getBalance
Returns the current balance snapshot for an account.
Endpoint:
Response:
getOrderBook
Returns an aggregated order-book snapshot for an asset and epoch.
Endpoint:
The endpoint also accepts an optional depth query parameter. It defaults to 200 and is constrained to a value between 1 and 5000.
Response:
getBookOrders
Returns resting book orders owned by one account.
Endpoint:
Response:
getTopOfBook
Returns the best bid, best ask, and last traded price for an asset and epoch.
Endpoint:
Response:
getPosition
Returns an account’s position for a specific asset and epoch.
Endpoint:
Response:
getAgentApproval
Returns the current agent approval for a master account.
Endpoint:
Response:
Possible status values:
When no approval exists, the response uses an empty agent address and a zero nonce:
getAgentApprovalNonce
Returns only the parsed agent approval nonce for a master account.
Endpoint:
SDK response:
The underlying HTTP endpoint returns the complete approval object:
getAgentApprovalNonce parses and returns only the nonce field.
getExchangeConfig
Returns the configured exchange contract addresses for a chain.
Endpoint:
The SDK README identifies this method and endpoint, but the supplied HTTP API documentation does not define the response body.
An example response should not be published until the development team provides the exact returned contract fields.
Available methods
getAsset
GET /asset/:assetId
getResolutionPrice
GET /resolve/:assetId/:epoch
getLastResolutionPrice
GET /resolve/last/epoch/:assetId
getBalance
GET /balance/:account
getOrderBook
GET /book/:assetId/:epoch
getBookOrders
GET /book/:assetId/:epoch/:account
getTopOfBook
GET /book/market/top/:assetId/:epoch
getPosition
GET /position/:account/:assetId/:epoch
getAgentApproval
GET /agents/status/:master
getAgentApprovalNonce
GET /agents/status/:master
getExchangeConfig
GET /config/chains/:chainId
Last updated