This README is uncomplete!
It is recommended to use moduleResolution: "nodenext"
in your tsconfig
npm install @aresrpg/aresrpg-sdk
You have access to a few packages
import * from '@aresrpg/aresrpg-sdk/sui'
import * from '@aresrpg/aresrpg-sdk/chunk'
import * from '@aresrpg/aresrpg-sdk/experience'
import * from '@aresrpg/aresrpg-sdk/stats'
import * from '@aresrpg/aresrpg-sdk/spells' // json file
import * from '@aresrpg/aresrpg-sdk/types' // some additonnal types
To start using the SDK, you need to configure it with the appropriate network details:
import { SDK } from '@aresrpg/aresrpg-sdk/sui'
const sdk = await SDK({
rpc_url: 'https://fullnode.testnet.sui.io/',
wss_url: 'wss://fullnode.testnet.sui.io/',
network: 'testnet', // required for modules addresses
})
Get a list of characters locked in the AresRPG extension of personal kiosks for an address:
const lockedCharacters = await sdk.get_locked_characters('0x00')
console.log(lockedCharacters)
Get a list of characters locked in every personal kiosks (unselected):
const unlockedCharacters = await sdk.get_unlocked_characters('0x00')
console.log(unlockedCharacters)
Subscribe to blockchain events:
const unsubscribe = await sdk.subscribe(sui_event => {
console.log('New event:', sui_event)
})
Contributions are welcome! Please feel free to submit pull requests or open issues to improve the library or suggest new features.