import {
BNB_TESTNET,
GachaMachineStage,
createGachaClient,
getError,
getValue,
isFailed,
} from '@renaiss-protocol/client';
const gacha = createGachaClient({
baseUrl: 'https://dev-api.renaiss.xyz',
network: BNB_TESTNET,
});
const result = await gacha.listGachaMachines({
stage: GachaMachineStage.Active,
pageSize: 5,
}).firstPage();
if (isFailed(result)) {
throw new Error(getError(result).detail);
}
for (const pack of getValue(result).items) {
console.log(pack.slug, pack.name, pack.priceInUsdt);
}