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- Pick a release from widgrensit/asobi-defold releases and add its Source code (zip) URL (or a packaged
.zipasset, if the library ships one) togame.projectunder[project]dependencies, then Fetch Libraries in the Defold editor. - Run
bunx @defold-typescript/cli resolveto materialize its types. - Import it under a namespace alias of your choice:
import * as api_economy from "asobi.api.economy"
- Pick a release from widgrensit/asobi-defold releases and add its Source code (zip) URL (or a packaged
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 to50.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.