Call an endpoint

By path

const result = await client.marketplace.call({
  path: "/p/demo-api/summarize",
  method: "POST",
  body: { text: "Hello from Galliun" },
  headers: {
    // optional extra headers
  },
});

If you omit method, the SDK uses POST when body is set, otherwise GET.

By template

const result = await client.marketplace.callEndpoint({
  projectSlug: "demo-api",
  pathTemplate: "/wallets/{address}/history",
  pathParams: { address: "0xabc" },
  method: "GET",
});

This builds /p/demo-api/wallets/0xabc/history via buildProtectedEndpointPath.

Payment

On 402, the SDK selects the accept option for your chain, asks wallet.pay(...), and retries with X-PAYMENT. You do not need to encode proofs manually.

Requires a marketplace wallet: Connect a wallet.