Skip to Content
defold-typescript libraries
widgrensitasobi-defold

widgrensit/asobi-defold/asobi.api.economy

asobi wallets and the store over REST. A project reaches it as client.economy.

  • GitHub: widgrensit/asobi-defold — pinned to v1.18.1
    1. Pick a release from widgrensit/asobi-defold releases and add its Source code (zip) URL (or a packaged .zip asset, if the library ships one) to game.project under [project] dependencies, then Fetch Libraries in the Defold editor.
    2. Run bunx @defold-typescript/cli resolve to materialize its types.
    3. Import it under a namespace alias of your choice:
      import * as api_economy from "asobi.api.economy"

Functions

get_wallets(client: Client, callback?: HttpCallback)

Fetches the signed-in player's wallets.

Parameters

  • client: Client — The client.
  • callback?: HttpCallback — Receives the wallets, or the error.

get_history(client: Client, currency: string, limit?: number, callback?: HttpCallback)

Fetches the transactions of one wallet.

Parameters

  • client: Client — The client.
  • currency: string — The wallet's currency.
  • limit?: number — The most transactions to return. Defaults to 50.
  • callback?: HttpCallback — Receives the transactions, or the error.

get_store(client: Client, currency?: string, callback?: HttpCallback)

Fetches the store's listings.

Parameters

  • client: Client — The client.
  • currency?: string — Only the listings priced in this currency. Every listing when left out.
  • callback?: HttpCallback — Receives the listings, or the error.

purchase(client: Client, listing_id: string, callback?: HttpCallback)

Buys a store listing with the signed-in player's wallet.

Parameters

  • client: Client — The client.
  • listing_id: string — The listing's id.
  • callback?: HttpCallback — Receives the purchase, or the error.

On this page