UNPKG

@puzzlehq/types

Version:

Puzzle <3 Typescript

89 lines (88 loc) 2.98 kB
import { z } from 'zod'; export var RecordStatus; (function (RecordStatus) { RecordStatus['Unspent'] = 'Unspent'; RecordStatus['Pending'] = 'Pending'; RecordStatus['Spent'] = 'Spent'; })(RecordStatus || (RecordStatus = {})); export const getNestedProperty = (data, path) => { let result = data; for (const key of path) { if (typeof result !== 'object' || result[key] === undefined) { return undefined; } result = result[key]; } return result; }; export const getNestedStringProperty = (data, path) => { const result = getNestedProperty(data, path); if (typeof result === 'string') { return result; } return undefined; }; /// enums export var EventType; (function (EventType) { EventType['Deploy'] = 'Deploy'; EventType['Execute'] = 'Execute'; EventType['Send'] = 'Send'; EventType['Receive'] = 'Receive'; EventType['Join'] = 'Join'; EventType['Split'] = 'Split'; EventType['Shield'] = 'Shield'; EventType['Unshield'] = 'Unshield'; EventType['Referral'] = 'Referral'; EventType['Points'] = 'Points'; /// arcade EventType['Spin'] = 'Spin'; EventType['Raffle'] = 'Raffle'; EventType['Mint'] = 'Mint'; EventType['StoreStock'] = 'Store Stock'; EventType['StorePurchase'] = 'Store Purchase'; EventType['StoreFulfillment'] = 'Store Fulfillment'; EventType['GiveawayEntry'] = 'Giveaway Entry'; EventType['GiveawayDraw'] = 'Giveaway Draw'; EventType['GiveawayWin'] = 'Giveaway Win'; EventType['SquashMint'] = 'Squash Mint'; EventType['SquashWater'] = 'Squash Water'; EventType['SquashLevelUp'] = 'Squash Level Up'; EventType['MysteryCity'] = 'Mystery City'; EventType['CreditsUpgrade'] = 'Credits Upgrade'; EventType['StreakFreeze'] = 'Streak Freeze'; EventType['DigitalAssetPurchase'] = 'Digital Asset Purchase'; })(EventType || (EventType = {})); export var EventStatus; (function (EventStatus) { EventStatus['Creating'] = 'Creating'; EventStatus['Pending'] = 'Pending'; EventStatus['Settled'] = 'Settled'; EventStatus['Failed'] = 'Failed'; })(EventStatus || (EventStatus = {})); export var Visibility; (function (Visibility) { Visibility['Private'] = 'Private'; Visibility['Public'] = 'Public'; })(Visibility || (Visibility = {})); export var Network; (function (Network) { Network['AleoTestnet'] = 'AleoTestnet'; Network['AleoMainnet'] = 'AleoMainnet'; })(Network || (Network = {})); /// note: these are not necessarily correct yet (except for testnet3) export const networkPath = (network) => { switch (network) { case Network.AleoTestnet: return 'testnet'; case Network.AleoMainnet: return 'mainnet'; } }; export const zodEventType = z.nativeEnum(EventType); export const zodEventStatus = z.nativeEnum(EventStatus); export const zodNetwork = z.nativeEnum(Network); export const zodVisibility = z.nativeEnum(Visibility); export const zodRecordStatus = z.nativeEnum(RecordStatus); export * from './aleo.js'; //# sourceMappingURL=index.js.map