@wowok/wowok 2.2.15 → 2.2.16
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/LICENSE +19 -131
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/jsonRpc/client.d.ts +2 -2
- package/dist/cjs/jsonRpc/types/chain.d.ts +3 -3
- package/dist/cjs/jsonRpc/types/generated.d.ts +249 -271
- package/dist/cjs/jsonRpc/types/generated_old.d.ts +954 -0
- package/dist/cjs/jsonRpc/types/generated_old.js +1 -0
- package/dist/cjs/jsonRpc/types/params.d.ts +2 -2
- package/dist/cjs/w/call/arbitration.js +1 -1
- package/dist/cjs/w/call/base.js +1 -1
- package/dist/cjs/w/call/contact.js +1 -1
- package/dist/cjs/w/call/demand.js +1 -1
- package/dist/cjs/w/call/guard.js +1 -1
- package/dist/cjs/w/call/machine.js +1 -1
- package/dist/cjs/w/call/personal.js +1 -1
- package/dist/cjs/w/call/repository.js +1 -1
- package/dist/cjs/w/call/reward.js +1 -1
- package/dist/cjs/w/call/service.js +1 -1
- package/dist/cjs/w/call/treasury.js +1 -1
- package/dist/cjs/w/local/storage.js +1 -1
- package/dist/cjs/w/local/util.js +1 -1
- package/dist/cjs/w/local/wip.js +1 -1
- package/dist/cjs/w/messenger/messenger-api.js +1 -1
- package/dist/cjs/w/messenger/messenger.js +1 -1
- package/dist/cjs/w/messenger/pq/crypto.js +1 -1
- package/dist/cjs/w/messenger/storage.js +1 -1
- package/dist/cjs/w/query/object.js +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/jsonRpc/client.d.ts +2 -2
- package/dist/esm/jsonRpc/types/chain.d.ts +3 -3
- package/dist/esm/jsonRpc/types/generated.d.ts +249 -271
- package/dist/esm/jsonRpc/types/generated_old.d.ts +954 -0
- package/dist/esm/jsonRpc/types/generated_old.js +1 -0
- package/dist/esm/jsonRpc/types/params.d.ts +2 -2
- package/dist/esm/w/call/arbitration.js +1 -1
- package/dist/esm/w/call/base.js +1 -1
- package/dist/esm/w/call/contact.js +1 -1
- package/dist/esm/w/call/demand.js +1 -1
- package/dist/esm/w/call/guard.js +1 -1
- package/dist/esm/w/call/machine.js +1 -1
- package/dist/esm/w/call/personal.js +1 -1
- package/dist/esm/w/call/repository.js +1 -1
- package/dist/esm/w/call/reward.js +1 -1
- package/dist/esm/w/call/service.js +1 -1
- package/dist/esm/w/call/treasury.js +1 -1
- package/dist/esm/w/local/storage.js +1 -1
- package/dist/esm/w/local/util.js +1 -1
- package/dist/esm/w/local/wip.js +1 -1
- package/dist/esm/w/messenger/messenger-api.js +1 -1
- package/dist/esm/w/messenger/messenger.js +1 -1
- package/dist/esm/w/messenger/pq/crypto.js +1 -1
- package/dist/esm/w/messenger/storage.js +1 -1
- package/dist/esm/w/query/object.js +1 -1
- package/package.json +1 -3
- package/NOTICE +0 -114
- package/THIRD_PARTY_LICENSES/APACHE_LICENSE.txt +0 -196
- package/THIRD_PARTY_LICENSES/MIT_LICENSE.txt +0 -58
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getFullnodeUrl}from'../../client/network.js';import{WowClient}from'../../client/index.js';import{Cache,CachePrefix}from'../local/cache.js';import{Config}from'../local/config.js';import{LocalMark}from'../local/local.js';import{W_ERROR,WErrors}from'../exception.js';import a204a from'lodash';import{restoreNodeFromOutput}from'../call/util.js';import{GetAccountOrMark_Address}from'../local/index.js';import{object_name_from_type,object_module_and_name_from_type,PackageAddress,WitnessType,ObjectType,ENTITY_LINKER_ADDRESS,ENTITY_REGISTRAR_ADDRESS}from'../common.js';import{bcsBytesToValue,parseRecipient,uint2address}from'../util.js';export{ObjectType};export const MAX_OBJECTS_PER_QUERY=0x32;export const WitnessSourceType=a=>{switch(a){case WitnessType['TypeArbArbitration']:case WitnessType['TypeArbOrder']:case WitnessType['TypeArbService']:case WitnessType['TypeArbProgress']:case WitnessType['TypeArbMachine']:return ObjectType['Arb'];case WitnessType['TypeOrderMachine']:case WitnessType['TypeOrderService']:case WitnessType['TypeOrderProgress']:return ObjectType['Order'];case WitnessType['TypeProgressMachine']:return ObjectType['Progress'];}};export const WitnessTargetType=a=>{switch(a){case WitnessType['TypeArbArbitration']:return ObjectType['Arbitration'];case WitnessType['TypeOrderMachine']:case WitnessType['TypeArbMachine']:case WitnessType['TypeProgressMachine']:return ObjectType['Machine'];case WitnessType['TypeOrderService']:case WitnessType['TypeArbService']:return ObjectType['Service'];case WitnessType['TypeOrderProgress']:case WitnessType['TypeArbProgress']:return ObjectType['Progress'];case WitnessType['TypeArbOrder']:return ObjectType['Order'];}};export const OBJECT_TYPE_DEFINITIONS={[ObjectType['Permission']]:{'name':ObjectType['Permission'],'moveValue':0x0,'moveName':'Permission'},[ObjectType['Repository']]:{'name':ObjectType['Repository'],'moveValue':0x1,'moveName':'Repository'},[ObjectType['Arb']]:{'name':ObjectType['Arb'],'moveValue':0x2,'moveName':'Arb'},[ObjectType['Arbitration']]:{'name':ObjectType['Arbitration'],'moveValue':0x3,'moveName':'Arbitration'},[ObjectType['Service']]:{'name':ObjectType['Service'],'moveValue':0x4,'moveName':'Service'},[ObjectType['Machine']]:{'name':ObjectType['Machine'],'moveValue':0x5,'moveName':'Machine'},[ObjectType['Order']]:{'name':ObjectType['Order'],'moveValue':0x6,'moveName':'Order'},[ObjectType['Progress']]:{'name':ObjectType['Progress'],'moveValue':0x7,'moveName':'Progress'},[ObjectType['Payment']]:{'name':ObjectType['Payment'],'moveValue':0x8,'moveName':'Payment'},[ObjectType['Treasury']]:{'name':ObjectType['Treasury'],'moveValue':0x9,'moveName':'Treasury'},[ObjectType['Guard']]:{'name':ObjectType['Guard'],'moveValue':0xa,'moveName':'Guard'},[ObjectType['Demand']]:{'name':ObjectType['Demand'],'moveValue':0xb,'moveName':'Demand'},[ObjectType['Passport']]:{'name':ObjectType['Passport'],'moveValue':0xc,'moveName':'Passport'},[ObjectType['Allocation']]:{'name':ObjectType['Allocation'],'moveValue':0xd,'moveName':'Allocation'},[ObjectType['Resource']]:{'name':ObjectType['Resource'],'moveValue':0xe,'moveName':'Resource'},[ObjectType['Reward']]:{'name':ObjectType['Reward'],'moveValue':0xf,'moveName':'Reward'},[ObjectType['Discount']]:{'name':ObjectType['Discount'],'moveValue':0x10,'moveName':'Discount'},[ObjectType['EntityRegistrar']]:{'name':ObjectType['EntityRegistrar'],'moveValue':0x11,'moveName':'EntityRegistrar'},[ObjectType['EntityLinker']]:{'name':ObjectType['EntityLinker'],'moveValue':0x12,'moveName':'EntityLinker'},[ObjectType['Proof']]:{'name':ObjectType['Proof'],'moveValue':0x13,'moveName':'Proof'},[ObjectType['Contact']]:{'name':ObjectType['Contact'],'moveValue':0x14,'moveName':'Contact'},[ObjectType['WReceivedObject']]:{'name':ObjectType['WReceivedObject'],'moveValue':0x15,'moveName':'WReceivedObject'},[ObjectType['TableItem_ProgressHistory']]:{'name':ObjectType['TableItem_ProgressHistory'],'moveValue':0x16,'moveName':'TableItem_ProgressHistory'},[ObjectType['TableItem_PermissionPerm']]:{'name':ObjectType['TableItem_PermissionPerm'],'moveValue':0x17,'moveName':'TableItem_PermissionPerm'},[ObjectType['TableItem_DemandPresenter']]:{'name':ObjectType['TableItem_DemandPresenter'],'moveValue':0x18,'moveName':'TableItem_DemandPresenter'},[ObjectType['TableItem_MachineNode']]:{'name':ObjectType['TableItem_MachineNode'],'moveValue':0x19,'moveName':'TableItem_MachineNode'},[ObjectType['TableItem_TreasuryHistory']]:{'name':ObjectType['TableItem_TreasuryHistory'],'moveValue':0x1a,'moveName':'TableItem_TreasuryHistory'},[ObjectType['TableItem_RepositoryData']]:{'name':ObjectType['TableItem_RepositoryData'],'moveValue':0x1b,'moveName':'TableItem_RepositoryData'},[ObjectType['TableItem_RewardRecord']]:{'name':ObjectType['TableItem_RewardRecord'],'moveValue':0x1c,'moveName':'TableItem_RewardRecord'},[ObjectType['TableItem_AddressMark']]:{'name':ObjectType['TableItem_AddressMark'],'moveValue':0x1d,'moveName':'TableItem_AddressMark'},[ObjectType['TableItem_EntityLinker']]:{'name':ObjectType['TableItem_EntityLinker'],'moveValue':0x1e,'moveName':'TableItem_EntityLinker'},[ObjectType['TableItem_EntityRegistrar']]:{'name':ObjectType['TableItem_EntityRegistrar'],'moveValue':0x1f,'moveName':'TableItem_EntityRegistrar'}};export const objectTypeToNumber=Object['fromEntries'](Object['entries'](OBJECT_TYPE_DEFINITIONS)['map'](([a,b])=>[a,b['moveValue']]));export const numberToObjectType=Object['fromEntries'](Object['entries'](OBJECT_TYPE_DEFINITIONS)['map'](([a,b])=>[b['moveValue'],a]));export function getObjectTypeFromNumber(a){return numberToObjectType[a];}export function getNumberFromObjectType(a){return objectTypeToNumber[a];}export function getObjectTypeDefinition(a){return OBJECT_TYPE_DEFINITIONS[a];}export function getObjectTypeDefinitionFromNumber(a){const b=numberToObjectType[a];return b?OBJECT_TYPE_DEFINITIONS[b]:undefined;}export function getObjectTypeFromMoveName(a){return Object['values'](OBJECT_TYPE_DEFINITIONS)['find'](b=>b['moveName']===a)?.['name'];}export function getMoveNameFromObjectType(a){return OBJECT_TYPE_DEFINITIONS[a]?.['moveName'];}export function getMoveNameFromNumber(a){return getObjectTypeDefinitionFromNumber(a)?.['moveName'];}export function getNumberFromMoveName(a){return Object['values'](OBJECT_TYPE_DEFINITIONS)['find'](b=>b['moveName']===a)?.['moveValue'];}export function getObjectTypesFromNumbers(a){return a['map'](getObjectTypeFromNumber);}export function getNumbersFromObjectTypes(a){return a['map'](getNumberFromObjectType);}export var AmountType;(function(a){a[a['GuardU64Identifier']=0x0]='GuardU64Identifier',a[a['Fixed']=0x1]='Fixed';}(AmountType||(AmountType={})));export var ArbStatus;(function(a){a[a['Principal_confirming']=0x0]='Principal_confirming',a[a['Arbitrator_confirming']=0x1]='Arbitrator_confirming',a[a['Voting']=0x2]='Voting',a[a['Arbitrated']=0x3]='Arbitrated',a[a['Objectionable']=0x4]='Objectionable',a[a['Finished']=0x5]='Finished',a[a['Withdrawn']=0x6]='Withdrawn';}(ArbStatus||(ArbStatus={})));export var DiscountType;(function(a){a[a['RATES']=0x0]='RATES',a[a['FIXED']=0x1]='FIXED';}(DiscountType||(DiscountType={})));export var TreasuryOp;(function(a){a[a['Withdraw']=0x0]='Withdraw',a[a['Deposit']=0x1]='Deposit',a[a['Receive']=0x2]='Receive';}(TreasuryOp||(TreasuryOp={})));export var IdFrom;(function(a){a[a['None']=0x0]='None',a[a['Clock']=0x1]='Clock',a[a['Signer']=0x2]='Signer';}(IdFrom||(IdFrom={})));export const parseIdFrom=a=>{if(typeof a==='number'){if(a>=0x0&&a<=0x2)return a;throw new Error('Invalid\x20IdFrom\x20number:\x20'+a+'.\x20Valid\x20range:\x200-2');}const b=Object['keys'](IdFrom)['filter'](e=>isNaN(Number(e))),c=a['toLowerCase'](),d=b['find'](e=>e['toLowerCase']()===c);if(d===undefined)throw new Error('Invalid\x20IdFrom\x20string:\x20\x22'+a+'\x22.\x20Valid\x20values:\x20'+b['join'](',\x20'));return IdFrom[d];};export const idFromToString=a=>{return IdFrom[a];};export const isValidIdFromInput=a=>{if(typeof a==='number')return a>=0x0&&a<=0x2;if(typeof a==='string'){const b=a['toUpperCase'](),c=IdFrom[b];return typeof c==='number';}return![];};export var AllocationMode;(function(a){a[a['Amount']=0x0]='Amount',a[a['Rate']=0x1]='Rate',a[a['Surplus']=0x2]='Surplus';}(AllocationMode||(AllocationMode={})));export const query_objects_json=async a=>{try{const b=JSON['parse'](a);return JSON['stringify']({'data':await query_objects(b)});}catch(c){return JSON['stringify']({'error':c?.['toString']()});}};export const query_table_json=async a=>{try{const b=JSON['parse'](a);return JSON['stringify']({'data':await query_table(b)});}catch(c){return JSON['stringify']({'error':c?.['toString']()});}};export const query_objects=async a=>{const b=await Config['Instance']()['network_get'](a['network']),c=a204a['uniq'](a['objects']);c['length']>MAX_OBJECTS_PER_QUERY&&W_ERROR(WErrors['MaxObjectsPerQuery'],'max\x20'+MAX_OBJECTS_PER_QUERY);const d=await LocalMark['Instance']()['get_many_address'](c),e=new Map(),f=[];c['forEach']((k,l)=>{const m=d[l];m&&(e['set'](m,k),f['push'](m));});if(f['length']===0x0)return{'objects':[]};const g=CachePrefix['object']+':'+b,h=f,i=await Cache['read_many'](g,h,async(k,l)=>{const m=new WowClient({'url':getFullnodeUrl(b)}),n=await m['multiGetObjects']({'ids':[...l],'options':{'showContent':!![],'showOwner':!![],'showPreviousTransaction':!![]}});return n['map'](o=>{const p=o?.['data'];if(!p)return undefined;const q=p?.['type']??p?.['content']?.['type']??undefined,r=q?object_name_from_type(q):undefined,s=Cache['DefaultExpireTime'](r==='Guard'||r==='Payment'||r==='Passport'),t=data2object(p);return{'expire':s,'data':t};})['filter'](o=>o!==undefined);},a['no_cache']),j=i['map'](k=>{const l=k['data'];return l['cache_expire']=k['expire'],l['query_name']=e['get'](l['object'])??l['object'],l;});return{'objects':j};};export const query_personal=async a=>{const b=a['account']??'',[c,d]=await Promise['all']([Config['Instance']()['network_get'](a['network']),GetAccountOrMark_Address({'name_or_address':b})]);!d&&W_ERROR(WErrors['InvalidParam'],'query_personal.account\x20'+b+'\x20not\x20found');const [e,f]=await Promise['all']([queryTableItem_EntityRegistrar({'address':{'name_or_address':b},'no_cache':a['no_cache'],'network':c})['catch'](()=>undefined),queryTableItem_EntityLinker({'address':{'name_or_address':b},'no_cache':a['no_cache'],'network':c})['catch'](()=>undefined)]);if(e)return{'address':d,'info':e?.['records']??[],'description':e?.['description']??'','referrer':e?.['referrer']??null,'mark_object':e?.['mark_object']??null,'details':f?.['votes']??[],'like':f?.['votes']?.['filter'](g=>g['like'])['length']??0x0,'dislike':f?.['votes']?.['filter'](g=>g['dislike'])['length']??0x0,'active_tx':e?.['previousTransaction']??null,'passive_tx':f?.['previousTransaction']??null,'time':e?.['time']??0x0};return undefined;};export const query_table=async a=>{const b=await Config['Instance']()['network_get'](a['network']),c=await LocalMark['Instance']()['get_address'](a['parent']);!c&&W_ERROR(WErrors['InvalidParam'],'query_table.query.parent\x20'+a['parent']+'\x20not\x20found');a['parent']=c;const e=await Cache['read']([CachePrefix['table'],a['parent'],a['cursor']??'',a['limit']?.['toString']()??'',b],async()=>{const f=new WowClient({'url':getFullnodeUrl(b)}),g=await f['getDynamicFields']({'parentId':a['parent'],'cursor':a['cursor'],'limit':a['limit']});(!g?.['data']?.['length']||g?.['data']?.['length']===0x0)&&W_ERROR(WErrors['Fail'],'query_table.query.parent\x20'+a['parent']+'\x20failed');const h={'items':g?.['data']?.['map'](i=>{return{'object':i['objectId'],'type':i['type'],'version':i['version'],'key':{'type':i['name']['type'],'value':i['name']['value']}};}),'nextCursor':g['nextCursor'],'hasNextPage':g['hasNextPage']};return{'expire':Cache['DefaultExpireTime'](),'data':h};},a['no_cache']);if(e){const f=e['data'];return f['cache_expire']=e['expire'],f;}return undefined;};export const query_tableItem=async a=>{const b=await Config['Instance']()['network_get'](a['network']);if(a['parent']!==ENTITY_REGISTRAR_ADDRESS&&a['parent']!==ENTITY_LINKER_ADDRESS){const e=await LocalMark['Instance']()['get_address'](a['parent']);!e&&W_ERROR(WErrors['InvalidParam'],'query_tableItem.query.parent\x20'+a['parent']+'\x20not\x20found'),a['parent']=e;}const c=[CachePrefix['table'],a['parent'],JSON['stringify'](a['key']['value'])],d=await Cache['read'](c,async()=>{const f=new WowClient({'url':getFullnodeUrl(b)}),g=await f['getDynamicFieldObject']({'parentId':a['parent'],'name':{'type':a['key']['type'],'value':a['key']['value']}});!g?.['data']&&W_ERROR(WErrors['Fail'],'query_tableItem('+a['key']['value']+'):\x20'+JSON['stringify'](g)+'\x20');const h=data2object(g?.['data']);return{'expire':Cache['DefaultExpireTime'](),'data':h};},a['no_cache']);if(d)return d['data']['cache_expire']=d['expire'],d['data'];return undefined;};const tableItemQuery_byString=async a=>{const b=typeof a['parent']==='string'?a['parent']:a['parent']['object'];return await query_tableItem({'parent':b,'key':{'type':'0x1::string::String','value':a['key']},'no_cache':a['no_cache'],'network':a['network']});};export const queryTableItem_RepositoryData=async a=>{const b=typeof a['parent']==='string'?a['parent']:a['parent']?.['object'];let c;if(typeof a['entity']==='bigint'||typeof a['entity']==='number')c=uint2address(a['entity']);else{const e=await GetAccountOrMark_Address(a['entity']);if(e)c=e;else return W_ERROR(WErrors['InvalidParam'],'tableItem_RepositoryData.entity'),undefined;}const d=await query_tableItem({'parent':b,'key':{'type':PackageAddress+'::repository::DataKey','value':{'id':c,'key':a['name']}},'no_cache':a['no_cache'],'network':a['network']});if(d?.['type']!=='TableItem_RepositoryData')return undefined;return d;};const tableItem_byAddress=async a=>{const b=typeof a['parent']==='string'?a['parent']:a['parent']?.['object'];let c;if(typeof a['address']==='string')c=a['address'];else{const d=await GetAccountOrMark_Address(a['address']);if(!d)return W_ERROR(WErrors['InvalidParam'],'queryTableItem_byAddress.address\x20'+a['address']+'\x20not\x20found'),undefined;c=d;}return await query_tableItem({'parent':b,'key':{'type':'address','value':c},'no_cache':a['no_cache'],'network':a['network']});};export const queryTableItem_PermissionPerm=async a=>{const b=await tableItem_byAddress(a);if(b?.['type']!=='TableItem_PermissionPerm')return undefined;return b;};export const queryTableItem_EntityRegistrar=async a=>{const b=await tableItem_byAddress({'parent':ENTITY_REGISTRAR_ADDRESS,'address':a['address'],'no_cache':a['no_cache'],'network':a['network']});if(b?.['type']!=='TableItem_EntityRegistrar')return undefined;return b;};export const queryTableItem_EntityLinker=async a=>{const b=await tableItem_byAddress({'parent':ENTITY_LINKER_ADDRESS,'address':a['address'],'no_cache':a['no_cache'],'network':a['network']});if(b?.['type']!=='TableItem_EntityLinker')return undefined;return b;};export const queryTableItem_RewardRecord=async a=>{const b=await tableItem_byAddress(a);if(b?.['type']!=='TableItem_RewardRecord')return undefined;return b;};export const queryTableItem_DemandPresenter=async a=>{const b=await tableItem_byAddress(a);if(b?.['type']!=='TableItem_DemandPresenter')return undefined;return b;};export const queryTableItem_TreasuryHistory=async a=>{const b=await tableItem_byAddress(a);if(b?.['type']!=='TableItem_TreasuryHistory')return undefined;return b;};export const queryTableItem_MachineNode=async a=>{const b=await tableItemQuery_byString(a);if(b?.['type']!=='TableItem_MachineNode')return undefined;return b;};export const queryTableItem_AddressMark=async a=>{const b=await tableItem_byAddress(a);if(b?.['type']!=='TableItem_AddressMark')return undefined;return b;};export const queryTableItem_ProgressHistory=async a=>{const b=typeof a['parent']==='string'?a['parent']:a['parent']['object'],c=await query_tableItem({'parent':b,'key':{'type':'u64','value':a['u64']['toString']()},'no_cache':a['no_cache'],'network':a['network']});if(c?.['type']!=='TableItem_ProgressHistory')return undefined;return c;};export function raw2type(a){if(!a)return undefined;const b=object_module_and_name_from_type(a);if(b?.['module']==='resource'&&b?.['name']==='Resource')return ObjectType['Resource'];else{if(b?.['module']==='payment'&&b?.['name']==='CoinWrapper')return ObjectType['WReceivedObject'];else{if(b?.['module']==='registrar'&&b?.['name']==='Registrar')return ObjectType['EntityLinker'];else{if(b?.['module']==='registrar'&&b?.['name']==='Entity')return ObjectType['EntityRegistrar'];}}}const c=object_name_from_type(a);if(Object['values'](ObjectType)['includes'](c))return c;const d=a?.['indexOf']('0x2::dynamic_field::Field<');if(d===0x0){const e=a?.['substring']('0x2::dynamic_field::Field<'['length']);if(e){if(e['includes']('::demand::ServiceInfo>'))return ObjectType['TableItem_DemandPresenter'];else{if(e['includes']('::machine::NodePair>>>'))return ObjectType['TableItem_MachineNode'];else{if(e['includes']('::progress::History>'))return ObjectType['TableItem_ProgressHistory'];else{if(e['includes']('::reward::RecipientRecord>'))return ObjectType['TableItem_RewardRecord'];else{if(e['includes']('::treasury::Record>'))return ObjectType['TableItem_TreasuryHistory'];else{if(e['includes']('::registrar::Votes>'))return ObjectType['TableItem_EntityLinker'];else{if(e['indexOf']('address')<e['indexOf']('0x2::parent_linked_table::Node<address,\x20vector<u16>>>'))return ObjectType['TableItem_PermissionPerm'];else{if(e['includes']('::repository::DataKey'))return ObjectType['TableItem_RepositoryData'];else{if(e['includes']('::registrar::AddressInfo>'))return ObjectType['TableItem_EntityRegistrar'];else{if(e['includes']('::resource::AddressTag>'))return ObjectType['TableItem_AddressMark'];}}}}}}}}}}}return undefined;}export function data2object(a){const b=a?.['content']?.['fields'],c=a?.['objectId']??b?.['id']?.['id']??undefined,d=a?.['type']??a?.['content']?.['type']??undefined,e=a?.['version']??undefined,f=a?.['owner']??undefined,g=raw2type(d);switch(g){case'Permission':return{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'builder':b?.['owner']??'','admin':b?.['admin'],'description':b?.['description']??'','entity_count':parseInt(b?.['table']?.['fields']?.['size']),'perm_remark':b?.['remark']?.['map'](h=>{return{'index':parseInt(h?.['fields']?.['index']),'remark':h?.['fields']?.['remark']};}),'um':b?.['um']??null};case'TableItem_PermissionPerm':return{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'address':b?.['name'],'perm':b?.['value']?.['fields']?.['value']};case'Guard':{console['dir'](b,{'depth':null,'colors':!![]});const h=b?.['validated']?.['map'](l=>{return{'identifier':parseInt(l?.['fields']?.['identifier']),'object_type':numberToObjectType[l?.['fields']?.['object_type']]};}),i=b?.['table']?.['map'](l=>{const m=parseInt(l?.['fields']?.['identifier']),n=bcsBytesToValue(Uint8Array['from'](l?.['fields']?.['value']));return{'identifier':m,'b_submission':l?.['fields']?.['b_submission'],'value_type':l?.['fields']?.['value'][0x0],'value':n,'name':l?.['fields']?.['name'],'object_type':h['find'](o=>o['identifier']===m)?.['object_type']};}),j=restoreNodeFromOutput(Uint8Array['from'](b?.['input']),i),k=i['filter'](l=>!j['autoGeneratedIdentifiers']['includes'](l['identifier']));return{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description']??'','table':k,'input':b?.['input'],'root':j['root'],'rep_quote':j['rep_quote'],'relies':b?.['relies'],'relies_logic_and':b?.['relies_logic_and'],'rep':b?.['rep']};}case'Passport':{return{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'info':b?.['guard']?.['map'](l=>{return{'guard':l['fields']['guard'],'result':l['fields']['result'],'impack':l['fields']['impack'],'relies':l['fields']['relies'],'relies_logic_and':l['fields']['relies_logic_and'],'submission':l['fields']['submission']['map'](m=>{return{'identifier':m['fields']['identifier'],'value_type':m['fields']['value'][0x0],'value':bcsBytesToValue(Uint8Array['from'](m['fields']['value']))};})};}),'result':b?.['result'],'tx_hash':b?.['tx_hash'],'impack_guard':b?.['impack'],'time':b?.['time'],'signer':b?.['signer'],'has_verified':b?.['has_verified']};}case'Allocation':{return{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['allocators']?.['fields']?.['description']??'','threshold':b?.['allocators']?.['fields']?.['threshold'],'balance':b?.['balance'],'payment_info':b?.['payment_info']?.['fields'],'payment':b?.['payment']??[],'allocators':b?.['allocators']?.['fields']?.['allocators']?.['map'](l=>{return{'guard':l['fields']['guard'],'fix':l['fields']['fix'],'max':l['fields']['max']??undefined,'sharing':l['fields']['sharing']['map'](m=>{let n;const o=m['fields']['who'];(!o||!o['variant'])&&W_ERROR(WErrors['ParseObjectContentFailed'],'Invalid\x20who\x20data:\x20'+JSON['stringify'](o));if(o['variant']==='GuardIdentifier'&&o['fields'])n={'GuardIdentifier':Number(o['fields']['pos0'])};else{if(o['variant']==='Entity'&&o['fields'])n={'Entity':{'name_or_address':o['fields']['pos0']}};else o['variant']==='Signer'?n={'Signer':null}:W_ERROR(WErrors['ParseObjectContentFailed'],'Invalid\x20who\x20variant:\x20'+o['variant']);}return{'who':n,'sharing':m['fields']['sharing'],'mode':m['fields']['mode']};})};})};}case'Payment':{return{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'amount':b?.['amount'],'time':b?.['time'],'from_object':b?.['from_object'],'signer':b?.['signer'],'info':b?.['info']?.['fields'],'record':b?.['record']?.['map'](l=>{return{'recipient':l['fields']['recipient'],'amount':l['fields']['amount']};})};}case'Contact':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'ims':b?.['ims']['map'](l=>{return{'description':l['fields']['description'],'at':l['fields']['at'],'join_time':l['fields']['join_time'],'status':l['fields']['status']};}),'location':b?.['location'],'permission':b?.['permission']};}case'Repository':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'policies':b?.['policies']['map'](l=>{return{'description':l['fields']['description'],'id_from':l['fields']['id_from'],'name':l['fields']['name'],'quote_guard':l['fields']['quote_guard'],'value_type':l['fields']['value_type'],'write_guard':l['fields']['write_guard']};}),'rewards':b?.['rewards'],'um':b?.['um']??null,'permission':b?.['permission']};}case'Demand':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'location':b?.['location'],'rewards':b?.['rewards'],'guards':b?.['guards']['map'](l=>{return{'guard':l['fields']['guard'],'service_identifier':l['fields']['service_identifier']};}),'presenters_count':b?.['presenters']?.['fields']?.['size'],'um':b?.['um']??null,'permission':b?.['permission']};}case'Machine':{return{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'node_count':b?.['nodes']?.['fields']?.['size'],'consensus_repositories':b?.['consensus_repositories'],'bPaused':b?.['bPaused'],'bPublished':b?.['bPublished'],'um':b?.['um']??null,'permission':b?.['permission']};}case'Order':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'items':b?.['items']['map'](l=>{return{'name':l['fields']['item'],'price':l['fields']['price'],'quantity':l['fields']['quantity'],'wip_hash':l['fields']['wip_hash']};}),'discount':b?.['discount'],'progress':b?.['progress'],'machine':b?.['machine'],'amount':b?.['amount'],'builder':b?.['owner'],'service':b?.['service'],'dispute':b?.['dispute'],'agent':b?.['agent'],'allocation':b?.['allocation'],'claimed_by':b?.['claimed_by'],'required_info':b?.['required_info'],'time':b?.['time']};}case'Progress':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'machine':b?.['machine'],'context_repositories':b?.['context_repositories'],'current':b?.['current'],'task':b?.['task'],'namedOperator':b?.['namedOperator']['map'](l=>{return{'name':l['fields']['name'],'operators':l['fields']['operators']};}),'session':b?.['session']['map'](l=>{return{'next_node':l['fields']['next_node'],'forwards':l['fields']['forwards']['map'](m=>{return{'forward':m['fields']['forward'],'who':m['fields']['who'],'retained_submission':m['fields']['retained_submission']['map'](n=>{return{'identifier':n['fields']['identifier'],'value_type':n['fields']['value_type'],'value':bcsBytesToValue(Uint8Array['from'](n['fields']['value']))};}),'msg':m['fields']['msg'],'accomplished':m['fields']['accomplished'],'time':m['fields']['time']};}),'weights':l['fields']['weights'],'threshold':l['fields']['threshold']};}),'history_count':b?.['history']?.['fields']?.['contents']?.['fields']?.['size'],'current_time':b?.['current_time']};}case'Reward':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'guards':b?.['guards']['map'](l=>{const m=l['fields']['amount']['variant']==='Fixed'?AmountType['Fixed']:AmountType['GuardU64Identifier'],n=parseRecipient(l['fields']['recipient']);return{'guard':l['fields']['guard'],'expiration_time':l['fields']['expiration_time'],'amount':{'type':m,'value':l['fields']['amount']['fields']?.['pos0']},'recipient':n,'store_from_id':l['fields']['store_from_id']??null};}),'balance':b?.['balance'],'guard_not_added_expiration_time':b?.['guard_not_added_expiration_time'],'record_count':b?.['record']?.['fields']?.['size'],'um':b?.['um']??null,'permission':b?.['permission']};}case'Service':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'location':b?.['location'],'sales':b?.['sales']?.['map'](l=>{return{'name':l['fields']['name'],'stock':l['fields']['stock'],'suspension':l['fields']['suspension'],'price':l['fields']['price'],'wip':l['fields']['wip'],'wip_hash':l['fields']['wip_hash']};}),'repositories':b?.['repositories'],'buy_guard':b?.['buy_guard'],'machine':b?.['machine'],'bPublished':b?.['bPublished'],'bPaused':b?.['bPaused'],'customer_required':b?.['customer_required'],'arbitrations':b?.['arbitrations'],'compensation_fund':b?.['compensation_fund'],'paused_time':b?.['paused_time'],'setting_lock_duration':b?.['setting_lock_duration'],'order_allocators':{'description':b?.['order_allocators']?.['fields']?.['description'],'threshold':b?.['order_allocators']?.['fields']?.['threshold'],'allocators':b?.['order_allocators']?.['fields']?.['allocators']['map'](l=>{return{'guard':l['fields']['guard'],'sharing':l['fields']['sharing']['map'](m=>{const n=parseRecipient(m['fields']['who']);return{'who':n,'sharing':m['fields']['sharing'],'mode':m['fields']['mode']};}),'fix':l['fields']['fix'],'max':l['fields']['max']};})},'rewards':b?.['rewards'],'um':b?.['um']??null,'permission':b?.['permission']};}case'Discount':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'name':b?.['name'],'discount_type':b?.['discount_type'],'benchmark':b?.['benchmark'],'off':b?.['off'],'time_start':b?.['time_start'],'time_end':b?.['time_end'],'service':b?.['service'],'transferable':b?.['transferable']};}case'Arb':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'order':b?.['order'],'arbitration':b?.['arbitration'],'voted':b?.['voted']?.['map'](l=>{return{'voter':l['fields']['voter'],'agrees':l['fields']['agrees'],'weight':l['fields']['weight'],'time':l['fields']['time']};}),'proposition':b?.['proposition']?.['map'](l=>{return{'name':l['fields']['name'],'votes':l['fields']['votes']};}),'fee':b?.['fee'],'feedback':b?.['feedback'],'indemnity':b?.['indemnity']?{'amount':b?.['indemnity']?.['fields']?.['amount'],'time':b?.['indemnity']?.['fields']?.['time']}:null,'voting_deadline':b?.['voting_deadline'],'objection':b?.['objection'],'status':b?.['status'],'compensation_time':b?.['compensation_time'],'time':b?.['time']};}case'Arbitration':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'location':b?.['location'],'fee':b?.['fee'],'bPaused':b?.['bPaused'],'balance':b?.['balance'],'usage_guard':b?.['usage_guard'],'um':b?.['um']??null,'permission':b?.['permission'],'voting_guard':b?.['voting_guard']['map'](l=>{let m;if(l['fields']['vote_weight']['variant']==='GuardIdentifier')m={'GuardIdentifier':l['fields']['vote_weight']['fields']?.['pos0']};else l['fields']['vote_weight']['variant']==='FixedValue'?m={'FixedValue':l['fields']['vote_weight']['fields']?.['pos0']}:W_ERROR(WErrors['InvalidParam'],'vote_weight'+l['fields']['vote_weight']['variant']+'\x20invalid');return{'guard':l['fields']['guard'],'vote_weight':m};})};}case'Proof':{return{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'proof':b?.['proof'],'server_pubkey':b?.['server_pubkey'],'server_signature':b?.['server_signature'],'proof_type':b?.['proof_type'],'item_count':b?.['item_count']??null,'about_address':b?.['about_address']??null,'signer':b?.['signer'],'time':b?.['time']};}case'Treasury':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'balance':b?.['balance'],'history_count':parseInt(b?.['history']?.['fields']?.['size']),'external_deposit_guard':b?.['external_deposit_guard']['map'](l=>({'guard':l['fields']['guard'],'identifier':l['fields']['identifier']??null,'store_from_id':l['fields']['store_from_id']??null})),'external_withdraw_guard':b?.['external_withdraw_guard']['map'](l=>({'guard':l['fields']['guard'],'identifier':l['fields']['identifier'],'store_from_id':l['fields']['store_from_id']??null})),'inflow':b?.['inflow'],'outflow':b?.['outflow'],'um':b?.['um']??null,'permission':b?.['permission']};}case'TableItem_DemandPresenter':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'address':b?.['name'],'recommend':b?.['value']?.['fields']?.['recommend'],'service':b?.['value']?.['fields']?.['service'],'update_time':b?.['value']?.['fields']?.['update_time'],'acceptance_score':b?.['value']?.['fields']?.['acceptance_score'],'feedback':b?.['value']?.['fields']?.['feedback'],'feedback_time':b?.['value']?.['fields']?.['feedback_time']};}case'TableItem_MachineNode':{return console['dir'](JSON['stringify'](b['value']['fields']['value']),{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'name':b?.['name'],'value':b?.['value']?.['fields']?.['value']?.['map'](l=>{return{'prev_node':l['fields']['prev_node'],'threshold':l['fields']['threshold'],'forwards':l['fields']['forwards']['map'](m=>{return{'name':m['fields']['name'],'weight':m['fields']['weight'],'namedOperator':m['fields']?.['namedOperator'],'permissionIndex':m['fields']?.['permissionIndex'],'guard':m['fields']?.['guard']?{'guard':m['fields']['guard']['fields']?.['guard'],'retained_submission':m['fields']['guard']['fields']?.['retained_submission']}:undefined};})};})};}case'TableItem_ProgressHistory':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'index':b?.['name'],'node':b?.['value']?.['fields']?.['node'],'next_node':b?.['value']?.['fields']?.['next_node'],'session':b?.['value']?.['fields']?.['session']['map'](l=>{return{'next_node':l['fields']['next_node'],'weights':l['fields']['weights'],'threshold':l['fields']['threshold'],'forwards':l['fields']['forwards']?.['map'](m=>{return{'forward':m['fields']['forward'],'who':m['fields']['who'],'msg':m['fields']['msg'],'accomplished':m['fields']['accomplished'],'time':m['fields']['time'],'retained_submission':m['fields']['retained_submission']?.['map'](n=>{return{'identifier':n['fields']['identifier'],'value_type':n['fields']['value_type'][0x0],'value':bcsBytesToValue(Uint8Array['from'](n['fields']['value']))};})};})};}),'time':b?.['value']?.['time']};}case'TableItem_TreasuryHistory':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'payment':b?.['name'],'op':b?.['value']?.['fields']?.['op'],'signer':b?.['value']?.['fields']?.['signer'],'external_guard':b?.['value']?.['fields']?.['external_guard'],'amount':b?.['value']?.['fields']?.['amount'],'time':b?.['value']?.['fields']?.['time'],'store_from_id':b?.['value']?.['fields']?.['store_from_id']??null};}case'TableItem_EntityLinker':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'address':b?.['name'],'pos':b?.['value']?.['fields']?.['pos'],'count':b?.['value']?.['fields']?.['count'],'votes':b?.['value']?.['fields']?.['votes']?.['map'](l=>{return{'who':l['fields']['who'],'info':l['fields']['info'],'like':(l['fields']['info']&0x2)!==0x0,'dislike':(l['fields']['info']&0x4)!==0x0,'affiliation':(l['fields']['info']&0x8)!==0x0,'time':l['fields']['time']};})};}case'TableItem_EntityRegistrar':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'address':b?.['name'],'description':b?.['value']?.['fields']?.['description'],'time':b?.['value']?.['fields']?.['time'],'referrer':b?.['referrer'],'mark_object':b?.['value']?.['fields']?.['resource'],'records':b?.['value']?.['fields']?.['records']?.['map'](l=>{return{'name':l['fields']['name'],'typed_value':l['fields']['typed_value'],'value':bcsBytesToValue(Uint8Array['from'](l['fields']['typed_value']))};})};}case'Resource':{return{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'entity_count':parseInt(b?.['table']?.['fields']?.['size'])};}case'TableItem_AddressMark':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'entity':b?.['name'],'name':b?.['value']?.['fields']?.['name'],'tags':b?.['value']?.['fields']?.['tags']};}case'TableItem_RepositoryData':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'entity':b?.['name']?.['fields']?.['id'],'name':b?.['name']?.['fields']?.['key'],'value':b?.['value'],'data':{'value_type':b?.['value'][0x0],'value':bcsBytesToValue(Uint8Array['from'](b['value']))}};}case'TableItem_RewardRecord':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'recipient':b?.['name'],'guard':b?.['value']?.['fields']?.['guard'],'total':b?.['value']?.['fields']?.['total'],'record':b?.['value']?.['fields']?.['amount']['map'](l=>{return{'amount':l['fields']['amount'],'time':l['fields']['time'],'store_from_id':l['fields']['store_from_id']??null};})};}case'EntityRegistrar':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'entity_count':parseInt(b?.['table']?.['fields']?.['size'])};}case'EntityLinker':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'entity_count':parseInt(b?.['table']?.['fields']?.['size'])};}}return{'object':c,'type':undefined,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'content_raw':b};}
|
|
1
|
+
import{getFullnodeUrl}from'../../client/network.js';import{WowClient}from'../../client/index.js';import{Cache,CachePrefix}from'../local/cache.js';import{Config}from'../local/config.js';import{LocalMark}from'../local/local.js';import{W_ERROR,WErrors}from'../exception.js';import a205a from'lodash';import{restoreNodeFromOutput}from'../call/util.js';import{GetAccountOrMark_Address}from'../local/index.js';import{object_name_from_type,object_module_and_name_from_type,PackageAddress,WitnessType,ObjectType,ENTITY_LINKER_ADDRESS,ENTITY_REGISTRAR_ADDRESS}from'../common.js';import{bcsBytesToValue,parseRecipient,uint2address}from'../util.js';export{ObjectType};export const MAX_OBJECTS_PER_QUERY=0x32;export const WitnessSourceType=a=>{switch(a){case WitnessType['TypeArbArbitration']:case WitnessType['TypeArbOrder']:case WitnessType['TypeArbService']:case WitnessType['TypeArbProgress']:case WitnessType['TypeArbMachine']:return ObjectType['Arb'];case WitnessType['TypeOrderMachine']:case WitnessType['TypeOrderService']:case WitnessType['TypeOrderProgress']:return ObjectType['Order'];case WitnessType['TypeProgressMachine']:return ObjectType['Progress'];}};export const WitnessTargetType=a=>{switch(a){case WitnessType['TypeArbArbitration']:return ObjectType['Arbitration'];case WitnessType['TypeOrderMachine']:case WitnessType['TypeArbMachine']:case WitnessType['TypeProgressMachine']:return ObjectType['Machine'];case WitnessType['TypeOrderService']:case WitnessType['TypeArbService']:return ObjectType['Service'];case WitnessType['TypeOrderProgress']:case WitnessType['TypeArbProgress']:return ObjectType['Progress'];case WitnessType['TypeArbOrder']:return ObjectType['Order'];}};export const OBJECT_TYPE_DEFINITIONS={[ObjectType['Permission']]:{'name':ObjectType['Permission'],'moveValue':0x0,'moveName':'Permission'},[ObjectType['Repository']]:{'name':ObjectType['Repository'],'moveValue':0x1,'moveName':'Repository'},[ObjectType['Arb']]:{'name':ObjectType['Arb'],'moveValue':0x2,'moveName':'Arb'},[ObjectType['Arbitration']]:{'name':ObjectType['Arbitration'],'moveValue':0x3,'moveName':'Arbitration'},[ObjectType['Service']]:{'name':ObjectType['Service'],'moveValue':0x4,'moveName':'Service'},[ObjectType['Machine']]:{'name':ObjectType['Machine'],'moveValue':0x5,'moveName':'Machine'},[ObjectType['Order']]:{'name':ObjectType['Order'],'moveValue':0x6,'moveName':'Order'},[ObjectType['Progress']]:{'name':ObjectType['Progress'],'moveValue':0x7,'moveName':'Progress'},[ObjectType['Payment']]:{'name':ObjectType['Payment'],'moveValue':0x8,'moveName':'Payment'},[ObjectType['Treasury']]:{'name':ObjectType['Treasury'],'moveValue':0x9,'moveName':'Treasury'},[ObjectType['Guard']]:{'name':ObjectType['Guard'],'moveValue':0xa,'moveName':'Guard'},[ObjectType['Demand']]:{'name':ObjectType['Demand'],'moveValue':0xb,'moveName':'Demand'},[ObjectType['Passport']]:{'name':ObjectType['Passport'],'moveValue':0xc,'moveName':'Passport'},[ObjectType['Allocation']]:{'name':ObjectType['Allocation'],'moveValue':0xd,'moveName':'Allocation'},[ObjectType['Resource']]:{'name':ObjectType['Resource'],'moveValue':0xe,'moveName':'Resource'},[ObjectType['Reward']]:{'name':ObjectType['Reward'],'moveValue':0xf,'moveName':'Reward'},[ObjectType['Discount']]:{'name':ObjectType['Discount'],'moveValue':0x10,'moveName':'Discount'},[ObjectType['EntityRegistrar']]:{'name':ObjectType['EntityRegistrar'],'moveValue':0x11,'moveName':'EntityRegistrar'},[ObjectType['EntityLinker']]:{'name':ObjectType['EntityLinker'],'moveValue':0x12,'moveName':'EntityLinker'},[ObjectType['Proof']]:{'name':ObjectType['Proof'],'moveValue':0x13,'moveName':'Proof'},[ObjectType['Contact']]:{'name':ObjectType['Contact'],'moveValue':0x14,'moveName':'Contact'},[ObjectType['WReceivedObject']]:{'name':ObjectType['WReceivedObject'],'moveValue':0x15,'moveName':'WReceivedObject'},[ObjectType['TableItem_ProgressHistory']]:{'name':ObjectType['TableItem_ProgressHistory'],'moveValue':0x16,'moveName':'TableItem_ProgressHistory'},[ObjectType['TableItem_PermissionPerm']]:{'name':ObjectType['TableItem_PermissionPerm'],'moveValue':0x17,'moveName':'TableItem_PermissionPerm'},[ObjectType['TableItem_DemandPresenter']]:{'name':ObjectType['TableItem_DemandPresenter'],'moveValue':0x18,'moveName':'TableItem_DemandPresenter'},[ObjectType['TableItem_MachineNode']]:{'name':ObjectType['TableItem_MachineNode'],'moveValue':0x19,'moveName':'TableItem_MachineNode'},[ObjectType['TableItem_TreasuryHistory']]:{'name':ObjectType['TableItem_TreasuryHistory'],'moveValue':0x1a,'moveName':'TableItem_TreasuryHistory'},[ObjectType['TableItem_RepositoryData']]:{'name':ObjectType['TableItem_RepositoryData'],'moveValue':0x1b,'moveName':'TableItem_RepositoryData'},[ObjectType['TableItem_RewardRecord']]:{'name':ObjectType['TableItem_RewardRecord'],'moveValue':0x1c,'moveName':'TableItem_RewardRecord'},[ObjectType['TableItem_AddressMark']]:{'name':ObjectType['TableItem_AddressMark'],'moveValue':0x1d,'moveName':'TableItem_AddressMark'},[ObjectType['TableItem_EntityLinker']]:{'name':ObjectType['TableItem_EntityLinker'],'moveValue':0x1e,'moveName':'TableItem_EntityLinker'},[ObjectType['TableItem_EntityRegistrar']]:{'name':ObjectType['TableItem_EntityRegistrar'],'moveValue':0x1f,'moveName':'TableItem_EntityRegistrar'}};export const objectTypeToNumber=Object['fromEntries'](Object['entries'](OBJECT_TYPE_DEFINITIONS)['map'](([a,b])=>[a,b['moveValue']]));export const numberToObjectType=Object['fromEntries'](Object['entries'](OBJECT_TYPE_DEFINITIONS)['map'](([a,b])=>[b['moveValue'],a]));export function getObjectTypeFromNumber(a){return numberToObjectType[a];}export function getNumberFromObjectType(a){return objectTypeToNumber[a];}export function getObjectTypeDefinition(a){return OBJECT_TYPE_DEFINITIONS[a];}export function getObjectTypeDefinitionFromNumber(a){const b=numberToObjectType[a];return b?OBJECT_TYPE_DEFINITIONS[b]:undefined;}export function getObjectTypeFromMoveName(a){return Object['values'](OBJECT_TYPE_DEFINITIONS)['find'](b=>b['moveName']===a)?.['name'];}export function getMoveNameFromObjectType(a){return OBJECT_TYPE_DEFINITIONS[a]?.['moveName'];}export function getMoveNameFromNumber(a){return getObjectTypeDefinitionFromNumber(a)?.['moveName'];}export function getNumberFromMoveName(a){return Object['values'](OBJECT_TYPE_DEFINITIONS)['find'](b=>b['moveName']===a)?.['moveValue'];}export function getObjectTypesFromNumbers(a){return a['map'](getObjectTypeFromNumber);}export function getNumbersFromObjectTypes(a){return a['map'](getNumberFromObjectType);}export var AmountType;(function(a){a[a['GuardU64Identifier']=0x0]='GuardU64Identifier',a[a['Fixed']=0x1]='Fixed';}(AmountType||(AmountType={})));export var ArbStatus;(function(a){a[a['Principal_confirming']=0x0]='Principal_confirming',a[a['Arbitrator_confirming']=0x1]='Arbitrator_confirming',a[a['Voting']=0x2]='Voting',a[a['Arbitrated']=0x3]='Arbitrated',a[a['Objectionable']=0x4]='Objectionable',a[a['Finished']=0x5]='Finished',a[a['Withdrawn']=0x6]='Withdrawn';}(ArbStatus||(ArbStatus={})));export var DiscountType;(function(a){a[a['RATES']=0x0]='RATES',a[a['FIXED']=0x1]='FIXED';}(DiscountType||(DiscountType={})));export var TreasuryOp;(function(a){a[a['Withdraw']=0x0]='Withdraw',a[a['Deposit']=0x1]='Deposit',a[a['Receive']=0x2]='Receive';}(TreasuryOp||(TreasuryOp={})));export var IdFrom;(function(a){a[a['None']=0x0]='None',a[a['Clock']=0x1]='Clock',a[a['Signer']=0x2]='Signer';}(IdFrom||(IdFrom={})));export const parseIdFrom=a=>{if(typeof a==='number'){if(a>=0x0&&a<=0x2)return a;throw new Error('Invalid\x20IdFrom\x20number:\x20'+a+'.\x20Valid\x20range:\x200-2');}const b=Object['keys'](IdFrom)['filter'](e=>isNaN(Number(e))),c=a['toLowerCase'](),d=b['find'](e=>e['toLowerCase']()===c);if(d===undefined)throw new Error('Invalid\x20IdFrom\x20string:\x20\x22'+a+'\x22.\x20Valid\x20values:\x20'+b['join'](',\x20'));return IdFrom[d];};export const idFromToString=a=>{return IdFrom[a];};export const isValidIdFromInput=a=>{if(typeof a==='number')return a>=0x0&&a<=0x2;if(typeof a==='string'){const b=a['toUpperCase'](),c=IdFrom[b];return typeof c==='number';}return![];};export var AllocationMode;(function(a){a[a['Amount']=0x0]='Amount',a[a['Rate']=0x1]='Rate',a[a['Surplus']=0x2]='Surplus';}(AllocationMode||(AllocationMode={})));export const query_objects_json=async a=>{try{const b=JSON['parse'](a);return JSON['stringify']({'data':await query_objects(b)});}catch(c){return JSON['stringify']({'error':c?.['toString']()});}};export const query_table_json=async a=>{try{const b=JSON['parse'](a);return JSON['stringify']({'data':await query_table(b)});}catch(c){return JSON['stringify']({'error':c?.['toString']()});}};export const query_objects=async a=>{const b=await Config['Instance']()['network_get'](a['network']),c=a205a['uniq'](a['objects']);c['length']>MAX_OBJECTS_PER_QUERY&&W_ERROR(WErrors['MaxObjectsPerQuery'],'max\x20'+MAX_OBJECTS_PER_QUERY);const d=await LocalMark['Instance']()['get_many_address'](c),e=new Map(),f=[];c['forEach']((k,l)=>{const m=d[l];m&&(e['set'](m,k),f['push'](m));});if(f['length']===0x0)return{'objects':[]};const g=CachePrefix['object']+':'+b,h=f,i=await Cache['read_many'](g,h,async(k,l)=>{const m=new WowClient({'url':getFullnodeUrl(b)}),n=await m['multiGetObjects']({'ids':[...l],'options':{'showContent':!![],'showOwner':!![],'showPreviousTransaction':!![]}});return n['map'](o=>{const p=o?.['data'];if(!p)return undefined;const q=p?.['type']??p?.['content']?.['type']??undefined,r=q?object_name_from_type(q):undefined,s=Cache['DefaultExpireTime'](r==='Guard'||r==='Payment'||r==='Passport'),t=data2object(p);return{'expire':s,'data':t};})['filter'](o=>o!==undefined);},a['no_cache']),j=i['map'](k=>{const l=k['data'];return l['cache_expire']=k['expire'],l['query_name']=e['get'](l['object'])??l['object'],l;});return{'objects':j};};export const query_personal=async a=>{const b=a['account']??'',[c,d]=await Promise['all']([Config['Instance']()['network_get'](a['network']),GetAccountOrMark_Address({'name_or_address':b})]);!d&&W_ERROR(WErrors['InvalidParam'],'query_personal.account\x20'+b+'\x20not\x20found');const [e,f]=await Promise['all']([queryTableItem_EntityRegistrar({'address':{'name_or_address':b},'no_cache':a['no_cache'],'network':c})['catch'](()=>undefined),queryTableItem_EntityLinker({'address':{'name_or_address':b},'no_cache':a['no_cache'],'network':c})['catch'](()=>undefined)]);if(e)return{'address':d,'info':e?.['records']??[],'description':e?.['description']??'','referrer':e?.['referrer']??null,'mark_object':e?.['mark_object']??null,'details':f?.['votes']??[],'like':f?.['votes']?.['filter'](g=>g['like'])['length']??0x0,'dislike':f?.['votes']?.['filter'](g=>g['dislike'])['length']??0x0,'active_tx':e?.['previousTransaction']??null,'passive_tx':f?.['previousTransaction']??null,'time':e?.['time']??0x0};return undefined;};export const query_table=async a=>{const b=await Config['Instance']()['network_get'](a['network']),c=await LocalMark['Instance']()['get_address'](a['parent']);!c&&W_ERROR(WErrors['InvalidParam'],'query_table.query.parent\x20'+a['parent']+'\x20not\x20found');a['parent']=c;const e=await Cache['read']([CachePrefix['table'],a['parent'],a['cursor']??'',a['limit']?.['toString']()??'',b],async()=>{const f=new WowClient({'url':getFullnodeUrl(b)}),g=await f['getDynamicFields']({'parentId':a['parent'],'cursor':a['cursor'],'limit':a['limit']});(!g?.['data']?.['length']||g?.['data']?.['length']===0x0)&&W_ERROR(WErrors['Fail'],'query_table.query.parent\x20'+a['parent']+'\x20failed');const h={'items':g?.['data']?.['map'](i=>{return{'object':i['objectId'],'type':i['type'],'version':i['version'],'key':{'type':i['name']['type'],'value':i['name']['value']}};}),'nextCursor':g['nextCursor'],'hasNextPage':g['hasNextPage']};return{'expire':Cache['DefaultExpireTime'](),'data':h};},a['no_cache']);if(e){const f=e['data'];return f['cache_expire']=e['expire'],f;}return undefined;};export const query_tableItem=async a=>{const b=await Config['Instance']()['network_get'](a['network']);if(a['parent']!==ENTITY_REGISTRAR_ADDRESS&&a['parent']!==ENTITY_LINKER_ADDRESS){const e=await LocalMark['Instance']()['get_address'](a['parent']);!e&&W_ERROR(WErrors['InvalidParam'],'query_tableItem.query.parent\x20'+a['parent']+'\x20not\x20found'),a['parent']=e;}const c=[CachePrefix['table'],a['parent'],JSON['stringify'](a['key']['value'])],d=await Cache['read'](c,async()=>{const f=new WowClient({'url':getFullnodeUrl(b)}),g=await f['getDynamicFieldObject']({'parentId':a['parent'],'name':{'type':a['key']['type'],'value':a['key']['value']}});!g?.['data']&&W_ERROR(WErrors['Fail'],'query_tableItem('+a['key']['value']+'):\x20'+JSON['stringify'](g)+'\x20');const h=data2object(g?.['data']);return{'expire':Cache['DefaultExpireTime'](),'data':h};},a['no_cache']);if(d)return d['data']['cache_expire']=d['expire'],d['data'];return undefined;};const tableItemQuery_byString=async a=>{const b=typeof a['parent']==='string'?a['parent']:a['parent']['object'];return await query_tableItem({'parent':b,'key':{'type':'0x1::string::String','value':a['key']},'no_cache':a['no_cache'],'network':a['network']});};export const queryTableItem_RepositoryData=async a=>{const b=typeof a['parent']==='string'?a['parent']:a['parent']?.['object'];let c;if(typeof a['entity']==='bigint'||typeof a['entity']==='number')c=uint2address(a['entity']);else{const e=await GetAccountOrMark_Address(a['entity']);if(e)c=e;else return W_ERROR(WErrors['InvalidParam'],'tableItem_RepositoryData.entity'),undefined;}const d=await query_tableItem({'parent':b,'key':{'type':PackageAddress+'::repository::DataKey','value':{'id':c,'key':a['name']}},'no_cache':a['no_cache'],'network':a['network']});if(d?.['type']!=='TableItem_RepositoryData')return undefined;return d;};const tableItem_byAddress=async a=>{const b=typeof a['parent']==='string'?a['parent']:a['parent']?.['object'];let c;if(typeof a['address']==='string')c=a['address'];else{const d=await GetAccountOrMark_Address(a['address']);if(!d)return W_ERROR(WErrors['InvalidParam'],'queryTableItem_byAddress.address\x20'+a['address']+'\x20not\x20found'),undefined;c=d;}return await query_tableItem({'parent':b,'key':{'type':'address','value':c},'no_cache':a['no_cache'],'network':a['network']});};export const queryTableItem_PermissionPerm=async a=>{const b=await tableItem_byAddress(a);if(b?.['type']!=='TableItem_PermissionPerm')return undefined;return b;};export const queryTableItem_EntityRegistrar=async a=>{const b=await tableItem_byAddress({'parent':ENTITY_REGISTRAR_ADDRESS,'address':a['address'],'no_cache':a['no_cache'],'network':a['network']});if(b?.['type']!=='TableItem_EntityRegistrar')return undefined;return b;};export const queryTableItem_EntityLinker=async a=>{const b=await tableItem_byAddress({'parent':ENTITY_LINKER_ADDRESS,'address':a['address'],'no_cache':a['no_cache'],'network':a['network']});if(b?.['type']!=='TableItem_EntityLinker')return undefined;return b;};export const queryTableItem_RewardRecord=async a=>{const b=await tableItem_byAddress(a);if(b?.['type']!=='TableItem_RewardRecord')return undefined;return b;};export const queryTableItem_DemandPresenter=async a=>{const b=await tableItem_byAddress(a);if(b?.['type']!=='TableItem_DemandPresenter')return undefined;return b;};export const queryTableItem_TreasuryHistory=async a=>{const b=await tableItem_byAddress(a);if(b?.['type']!=='TableItem_TreasuryHistory')return undefined;return b;};export const queryTableItem_MachineNode=async a=>{const b=await tableItemQuery_byString(a);if(b?.['type']!=='TableItem_MachineNode')return undefined;return b;};export const queryTableItem_AddressMark=async a=>{const b=await tableItem_byAddress(a);if(b?.['type']!=='TableItem_AddressMark')return undefined;return b;};export const queryTableItem_ProgressHistory=async a=>{const b=typeof a['parent']==='string'?a['parent']:a['parent']['object'],c=await query_tableItem({'parent':b,'key':{'type':'u64','value':a['u64']['toString']()},'no_cache':a['no_cache'],'network':a['network']});if(c?.['type']!=='TableItem_ProgressHistory')return undefined;return c;};export function raw2type(a){if(!a)return undefined;const b=object_module_and_name_from_type(a);if(b?.['module']==='resource'&&b?.['name']==='Resource')return ObjectType['Resource'];else{if(b?.['module']==='payment'&&b?.['name']==='CoinWrapper')return ObjectType['WReceivedObject'];else{if(b?.['module']==='registrar'&&b?.['name']==='Registrar')return ObjectType['EntityLinker'];else{if(b?.['module']==='registrar'&&b?.['name']==='Entity')return ObjectType['EntityRegistrar'];}}}const c=object_name_from_type(a);if(Object['values'](ObjectType)['includes'](c))return c;const d=a?.['indexOf']('0x2::dynamic_field::Field<');if(d===0x0){const e=a?.['substring']('0x2::dynamic_field::Field<'['length']);if(e){if(e['includes']('::demand::ServiceInfo>'))return ObjectType['TableItem_DemandPresenter'];else{if(e['includes']('::machine::NodePair>>>'))return ObjectType['TableItem_MachineNode'];else{if(e['includes']('::progress::History>'))return ObjectType['TableItem_ProgressHistory'];else{if(e['includes']('::reward::RecipientRecord>'))return ObjectType['TableItem_RewardRecord'];else{if(e['includes']('::treasury::Record>'))return ObjectType['TableItem_TreasuryHistory'];else{if(e['includes']('::registrar::Votes>'))return ObjectType['TableItem_EntityLinker'];else{if(e['indexOf']('address')<e['indexOf']('0x2::parent_linked_table::Node<address,\x20vector<u16>>>'))return ObjectType['TableItem_PermissionPerm'];else{if(e['includes']('::repository::DataKey'))return ObjectType['TableItem_RepositoryData'];else{if(e['includes']('::registrar::AddressInfo>'))return ObjectType['TableItem_EntityRegistrar'];else{if(e['includes']('::resource::AddressTag>'))return ObjectType['TableItem_AddressMark'];}}}}}}}}}}}return undefined;}export function data2object(a){const b=a?.['content']?.['fields'],c=a?.['objectId']??b?.['id']?.['id']??undefined,d=a?.['type']??a?.['content']?.['type']??undefined,e=a?.['version']??undefined,f=a?.['owner']??undefined,g=raw2type(d);switch(g){case'Permission':return{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'builder':b?.['owner']??'','admin':b?.['admin'],'description':b?.['description']??'','entity_count':parseInt(b?.['table']?.['fields']?.['size']),'perm_remark':b?.['remark']?.['map'](h=>{return{'index':parseInt(h?.['fields']?.['index']),'remark':h?.['fields']?.['remark']};}),'um':b?.['um']??null};case'TableItem_PermissionPerm':return{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'address':b?.['name'],'perm':b?.['value']?.['fields']?.['value']};case'Guard':{console['dir'](b,{'depth':null,'colors':!![]});const h=b?.['validated']?.['map'](l=>{return{'identifier':parseInt(l?.['fields']?.['identifier']),'object_type':numberToObjectType[l?.['fields']?.['object_type']]};}),i=b?.['table']?.['map'](l=>{const m=parseInt(l?.['fields']?.['identifier']),n=bcsBytesToValue(Uint8Array['from'](l?.['fields']?.['value']));return{'identifier':m,'b_submission':l?.['fields']?.['b_submission'],'value_type':l?.['fields']?.['value'][0x0],'value':n,'name':l?.['fields']?.['name'],'object_type':h['find'](o=>o['identifier']===m)?.['object_type']};}),j=restoreNodeFromOutput(Uint8Array['from'](b?.['input']),i),k=i['filter'](l=>!j['autoGeneratedIdentifiers']['includes'](l['identifier']));return{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description']??'','table':k,'input':b?.['input'],'root':j['root'],'rep_quote':j['rep_quote'],'relies':b?.['relies'],'relies_logic_and':b?.['relies_logic_and'],'rep':b?.['rep']};}case'Passport':{return{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'info':b?.['guard']?.['map'](l=>{return{'guard':l['fields']['guard'],'result':l['fields']['result'],'impack':l['fields']['impack'],'relies':l['fields']['relies'],'relies_logic_and':l['fields']['relies_logic_and'],'submission':l['fields']['submission']['map'](m=>{return{'identifier':m['fields']['identifier'],'value_type':m['fields']['value'][0x0],'value':bcsBytesToValue(Uint8Array['from'](m['fields']['value']))};})};}),'result':b?.['result'],'tx_hash':b?.['tx_hash'],'impack_guard':b?.['impack'],'time':b?.['time'],'signer':b?.['signer'],'has_verified':b?.['has_verified']};}case'Allocation':{return{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['allocators']?.['fields']?.['description']??'','threshold':b?.['allocators']?.['fields']?.['threshold'],'balance':b?.['balance'],'payment_info':b?.['payment_info']?.['fields'],'payment':b?.['payment']??[],'allocators':b?.['allocators']?.['fields']?.['allocators']?.['map'](l=>{return{'guard':l['fields']['guard'],'fix':l['fields']['fix'],'max':l['fields']['max']??undefined,'sharing':l['fields']['sharing']['map'](m=>{let n;const o=m['fields']['who'];(!o||!o['variant'])&&W_ERROR(WErrors['ParseObjectContentFailed'],'Invalid\x20who\x20data:\x20'+JSON['stringify'](o));if(o['variant']==='GuardIdentifier'&&o['fields'])n={'GuardIdentifier':Number(o['fields']['pos0'])};else{if(o['variant']==='Entity'&&o['fields'])n={'Entity':{'name_or_address':o['fields']['pos0']}};else o['variant']==='Signer'?n={'Signer':null}:W_ERROR(WErrors['ParseObjectContentFailed'],'Invalid\x20who\x20variant:\x20'+o['variant']);}return{'who':n,'sharing':m['fields']['sharing'],'mode':m['fields']['mode']};})};})};}case'Payment':{return{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'amount':b?.['amount'],'time':b?.['time'],'from_object':b?.['from_object'],'signer':b?.['signer'],'info':b?.['info']?.['fields'],'record':b?.['record']?.['map'](l=>{return{'recipient':l['fields']['recipient'],'amount':l['fields']['amount']};})};}case'Contact':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'ims':b?.['ims']['map'](l=>{return{'description':l['fields']['description'],'at':l['fields']['at'],'join_time':l['fields']['join_time'],'status':l['fields']['status']};}),'location':b?.['location'],'permission':b?.['permission']};}case'Repository':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'policies':b?.['policies']['map'](l=>{return{'description':l['fields']['description'],'id_from':l['fields']['id_from'],'name':l['fields']['name'],'quote_guard':l['fields']['quote_guard'],'value_type':l['fields']['value_type'],'write_guard':l['fields']['write_guard']};}),'rewards':b?.['rewards'],'um':b?.['um']??null,'permission':b?.['permission']};}case'Demand':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'location':b?.['location'],'rewards':b?.['rewards'],'guards':b?.['guards']['map'](l=>{return{'guard':l['fields']['guard'],'service_identifier':l['fields']['service_identifier']};}),'presenters_count':b?.['presenters']?.['fields']?.['size'],'um':b?.['um']??null,'permission':b?.['permission']};}case'Machine':{return{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'node_count':b?.['nodes']?.['fields']?.['size'],'consensus_repositories':b?.['consensus_repositories'],'bPaused':b?.['bPaused'],'bPublished':b?.['bPublished'],'um':b?.['um']??null,'permission':b?.['permission']};}case'Order':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'items':b?.['items']['map'](l=>{return{'name':l['fields']['item'],'price':l['fields']['price'],'quantity':l['fields']['quantity'],'wip_hash':l['fields']['wip_hash']};}),'discount':b?.['discount'],'progress':b?.['progress'],'machine':b?.['machine'],'amount':b?.['amount'],'builder':b?.['owner'],'service':b?.['service'],'dispute':b?.['dispute'],'agent':b?.['agent'],'allocation':b?.['allocation'],'claimed_by':b?.['claimed_by'],'required_info':b?.['required_info'],'time':b?.['time']};}case'Progress':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'machine':b?.['machine'],'context_repositories':b?.['context_repositories'],'current':b?.['current'],'task':b?.['task'],'namedOperator':b?.['namedOperator']['map'](l=>{return{'name':l['fields']['name'],'operators':l['fields']['operators']};}),'session':b?.['session']['map'](l=>{return{'next_node':l['fields']['next_node'],'forwards':l['fields']['forwards']['map'](m=>{return{'forward':m['fields']['forward'],'who':m['fields']['who'],'retained_submission':m['fields']['retained_submission']['map'](n=>{return{'identifier':n['fields']['identifier'],'value_type':n['fields']['value_type'],'value':bcsBytesToValue(Uint8Array['from'](n['fields']['value']))};}),'msg':m['fields']['msg'],'accomplished':m['fields']['accomplished'],'time':m['fields']['time']};}),'weights':l['fields']['weights'],'threshold':l['fields']['threshold']};}),'history_count':b?.['history']?.['fields']?.['contents']?.['fields']?.['size'],'current_time':b?.['current_time']};}case'Reward':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'guards':b?.['guards']['map'](l=>{const m=l['fields']['amount']['variant']==='Fixed'?AmountType['Fixed']:AmountType['GuardU64Identifier'],n=parseRecipient(l['fields']['recipient']);return{'guard':l['fields']['guard'],'expiration_time':l['fields']['expiration_time'],'amount':{'type':m,'value':l['fields']['amount']['fields']?.['pos0']},'recipient':n,'store_from_id':l['fields']['store_from_id']??null};}),'balance':b?.['balance'],'guard_not_added_expiration_time':b?.['guard_not_added_expiration_time'],'record_count':b?.['record']?.['fields']?.['size'],'um':b?.['um']??null,'permission':b?.['permission']};}case'Service':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'location':b?.['location'],'sales':b?.['sales']?.['map'](l=>{return{'name':l['fields']['name'],'stock':l['fields']['stock'],'suspension':l['fields']['suspension'],'price':l['fields']['price'],'wip':l['fields']['wip'],'wip_hash':l['fields']['wip_hash']};}),'repositories':b?.['repositories'],'buy_guard':b?.['buy_guard'],'machine':b?.['machine'],'bPublished':b?.['bPublished'],'bPaused':b?.['bPaused'],'customer_required':b?.['customer_required'],'arbitrations':b?.['arbitrations'],'compensation_fund':b?.['compensation_fund'],'paused_time':b?.['paused_time'],'setting_lock_duration':b?.['setting_lock_duration'],'order_allocators':{'description':b?.['order_allocators']?.['fields']?.['description'],'threshold':b?.['order_allocators']?.['fields']?.['threshold'],'allocators':b?.['order_allocators']?.['fields']?.['allocators']['map'](l=>{return{'guard':l['fields']['guard'],'sharing':l['fields']['sharing']['map'](m=>{const n=parseRecipient(m['fields']['who']);return{'who':n,'sharing':m['fields']['sharing'],'mode':m['fields']['mode']};}),'fix':l['fields']['fix'],'max':l['fields']['max']};})},'rewards':b?.['rewards'],'um':b?.['um']??null,'permission':b?.['permission']};}case'Discount':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'name':b?.['name'],'discount_type':b?.['discount_type'],'benchmark':b?.['benchmark'],'off':b?.['off'],'time_start':b?.['time_start'],'time_end':b?.['time_end'],'service':b?.['service'],'transferable':b?.['transferable']};}case'Arb':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'order':b?.['order'],'arbitration':b?.['arbitration'],'voted':b?.['voted']?.['map'](l=>{return{'voter':l['fields']['voter'],'agrees':l['fields']['agrees'],'weight':l['fields']['weight'],'time':l['fields']['time']};}),'proposition':b?.['proposition']?.['map'](l=>{return{'name':l['fields']['name'],'votes':l['fields']['votes']};}),'fee':b?.['fee'],'feedback':b?.['feedback'],'indemnity':b?.['indemnity']?{'amount':b?.['indemnity']?.['fields']?.['amount'],'time':b?.['indemnity']?.['fields']?.['time']}:null,'voting_deadline':b?.['voting_deadline'],'objection':b?.['objection'],'status':b?.['status'],'compensation_time':b?.['compensation_time'],'time':b?.['time']};}case'Arbitration':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'location':b?.['location'],'fee':b?.['fee'],'bPaused':b?.['bPaused'],'balance':b?.['balance'],'usage_guard':b?.['usage_guard'],'um':b?.['um']??null,'permission':b?.['permission'],'voting_guard':b?.['voting_guard']['map'](l=>{let m;if(l['fields']['vote_weight']['variant']==='GuardIdentifier')m={'GuardIdentifier':l['fields']['vote_weight']['fields']?.['pos0']};else l['fields']['vote_weight']['variant']==='FixedValue'?m={'FixedValue':l['fields']['vote_weight']['fields']?.['pos0']}:W_ERROR(WErrors['InvalidParam'],'vote_weight'+l['fields']['vote_weight']['variant']+'\x20invalid');return{'guard':l['fields']['guard'],'vote_weight':m};})};}case'Proof':{return{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'proof':b?.['proof'],'server_pubkey':b?.['server_pubkey'],'server_signature':b?.['server_signature'],'proof_type':b?.['proof_type'],'item_count':b?.['item_count']??null,'about_address':b?.['about_address']??null,'signer':b?.['signer'],'time':b?.['time']};}case'Treasury':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'description':b?.['description'],'balance':b?.['balance'],'history_count':parseInt(b?.['history']?.['fields']?.['size']),'external_deposit_guard':b?.['external_deposit_guard']['map'](l=>({'guard':l['fields']['guard'],'identifier':l['fields']['identifier']??null,'store_from_id':l['fields']['store_from_id']??null})),'external_withdraw_guard':b?.['external_withdraw_guard']['map'](l=>({'guard':l['fields']['guard'],'identifier':l['fields']['identifier'],'store_from_id':l['fields']['store_from_id']??null})),'inflow':b?.['inflow'],'outflow':b?.['outflow'],'um':b?.['um']??null,'permission':b?.['permission']};}case'TableItem_DemandPresenter':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'address':b?.['name'],'recommend':b?.['value']?.['fields']?.['recommend'],'service':b?.['value']?.['fields']?.['service'],'update_time':b?.['value']?.['fields']?.['update_time'],'acceptance_score':b?.['value']?.['fields']?.['acceptance_score'],'feedback':b?.['value']?.['fields']?.['feedback'],'feedback_time':b?.['value']?.['fields']?.['feedback_time']};}case'TableItem_MachineNode':{return console['dir'](JSON['stringify'](b['value']['fields']['value']),{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'name':b?.['name'],'value':b?.['value']?.['fields']?.['value']?.['map'](l=>{return{'prev_node':l['fields']['prev_node'],'threshold':l['fields']['threshold'],'forwards':l['fields']['forwards']['map'](m=>{return{'name':m['fields']['name'],'weight':m['fields']['weight'],'namedOperator':m['fields']?.['namedOperator'],'permissionIndex':m['fields']?.['permissionIndex'],'guard':m['fields']?.['guard']?{'guard':m['fields']['guard']['fields']?.['guard'],'retained_submission':m['fields']['guard']['fields']?.['retained_submission']}:undefined};})};})};}case'TableItem_ProgressHistory':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'index':b?.['name'],'node':b?.['value']?.['fields']?.['node'],'next_node':b?.['value']?.['fields']?.['next_node'],'session':b?.['value']?.['fields']?.['session']['map'](l=>{return{'next_node':l['fields']['next_node'],'weights':l['fields']['weights'],'threshold':l['fields']['threshold'],'forwards':l['fields']['forwards']?.['map'](m=>{return{'forward':m['fields']['forward'],'who':m['fields']['who'],'msg':m['fields']['msg'],'accomplished':m['fields']['accomplished'],'time':m['fields']['time'],'retained_submission':m['fields']['retained_submission']?.['map'](n=>{return{'identifier':n['fields']['identifier'],'value_type':n['fields']['value_type'][0x0],'value':bcsBytesToValue(Uint8Array['from'](n['fields']['value']))};})};})};}),'time':b?.['value']?.['time']};}case'TableItem_TreasuryHistory':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'payment':b?.['name'],'op':b?.['value']?.['fields']?.['op'],'signer':b?.['value']?.['fields']?.['signer'],'external_guard':b?.['value']?.['fields']?.['external_guard'],'amount':b?.['value']?.['fields']?.['amount'],'time':b?.['value']?.['fields']?.['time'],'store_from_id':b?.['value']?.['fields']?.['store_from_id']??null};}case'TableItem_EntityLinker':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'address':b?.['name'],'pos':b?.['value']?.['fields']?.['pos'],'count':b?.['value']?.['fields']?.['count'],'votes':b?.['value']?.['fields']?.['votes']?.['map'](l=>{return{'who':l['fields']['who'],'info':l['fields']['info'],'like':(l['fields']['info']&0x2)!==0x0,'dislike':(l['fields']['info']&0x4)!==0x0,'affiliation':(l['fields']['info']&0x8)!==0x0,'time':l['fields']['time']};})};}case'TableItem_EntityRegistrar':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'address':b?.['name'],'description':b?.['value']?.['fields']?.['description'],'time':b?.['value']?.['fields']?.['time'],'referrer':b?.['referrer'],'mark_object':b?.['value']?.['fields']?.['resource'],'records':b?.['value']?.['fields']?.['records']?.['map'](l=>{return{'name':l['fields']['name'],'typed_value':l['fields']['typed_value'],'value':bcsBytesToValue(Uint8Array['from'](l['fields']['typed_value']))};})};}case'Resource':{return{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'entity_count':parseInt(b?.['table']?.['fields']?.['size'])};}case'TableItem_AddressMark':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'entity':b?.['name'],'name':b?.['value']?.['fields']?.['name'],'tags':b?.['value']?.['fields']?.['tags']};}case'TableItem_RepositoryData':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'entity':b?.['name']?.['fields']?.['id'],'name':b?.['name']?.['fields']?.['key'],'value':b?.['value'],'data':{'value_type':b?.['value'][0x0],'value':bcsBytesToValue(Uint8Array['from'](b['value']))}};}case'TableItem_RewardRecord':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'recipient':b?.['name'],'guard':b?.['value']?.['fields']?.['guard'],'total':b?.['value']?.['fields']?.['total'],'record':b?.['value']?.['fields']?.['amount']['map'](l=>{return{'amount':l['fields']['amount'],'time':l['fields']['time'],'store_from_id':l['fields']['store_from_id']??null};})};}case'EntityRegistrar':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'entity_count':parseInt(b?.['table']?.['fields']?.['size'])};}case'EntityLinker':{return console['dir'](b,{'depth':null,'colors':!![]}),{'object':c,'type':g,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'entity_count':parseInt(b?.['table']?.['fields']?.['size'])};}}return{'object':c,'type':undefined,'type_raw':d,'owner':f,'version':e,'previousTransaction':a?.['previousTransaction'],'content_raw':b};}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"author": "wowok <build@wowok.net>",
|
|
4
4
|
"description": "Wowok Blockchain TypeScript API",
|
|
5
5
|
"homepage": "https://wowok.net",
|
|
6
|
-
"version": "2.2.
|
|
6
|
+
"version": "2.2.16",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"files": [
|
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
"prebuilds",
|
|
12
12
|
"scripts",
|
|
13
13
|
"LICENSE",
|
|
14
|
-
"NOTICE",
|
|
15
|
-
"THIRD_PARTY_LICENSES",
|
|
16
14
|
"README.md"
|
|
17
15
|
],
|
|
18
16
|
"engines": {
|
package/NOTICE
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
WoWok Blockchain Project
|
|
2
|
-
https://wowok.net
|
|
3
|
-
|
|
4
|
-
Copyright (c) 2024-2025 WoWok Team. All Rights Reserved.
|
|
5
|
-
|
|
6
|
-
====================================================================
|
|
7
|
-
|
|
8
|
-
COMMERCIAL LICENSE NOTICE
|
|
9
|
-
|
|
10
|
-
This software is proprietary and confidential. Unauthorized copying,
|
|
11
|
-
transfer, or distribution of this software, via any medium, is
|
|
12
|
-
strictly prohibited. All rights reserved.
|
|
13
|
-
|
|
14
|
-
For licensing inquiries, please contact: build@wowok.net
|
|
15
|
-
|
|
16
|
-
====================================================================
|
|
17
|
-
|
|
18
|
-
THIRD-PARTY SOFTWARE NOTICES
|
|
19
|
-
|
|
20
|
-
This product contains software developed by third parties. The
|
|
21
|
-
following components are used under their respective licenses:
|
|
22
|
-
|
|
23
|
-
1. @mysten/bcs, @mysten/utils
|
|
24
|
-
Copyright: Mysten Labs, Inc.
|
|
25
|
-
License: Apache License 2.0
|
|
26
|
-
Source: https://github.com/MystenLabs/sui
|
|
27
|
-
|
|
28
|
-
2. @noble/curves, @noble/hashes, @noble/post-quantum
|
|
29
|
-
Copyright: Paul Miller (paulmillr.com)
|
|
30
|
-
License: MIT License
|
|
31
|
-
Source: https://github.com/paulmillr/noble-curves
|
|
32
|
-
|
|
33
|
-
3. @protobuf-ts/*
|
|
34
|
-
Copyright: Timo Stamm
|
|
35
|
-
License: Apache License 2.0
|
|
36
|
-
Source: https://github.com/timostamm/protobuf-ts
|
|
37
|
-
|
|
38
|
-
4. @scure/*
|
|
39
|
-
Copyright: Paul Miller (paulmillr.com)
|
|
40
|
-
License: MIT License
|
|
41
|
-
Source: https://github.com/paulmillr/scure-base
|
|
42
|
-
|
|
43
|
-
5. @zip.js/zip.js
|
|
44
|
-
Copyright: Gildas Lormeau
|
|
45
|
-
License: BSD-3-Clause
|
|
46
|
-
Source: https://github.com/gildas-lormeau/zip.js
|
|
47
|
-
|
|
48
|
-
6. libsql (libSQL)
|
|
49
|
-
Copyright: Turso and contributors
|
|
50
|
-
License: MIT License
|
|
51
|
-
Source: https://github.com/tursodatabase/libsql
|
|
52
|
-
|
|
53
|
-
7. lodash
|
|
54
|
-
Copyright: OpenJS Foundation and other contributors
|
|
55
|
-
License: MIT License
|
|
56
|
-
Source: https://github.com/lodash/lodash
|
|
57
|
-
|
|
58
|
-
8. valibot
|
|
59
|
-
Copyright: Fabian Hiller
|
|
60
|
-
License: MIT License
|
|
61
|
-
Source: https://github.com/fabian-hiller/valibot
|
|
62
|
-
|
|
63
|
-
====================================================================
|
|
64
|
-
|
|
65
|
-
APACHE 2.0 LICENSE COMPONENTS
|
|
66
|
-
|
|
67
|
-
The following components are licensed under the Apache License 2.0:
|
|
68
|
-
- @mysten/bcs
|
|
69
|
-
- @mysten/utils
|
|
70
|
-
- @protobuf-ts/grpcweb-transport
|
|
71
|
-
- @protobuf-ts/runtime
|
|
72
|
-
- @protobuf-ts/runtime-rpc
|
|
73
|
-
|
|
74
|
-
You may obtain a copy of the Apache License 2.0 at:
|
|
75
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
76
|
-
|
|
77
|
-
====================================================================
|
|
78
|
-
|
|
79
|
-
MIT LICENSE COMPONENTS
|
|
80
|
-
|
|
81
|
-
The following components are licensed under the MIT License:
|
|
82
|
-
- @noble/curves
|
|
83
|
-
- @noble/hashes
|
|
84
|
-
- @noble/post-quantum
|
|
85
|
-
- @scure/base
|
|
86
|
-
- @scure/bip32
|
|
87
|
-
- @scure/bip39
|
|
88
|
-
- libsql
|
|
89
|
-
- lodash
|
|
90
|
-
- valibot
|
|
91
|
-
|
|
92
|
-
====================================================================
|
|
93
|
-
|
|
94
|
-
BSD LICENSE COMPONENTS
|
|
95
|
-
|
|
96
|
-
The following components are licensed under BSD License:
|
|
97
|
-
- @zip.js/zip.js
|
|
98
|
-
|
|
99
|
-
====================================================================
|
|
100
|
-
|
|
101
|
-
DISCLAIMER
|
|
102
|
-
|
|
103
|
-
THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
104
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
105
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
106
|
-
|
|
107
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
108
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
109
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
110
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
111
|
-
|
|
112
|
-
====================================================================
|
|
113
|
-
|
|
114
|
-
END OF NOTICE
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
================================================================================
|
|
2
|
-
APACHE LICENSE 2.0
|
|
3
|
-
================================================================================
|
|
4
|
-
|
|
5
|
-
The following software components are licensed under the Apache License 2.0:
|
|
6
|
-
|
|
7
|
-
1. @mysten/bcs, @mysten/utils
|
|
8
|
-
Copyright (c) Mysten Labs, Inc.
|
|
9
|
-
Source: https://github.com/MystenLabs/sui
|
|
10
|
-
|
|
11
|
-
2. @protobuf-ts/grpcweb-transport, @protobuf-ts/runtime, @protobuf-ts/runtime-rpc
|
|
12
|
-
Copyright (c) Timo Stamm
|
|
13
|
-
Source: https://github.com/timostamm/protobuf-ts
|
|
14
|
-
|
|
15
|
-
================================================================================
|
|
16
|
-
|
|
17
|
-
Apache License
|
|
18
|
-
Version 2.0, January 2004
|
|
19
|
-
http://www.apache.org/licenses/
|
|
20
|
-
|
|
21
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
22
|
-
|
|
23
|
-
1. Definitions.
|
|
24
|
-
|
|
25
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
26
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
27
|
-
|
|
28
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
29
|
-
the copyright owner that is granting the License.
|
|
30
|
-
|
|
31
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
32
|
-
other entities that control, are controlled by, or are under common
|
|
33
|
-
control with that entity. For the purposes of this definition,
|
|
34
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
35
|
-
direction or management of such entity, whether by contract or
|
|
36
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
37
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
38
|
-
|
|
39
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
40
|
-
exercising permissions granted by this License.
|
|
41
|
-
|
|
42
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
43
|
-
including but not limited to software source code, documentation
|
|
44
|
-
source, and configuration files.
|
|
45
|
-
|
|
46
|
-
"Object" form shall mean any form resulting from mechanical
|
|
47
|
-
transformation or translation of a Source form, including but
|
|
48
|
-
not limited to compiled object code, generated documentation,
|
|
49
|
-
and conversions to other media types.
|
|
50
|
-
|
|
51
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
52
|
-
Object form, made available under the License, as indicated by a
|
|
53
|
-
copyright notice that is included in or attached to the work
|
|
54
|
-
(an example is provided in the Appendix below).
|
|
55
|
-
|
|
56
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
57
|
-
form, that is based on (or derived from) the Work and for which the
|
|
58
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
59
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
60
|
-
of this License, Derivative Works shall not include works that remain
|
|
61
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
62
|
-
the Work and Derivative Works thereof.
|
|
63
|
-
|
|
64
|
-
"Contribution" shall mean any work of authorship, including
|
|
65
|
-
the original version of the Work and any modifications or additions
|
|
66
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
67
|
-
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
68
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
69
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
70
|
-
means any form of electronic, verbal, or written communication sent
|
|
71
|
-
to the Licensor or its representatives, including but not limited to
|
|
72
|
-
communication on electronic mailing lists, source code control systems,
|
|
73
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
74
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
75
|
-
excluding communication that is conspicuously marked or otherwise
|
|
76
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
77
|
-
|
|
78
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
79
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
80
|
-
subsequently incorporated within the Work.
|
|
81
|
-
|
|
82
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
83
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
84
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
85
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
86
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
87
|
-
Work and such Derivative Works in Source or Object form.
|
|
88
|
-
|
|
89
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
90
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
91
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
92
|
-
(except as stated in this section) patent license to make, have made,
|
|
93
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
94
|
-
where such license applies only to those patent claims licensable
|
|
95
|
-
by such Contributor that are necessarily infringed by their
|
|
96
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
97
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
98
|
-
institute patent litigation against any entity (including a
|
|
99
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
100
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
101
|
-
or contributory patent infringement, then any patent licenses
|
|
102
|
-
granted to You under this License for that Work shall terminate
|
|
103
|
-
as of the date such litigation is filed.
|
|
104
|
-
|
|
105
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
106
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
107
|
-
modifications, and in Source or Object form, provided that You
|
|
108
|
-
meet the following conditions:
|
|
109
|
-
|
|
110
|
-
(a) You must give any other recipients of the Work or
|
|
111
|
-
Derivative Works a copy of this License; and
|
|
112
|
-
|
|
113
|
-
(b) You must cause any modified files to carry prominent notices
|
|
114
|
-
stating that You changed the files; and
|
|
115
|
-
|
|
116
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
117
|
-
that You distribute, all copyright, patent, trademark, and
|
|
118
|
-
attribution notices from the Source form of the Work,
|
|
119
|
-
excluding those notices that do not pertain to any part of
|
|
120
|
-
the Derivative Works; and
|
|
121
|
-
|
|
122
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
123
|
-
distribution, then any Derivative Works that You distribute must
|
|
124
|
-
include a readable copy of the attribution notices contained
|
|
125
|
-
within such NOTICE file, excluding those notices that do not
|
|
126
|
-
pertain to any part of the Derivative Works, in at least one
|
|
127
|
-
of the following places: within a NOTICE text file distributed
|
|
128
|
-
as part of the Derivative Works; within the Source form or
|
|
129
|
-
documentation, if provided along with the Derivative Works; or,
|
|
130
|
-
within a display generated by the Derivative Works, if and
|
|
131
|
-
wherever such third-party notices normally appear. The contents
|
|
132
|
-
of the NOTICE file are for informational purposes only and
|
|
133
|
-
do not modify the License. You may add Your own attribution
|
|
134
|
-
notices within Derivative Works that You distribute, alongside
|
|
135
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
136
|
-
that such additional attribution notices cannot be construed
|
|
137
|
-
as modifying the License.
|
|
138
|
-
|
|
139
|
-
You may add Your own copyright statement to Your modifications and
|
|
140
|
-
may provide additional or different license terms and conditions
|
|
141
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
142
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
143
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
144
|
-
the conditions stated in this License.
|
|
145
|
-
|
|
146
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
147
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
148
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
149
|
-
this License, without any additional terms or conditions.
|
|
150
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
151
|
-
the terms of any separate license agreement you may have executed
|
|
152
|
-
with Licensor regarding such Contributions.
|
|
153
|
-
|
|
154
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
155
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
156
|
-
except as required for reasonable and customary use in describing the
|
|
157
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
158
|
-
|
|
159
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
160
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
161
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
162
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
163
|
-
implied, including, without limitation, any warranties or conditions
|
|
164
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
165
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
166
|
-
appropriateness of using or redistributing the Work and assume any
|
|
167
|
-
risks associated with Your exercise of permissions under this License.
|
|
168
|
-
|
|
169
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
170
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
171
|
-
unless required by applicable law (such as deliberate and grossly
|
|
172
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
173
|
-
liable to You for damages, including any direct, indirect, special,
|
|
174
|
-
incidental, or consequential damages of any character arising as a
|
|
175
|
-
result of this License or out of the use or inability to use the
|
|
176
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
177
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
178
|
-
other commercial damages or losses), even if such Contributor
|
|
179
|
-
has been advised of the possibility of such damages.
|
|
180
|
-
|
|
181
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
182
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
183
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
184
|
-
or other liability obligations and/or rights consistent with this
|
|
185
|
-
License. However, in accepting such obligations, You may act only
|
|
186
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
187
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
188
|
-
defend, and hold each Contributor harmless for any liability
|
|
189
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
190
|
-
of your accepting any such warranty or additional liability.
|
|
191
|
-
|
|
192
|
-
END OF TERMS AND CONDITIONS
|
|
193
|
-
|
|
194
|
-
================================================================================
|
|
195
|
-
END OF APACHE LICENSE 2.0
|
|
196
|
-
================================================================================
|