wowok_agent 2.1.40 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2064 -177
- package/dist/index.js +1284 -1
- package/dist/schema/call/allocation.js +24 -1
- package/dist/schema/call/arbitration.js +92 -1
- package/dist/schema/call/base.d.ts +1 -1
- package/dist/schema/call/base.js +138 -1
- package/dist/schema/call/contact.js +37 -1
- package/dist/schema/call/demand.js +47 -1
- package/dist/schema/call/guard.js +58 -1
- package/dist/schema/call/handler.js +171 -1
- package/dist/schema/call/index.js +18 -1
- package/dist/schema/call/machine.d.ts +32 -32
- package/dist/schema/call/machine.js +152 -1
- package/dist/schema/call/order.js +34 -1
- package/dist/schema/call/payment.js +17 -1
- package/dist/schema/call/permission.js +105 -1
- package/dist/schema/call/personal.js +68 -1
- package/dist/schema/call/progress.js +26 -1
- package/dist/schema/call/proof.js +27 -1
- package/dist/schema/call/repository.js +76 -1
- package/dist/schema/call/reward.js +42 -1
- package/dist/schema/call/service.js +82 -1
- package/dist/schema/call/treasury.js +71 -1
- package/dist/schema/common/index.js +345 -1
- package/dist/schema/index.js +7 -1
- package/dist/schema/local/index.js +855 -1
- package/dist/schema/local/wip.js +187 -1
- package/dist/schema/messenger/index.js +446 -1
- package/dist/schema/query/index.d.ts +43 -43
- package/dist/schema/query/index.js +1265 -1
- package/dist/schema/utils/guard-parser.js +401 -1
- package/dist/schema/utils/guard-query-utils.js +22 -1
- package/dist/schema/utils/node-parser.js +353 -1
- package/dist/schema/utils/permission-index-utils.js +7 -1
- package/package.json +3 -6
|
@@ -1 +1,855 @@
|
|
|
1
|
-
import{EntrypointSchema,ObjectOwnerSchema,NameOrAddressSchema,NameSchema,WowAddressSchema,TokenTypeSchema,FaucetNetworkSchema}from'../common/index.js';import{z}from'zod';export const LocalMarkConstraints={'nameMaxLength':0x40,'tagMaxLength':0x40,'tagMaxCount':0x32};export const LocalInfoConstraints={'nameMaxLength':0x40,'contentMaxLength':0x12c,'contentMaxCount':0x32,'defaultName':'Address\x20of\x20delivery'};export const AccountConstraints={'nameMaxLength':0x40};export const ErrorResultSchema=z['object']({'error':z['literal'](!![])['describe']('Always\x20true\x20for\x20error\x20responses'),'code':z['string']()['optional']()['describe']('Error\x20code\x20for\x20programmatic\x20handling'),'message':z['string']()['describe']('Human-readable\x20error\x20message'),'details':z['record'](z['string'](),z['string']())['optional']()['describe']('Additional\x20error\x20context')})['describe']('Error\x20response\x20structure');export const createResultSchema=a=>z['union']([z['object']({'success':z['literal'](!![]),'data':a}),ErrorResultSchema]);export const CoinBalanceSchema=z['object']({'coinType':z['string']()['describe']('Coin\x20type'),'coinObjectCount':z['number']()['describe']('Coin\x20object\x20count'),'totalBalance':z['string']()['describe']('Total\x20balance'),'lockedBalance':z['record'](z['string'](),z['string']())['describe']('Locked\x20balance')})['describe']('Coin\x20balance');export const CoinStructSchema=z['object']({'balance':z['string']()['describe']('Coin\x20balance'),'coinObjectId':z['string']()['describe']('Coin\x20object\x20ID'),'coinType':z['string']()['describe']('Coin\x20type'),'digest':z['string']()['describe']('Transaction\x20digest'),'previousTransaction':z['string']()['describe']('Previous\x20transaction\x20digest'),'version':z['string']()['describe']('Coin\x20object\x20version')})['describe']('Coin\x20object');export const PaginatedCoinsSchema=z['object']({'data':z['array'](CoinStructSchema)['describe']('Coin\x20object\x20list'),'hasNextPage':z['boolean']()['describe']('Whether\x20there\x20is\x20a\x20next\x20page'),'nextCursor':z['union']([z['string'](),z['null']()])['optional']()['describe']('Next\x20query\x20cursor')})['describe']('Paginated\x20coin\x20objects');export const FaucetCoinInfoSchema=z['object']({'amount':z['number']()['describe']('Coin\x20amount'),'id':z['string']()['describe']('Coin\x20ID'),'transferTxDigest':z['string']()['describe']('Transfer\x20transaction\x20digest')})['describe']('Testnet\x20faucet\x20coin\x20info');export const EventIdSchema=z['object']({'eventSeq':z['string']()['describe']('Event\x20sequence\x20number'),'txDigest':z['string']()['describe']('Transaction\x20digest')})['describe']('Event\x20ID');export const WowEventSchema=z['discriminatedUnion']('bcsEncoding',[z['object']({'id':EventIdSchema['describe']('Event\x20ID'),'packageId':z['string']()['describe']('Package\x20ID\x20where\x20event\x20originated'),'parsedJson':z['record'](z['string'](),z['union']([z['string'](),z['number'](),z['boolean']()]))['describe']('Parsed\x20JSON\x20value\x20of\x20the\x20event'),'sender':z['string']()['describe']('Sender\x27s\x20address'),'timestampMs':z['union']([z['string'](),z['null']()])['optional']()['describe']('UTC\x20timestamp\x20in\x20milliseconds\x20since\x20epoch'),'transactionModule':z['string']()['describe']('Module\x20where\x20event\x20originated'),'type':z['string']()['describe']('Move\x20event\x20type'),'bcs':z['string']()['describe']('BCS\x20encoded\x20event'),'bcsEncoding':z['literal']('base64')['describe']('BCS\x20encoding\x20format')}),z['object']({'id':EventIdSchema['describe']('Event\x20ID'),'packageId':z['string']()['describe']('Package\x20ID\x20where\x20event\x20originated'),'parsedJson':z['record'](z['string'](),z['union']([z['string'](),z['number'](),z['boolean']()]))['describe']('Parsed\x20JSON\x20value\x20of\x20the\x20event'),'sender':z['string']()['describe']('Sender\x27s\x20ID'),'timestampMs':z['union']([z['string'](),z['null']()])['optional']()['describe']('UTC\x20timestamp\x20in\x20milliseconds\x20since\x20epoch'),'transactionModule':z['string']()['describe']('Module\x20where\x20event\x20originated'),'type':z['string']()['describe']('Move\x20event\x20type'),'bcs':z['string']()['describe']('BCS\x20encoded\x20event'),'bcsEncoding':z['literal']('base58')['describe']('BCS\x20encoding\x20format')})])['describe']('Blockchain\x20event');export const BalanceChangeSchema=z['object']({'amount':z['string']()['describe']('Balance\x20change\x20value,\x20negative\x20for\x20spending,\x20positive\x20for\x20receiving'),'coinType':z['string']()['describe']('Coin\x20type'),'owner':ObjectOwnerSchema['describe']('Owner\x20of\x20the\x20balance\x20change')})['describe']('Balance\x20change');export const GasCostSummarySchema=z['object']({'computationCost':z['string']()['describe']('Computation/execution\x20cost'),'nonRefundableStorageFee':z['string']()['describe']('Non-refundable\x20storage\x20fee'),'storageCost':z['string']()['describe']('Storage\x20cost'),'storageRebate':z['string']()['describe']('Storage\x20rebate')})['describe']('Transaction\x20fee\x20summary');export const WowObjectRefSchema=z['object']({'digest':z['string']()['describe']('Base64\x20string\x20of\x20object\x20digest'),'objectId':z['string']()['describe']('Hex\x20code\x20string\x20representing\x20object\x20ID'),'version':z['union']([z['string'](),z['number']()])['describe']('Object\x20version')})['describe']('Wow\x20object\x20reference');export const OwnedObjectRefSchema=z['object']({'owner':ObjectOwnerSchema['describe']('Owner'),'reference':WowObjectRefSchema['describe']('Object\x20reference')})['describe']('Owned\x20object\x20reference');export const TransactionBlockEffectsModifiedAtVersionsSchema=z['object']({'objectId':z['string']()['describe']('Object\x20ID'),'sequenceNumber':z['string']()['describe']('Sequence\x20number')})['describe']('Transaction\x20block\x20effects\x20modified\x20versions');export const WowMoveAbortSchema=z['object']({'error_code':z['union']([z['string'](),z['null']()])['optional']()['describe']('Error\x20code'),'function':z['union']([z['string'](),z['null']()])['optional']()['describe']('Function'),'line':z['union']([z['number'](),z['null']()])['optional']()['describe']('Line\x20number'),'module_id':z['union']([z['string'](),z['null']()])['optional']()['describe']('Module\x20ID')})['describe']('Wow\x20Move\x20abort');export const ExecutionStatusSchema=z['object']({'status':z['union']([z['literal']('success'),z['literal']('failure')])['describe']('Execution\x20status'),'error':z['string']()['optional']()['describe']('Error\x20message')})['describe']('Execution\x20status');export const WowGasDataSchema=z['object']({'budget':z['string']()['describe']('Budget'),'owner':z['string']()['describe']('Owner'),'payment':z['array'](WowObjectRefSchema)['describe']('Payment'),'price':z['string']()['describe']('Price')})['describe']('Wow\x20gas\x20data');export const WowTransactionBlockKindSchema=z['object']({'kind':z['string']()['describe']('Transaction\x20type')})['passthrough']()['describe']('Wow\x20transaction\x20block\x20kind');export const TransactionBlockDataSchema=z['object']({'gasData':WowGasDataSchema['describe']('Gas\x20data'),'messageVersion':z['literal']('v1')['describe']('Message\x20version'),'sender':z['string']()['describe']('Sender'),'transaction':WowTransactionBlockKindSchema['describe']('Transaction')})['describe']('Transaction\x20block\x20data');export const WowTransactionBlockSchema=z['object']({'data':TransactionBlockDataSchema['describe']('Transaction\x20data'),'txSignatures':z['array'](z['string']())['describe']('Transaction\x20signatures')})['describe']('Wow\x20transaction\x20block');export const WowObjectChangeSchema=z['discriminatedUnion']('type',[z['object']({'type':z['literal']('published'),'digest':z['string']()['describe']('Digest'),'modules':z['array'](z['string']())['describe']('Modules'),'packageId':z['string']()['describe']('Package\x20ID'),'version':z['union']([z['string'](),z['number']()])['describe']('Version')}),z['object']({'type':z['literal']('transferred'),'digest':z['string']()['describe']('Digest'),'objectId':z['string']()['describe']('Object\x20ID'),'objectType':z['string']()['describe']('Object\x20type'),'recipient':ObjectOwnerSchema['describe']('Recipient'),'sender':z['string']()['describe']('Sender\x20ID'),'version':z['union']([z['string'](),z['number']()])['describe']('Version')}),z['object']({'type':z['literal']('mutated'),'digest':z['string']()['describe']('Digest'),'objectId':z['string']()['describe']('Object\x20ID'),'objectType':z['string']()['describe']('Object\x20type'),'owner':z['union']([ObjectOwnerSchema,z['null']()])['describe']('Owner'),'previousVersion':z['union']([z['string'](),z['number']()])['describe']('Previous\x20version'),'sender':z['string']()['describe']('Sender'),'version':z['union']([z['string'](),z['number']()])['describe']('Version')}),z['object']({'type':z['literal']('deleted'),'objectId':z['string']()['describe']('Object\x20ID'),'objectType':z['string']()['describe']('Object\x20type'),'sender':z['string']()['describe']('Sender'),'version':z['union']([z['string'](),z['number']()])['describe']('Version')}),z['object']({'type':z['literal']('wrapped'),'objectId':z['string']()['describe']('Object\x20ID'),'objectType':z['string']()['describe']('Object\x20type'),'sender':z['string']()['describe']('Sender'),'version':z['union']([z['string'](),z['number']()])['describe']('Version')}),z['object']({'type':z['literal']('created'),'digest':z['string']()['describe']('Digest'),'objectId':z['string']()['describe']('Object\x20ID'),'objectType':z['string']()['describe']('Object\x20type'),'owner':z['union']([ObjectOwnerSchema,z['null']()])['describe']('Owner'),'sender':z['string']()['describe']('Sender'),'version':z['union']([z['string'](),z['number']()])['describe']('Version')})])['describe']('Object\x20change\x20information');export const TransactionEffectsSchema=z['object']({'abortError':z['union']([WowTransactionBlockSchema,z['null']()])['optional']()['describe']('Abort\x20error\x20if\x20transaction\x20failed\x20with\x20abort\x20code'),'created':z['array'](OwnedObjectRefSchema)['optional']()['describe']('ObjectRef\x20and\x20owner\x20of\x20newly\x20created\x20objects'),'deleted':z['array'](WowObjectRefSchema)['optional']()['describe']('Object\x20references\x20(old\x20refs)\x20of\x20now\x20deleted\x20objects'),'dependencies':z['array'](z['string']())['optional']()['describe']('Set\x20of\x20transaction\x20digests\x20this\x20transaction\x20depends\x20on'),'eventsDigest':z['union']([z['string'](),z['null']()])['optional']()['describe']('Digest\x20of\x20events\x20emitted\x20during\x20execution'),'executedEpoch':z['union']([z['string'](),z['number']()])['describe']('Epoch\x20in\x20which\x20this\x20transaction\x20was\x20executed'),'gasObject':OwnedObjectRefSchema['describe']('Updated\x20gas\x20object\x20reference'),'gasUsed':GasCostSummarySchema['describe']('Gas\x20used'),'messageVersion':z['literal']('v1')['describe']('Message\x20version'),'modifiedAtVersions':z['array'](TransactionBlockEffectsModifiedAtVersionsSchema)['optional']()['describe']('Version\x20of\x20each\x20modified\x20(mutated\x20or\x20deleted)\x20object\x20before\x20this\x20transaction\x20modified\x20it'),'mutated':z['array'](OwnedObjectRefSchema)['optional']()['describe']('ObjectRef\x20and\x20owner\x20of\x20mutated\x20objects,\x20including\x20gas\x20object'),'sharedObjects':z['array'](WowObjectRefSchema)['optional']()['describe']('Object\x20references\x20of\x20shared\x20objects\x20used\x20in\x20this\x20transaction'),'status':ExecutionStatusSchema['describe']('Execution\x20status'),'transactionDigest':z['string']()['describe']('Transaction\x20digest'),'unwrapped':z['array'](OwnedObjectRefSchema)['optional']()['describe']('ObjectRef\x20and\x20owner\x20of\x20objects\x20unwrapped\x20in\x20this\x20transaction'),'unwrappedThenDeleted':z['array'](WowObjectRefSchema)['optional']()['describe']('Object\x20references\x20of\x20objects\x20previously\x20wrapped\x20in\x20other\x20objects\x20but\x20now\x20deleted'),'wrapped':z['array'](WowObjectRefSchema)['optional']()['describe']('Object\x20references\x20of\x20objects\x20now\x20wrapped\x20in\x20other\x20objects')})['describe']('Transaction\x20effects');export const WowTransactionBlockResponseSchema=z['object']({'balanceChanges':z['union']([z['array'](BalanceChangeSchema),z['null']()])['optional']()['describe']('Balance\x20changes'),'checkpoint':z['union']([z['string'](),z['null']()])['optional']()['describe']('Checkpoint\x20number\x20that\x20this\x20transaction\x20is\x20included\x20in\x20and\x20thus\x20completed'),'confirmedLocalExecution':z['union']([z['boolean'](),z['null']()])['optional']()['describe']('Confirmed\x20local\x20execution'),'digest':z['string']()['describe']('Transaction\x20digest'),'effects':z['union']([TransactionEffectsSchema,z['null']()])['optional']()['describe']('Transaction\x20effects'),'errors':z['array'](z['string']())['optional']()['describe']('Error\x20messages'),'events':z['union']([z['array'](WowEventSchema),z['null']()])['optional']()['describe']('Events'),'objectChanges':z['union']([z['array'](WowObjectChangeSchema),z['null']()])['optional']()['describe']('Object\x20changes'),'rawEffects':z['array'](z['number']())['optional']()['describe']('Raw\x20effects'),'rawTransaction':z['string']()['optional']()['describe']('Raw\x20transaction'),'timestampMs':z['union']([z['string'](),z['null']()])['optional']()['describe']('Timestamp'),'transaction':z['union']([WowTransactionBlockSchema,z['null']()])['optional']()['describe']('Transaction\x20input\x20data')})['describe']('Wow\x20transaction\x20block\x20response');export const MarkParamSchema=z['object']({'name':z['object']({'value':z['string']()['max'](LocalMarkConstraints['nameMaxLength'],'Mark\x20name\x20exceeds\x20maximum\x20length\x20of\x20'+LocalMarkConstraints['nameMaxLength']+'\x20bcs\x20characters')['describe']('Mark\x20name\x20value\x20(max\x20'+LocalMarkConstraints['nameMaxLength']+'\x20bcs\x20characters)'),'replaceExistName':z['boolean']()['optional']()['default'](![])['describe']('If\x20true,\x20replace\x20existing\x20mark\x20with\x20same\x20name;\x20if\x20false\x20(default),\x20throw\x20error\x20when\x20name\x20exists')})['optional']()['describe']('Mark\x20naming\x20configuration'),'address':WowAddressSchema,'tags':z['array'](z['string']()['max'](LocalMarkConstraints['tagMaxLength'],'Tag\x20exceeds\x20maximum\x20length\x20of\x20'+LocalMarkConstraints['tagMaxLength']+'\x20bcs\x20characters'))['max'](LocalMarkConstraints['tagMaxCount'],'Tag\x20count\x20exceeds\x20maximum\x20of\x20'+LocalMarkConstraints['tagMaxCount'])['optional']()['describe']('Tags\x20for\x20categorization\x20(max\x20'+LocalMarkConstraints['tagMaxCount']+'\x20tags,\x20each\x20max\x20'+LocalMarkConstraints['tagMaxLength']+'\x20bcs\x20characters)')})['describe']('LOCAL\x20ONLY:\x20Parameters\x20for\x20creating\x20or\x20updating\x20a\x20LOCAL\x20mark.\x20This\x20data\x20is\x20stored\x20privately\x20on\x20your\x20device\x20and\x20will\x20NEVER\x20be\x20published\x20to\x20the\x20blockchain.\x20For\x20public\x20on-chain\x20marks,\x20use\x20the\x20\x27personal\x27\x20tool\x20instead.');export const MarkDataSchema=z['object']({'name':z['string']()['max'](LocalMarkConstraints['nameMaxLength'],'Mark\x20name\x20exceeds\x20maximum\x20length\x20of\x20'+LocalMarkConstraints['nameMaxLength']+'\x20bcs\x20characters')['optional']()['describe']('Mark\x20name\x20(max\x20'+LocalMarkConstraints['nameMaxLength']+'\x20bcs\x20characters)'),'address':WowAddressSchema,'tags':z['array'](z['string']()['max'](LocalMarkConstraints['tagMaxLength'],'Tag\x20exceeds\x20maximum\x20length\x20of\x20'+LocalMarkConstraints['tagMaxLength']+'\x20bcs\x20characters'))['max'](LocalMarkConstraints['tagMaxCount'],'Tag\x20count\x20exceeds\x20maximum\x20of\x20'+LocalMarkConstraints['tagMaxCount'])['optional']()['describe']('Tags\x20for\x20categorization\x20(max\x20'+LocalMarkConstraints['tagMaxCount']+'\x20tags,\x20each\x20max\x20'+LocalMarkConstraints['tagMaxLength']+'\x20bcs\x20characters)'),'createdAt':z['number']()['optional']()['describe']('Unix\x20timestamp\x20(ms)\x20when\x20this\x20mark\x20was\x20created'),'updatedAt':z['number']()['optional']()['describe']('Unix\x20timestamp\x20(ms)\x20when\x20this\x20mark\x20was\x20last\x20modified')})['describe']('LOCAL\x20PRIVATE:\x20Local\x20mark\x20data\x20structure\x20for\x20storing\x20address\x20names\x20and\x20tags\x20privately\x20on\x20your\x20device.\x20This\x20data\x20is\x20NEVER\x20published\x20to\x20the\x20blockchain.');export const InfoDataInnerSchema=z['object']({'default':z['string']()['max'](LocalInfoConstraints['contentMaxLength'],'Default\x20value\x20exceeds\x20maximum\x20length\x20of\x20'+LocalInfoConstraints['contentMaxLength']+'\x20bcs\x20characters')['describe']('Primary/default\x20value\x20for\x20this\x20info\x20(max\x20'+LocalInfoConstraints['contentMaxLength']+'\x20bcs\x20characters)'),'contents':z['array'](z['string']()['max'](LocalInfoConstraints['contentMaxLength'],'Content\x20item\x20exceeds\x20maximum\x20length\x20of\x20'+LocalInfoConstraints['contentMaxLength']+'\x20bcs\x20characters'))['max'](LocalInfoConstraints['contentMaxCount'],'Content\x20count\x20exceeds\x20maximum\x20of\x20'+LocalInfoConstraints['contentMaxCount'])['optional']()['describe']('Additional\x20content\x20values\x20(max\x20'+LocalInfoConstraints['contentMaxCount']+'\x20items,\x20each\x20max\x20'+LocalInfoConstraints['contentMaxLength']+'\x20bcs\x20characters)'),'createdAt':z['number']()['optional']()['describe']('Unix\x20timestamp\x20(ms)\x20when\x20this\x20info\x20was\x20created'),'updatedAt':z['number']()['optional']()['describe']('Unix\x20timestamp\x20(ms)\x20when\x20this\x20info\x20was\x20last\x20modified')})['describe']('Info\x20data\x20inner\x20structure');export const InfoDataSchema=InfoDataInnerSchema['extend']({'name':z['string']()['max'](LocalInfoConstraints['nameMaxLength'],'Info\x20name\x20exceeds\x20maximum\x20length\x20of\x20'+LocalInfoConstraints['nameMaxLength']+'\x20bcs\x20characters')['describe']('Unique\x20identifier\x20for\x20this\x20info\x20entry\x20(max\x20'+LocalInfoConstraints['nameMaxLength']+'\x20bcs\x20characters)')})['describe']('LOCAL\x20PRIVATE:\x20Local\x20info\x20data\x20structure\x20for\x20storing\x20sensitive\x20personal\x20information\x20like\x20delivery\x20addresses,\x20phone\x20numbers,\x20etc.\x20This\x20data\x20is\x20stored\x20ONLY\x20on\x20your\x20device\x20and\x20NEVER\x20published\x20to\x20the\x20blockchain.');export const LocalMarkFilterSchema=z['object']({'name':NameSchema['optional']()['describe']('Filter\x20by\x20mark\x20name\x20(supports\x20fuzzy\x20match)'),'tags':z['array'](z['string']())['optional']()['describe']('Filter\x20by\x20tags\x20-\x20returns\x20marks\x20that\x20contain\x20ANY\x20of\x20the\x20specified\x20tags'),'address':WowAddressSchema['optional']()['describe']('Filter\x20by\x20address\x20(exact\x20match,\x20format:\x200x\x20+\x2064\x20hex\x20characters)'),'createdAt':z['object']({'gte':z['number']()['optional']()['describe']('Filter\x20marks\x20created\x20on\x20or\x20after\x20this\x20timestamp\x20(ms)'),'lte':z['number']()['optional']()['describe']('Filter\x20marks\x20created\x20on\x20or\x20before\x20this\x20timestamp\x20(ms)')})['optional']()['describe']('Filter\x20by\x20creation\x20time\x20range'),'updatedAt':z['object']({'gte':z['number']()['optional']()['describe']('Filter\x20marks\x20updated\x20on\x20or\x20after\x20this\x20timestamp\x20(ms)'),'lte':z['number']()['optional']()['describe']('Filter\x20marks\x20updated\x20on\x20or\x20before\x20this\x20timestamp\x20(ms)')})['optional']()['describe']('Filter\x20by\x20update\x20time\x20range')})['describe']('Filter\x20criteria\x20for\x20querying\x20local\x20marks.\x20Multiple\x20filters\x20are\x20combined\x20with\x20AND\x20logic.');export const LocalInfoFilterSchema=z['object']({'name':NameSchema['optional']()['describe']('Filter\x20by\x20info\x20name\x20(supports\x20fuzzy\x20match)'),'default':z['string']()['optional']()['describe']('Filter\x20by\x20default\x20value\x20(supports\x20fuzzy\x20match)'),'contents':z['array'](z['string']())['optional']()['describe']('Filter\x20by\x20contents\x20-\x20returns\x20info\x20that\x20contains\x20ANY\x20of\x20the\x20specified\x20content\x20items'),'createdAt':z['object']({'gte':z['number']()['optional']()['describe']('Filter\x20info\x20created\x20on\x20or\x20after\x20this\x20timestamp\x20(ms)'),'lte':z['number']()['optional']()['describe']('Filter\x20info\x20created\x20on\x20or\x20before\x20this\x20timestamp\x20(ms)')})['optional']()['describe']('Filter\x20by\x20creation\x20time\x20range'),'updatedAt':z['object']({'gte':z['number']()['optional']()['describe']('Filter\x20info\x20updated\x20on\x20or\x20after\x20this\x20timestamp\x20(ms)'),'lte':z['number']()['optional']()['describe']('Filter\x20info\x20updated\x20on\x20or\x20before\x20this\x20timestamp\x20(ms)')})['optional']()['describe']('Filter\x20by\x20update\x20time\x20range')})['describe']('Filter\x20criteria\x20for\x20querying\x20local\x20info.\x20Multiple\x20filters\x20are\x20combined\x20with\x20AND\x20logic.');export const QueryLocalInfoListSchema=z['object']({'filter':LocalInfoFilterSchema['optional']()['describe']('Local\x20info\x20filter')})['describe']('Query\x20local\x20info\x20list\x20parameters');export const QueryAccountSchema=z['object']({'name_or_address':NameOrAddressSchema['optional']()['describe']('Account\x20name\x20or\x20address.\x20Use\x20empty\x20string\x20\x27\x27\x20for\x20the\x20default\x20account.\x20Defaults\x20to\x20\x27\x27\x20if\x20omitted.'),'balance':z['boolean']()['optional']()['describe']('Whether\x20to\x20query\x20coin\x20balance\x20amount'),'coin':z['object']({'cursor':z['union']([z['string'](),z['null']()])['optional']()['describe']('Query\x20cursor\x20for\x20pagination'),'limit':z['union']([z['number'](),z['null']()])['optional']()['describe']('Maximum\x20number\x20of\x20objects\x20to\x20return')})['optional']()['describe']('Whether\x20to\x20query\x20coin\x20object\x20list'),'token_type':TokenTypeSchema['optional']()['describe']('Token\x20type;\x20default\x20token\x20type\x20is\x200x2::wow::WOW'),'network':EntrypointSchema['optional']()})['describe']('Used\x20to\x20query\x20account\x27s\x20coin\x20balance');export const QueryAccountResultSchema=z['object']({'name_or_address':NameOrAddressSchema['optional']()['describe']('Account\x20name\x20or\x20ID'),'address':z['string']()['optional']()['describe']('Account\x20ID'),'balance':CoinBalanceSchema['optional']()['describe']('Coin\x20balance\x20details'),'coin':PaginatedCoinsSchema['optional']()['describe']('Paginated\x20coin\x20object\x20list')})['describe']('Result\x20of\x20querying\x20account\x27s\x20coin\x20balance');export const AccountOperationSchema=z['object']({'gen':z['object']({'name':NameSchema['optional']()['describe']('Account\x20name\x20(max\x20'+AccountConstraints['nameMaxLength']+'\x20characters).\x20Use\x20empty\x20string\x20\x27\x27\x20or\x20omit\x20for\x20the\x20default\x20account.'),'replaceExistName':z['boolean']()['optional']()['describe']('If\x20true,\x20existing\x20account\x20with\x20the\x20same\x20name\x20will\x20lose\x20the\x20name;\x20if\x20false\x20(default),\x20throw\x20error\x20when\x20name\x20exists'),'m':z['union']([NameSchema,z['null']()])['optional']()['describe']('Messenger\x20name\x20to\x20enable\x20messenger\x20for\x20this\x20account\x20(max\x2064\x20characters).\x20If\x20null,\x20disable\x20messenger.\x20Omit\x20to\x20leave\x20messenger\x20unchanged.')})['optional']()['describe']('Generate\x20new\x20account'),'faucet':z['object']({'name_or_address':NameOrAddressSchema['optional']()['describe']('Account\x20name\x20or\x20address.\x20Use\x20empty\x20string\x20\x27\x27\x20for\x20the\x20default\x20account.\x20Defaults\x20to\x20\x27\x27\x20if\x20omitted.'),'network':FaucetNetworkSchema})['optional']()['describe']('Distribute\x20test\x20coins\x20from\x20faucet\x20to\x20the\x20specified\x20account'),'suspend':z['object']({'name_or_address':NameOrAddressSchema['optional']()['describe']('Account\x20name\x20or\x20address.\x20Use\x20empty\x20string\x20\x27\x27\x20for\x20the\x20default\x20account.\x20Defaults\x20to\x20\x27\x27\x20if\x20omitted.')})['optional']()['describe']('Remove\x20account\x20from\x20active\x20account\x20list\x20(cannot\x20sign\x20transactions),\x20and\x20delete\x20its\x20name'),'resume':z['object']({'address':WowAddressSchema,'name':NameSchema['optional']()['describe']('New\x20name\x20for\x20the\x20resumed\x20account.\x20Omit\x20to\x20leave\x20unnamed.')})['optional']()['describe']('Add\x20account\x20back\x20to\x20active\x20account\x20list'),'rename':z['object']({'name_or_address':NameOrAddressSchema['optional']()['describe']('Source\x20account\x20name\x20or\x20address.\x20Use\x20empty\x20string\x20\x27\x27\x20for\x20the\x20default\x20account.\x20Defaults\x20to\x20\x27\x27\x20if\x20omitted.\x20Can\x20be\x20a\x20name\x20or\x20address.'),'new_name':NameSchema['describe']('New\x20account\x20name\x20(max\x20'+AccountConstraints['nameMaxLength']+'\x20characters).\x20Must\x20be\x20a\x20name\x20(not\x20an\x20address).')})['optional']()['describe']('Rename\x20account.\x20name_or_address\x20can\x20be\x20name\x20or\x20address,\x20new_name\x20must\x20be\x20a\x20name.'),'swap_name':z['object']({'name1':NameSchema['optional']()['describe']('First\x20account\x20name.\x20Use\x20empty\x20string\x20\x27\x27\x20for\x20the\x20default\x20account.'),'name2':NameSchema['optional']()['describe']('Second\x20account\x20name.\x20Use\x20empty\x20string\x20\x27\x27\x20for\x20the\x20default\x20account.')})['optional']()['describe']('Swap\x20the\x20names\x20of\x20two\x20accounts'),'transfer':z['object']({'name_or_address_from':NameOrAddressSchema['optional']()['describe']('Sender\x20account\x20name\x20or\x20address.\x20Use\x20empty\x20string\x20\x27\x27\x20for\x20the\x20default\x20account.'),'name_or_address_to':NameOrAddressSchema['optional']()['describe']('Recipient\x20account\x20name\x20or\x20address.\x20Use\x20empty\x20string\x20\x27\x27\x20for\x20the\x20default\x20account.'),'amount':z['union']([z['number'](),z['string']()])['describe']('Amount\x20of\x20tokens\x20to\x20transfer'),'token_type':z['string']()['optional']()['describe']('Token\x20type;\x20default\x20token\x20type\x20is\x200x2::wow::WOW'),'network':EntrypointSchema['optional']()})['optional']()['describe']('Transfer\x20tokens\x20from\x20one\x20account\x20to\x20another'),'get':z['object']({'name_or_address':NameOrAddressSchema['optional']()['describe']('Account\x20name\x20or\x20address.\x20Use\x20empty\x20string\x20\x27\x27\x20for\x20the\x20default\x20account.'),'balance_required':z['union']([z['string'](),z['number']()])['describe']('Required\x20balance\x20amount'),'token_type':z['string']()['optional']()['describe']('Token\x20type;\x20default\x20token\x20type\x20is\x200x2::wow::WOW'),'network':EntrypointSchema['optional']()})['optional']()['describe']('Generate\x20new\x20coin\x20object\x20ID\x20from\x20account\x20by\x20required\x20amount\x20and\x20return'),'signData':z['object']({'name_or_address':NameOrAddressSchema['optional']()['describe']('Account\x20name\x20or\x20address.\x20Use\x20empty\x20string\x20\x27\x27\x20for\x20the\x20default\x20account.'),'data':z['string']()['describe']('Data\x20to\x20sign.\x20If\x20data_encoding\x20is\x20not\x20specified,\x20treated\x20as\x20UTF-8\x20string.'),'data_encoding':z['union']([z['literal']('utf8')['describe']('Data\x20is\x20UTF-8\x20encoded\x20string'),z['literal']('base64')['describe']('Data\x20is\x20base64\x20encoded\x20bytes'),z['literal']('hex')['describe']('Data\x20is\x20hex\x20encoded\x20bytes\x20(with\x20or\x20without\x200x\x20prefix)')])['optional']()['describe']('Encoding\x20format\x20of\x20the\x20data\x20field.\x20If\x20not\x20specified,\x20defaults\x20to\x20utf8.')})['optional']()['describe']('Sign\x20data\x20with\x20account\x27s\x20private\x20key'),'messenger':z['object']({'name_or_account':NameOrAddressSchema['optional']()['describe']('Account\x20name\x20or\x20address.\x20Use\x20empty\x20string\x20\x27\x27\x20for\x20the\x20default\x20account.\x20Defaults\x20to\x20\x27\x27\x20if\x20omitted.'),'m':z['union']([NameSchema,z['null']()])['describe']('Messenger\x20name\x20to\x20enable\x20messenger\x20for\x20this\x20account\x20(max\x2064\x20characters).\x20If\x20null,\x20disable\x20messenger.')})['optional']()['describe']('Enable\x20or\x20disable\x20messenger\x20for\x20an\x20account')})['describe']('Account\x20operations');export const AccountOperationResultSchema=z['object']({'gen':z['object']({'address':z['string']()['describe']('Newly\x20generated\x20account\x20ID'),'name':NameSchema['optional']()['describe']('Account\x20name'),'m':z['union']([NameSchema,z['null']()])['optional']()['describe']('Messenger\x20name\x20if\x20enabled')})['optional']()['describe']('Result\x20of\x20generating\x20new\x20account'),'faucet':z['object']({'name_or_address':NameOrAddressSchema['optional']()['describe']('Account\x20name\x20or\x20address\x20that\x20received\x20faucet\x20coins'),'result':z['array'](FaucetCoinInfoSchema)['describe']('List\x20of\x20distributed\x20test\x20coin\x20info'),'network':FaucetNetworkSchema})['optional']()['describe']('Result\x20of\x20distributing\x20test\x20coins\x20from\x20faucet\x20to\x20the\x20specified\x20account'),'suspend':z['object']({'name_or_address':NameOrAddressSchema['optional']()['describe']('Account\x20name\x20or\x20address\x20that\x20was\x20suspended'),'success':z['boolean']()['describe']('True\x20if\x20account\x20was\x20successfully\x20suspended,\x20false\x20if\x20account\x20does\x20not\x20exist')})['optional']()['describe']('Result\x20of\x20removing\x20account\x20from\x20active\x20account\x20list\x20(cannot\x20sign\x20transactions)'),'resume':z['object']({'address':WowAddressSchema['describe']('Account\x20ID\x20that\x20was\x20resumed'),'name':NameSchema['optional']()['describe']('New\x20name\x20assigned\x20to\x20the\x20account'),'success':z['boolean']()['describe']('True\x20if\x20account\x20was\x20successfully\x20resumed,\x20false\x20if\x20account\x20does\x20not\x20exist')})['optional']()['describe']('Result\x20of\x20adding\x20account\x20back\x20to\x20active\x20account\x20list'),'rename':z['object']({'name_or_address':NameOrAddressSchema['optional']()['describe']('Source\x20account\x20name\x20or\x20address\x20that\x20was\x20renamed'),'new_name':NameSchema['describe']('New\x20account\x20name'),'success':z['boolean']()['describe']('True\x20if\x20rename\x20was\x20successful,\x20false\x20if\x20account\x20not\x20found\x20or\x20name\x20already\x20exists')})['optional']()['describe']('Result\x20of\x20renaming\x20account'),'swap_name':z['object']({'name1':NameSchema['optional']()['describe']('First\x20account\x20name'),'name2':NameSchema['optional']()['describe']('Second\x20account\x20name'),'success':z['boolean']()['describe']('True\x20if\x20swap\x20was\x20successful,\x20false\x20if\x20either\x20account\x20not\x20found')})['optional']()['describe']('Result\x20of\x20swapping\x20account\x20names'),'transfer':WowTransactionBlockResponseSchema['optional']()['describe']('Result\x20of\x20token\x20transfer\x20transaction'),'get':z['object']({'coin_address':z['string']()['optional']()['describe']('Newly\x20generated\x20coin\x20object\x20ID'),'name_or_address':NameOrAddressSchema['optional']()['describe']('Account\x20name\x20or\x20address'),'balance_required':z['union']([z['string'](),z['number']()])['describe']('Required\x20coin\x20object\x20balance'),'token_type':z['string']()['optional']()['describe']('Token\x20type;\x20default\x20token\x20type\x20is\x200x2::wow::WOW'),'network':EntrypointSchema['optional']()})['optional']()['describe']('Result\x20of\x20generating\x20new\x20coin\x20object\x20ID\x20from\x20account\x20by\x20required\x20amount'),'signData':z['object']({'name_or_address':NameOrAddressSchema['optional']()['describe']('Account\x20name\x20or\x20address\x20used\x20for\x20signing'),'signature':z['string']()['describe']('Signature\x20in\x20hex\x20format'),'publicKey':z['string']()['describe']('Public\x20key\x20in\x20hex\x20format'),'address':z['string']()['describe']('Account\x20address')})['optional']()['describe']('Result\x20of\x20signing\x20data\x20with\x20account'),'messenger':z['object']({'name_or_account':NameOrAddressSchema['optional']()['describe']('Account\x20name\x20or\x20address'),'m':z['union']([NameSchema,z['null']()])['describe']('Messenger\x20name\x20if\x20enabled,\x20null\x20if\x20disabled')})['optional']()['describe']('Result\x20of\x20enabling\x20or\x20disabling\x20messenger\x20for\x20an\x20account')})['describe']('Results\x20of\x20account\x20operations');export const LocalMarkOperationSchema=z['object']({'add':z['object']({'op':z['literal']('add')['describe']('Operation\x20type:\x20add\x20marks'),'data':z['array'](MarkParamSchema)['min'](0x1)['describe']('Array\x20of\x20mark\x20data\x20to\x20add\x20(at\x20least\x201\x20item)')})['optional']()['describe']('Add\x20one\x20or\x20more\x20marks'),'remove':z['object']({'op':z['literal']('remove')['describe']('Operation\x20type:\x20remove\x20marks'),'names':z['array'](z['string']())['min'](0x1)['describe']('Array\x20of\x20mark\x20names\x20or\x20addresses\x20to\x20remove')})['optional']()['describe']('Remove\x20marks\x20by\x20name\x20or\x20address'),'clear':z['object']({'op':z['literal']('clear')['describe']('Operation\x20type:\x20clear\x20all\x20marks')})['optional']()['describe']('Remove\x20all\x20marks')})['describe']('Local\x20mark\x20operations.\x20Exactly\x20one\x20operation\x20type\x20(add/remove/clear)\x20must\x20be\x20specified.');export const LocalMarkOperationResultSchema=z['object']({'clear':z['boolean']()['optional']()['describe']('Whether\x20all\x20marks\x20were\x20successfully\x20removed'),'add':z['array'](MarkDataSchema)['optional']()['describe']('List\x20of\x20added\x20mark\x20data'),'remove':z['array'](MarkDataSchema)['optional']()['describe']('List\x20of\x20removed\x20mark\x20data')})['describe']('Results\x20of\x20local\x20mark\x20operations\x20for\x20ID');export const LocalInfoOperationSchema=z['object']({'add':z['object']({'op':z['literal']('add')['describe']('Operation\x20type:\x20add\x20info'),'data':z['array'](InfoDataSchema)['min'](0x1)['describe']('Array\x20of\x20info\x20data\x20to\x20add\x20(at\x20least\x201\x20item)')})['optional']()['describe']('Add\x20one\x20or\x20more\x20info\x20entries'),'remove':z['object']({'op':z['literal']('remove')['describe']('Operation\x20type:\x20remove\x20info'),'data':z['array'](z['string']())['min'](0x1)['describe']('Array\x20of\x20info\x20names\x20to\x20remove')})['optional']()['describe']('Remove\x20info\x20entries\x20by\x20name'),'reset':z['object']({'op':z['literal']('reset')['describe']('Operation\x20type:\x20reset\x20contents'),'name':z['string']()['describe']('Name\x20of\x20info\x20entry\x20to\x20reset'),'contents':z['array'](z['string']())['describe']('New\x20content\x20list\x20to\x20replace\x20existing\x20contents')})['optional']()['describe']('Reset\x20the\x20contents\x20of\x20an\x20existing\x20info\x20entry'),'clear':z['object']({'op':z['literal']('clear')['describe']('Operation\x20type:\x20clear\x20all\x20info')})['optional']()['describe']('Remove\x20all\x20info\x20entries')})['describe']('Local\x20info\x20operations.\x20Exactly\x20one\x20operation\x20type\x20(add/remove/reset/clear)\x20must\x20be\x20specified.');export const LocalInfoOperationResultSchema=z['object']({'success':z['boolean']()['describe']('Whether\x20successful')})['describe']('Results\x20of\x20local\x20info\x20operations');export const FetchTokenInfoOperationSchema=z['object']({'tokenType':z['union']([TokenTypeSchema,z['null']()])['optional']()['describe']('Token\x20type;\x20default\x20token\x20type\x20is\x200x2::wow::WOW'),'alias':NameSchema['optional']()['describe']('Token\x20alias;\x20used\x20to\x20quickly\x20fetch\x20token\x20info'),'network':EntrypointSchema['optional']()})['describe']('Fetch\x20token\x20info\x20to\x20local\x20and\x20name\x20it');export const QueryLocalMarkListSchema=z['object']({'filter':LocalMarkFilterSchema['optional']()['describe']('Local\x20mark\x20filter')})['describe']('Query\x20local\x20mark\x20list\x20parameters');export const QueryLocalMarkListResultSchema=z['object']({'result':z['array'](MarkDataSchema)['describe']('Local\x20mark\x20list')})['describe']('Query\x20local\x20mark\x20list\x20result');export const AccountFilterSchema=z['object']({'name':NameSchema['optional']()['describe']('Filter\x20by\x20account\x20name\x20(supports\x20fuzzy\x20match)'),'address':WowAddressSchema['optional']()['describe']('Filter\x20by\x20account\x20address\x20(supports\x20partial\x20match,\x20format:\x200x\x20+\x20hex\x20characters)'),'suspended':z['boolean']()['optional']()['describe']('Filter\x20by\x20suspension\x20status.\x20Omit\x20to\x20return\x20all\x20accounts\x20regardless\x20of\x20status'),'hasMessenger':z['boolean']()['optional']()['describe']('Filter\x20accounts\x20with\x20messenger\x20enabled'),'m':NameSchema['optional']()['describe']('Filter\x20by\x20messenger\x20name\x20(supports\x20fuzzy\x20match)'),'createdAt':z['object']({'gte':z['number']()['optional']()['describe']('Filter\x20accounts\x20created\x20on\x20or\x20after\x20this\x20timestamp\x20(ms)'),'lte':z['number']()['optional']()['describe']('Filter\x20accounts\x20created\x20on\x20or\x20before\x20this\x20timestamp\x20(ms)')})['optional']()['describe']('Filter\x20by\x20creation\x20time\x20range'),'updatedAt':z['object']({'gte':z['number']()['optional']()['describe']('Filter\x20accounts\x20updated\x20on\x20or\x20after\x20this\x20timestamp\x20(ms)'),'lte':z['number']()['optional']()['describe']('Filter\x20accounts\x20updated\x20on\x20or\x20before\x20this\x20timestamp\x20(ms)')})['optional']()['describe']('Filter\x20by\x20update\x20time\x20range')})['describe']('Filter\x20criteria\x20for\x20querying\x20accounts.\x20Multiple\x20filters\x20are\x20combined\x20with\x20AND\x20logic.');export const QueryAccountListSchema=z['object']({'filter':AccountFilterSchema['optional']()['describe']('Account\x20filter')})['describe']('Query\x20account\x20list\x20parameters');export const AccountDataSchema=z['object']({'name':z['string']()['optional']()['describe']('Account\x20name'),'address':z['string']()['describe']('Account\x20address'),'pubkey':z['string']()['optional']()['describe']('Account\x20public\x20key'),'secret':z['string']()['optional']()['describe']('Account\x20secret\x20key'),'suspended':z['boolean']()['optional']()['describe']('Whether\x20account\x20is\x20suspended'),'createdAt':z['number']()['optional']()['describe']('Timestamp\x20when\x20account\x20was\x20created'),'updatedAt':z['number']()['optional']()['describe']('Timestamp\x20when\x20account\x20was\x20last\x20updated'),'m':z['string']()['nullable']()['optional']()['describe']('Messenger\x20name,\x20indicates\x20this\x20account\x20has\x20messenger\x20enabled')})['describe']('Account\x20data');export const QueryAccountListResultSchema=z['object']({'result':z['array'](AccountDataSchema)['describe']('Account\x20list')})['describe']('Query\x20account\x20list\x20result');export const QueryLocalInfoListResultSchema=z['object']({'result':z['array'](InfoDataSchema)['describe']('Local\x20info\x20list')})['describe']('Query\x20local\x20info\x20list\x20result');export const TokenTypeInfoSchema=z['object']({'type':z['string']()['describe']('Token\x20type'),'alias':z['string']()['optional']()['describe']('Token\x20alias'),'name':z['string']()['describe']('Token\x20name'),'symbol':z['string']()['describe']('Token\x20symbol'),'decimals':z['number']()['describe']('Number\x20of\x20decimal\x20places'),'description':z['string']()['describe']('Description\x20of\x20the\x20token'),'iconUrl':z['union']([z['string'](),z['null']()])['optional']()['describe']('URL\x20for\x20the\x20token\x20logo'),'id':z['union']([z['string'](),z['null']()])['optional']()['describe']('Object\x20id\x20for\x20the\x20CoinMetadata\x20object')})['describe']('Token\x20type\x20info');export const TokenDataFilterSchema=z['object']({'alias_or_name':NameSchema['optional']()['describe']('Alias\x20or\x20name\x20filter'),'symbol':z['string']()['optional']()['describe']('Token\x20symbol'),'type':z['string']()['optional']()['describe']('Token\x20type')})['describe']('Token\x20data\x20filter');export const QueryLocalTokenListResultSchema=z['object']({'result':z['array'](TokenTypeInfoSchema)['describe']('Local\x20token\x20list')})['describe']('Query\x20local\x20token\x20list\x20result');export const AccountOperationOutputSchema=z['discriminatedUnion']('status',[z['object']({'status':z['literal']('success'),'data':AccountOperationResultSchema['describe']('Success\x20result\x20data')}),z['object']({'status':z['literal']('error'),'error':z['string']()['describe']('Error\x20message')})])['describe']('Account\x20operation\x20output\x20schema\x20with\x20discriminator');export const AccountOperationOutputWrappedSchema=z['object']({'result':AccountOperationOutputSchema})['describe']('Account\x20operation\x20output\x20wrapped\x20schema');export const LocalMarkOperationOutputSchema=z['discriminatedUnion']('status',[z['object']({'status':z['literal']('success'),'data':LocalMarkOperationResultSchema['describe']('Success\x20result\x20data')}),z['object']({'status':z['literal']('error'),'error':z['string']()['describe']('Error\x20message')})])['describe']('Local\x20mark\x20operation\x20output\x20schema\x20with\x20discriminator');export const LocalMarkOperationOutputWrappedSchema=z['object']({'result':LocalMarkOperationOutputSchema})['describe']('Local\x20mark\x20operation\x20output\x20wrapped\x20schema');export const LocalInfoOperationOutputSchema=z['discriminatedUnion']('status',[z['object']({'status':z['literal']('success'),'data':LocalInfoOperationResultSchema['describe']('Success\x20result\x20data')}),z['object']({'status':z['literal']('error'),'error':z['string']()['describe']('Error\x20message')})])['describe']('Local\x20info\x20operation\x20output\x20schema\x20with\x20discriminator');export const LocalInfoOperationOutputWrappedSchema=z['object']({'result':LocalInfoOperationOutputSchema})['describe']('Local\x20info\x20operation\x20output\x20wrapped\x20schema');export*from'./wip.js';
|
|
1
|
+
import { EntrypointSchema, ObjectOwnerSchema, NameOrAddressSchema, NameSchema, WowAddressSchema, TokenTypeSchema, FaucetNetworkSchema } from "../common/index.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export const LocalMarkConstraints = {
|
|
4
|
+
nameMaxLength: 64,
|
|
5
|
+
tagMaxLength: 64,
|
|
6
|
+
tagMaxCount: 50,
|
|
7
|
+
};
|
|
8
|
+
export const LocalInfoConstraints = {
|
|
9
|
+
nameMaxLength: 64,
|
|
10
|
+
contentMaxLength: 300,
|
|
11
|
+
contentMaxCount: 50,
|
|
12
|
+
defaultName: "Address of delivery",
|
|
13
|
+
};
|
|
14
|
+
export const AccountConstraints = {
|
|
15
|
+
nameMaxLength: 64,
|
|
16
|
+
};
|
|
17
|
+
export const ErrorResultSchema = z
|
|
18
|
+
.object({
|
|
19
|
+
error: z.literal(true).describe("Always true for error responses"),
|
|
20
|
+
code: z.string().optional().describe("Error code for programmatic handling"),
|
|
21
|
+
message: z.string().describe("Human-readable error message"),
|
|
22
|
+
details: z.record(z.string(), z.string()).optional().describe("Additional error context"),
|
|
23
|
+
})
|
|
24
|
+
.describe("Error response structure");
|
|
25
|
+
export const createResultSchema = (successSchema) => z.union([
|
|
26
|
+
z.object({ success: z.literal(true), data: successSchema }),
|
|
27
|
+
ErrorResultSchema,
|
|
28
|
+
]);
|
|
29
|
+
export const CoinBalanceSchema = z.object({
|
|
30
|
+
coinType: z.string().describe("Coin type"),
|
|
31
|
+
coinObjectCount: z.number().describe("Coin object count"),
|
|
32
|
+
totalBalance: z.string().describe("Total balance"),
|
|
33
|
+
lockedBalance: z.record(z.string(), z.string()).describe("Locked balance"),
|
|
34
|
+
}).describe("Coin balance");
|
|
35
|
+
export const CoinStructSchema = z.object({
|
|
36
|
+
balance: z.string().describe("Coin balance"),
|
|
37
|
+
coinObjectId: z.string().describe("Coin object ID"),
|
|
38
|
+
coinType: z.string().describe("Coin type"),
|
|
39
|
+
digest: z.string().describe("Transaction digest"),
|
|
40
|
+
previousTransaction: z.string().describe("Previous transaction digest"),
|
|
41
|
+
version: z.string().describe("Coin object version"),
|
|
42
|
+
}).describe("Coin object");
|
|
43
|
+
export const PaginatedCoinsSchema = z.object({
|
|
44
|
+
data: z.array(CoinStructSchema).describe("Coin object list"),
|
|
45
|
+
hasNextPage: z.boolean().describe("Whether there is a next page"),
|
|
46
|
+
nextCursor: z.union([z.string(), z.null()]).optional().describe("Next query cursor"),
|
|
47
|
+
}).describe("Paginated coin objects");
|
|
48
|
+
export const FaucetCoinInfoSchema = z.object({
|
|
49
|
+
amount: z.number().describe("Coin amount"),
|
|
50
|
+
id: z.string().describe("Coin ID"),
|
|
51
|
+
transferTxDigest: z.string().describe("Transfer transaction digest"),
|
|
52
|
+
}).describe("Testnet faucet coin info");
|
|
53
|
+
export const EventIdSchema = z.object({
|
|
54
|
+
eventSeq: z.string().describe("Event sequence number"),
|
|
55
|
+
txDigest: z.string().describe("Transaction digest"),
|
|
56
|
+
}).describe("Event ID");
|
|
57
|
+
export const WowEventSchema = z.discriminatedUnion("bcsEncoding", [
|
|
58
|
+
z.object({
|
|
59
|
+
id: EventIdSchema.describe("Event ID"),
|
|
60
|
+
packageId: z.string().describe("Package ID where event originated"),
|
|
61
|
+
parsedJson: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).describe("Parsed JSON value of the event"),
|
|
62
|
+
sender: z.string().describe("Sender's address"),
|
|
63
|
+
timestampMs: z.union([z.string(), z.null()]).optional().describe("UTC timestamp in milliseconds since epoch"),
|
|
64
|
+
transactionModule: z.string().describe("Module where event originated"),
|
|
65
|
+
type: z.string().describe("Move event type"),
|
|
66
|
+
bcs: z.string().describe("BCS encoded event"),
|
|
67
|
+
bcsEncoding: z.literal("base64").describe("BCS encoding format"),
|
|
68
|
+
}),
|
|
69
|
+
z.object({
|
|
70
|
+
id: EventIdSchema.describe("Event ID"),
|
|
71
|
+
packageId: z.string().describe("Package ID where event originated"),
|
|
72
|
+
parsedJson: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).describe("Parsed JSON value of the event"),
|
|
73
|
+
sender: z.string().describe("Sender's ID"),
|
|
74
|
+
timestampMs: z.union([z.string(), z.null()]).optional().describe("UTC timestamp in milliseconds since epoch"),
|
|
75
|
+
transactionModule: z.string().describe("Module where event originated"),
|
|
76
|
+
type: z.string().describe("Move event type"),
|
|
77
|
+
bcs: z.string().describe("BCS encoded event"),
|
|
78
|
+
bcsEncoding: z.literal("base58").describe("BCS encoding format"),
|
|
79
|
+
}),
|
|
80
|
+
]).describe("Blockchain event");
|
|
81
|
+
export const BalanceChangeSchema = z.object({
|
|
82
|
+
amount: z.string().describe("Balance change value, negative for spending, positive for receiving"),
|
|
83
|
+
coinType: z.string().describe("Coin type"),
|
|
84
|
+
owner: ObjectOwnerSchema.describe("Owner of the balance change"),
|
|
85
|
+
}).describe("Balance change");
|
|
86
|
+
export const GasCostSummarySchema = z.object({
|
|
87
|
+
computationCost: z.string().describe("Computation/execution cost"),
|
|
88
|
+
nonRefundableStorageFee: z.string().describe("Non-refundable storage fee"),
|
|
89
|
+
storageCost: z.string().describe("Storage cost"),
|
|
90
|
+
storageRebate: z.string().describe("Storage rebate"),
|
|
91
|
+
}).describe("Transaction fee summary");
|
|
92
|
+
export const WowObjectRefSchema = z.object({
|
|
93
|
+
digest: z.string().describe("Base64 string of object digest"),
|
|
94
|
+
objectId: z.string().describe("Hex code string representing object ID"),
|
|
95
|
+
version: z.union([z.string(), z.number()]).describe("Object version"),
|
|
96
|
+
}).describe("Wow object reference");
|
|
97
|
+
export const OwnedObjectRefSchema = z.object({
|
|
98
|
+
owner: ObjectOwnerSchema.describe("Owner"),
|
|
99
|
+
reference: WowObjectRefSchema.describe("Object reference"),
|
|
100
|
+
}).describe("Owned object reference");
|
|
101
|
+
export const TransactionBlockEffectsModifiedAtVersionsSchema = z.object({
|
|
102
|
+
objectId: z.string().describe("Object ID"),
|
|
103
|
+
sequenceNumber: z.string().describe("Sequence number"),
|
|
104
|
+
}).describe("Transaction block effects modified versions");
|
|
105
|
+
export const WowMoveAbortSchema = z.object({
|
|
106
|
+
error_code: z.union([z.string(), z.null()]).optional().describe("Error code"),
|
|
107
|
+
function: z.union([z.string(), z.null()]).optional().describe("Function"),
|
|
108
|
+
line: z.union([z.number(), z.null()]).optional().describe("Line number"),
|
|
109
|
+
module_id: z.union([z.string(), z.null()]).optional().describe("Module ID"),
|
|
110
|
+
}).describe("Wow Move abort");
|
|
111
|
+
export const ExecutionStatusSchema = z.object({
|
|
112
|
+
status: z.union([z.literal("success"), z.literal("failure")]).describe("Execution status"),
|
|
113
|
+
error: z.string().optional().describe("Error message"),
|
|
114
|
+
}).describe("Execution status");
|
|
115
|
+
export const WowGasDataSchema = z.object({
|
|
116
|
+
budget: z.string().describe("Budget"),
|
|
117
|
+
owner: z.string().describe("Owner"),
|
|
118
|
+
payment: z.array(WowObjectRefSchema).describe("Payment"),
|
|
119
|
+
price: z.string().describe("Price"),
|
|
120
|
+
}).describe("Wow gas data");
|
|
121
|
+
export const WowTransactionBlockKindSchema = z.object({
|
|
122
|
+
kind: z.string().describe("Transaction type"),
|
|
123
|
+
}).passthrough().describe("Wow transaction block kind");
|
|
124
|
+
export const TransactionBlockDataSchema = z.object({
|
|
125
|
+
gasData: WowGasDataSchema.describe("Gas data"),
|
|
126
|
+
messageVersion: z.literal("v1").describe("Message version"),
|
|
127
|
+
sender: z.string().describe("Sender"),
|
|
128
|
+
transaction: WowTransactionBlockKindSchema.describe("Transaction"),
|
|
129
|
+
}).describe("Transaction block data");
|
|
130
|
+
export const WowTransactionBlockSchema = z.object({
|
|
131
|
+
data: TransactionBlockDataSchema.describe("Transaction data"),
|
|
132
|
+
txSignatures: z.array(z.string()).describe("Transaction signatures"),
|
|
133
|
+
}).describe("Wow transaction block");
|
|
134
|
+
export const WowObjectChangeSchema = z.discriminatedUnion("type", [
|
|
135
|
+
z.object({
|
|
136
|
+
type: z.literal("published"),
|
|
137
|
+
digest: z.string().describe("Digest"),
|
|
138
|
+
modules: z.array(z.string()).describe("Modules"),
|
|
139
|
+
packageId: z.string().describe("Package ID"),
|
|
140
|
+
version: z.union([z.string(), z.number()]).describe("Version"),
|
|
141
|
+
}),
|
|
142
|
+
z.object({
|
|
143
|
+
type: z.literal("transferred"),
|
|
144
|
+
digest: z.string().describe("Digest"),
|
|
145
|
+
objectId: z.string().describe("Object ID"),
|
|
146
|
+
objectType: z.string().describe("Object type"),
|
|
147
|
+
recipient: ObjectOwnerSchema.describe("Recipient"),
|
|
148
|
+
sender: z.string().describe("Sender ID"),
|
|
149
|
+
version: z.union([z.string(), z.number()]).describe("Version"),
|
|
150
|
+
}),
|
|
151
|
+
z.object({
|
|
152
|
+
type: z.literal("mutated"),
|
|
153
|
+
digest: z.string().describe("Digest"),
|
|
154
|
+
objectId: z.string().describe("Object ID"),
|
|
155
|
+
objectType: z.string().describe("Object type"),
|
|
156
|
+
owner: z.union([ObjectOwnerSchema, z.null()]).describe("Owner"),
|
|
157
|
+
previousVersion: z.union([z.string(), z.number()]).describe("Previous version"),
|
|
158
|
+
sender: z.string().describe("Sender"),
|
|
159
|
+
version: z.union([z.string(), z.number()]).describe("Version"),
|
|
160
|
+
}),
|
|
161
|
+
z.object({
|
|
162
|
+
type: z.literal("deleted"),
|
|
163
|
+
objectId: z.string().describe("Object ID"),
|
|
164
|
+
objectType: z.string().describe("Object type"),
|
|
165
|
+
sender: z.string().describe("Sender"),
|
|
166
|
+
version: z.union([z.string(), z.number()]).describe("Version"),
|
|
167
|
+
}),
|
|
168
|
+
z.object({
|
|
169
|
+
type: z.literal("wrapped"),
|
|
170
|
+
objectId: z.string().describe("Object ID"),
|
|
171
|
+
objectType: z.string().describe("Object type"),
|
|
172
|
+
sender: z.string().describe("Sender"),
|
|
173
|
+
version: z.union([z.string(), z.number()]).describe("Version"),
|
|
174
|
+
}),
|
|
175
|
+
z.object({
|
|
176
|
+
type: z.literal("created"),
|
|
177
|
+
digest: z.string().describe("Digest"),
|
|
178
|
+
objectId: z.string().describe("Object ID"),
|
|
179
|
+
objectType: z.string().describe("Object type"),
|
|
180
|
+
owner: z.union([ObjectOwnerSchema, z.null()]).describe("Owner"),
|
|
181
|
+
sender: z.string().describe("Sender"),
|
|
182
|
+
version: z.union([z.string(), z.number()]).describe("Version"),
|
|
183
|
+
}),
|
|
184
|
+
]).describe("Object change information");
|
|
185
|
+
export const TransactionEffectsSchema = z.object({
|
|
186
|
+
abortError: z.union([WowTransactionBlockSchema, z.null()]).optional().describe("Abort error if transaction failed with abort code"),
|
|
187
|
+
created: z.array(OwnedObjectRefSchema).optional().describe("ObjectRef and owner of newly created objects"),
|
|
188
|
+
deleted: z.array(WowObjectRefSchema).optional().describe("Object references (old refs) of now deleted objects"),
|
|
189
|
+
dependencies: z.array(z.string()).optional().describe("Set of transaction digests this transaction depends on"),
|
|
190
|
+
eventsDigest: z.union([z.string(), z.null()]).optional().describe("Digest of events emitted during execution"),
|
|
191
|
+
executedEpoch: z.union([z.string(), z.number()]).describe("Epoch in which this transaction was executed"),
|
|
192
|
+
gasObject: OwnedObjectRefSchema.describe("Updated gas object reference"),
|
|
193
|
+
gasUsed: GasCostSummarySchema.describe("Gas used"),
|
|
194
|
+
messageVersion: z.literal("v1").describe("Message version"),
|
|
195
|
+
modifiedAtVersions: z.array(TransactionBlockEffectsModifiedAtVersionsSchema).optional().describe("Version of each modified (mutated or deleted) object before this transaction modified it"),
|
|
196
|
+
mutated: z.array(OwnedObjectRefSchema).optional().describe("ObjectRef and owner of mutated objects, including gas object"),
|
|
197
|
+
sharedObjects: z.array(WowObjectRefSchema).optional().describe("Object references of shared objects used in this transaction"),
|
|
198
|
+
status: ExecutionStatusSchema.describe("Execution status"),
|
|
199
|
+
transactionDigest: z.string().describe("Transaction digest"),
|
|
200
|
+
unwrapped: z.array(OwnedObjectRefSchema).optional().describe("ObjectRef and owner of objects unwrapped in this transaction"),
|
|
201
|
+
unwrappedThenDeleted: z.array(WowObjectRefSchema).optional().describe("Object references of objects previously wrapped in other objects but now deleted"),
|
|
202
|
+
wrapped: z.array(WowObjectRefSchema).optional().describe("Object references of objects now wrapped in other objects"),
|
|
203
|
+
}).describe("Transaction effects");
|
|
204
|
+
export const WowTransactionBlockResponseSchema = z.object({
|
|
205
|
+
balanceChanges: z.union([z.array(BalanceChangeSchema), z.null()]).optional().describe("Balance changes"),
|
|
206
|
+
checkpoint: z.union([z.string(), z.null()]).optional().describe("Checkpoint number that this transaction is included in and thus completed"),
|
|
207
|
+
confirmedLocalExecution: z.union([z.boolean(), z.null()]).optional().describe("Confirmed local execution"),
|
|
208
|
+
digest: z.string().describe("Transaction digest"),
|
|
209
|
+
effects: z.union([TransactionEffectsSchema, z.null()]).optional().describe("Transaction effects"),
|
|
210
|
+
errors: z.array(z.string()).optional().describe("Error messages"),
|
|
211
|
+
events: z.union([z.array(WowEventSchema), z.null()]).optional().describe("Events"),
|
|
212
|
+
objectChanges: z.union([z.array(WowObjectChangeSchema), z.null()]).optional().describe("Object changes"),
|
|
213
|
+
rawEffects: z.array(z.number()).optional().describe("Raw effects"),
|
|
214
|
+
rawTransaction: z.string().optional().describe("Raw transaction"),
|
|
215
|
+
timestampMs: z.union([z.string(), z.null()]).optional().describe("Timestamp"),
|
|
216
|
+
transaction: z.union([WowTransactionBlockSchema, z.null()]).optional().describe("Transaction input data"),
|
|
217
|
+
}).describe("Wow transaction block response");
|
|
218
|
+
export const MarkParamSchema = z
|
|
219
|
+
.object({
|
|
220
|
+
name: z
|
|
221
|
+
.object({
|
|
222
|
+
value: z
|
|
223
|
+
.string()
|
|
224
|
+
.max(LocalMarkConstraints.nameMaxLength, `Mark name exceeds maximum length of ${LocalMarkConstraints.nameMaxLength} bcs characters`)
|
|
225
|
+
.describe(`Mark name value (max ${LocalMarkConstraints.nameMaxLength} bcs characters)`),
|
|
226
|
+
replaceExistName: z
|
|
227
|
+
.boolean()
|
|
228
|
+
.optional()
|
|
229
|
+
.default(false)
|
|
230
|
+
.describe("If true, replace existing mark with same name; if false (default), throw error when name exists"),
|
|
231
|
+
})
|
|
232
|
+
.optional()
|
|
233
|
+
.describe("Mark naming configuration"),
|
|
234
|
+
address: WowAddressSchema,
|
|
235
|
+
tags: z
|
|
236
|
+
.array(z
|
|
237
|
+
.string()
|
|
238
|
+
.max(LocalMarkConstraints.tagMaxLength, `Tag exceeds maximum length of ${LocalMarkConstraints.tagMaxLength} bcs characters`))
|
|
239
|
+
.max(LocalMarkConstraints.tagMaxCount, `Tag count exceeds maximum of ${LocalMarkConstraints.tagMaxCount}`)
|
|
240
|
+
.optional()
|
|
241
|
+
.describe(`Tags for categorization (max ${LocalMarkConstraints.tagMaxCount} tags, each max ${LocalMarkConstraints.tagMaxLength} bcs characters)`),
|
|
242
|
+
})
|
|
243
|
+
.describe("LOCAL ONLY: Parameters for creating or updating a LOCAL mark. This data is stored privately on your device and will NEVER be published to the blockchain. For public on-chain marks, use the 'personal' tool instead.");
|
|
244
|
+
export const MarkDataSchema = z
|
|
245
|
+
.object({
|
|
246
|
+
name: z
|
|
247
|
+
.string()
|
|
248
|
+
.max(LocalMarkConstraints.nameMaxLength, `Mark name exceeds maximum length of ${LocalMarkConstraints.nameMaxLength} bcs characters`)
|
|
249
|
+
.optional()
|
|
250
|
+
.describe(`Mark name (max ${LocalMarkConstraints.nameMaxLength} bcs characters)`),
|
|
251
|
+
address: WowAddressSchema,
|
|
252
|
+
tags: z
|
|
253
|
+
.array(z.string().max(LocalMarkConstraints.tagMaxLength, `Tag exceeds maximum length of ${LocalMarkConstraints.tagMaxLength} bcs characters`))
|
|
254
|
+
.max(LocalMarkConstraints.tagMaxCount, `Tag count exceeds maximum of ${LocalMarkConstraints.tagMaxCount}`)
|
|
255
|
+
.optional()
|
|
256
|
+
.describe(`Tags for categorization (max ${LocalMarkConstraints.tagMaxCount} tags, each max ${LocalMarkConstraints.tagMaxLength} bcs characters)`),
|
|
257
|
+
createdAt: z
|
|
258
|
+
.number()
|
|
259
|
+
.optional()
|
|
260
|
+
.describe("Unix timestamp (ms) when this mark was created"),
|
|
261
|
+
updatedAt: z
|
|
262
|
+
.number()
|
|
263
|
+
.optional()
|
|
264
|
+
.describe("Unix timestamp (ms) when this mark was last modified"),
|
|
265
|
+
})
|
|
266
|
+
.describe("LOCAL PRIVATE: Local mark data structure for storing address names and tags privately on your device. This data is NEVER published to the blockchain.");
|
|
267
|
+
export const InfoDataInnerSchema = z
|
|
268
|
+
.object({
|
|
269
|
+
default: z
|
|
270
|
+
.string()
|
|
271
|
+
.max(LocalInfoConstraints.contentMaxLength, `Default value exceeds maximum length of ${LocalInfoConstraints.contentMaxLength} bcs characters`)
|
|
272
|
+
.describe(`Primary/default value for this info (max ${LocalInfoConstraints.contentMaxLength} bcs characters)`),
|
|
273
|
+
contents: z
|
|
274
|
+
.array(z.string().max(LocalInfoConstraints.contentMaxLength, `Content item exceeds maximum length of ${LocalInfoConstraints.contentMaxLength} bcs characters`))
|
|
275
|
+
.max(LocalInfoConstraints.contentMaxCount, `Content count exceeds maximum of ${LocalInfoConstraints.contentMaxCount}`)
|
|
276
|
+
.optional()
|
|
277
|
+
.describe(`Additional content values (max ${LocalInfoConstraints.contentMaxCount} items, each max ${LocalInfoConstraints.contentMaxLength} bcs characters)`),
|
|
278
|
+
createdAt: z
|
|
279
|
+
.number()
|
|
280
|
+
.optional()
|
|
281
|
+
.describe("Unix timestamp (ms) when this info was created"),
|
|
282
|
+
updatedAt: z
|
|
283
|
+
.number()
|
|
284
|
+
.optional()
|
|
285
|
+
.describe("Unix timestamp (ms) when this info was last modified"),
|
|
286
|
+
})
|
|
287
|
+
.describe("Info data inner structure");
|
|
288
|
+
export const InfoDataSchema = InfoDataInnerSchema.extend({
|
|
289
|
+
name: z
|
|
290
|
+
.string()
|
|
291
|
+
.max(LocalInfoConstraints.nameMaxLength, `Info name exceeds maximum length of ${LocalInfoConstraints.nameMaxLength} bcs characters`)
|
|
292
|
+
.describe(`Unique identifier for this info entry (max ${LocalInfoConstraints.nameMaxLength} bcs characters)`),
|
|
293
|
+
}).describe("LOCAL PRIVATE: Local info data structure for storing sensitive personal information like delivery addresses, phone numbers, etc. This data is stored ONLY on your device and NEVER published to the blockchain.");
|
|
294
|
+
export const LocalMarkFilterSchema = z
|
|
295
|
+
.object({
|
|
296
|
+
name: NameSchema
|
|
297
|
+
.optional()
|
|
298
|
+
.describe("Filter by mark name (supports fuzzy match)"),
|
|
299
|
+
tags: z
|
|
300
|
+
.array(z.string())
|
|
301
|
+
.optional()
|
|
302
|
+
.describe("Filter by tags - returns marks that contain ANY of the specified tags"),
|
|
303
|
+
address: WowAddressSchema
|
|
304
|
+
.optional()
|
|
305
|
+
.describe("Filter by address (exact match, format: 0x + 64 hex characters)"),
|
|
306
|
+
createdAt: z
|
|
307
|
+
.object({
|
|
308
|
+
gte: z
|
|
309
|
+
.number()
|
|
310
|
+
.optional()
|
|
311
|
+
.describe("Filter marks created on or after this timestamp (ms)"),
|
|
312
|
+
lte: z
|
|
313
|
+
.number()
|
|
314
|
+
.optional()
|
|
315
|
+
.describe("Filter marks created on or before this timestamp (ms)"),
|
|
316
|
+
})
|
|
317
|
+
.optional()
|
|
318
|
+
.describe("Filter by creation time range"),
|
|
319
|
+
updatedAt: z
|
|
320
|
+
.object({
|
|
321
|
+
gte: z
|
|
322
|
+
.number()
|
|
323
|
+
.optional()
|
|
324
|
+
.describe("Filter marks updated on or after this timestamp (ms)"),
|
|
325
|
+
lte: z
|
|
326
|
+
.number()
|
|
327
|
+
.optional()
|
|
328
|
+
.describe("Filter marks updated on or before this timestamp (ms)"),
|
|
329
|
+
})
|
|
330
|
+
.optional()
|
|
331
|
+
.describe("Filter by update time range"),
|
|
332
|
+
})
|
|
333
|
+
.describe("Filter criteria for querying local marks. Multiple filters are combined with AND logic.");
|
|
334
|
+
export const LocalInfoFilterSchema = z
|
|
335
|
+
.object({
|
|
336
|
+
name: NameSchema
|
|
337
|
+
.optional()
|
|
338
|
+
.describe("Filter by info name (supports fuzzy match)"),
|
|
339
|
+
default: z
|
|
340
|
+
.string()
|
|
341
|
+
.optional()
|
|
342
|
+
.describe("Filter by default value (supports fuzzy match)"),
|
|
343
|
+
contents: z
|
|
344
|
+
.array(z.string())
|
|
345
|
+
.optional()
|
|
346
|
+
.describe("Filter by contents - returns info that contains ANY of the specified content items"),
|
|
347
|
+
createdAt: z
|
|
348
|
+
.object({
|
|
349
|
+
gte: z
|
|
350
|
+
.number()
|
|
351
|
+
.optional()
|
|
352
|
+
.describe("Filter info created on or after this timestamp (ms)"),
|
|
353
|
+
lte: z
|
|
354
|
+
.number()
|
|
355
|
+
.optional()
|
|
356
|
+
.describe("Filter info created on or before this timestamp (ms)"),
|
|
357
|
+
})
|
|
358
|
+
.optional()
|
|
359
|
+
.describe("Filter by creation time range"),
|
|
360
|
+
updatedAt: z
|
|
361
|
+
.object({
|
|
362
|
+
gte: z
|
|
363
|
+
.number()
|
|
364
|
+
.optional()
|
|
365
|
+
.describe("Filter info updated on or after this timestamp (ms)"),
|
|
366
|
+
lte: z
|
|
367
|
+
.number()
|
|
368
|
+
.optional()
|
|
369
|
+
.describe("Filter info updated on or before this timestamp (ms)"),
|
|
370
|
+
})
|
|
371
|
+
.optional()
|
|
372
|
+
.describe("Filter by update time range"),
|
|
373
|
+
})
|
|
374
|
+
.describe("Filter criteria for querying local info. Multiple filters are combined with AND logic.");
|
|
375
|
+
export const QueryLocalInfoListSchema = z.object({
|
|
376
|
+
filter: LocalInfoFilterSchema.optional().describe("Local info filter"),
|
|
377
|
+
}).describe("Query local info list parameters");
|
|
378
|
+
export const QueryAccountSchema = z
|
|
379
|
+
.object({
|
|
380
|
+
name_or_address: NameOrAddressSchema.optional()
|
|
381
|
+
.describe("Account name or address. Use empty string '' for the default account. Defaults to '' if omitted."),
|
|
382
|
+
balance: z
|
|
383
|
+
.boolean()
|
|
384
|
+
.optional()
|
|
385
|
+
.describe("Whether to query coin balance amount"),
|
|
386
|
+
coin: z
|
|
387
|
+
.object({
|
|
388
|
+
cursor: z
|
|
389
|
+
.union([z.string(), z.null()])
|
|
390
|
+
.optional()
|
|
391
|
+
.describe("Query cursor for pagination"),
|
|
392
|
+
limit: z
|
|
393
|
+
.union([z.number(), z.null()])
|
|
394
|
+
.optional()
|
|
395
|
+
.describe("Maximum number of objects to return"),
|
|
396
|
+
})
|
|
397
|
+
.optional()
|
|
398
|
+
.describe("Whether to query coin object list"),
|
|
399
|
+
token_type: TokenTypeSchema
|
|
400
|
+
.optional()
|
|
401
|
+
.describe("Token type; default token type is 0x2::wow::WOW"),
|
|
402
|
+
network: EntrypointSchema
|
|
403
|
+
.optional(),
|
|
404
|
+
})
|
|
405
|
+
.describe("Used to query account's coin balance");
|
|
406
|
+
export const QueryAccountResultSchema = z.object({
|
|
407
|
+
name_or_address: NameOrAddressSchema.optional().describe("Account name or ID"),
|
|
408
|
+
address: z.string().optional().describe("Account ID"),
|
|
409
|
+
balance: CoinBalanceSchema.optional().describe("Coin balance details"),
|
|
410
|
+
coin: PaginatedCoinsSchema.optional().describe("Paginated coin object list"),
|
|
411
|
+
}).describe("Result of querying account's coin balance");
|
|
412
|
+
export const AccountOperationSchema = z
|
|
413
|
+
.object({
|
|
414
|
+
gen: z
|
|
415
|
+
.object({
|
|
416
|
+
name: NameSchema
|
|
417
|
+
.optional()
|
|
418
|
+
.describe(`Account name (max ${AccountConstraints.nameMaxLength} characters). Use empty string '' or omit for the default account.`),
|
|
419
|
+
replaceExistName: z
|
|
420
|
+
.boolean()
|
|
421
|
+
.optional()
|
|
422
|
+
.describe("If true, existing account with the same name will lose the name; if false (default), throw error when name exists"),
|
|
423
|
+
m: z
|
|
424
|
+
.union([NameSchema, z.null()])
|
|
425
|
+
.optional()
|
|
426
|
+
.describe("Messenger name to enable messenger for this account (max 64 characters). If null, disable messenger. Omit to leave messenger unchanged."),
|
|
427
|
+
})
|
|
428
|
+
.optional()
|
|
429
|
+
.describe("Generate new account"),
|
|
430
|
+
faucet: z
|
|
431
|
+
.object({
|
|
432
|
+
name_or_address: NameOrAddressSchema.optional()
|
|
433
|
+
.describe("Account name or address. Use empty string '' for the default account. Defaults to '' if omitted."),
|
|
434
|
+
network: FaucetNetworkSchema,
|
|
435
|
+
})
|
|
436
|
+
.optional()
|
|
437
|
+
.describe("Distribute test coins from faucet to the specified account"),
|
|
438
|
+
suspend: z
|
|
439
|
+
.object({
|
|
440
|
+
name_or_address: NameOrAddressSchema.optional()
|
|
441
|
+
.describe("Account name or address. Use empty string '' for the default account. Defaults to '' if omitted."),
|
|
442
|
+
})
|
|
443
|
+
.optional()
|
|
444
|
+
.describe("Remove account from active account list (cannot sign transactions), and delete its name"),
|
|
445
|
+
resume: z
|
|
446
|
+
.object({
|
|
447
|
+
address: WowAddressSchema,
|
|
448
|
+
name: NameSchema.optional()
|
|
449
|
+
.describe("New name for the resumed account. Omit to leave unnamed."),
|
|
450
|
+
})
|
|
451
|
+
.optional()
|
|
452
|
+
.describe("Add account back to active account list"),
|
|
453
|
+
rename: z
|
|
454
|
+
.object({
|
|
455
|
+
name_or_address: NameOrAddressSchema.optional()
|
|
456
|
+
.describe(`Source account name or address. Use empty string '' for the default account. Defaults to '' if omitted. Can be a name or address.`),
|
|
457
|
+
new_name: NameSchema
|
|
458
|
+
.describe(`New account name (max ${AccountConstraints.nameMaxLength} characters). Must be a name (not an address).`),
|
|
459
|
+
})
|
|
460
|
+
.optional()
|
|
461
|
+
.describe("Rename account. name_or_address can be name or address, new_name must be a name."),
|
|
462
|
+
swap_name: z
|
|
463
|
+
.object({
|
|
464
|
+
name1: NameSchema.optional()
|
|
465
|
+
.describe("First account name. Use empty string '' for the default account."),
|
|
466
|
+
name2: NameSchema.optional()
|
|
467
|
+
.describe("Second account name. Use empty string '' for the default account."),
|
|
468
|
+
})
|
|
469
|
+
.optional()
|
|
470
|
+
.describe("Swap the names of two accounts"),
|
|
471
|
+
transfer: z
|
|
472
|
+
.object({
|
|
473
|
+
name_or_address_from: NameOrAddressSchema.optional()
|
|
474
|
+
.describe("Sender account name or address. Use empty string '' for the default account."),
|
|
475
|
+
name_or_address_to: NameOrAddressSchema.optional()
|
|
476
|
+
.describe("Recipient account name or address. Use empty string '' for the default account."),
|
|
477
|
+
amount: z
|
|
478
|
+
.union([z.number(), z.string()])
|
|
479
|
+
.describe("Amount of tokens to transfer"),
|
|
480
|
+
token_type: z
|
|
481
|
+
.string()
|
|
482
|
+
.optional()
|
|
483
|
+
.describe("Token type; default token type is 0x2::wow::WOW"),
|
|
484
|
+
network: EntrypointSchema
|
|
485
|
+
.optional()
|
|
486
|
+
})
|
|
487
|
+
.optional()
|
|
488
|
+
.describe("Transfer tokens from one account to another"),
|
|
489
|
+
get: z
|
|
490
|
+
.object({
|
|
491
|
+
name_or_address: NameOrAddressSchema.optional()
|
|
492
|
+
.describe("Account name or address. Use empty string '' for the default account."),
|
|
493
|
+
balance_required: z
|
|
494
|
+
.union([z.string(), z.number()])
|
|
495
|
+
.describe("Required balance amount"),
|
|
496
|
+
token_type: z
|
|
497
|
+
.string()
|
|
498
|
+
.optional()
|
|
499
|
+
.describe("Token type; default token type is 0x2::wow::WOW"),
|
|
500
|
+
network: EntrypointSchema
|
|
501
|
+
.optional()
|
|
502
|
+
})
|
|
503
|
+
.optional()
|
|
504
|
+
.describe("Generate new coin object ID from account by required amount and return"),
|
|
505
|
+
signData: z
|
|
506
|
+
.object({
|
|
507
|
+
name_or_address: NameOrAddressSchema.optional()
|
|
508
|
+
.describe("Account name or address. Use empty string '' for the default account."),
|
|
509
|
+
data: z.string().describe("Data to sign. If data_encoding is not specified, treated as UTF-8 string."),
|
|
510
|
+
data_encoding: z
|
|
511
|
+
.union([
|
|
512
|
+
z.literal("utf8").describe("Data is UTF-8 encoded string"),
|
|
513
|
+
z.literal("base64").describe("Data is base64 encoded bytes"),
|
|
514
|
+
z.literal("hex").describe("Data is hex encoded bytes (with or without 0x prefix)"),
|
|
515
|
+
])
|
|
516
|
+
.optional()
|
|
517
|
+
.describe("Encoding format of the data field. If not specified, defaults to utf8."),
|
|
518
|
+
})
|
|
519
|
+
.optional()
|
|
520
|
+
.describe("Sign data with account's private key"),
|
|
521
|
+
messenger: z
|
|
522
|
+
.object({
|
|
523
|
+
name_or_account: NameOrAddressSchema.optional()
|
|
524
|
+
.describe("Account name or address. Use empty string '' for the default account. Defaults to '' if omitted."),
|
|
525
|
+
m: z
|
|
526
|
+
.union([NameSchema, z.null()])
|
|
527
|
+
.describe("Messenger name to enable messenger for this account (max 64 characters). If null, disable messenger."),
|
|
528
|
+
})
|
|
529
|
+
.optional()
|
|
530
|
+
.describe("Enable or disable messenger for an account"),
|
|
531
|
+
})
|
|
532
|
+
.describe("Account operations");
|
|
533
|
+
export const AccountOperationResultSchema = z
|
|
534
|
+
.object({
|
|
535
|
+
gen: z
|
|
536
|
+
.object({
|
|
537
|
+
address: z.string().describe("Newly generated account ID"),
|
|
538
|
+
name: NameSchema.optional().describe("Account name"),
|
|
539
|
+
m: z
|
|
540
|
+
.union([NameSchema, z.null()])
|
|
541
|
+
.optional()
|
|
542
|
+
.describe("Messenger name if enabled"),
|
|
543
|
+
})
|
|
544
|
+
.optional()
|
|
545
|
+
.describe("Result of generating new account"),
|
|
546
|
+
faucet: z
|
|
547
|
+
.object({
|
|
548
|
+
name_or_address: NameOrAddressSchema.optional()
|
|
549
|
+
.describe("Account name or address that received faucet coins"),
|
|
550
|
+
result: z
|
|
551
|
+
.array(FaucetCoinInfoSchema)
|
|
552
|
+
.describe("List of distributed test coin info"),
|
|
553
|
+
network: FaucetNetworkSchema,
|
|
554
|
+
})
|
|
555
|
+
.optional()
|
|
556
|
+
.describe("Result of distributing test coins from faucet to the specified account"),
|
|
557
|
+
suspend: z
|
|
558
|
+
.object({
|
|
559
|
+
name_or_address: NameOrAddressSchema.optional()
|
|
560
|
+
.describe("Account name or address that was suspended"),
|
|
561
|
+
success: z
|
|
562
|
+
.boolean()
|
|
563
|
+
.describe("True if account was successfully suspended, false if account does not exist"),
|
|
564
|
+
})
|
|
565
|
+
.optional()
|
|
566
|
+
.describe("Result of removing account from active account list (cannot sign transactions)"),
|
|
567
|
+
resume: z
|
|
568
|
+
.object({
|
|
569
|
+
address: WowAddressSchema.describe("Account ID that was resumed"),
|
|
570
|
+
name: NameSchema.optional().describe("New name assigned to the account"),
|
|
571
|
+
success: z
|
|
572
|
+
.boolean()
|
|
573
|
+
.describe("True if account was successfully resumed, false if account does not exist"),
|
|
574
|
+
})
|
|
575
|
+
.optional()
|
|
576
|
+
.describe("Result of adding account back to active account list"),
|
|
577
|
+
rename: z
|
|
578
|
+
.object({
|
|
579
|
+
name_or_address: NameOrAddressSchema.optional()
|
|
580
|
+
.describe("Source account name or address that was renamed"),
|
|
581
|
+
new_name: NameSchema.describe("New account name"),
|
|
582
|
+
success: z
|
|
583
|
+
.boolean()
|
|
584
|
+
.describe("True if rename was successful, false if account not found or name already exists"),
|
|
585
|
+
})
|
|
586
|
+
.optional()
|
|
587
|
+
.describe("Result of renaming account"),
|
|
588
|
+
swap_name: z
|
|
589
|
+
.object({
|
|
590
|
+
name1: NameSchema.optional()
|
|
591
|
+
.describe("First account name"),
|
|
592
|
+
name2: NameSchema.optional()
|
|
593
|
+
.describe("Second account name"),
|
|
594
|
+
success: z
|
|
595
|
+
.boolean()
|
|
596
|
+
.describe("True if swap was successful, false if either account not found"),
|
|
597
|
+
})
|
|
598
|
+
.optional()
|
|
599
|
+
.describe("Result of swapping account names"),
|
|
600
|
+
transfer: WowTransactionBlockResponseSchema.optional().describe("Result of token transfer transaction"),
|
|
601
|
+
get: z
|
|
602
|
+
.object({
|
|
603
|
+
coin_address: z
|
|
604
|
+
.string()
|
|
605
|
+
.optional()
|
|
606
|
+
.describe("Newly generated coin object ID"),
|
|
607
|
+
name_or_address: NameOrAddressSchema.optional()
|
|
608
|
+
.describe("Account name or address"),
|
|
609
|
+
balance_required: z
|
|
610
|
+
.union([z.string(), z.number()])
|
|
611
|
+
.describe("Required coin object balance"),
|
|
612
|
+
token_type: z
|
|
613
|
+
.string()
|
|
614
|
+
.optional()
|
|
615
|
+
.describe("Token type; default token type is 0x2::wow::WOW"),
|
|
616
|
+
network: EntrypointSchema
|
|
617
|
+
.optional()
|
|
618
|
+
})
|
|
619
|
+
.optional()
|
|
620
|
+
.describe("Result of generating new coin object ID from account by required amount"),
|
|
621
|
+
signData: z
|
|
622
|
+
.object({
|
|
623
|
+
name_or_address: NameOrAddressSchema.optional()
|
|
624
|
+
.describe("Account name or address used for signing"),
|
|
625
|
+
signature: z.string().describe("Signature in hex format"),
|
|
626
|
+
publicKey: z.string().describe("Public key in hex format"),
|
|
627
|
+
address: z.string().describe("Account address"),
|
|
628
|
+
})
|
|
629
|
+
.optional()
|
|
630
|
+
.describe("Result of signing data with account"),
|
|
631
|
+
messenger: z
|
|
632
|
+
.object({
|
|
633
|
+
name_or_account: NameOrAddressSchema.optional()
|
|
634
|
+
.describe("Account name or address"),
|
|
635
|
+
m: z
|
|
636
|
+
.union([NameSchema, z.null()])
|
|
637
|
+
.describe("Messenger name if enabled, null if disabled"),
|
|
638
|
+
})
|
|
639
|
+
.optional()
|
|
640
|
+
.describe("Result of enabling or disabling messenger for an account"),
|
|
641
|
+
})
|
|
642
|
+
.describe("Results of account operations");
|
|
643
|
+
export const LocalMarkOperationSchema = z
|
|
644
|
+
.object({
|
|
645
|
+
add: z
|
|
646
|
+
.object({
|
|
647
|
+
op: z.literal("add").describe("Operation type: add marks"),
|
|
648
|
+
data: z
|
|
649
|
+
.array(MarkParamSchema)
|
|
650
|
+
.min(1)
|
|
651
|
+
.describe("Array of mark data to add (at least 1 item)"),
|
|
652
|
+
})
|
|
653
|
+
.optional()
|
|
654
|
+
.describe("Add one or more marks"),
|
|
655
|
+
remove: z
|
|
656
|
+
.object({
|
|
657
|
+
op: z.literal("remove").describe("Operation type: remove marks"),
|
|
658
|
+
names: z
|
|
659
|
+
.array(z.string())
|
|
660
|
+
.min(1)
|
|
661
|
+
.describe("Array of mark names or addresses to remove"),
|
|
662
|
+
})
|
|
663
|
+
.optional()
|
|
664
|
+
.describe("Remove marks by name or address"),
|
|
665
|
+
clear: z
|
|
666
|
+
.object({
|
|
667
|
+
op: z.literal("clear").describe("Operation type: clear all marks"),
|
|
668
|
+
})
|
|
669
|
+
.optional()
|
|
670
|
+
.describe("Remove all marks"),
|
|
671
|
+
})
|
|
672
|
+
.describe("Local mark operations. Exactly one operation type (add/remove/clear) must be specified.");
|
|
673
|
+
export const LocalMarkOperationResultSchema = z.object({
|
|
674
|
+
clear: z.boolean().optional().describe("Whether all marks were successfully removed"),
|
|
675
|
+
add: z.array(MarkDataSchema).optional().describe("List of added mark data"),
|
|
676
|
+
remove: z.array(MarkDataSchema).optional().describe("List of removed mark data"),
|
|
677
|
+
}).describe("Results of local mark operations for ID");
|
|
678
|
+
export const LocalInfoOperationSchema = z
|
|
679
|
+
.object({
|
|
680
|
+
add: z
|
|
681
|
+
.object({
|
|
682
|
+
op: z.literal("add").describe("Operation type: add info"),
|
|
683
|
+
data: z
|
|
684
|
+
.array(InfoDataSchema)
|
|
685
|
+
.min(1)
|
|
686
|
+
.describe("Array of info data to add (at least 1 item)"),
|
|
687
|
+
})
|
|
688
|
+
.optional()
|
|
689
|
+
.describe("Add one or more info entries"),
|
|
690
|
+
remove: z
|
|
691
|
+
.object({
|
|
692
|
+
op: z.literal("remove").describe("Operation type: remove info"),
|
|
693
|
+
data: z
|
|
694
|
+
.array(z.string())
|
|
695
|
+
.min(1)
|
|
696
|
+
.describe("Array of info names to remove"),
|
|
697
|
+
})
|
|
698
|
+
.optional()
|
|
699
|
+
.describe("Remove info entries by name"),
|
|
700
|
+
reset: z
|
|
701
|
+
.object({
|
|
702
|
+
op: z.literal("reset").describe("Operation type: reset contents"),
|
|
703
|
+
name: z.string().describe("Name of info entry to reset"),
|
|
704
|
+
contents: z
|
|
705
|
+
.array(z.string())
|
|
706
|
+
.describe("New content list to replace existing contents"),
|
|
707
|
+
})
|
|
708
|
+
.optional()
|
|
709
|
+
.describe("Reset the contents of an existing info entry"),
|
|
710
|
+
clear: z
|
|
711
|
+
.object({
|
|
712
|
+
op: z.literal("clear").describe("Operation type: clear all info"),
|
|
713
|
+
})
|
|
714
|
+
.optional()
|
|
715
|
+
.describe("Remove all info entries"),
|
|
716
|
+
})
|
|
717
|
+
.describe("Local info operations. Exactly one operation type (add/remove/reset/clear) must be specified.");
|
|
718
|
+
export const LocalInfoOperationResultSchema = z.object({
|
|
719
|
+
success: z.boolean().describe("Whether successful"),
|
|
720
|
+
}).describe("Results of local info operations");
|
|
721
|
+
export const FetchTokenInfoOperationSchema = z.object({
|
|
722
|
+
tokenType: z.union([TokenTypeSchema, z.null()]).optional().describe("Token type; default token type is 0x2::wow::WOW"),
|
|
723
|
+
alias: NameSchema.optional().describe("Token alias; used to quickly fetch token info"),
|
|
724
|
+
network: EntrypointSchema.optional(),
|
|
725
|
+
}).describe("Fetch token info to local and name it");
|
|
726
|
+
export const QueryLocalMarkListSchema = z.object({
|
|
727
|
+
filter: LocalMarkFilterSchema.optional().describe("Local mark filter"),
|
|
728
|
+
}).describe("Query local mark list parameters");
|
|
729
|
+
export const QueryLocalMarkListResultSchema = z.object({
|
|
730
|
+
result: z.array(MarkDataSchema).describe("Local mark list"),
|
|
731
|
+
}).describe("Query local mark list result");
|
|
732
|
+
export const AccountFilterSchema = z
|
|
733
|
+
.object({
|
|
734
|
+
name: NameSchema
|
|
735
|
+
.optional()
|
|
736
|
+
.describe("Filter by account name (supports fuzzy match)"),
|
|
737
|
+
address: WowAddressSchema
|
|
738
|
+
.optional()
|
|
739
|
+
.describe("Filter by account address (supports partial match, format: 0x + hex characters)"),
|
|
740
|
+
suspended: z
|
|
741
|
+
.boolean()
|
|
742
|
+
.optional()
|
|
743
|
+
.describe("Filter by suspension status. Omit to return all accounts regardless of status"),
|
|
744
|
+
hasMessenger: z
|
|
745
|
+
.boolean()
|
|
746
|
+
.optional()
|
|
747
|
+
.describe("Filter accounts with messenger enabled"),
|
|
748
|
+
m: NameSchema
|
|
749
|
+
.optional()
|
|
750
|
+
.describe("Filter by messenger name (supports fuzzy match)"),
|
|
751
|
+
createdAt: z
|
|
752
|
+
.object({
|
|
753
|
+
gte: z
|
|
754
|
+
.number()
|
|
755
|
+
.optional()
|
|
756
|
+
.describe("Filter accounts created on or after this timestamp (ms)"),
|
|
757
|
+
lte: z
|
|
758
|
+
.number()
|
|
759
|
+
.optional()
|
|
760
|
+
.describe("Filter accounts created on or before this timestamp (ms)"),
|
|
761
|
+
})
|
|
762
|
+
.optional()
|
|
763
|
+
.describe("Filter by creation time range"),
|
|
764
|
+
updatedAt: z
|
|
765
|
+
.object({
|
|
766
|
+
gte: z
|
|
767
|
+
.number()
|
|
768
|
+
.optional()
|
|
769
|
+
.describe("Filter accounts updated on or after this timestamp (ms)"),
|
|
770
|
+
lte: z
|
|
771
|
+
.number()
|
|
772
|
+
.optional()
|
|
773
|
+
.describe("Filter accounts updated on or before this timestamp (ms)"),
|
|
774
|
+
})
|
|
775
|
+
.optional()
|
|
776
|
+
.describe("Filter by update time range"),
|
|
777
|
+
})
|
|
778
|
+
.describe("Filter criteria for querying accounts. Multiple filters are combined with AND logic.");
|
|
779
|
+
export const QueryAccountListSchema = z.object({
|
|
780
|
+
filter: AccountFilterSchema.optional().describe("Account filter"),
|
|
781
|
+
}).describe("Query account list parameters");
|
|
782
|
+
export const AccountDataSchema = z.object({
|
|
783
|
+
name: z.string().optional().describe("Account name"),
|
|
784
|
+
address: z.string().describe("Account address"),
|
|
785
|
+
pubkey: z.string().optional().describe("Account public key"),
|
|
786
|
+
secret: z.string().optional().describe("Account secret key"),
|
|
787
|
+
suspended: z.boolean().optional().describe("Whether account is suspended"),
|
|
788
|
+
createdAt: z.number().optional().describe("Timestamp when account was created"),
|
|
789
|
+
updatedAt: z.number().optional().describe("Timestamp when account was last updated"),
|
|
790
|
+
m: z.string().nullable().optional().describe("Messenger name, indicates this account has messenger enabled"),
|
|
791
|
+
}).describe("Account data");
|
|
792
|
+
export const QueryAccountListResultSchema = z.object({
|
|
793
|
+
result: z.array(AccountDataSchema).describe("Account list"),
|
|
794
|
+
}).describe("Query account list result");
|
|
795
|
+
export const QueryLocalInfoListResultSchema = z.object({
|
|
796
|
+
result: z.array(InfoDataSchema).describe("Local info list"),
|
|
797
|
+
}).describe("Query local info list result");
|
|
798
|
+
export const TokenTypeInfoSchema = z.object({
|
|
799
|
+
type: z.string().describe("Token type"),
|
|
800
|
+
alias: z.string().optional().describe("Token alias"),
|
|
801
|
+
name: z.string().describe("Token name"),
|
|
802
|
+
symbol: z.string().describe("Token symbol"),
|
|
803
|
+
decimals: z.number().describe("Number of decimal places"),
|
|
804
|
+
description: z.string().describe("Description of the token"),
|
|
805
|
+
iconUrl: z.union([z.string(), z.null()]).optional().describe("URL for the token logo"),
|
|
806
|
+
id: z.union([z.string(), z.null()]).optional().describe("Object id for the CoinMetadata object"),
|
|
807
|
+
}).describe("Token type info");
|
|
808
|
+
export const TokenDataFilterSchema = z.object({
|
|
809
|
+
alias_or_name: NameSchema.optional().describe("Alias or name filter"),
|
|
810
|
+
symbol: z.string().optional().describe("Token symbol"),
|
|
811
|
+
type: z.string().optional().describe("Token type"),
|
|
812
|
+
}).describe("Token data filter");
|
|
813
|
+
export const QueryLocalTokenListResultSchema = z.object({
|
|
814
|
+
result: z.array(TokenTypeInfoSchema).describe("Local token list"),
|
|
815
|
+
}).describe("Query local token list result");
|
|
816
|
+
export const AccountOperationOutputSchema = z.discriminatedUnion("status", [
|
|
817
|
+
z.object({
|
|
818
|
+
status: z.literal("success"),
|
|
819
|
+
data: AccountOperationResultSchema.describe("Success result data"),
|
|
820
|
+
}),
|
|
821
|
+
z.object({
|
|
822
|
+
status: z.literal("error"),
|
|
823
|
+
error: z.string().describe("Error message"),
|
|
824
|
+
}),
|
|
825
|
+
]).describe("Account operation output schema with discriminator");
|
|
826
|
+
export const AccountOperationOutputWrappedSchema = z.object({
|
|
827
|
+
result: AccountOperationOutputSchema,
|
|
828
|
+
}).describe("Account operation output wrapped schema");
|
|
829
|
+
export const LocalMarkOperationOutputSchema = z.discriminatedUnion("status", [
|
|
830
|
+
z.object({
|
|
831
|
+
status: z.literal("success"),
|
|
832
|
+
data: LocalMarkOperationResultSchema.describe("Success result data"),
|
|
833
|
+
}),
|
|
834
|
+
z.object({
|
|
835
|
+
status: z.literal("error"),
|
|
836
|
+
error: z.string().describe("Error message"),
|
|
837
|
+
}),
|
|
838
|
+
]).describe("Local mark operation output schema with discriminator");
|
|
839
|
+
export const LocalMarkOperationOutputWrappedSchema = z.object({
|
|
840
|
+
result: LocalMarkOperationOutputSchema,
|
|
841
|
+
}).describe("Local mark operation output wrapped schema");
|
|
842
|
+
export const LocalInfoOperationOutputSchema = z.discriminatedUnion("status", [
|
|
843
|
+
z.object({
|
|
844
|
+
status: z.literal("success"),
|
|
845
|
+
data: LocalInfoOperationResultSchema.describe("Success result data"),
|
|
846
|
+
}),
|
|
847
|
+
z.object({
|
|
848
|
+
status: z.literal("error"),
|
|
849
|
+
error: z.string().describe("Error message"),
|
|
850
|
+
}),
|
|
851
|
+
]).describe("Local info operation output schema with discriminator");
|
|
852
|
+
export const LocalInfoOperationOutputWrappedSchema = z.object({
|
|
853
|
+
result: LocalInfoOperationOutputSchema,
|
|
854
|
+
}).describe("Local info operation output wrapped schema");
|
|
855
|
+
export * from "./wip.js";
|