💰 Bag

Quickstart

What's this? Getting started

Building a store bot

(LEGACY) Building a store bot

Codebase

Methods

Types

App

Properties:

id: number
name: string
description: string
permissions: string
public: boolean
metadata: string

Item

Properties:

name: string
image: string
description: string
reaction: string
commodity: boolean
tradable: boolean
public: boolean
metadata: string

Skill

Properties:

name: string
maxLevel: number
description: string
reaction: string
metadata: string

Identity

Properties:

slack: string
inventory: Instance[]
metadata: string

Instance

Properties:

id: number
itemId: string
identityId: string
quantity: number
metadata: string
item: Item

SkillInstance

Properties:

id: number
skillId: string
identityId: string
level: number
metadata: string
skill: Skill

Trade

Properties:

id: number
initiatorIdentityId: string
receiverIdentityId: string
initiatorTrades: TradeInstance[]
receiverTrades: TradeInstance[]
public: boolean
closed: boolean

TradeInstance

Properties:

id: number
instanceId: number
instance: Instance
quantity: number

RecipeItem

Properties:

id: number
recipeItemId: string
recipeItem: Item
quantity: number

Recipe

Properties:

id: number
inputs: RecipeItem[]
outputs: RecipeItem[]
tools: RecipeItem[]
skills: Skill[]
public: boolean
description: string
time: number

Action

Properties:

id: number
locations: string[]
tools: string[]
branch: string

ActionInstance

Properties:

id: number
done: boolean
identityId: string
identity: Identity
actionId: number
action: Action

OfferItem

Properties:

itemName: string
quantity: number

Methods

createInstances

Arguments:

instances: Instance[]
identityId: string
show: boolean
note: string

Returns:

response: string
instances: Instance[]

createInstance

Arguments:

itemId: string
identityId: string
quantity: number
metadata: string
public: boolean
show: boolean
note: string

Returns:

response: string
instance: Instance

createApp

Arguments:

name: string
description: string
permissions: number
public: boolean
metadata: string

Returns:

response: string
app: App

createItem

Arguments:

item: Item

Returns:

response: string
item: Item

createRecipe

Arguments:

recipe: Recipe

Returns:

response: string
recipe: Recipe

createTrade

Arguments:

initiator: string
receiver: string
callbackUrl: string
callbackMetadata: string
public: boolean

Returns:

response: string
initiated: boolean

createAction

Arguments:

action: Action

Returns:

response: string
action: Action

getIdentities

Arguments:

query: string

Returns:

response: string
identities: Identity[]

getIdentity

Arguments:

identityId: string

Returns:

response: string
identity: Identity

getInventory

Arguments:

identityId: string
available: boolean

Returns:

response: string
inventory: Instance[]

getItem

Arguments:

query: string

Returns:

response: string
item: Item

getItems

Arguments:

query: string

Returns:

response: string
items: Item[]

getInstance

Arguments:

instanceId: number

Returns:

response: string
instance: Instance

getApp

Arguments:

optAppId: number

Returns:

response: string
app: App

getTrade

Arguments:

query: Trade

Returns:

response: string
trade: Trade

getTrades

Arguments:

query: Trade

Returns:

response: string
trades: Trade[]

getRecipes

Arguments:

query: Recipe
inclusive: boolean

Returns:

response: string
recipes: Recipe[]

getRecipe

Arguments:

query: Recipe

Returns:

response: string
recipe: Recipe

getAction

Arguments:

query: Action

Returns:

response: string
actions: Action[]

updateIdentityMetadata

Arguments:

identityId: string
metadata: string

Returns:

response: string
identity: Identity

updateInstance

Arguments:

instanceId: number
new: Instance
show: boolean
note: string

Returns:

response: string
instance: Instance

updateItem

Arguments:

itemId: string
new: Item

Returns:

response: string
item: Item

updateApp

Arguments:

optAppId: number
new: App

Returns:

response: string
app: App

updateTrade

Arguments:

tradeId: number
identityId: string
add: Instance[]
remove: Instance[]
callbackUrl: string
callbackMetadata: string

Returns:

response: string
initiated: boolean

updateRecipe

Arguments:

recipeId: number
new: Recipe

Returns:

response: string
recipe: Recipe

updateAction

Arguments:

actionId: number
new: Action

Returns:

response: string
action: Action

deleteApp

Arguments:

deleteAppId: number

Returns:

response: string
deletedApp: App

deleteInstance

Arguments:

instanceId: number

Returns:

response: string
deletedInstance: Instance

deleteTrade

Arguments:

tradeId: number

Returns:

response: string
deletedTrade: Trade

closeTrade

Arguments:

tradeId: number
cancel: boolean
callbackUrl: string
callbackMetadata: string

Returns:

response: string
initiated: boolean

verifyKey

Arguments:

No extra fields.

Returns:

valid: boolean

runGive

Arguments:

giverId: string
receiverId: string
instances: Instance[]

Returns:

response: string
instances: Instance[]

runCraft

Arguments:

identityId: string
recipeId: number
callbackUrl: string
callbackMetadata: string

Returns:

response: string
time: number

getCraftStatus

Arguments:

identityId: string

Returns:

response: string
crafting: boolean

makeOffer

Arguments:

sourceIdentityId: string
targetIdentityId: string
offerToGive: OfferItem[]
offerToReceive: OfferItem[]
callbackUrl: string
slackIdToDm: string

Returns:

response: string
success: boolean