@wowok/wowok 2.7.1 → 2.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/Transaction-CClYcZIE.mjs +1 -0
- package/dist/esm/arb-BzFlUNMS.mjs +1 -0
- package/dist/esm/base-34PdEIjR.mjs +1 -0
- package/dist/esm/{cache-DSTBqmVF.d.mts → cache-BMhtVd6c.d.mts} +16 -1
- package/dist/esm/call-CD3jde0S.mjs +1 -0
- package/dist/esm/client/index.d.mts +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/{client-B2NwgKQ6.mjs → client-Bmbe0gz3.mjs} +1 -1
- package/dist/esm/{common-BDlb-AoC.mjs → common-ofEOpNis.mjs} +1 -1
- package/dist/esm/cryptography/index.d.mts +1 -1
- package/dist/esm/cryptography/index.mjs +1 -1
- package/dist/esm/{ed25519-LQZKHVDN.mjs → ed25519-9wJMPpyI.mjs} +1 -1
- package/dist/esm/{evm-account-C-WmGOoz.d.mts → evm-account-CNlXZf5j.d.mts} +2 -2
- package/dist/esm/{falcon512-Be5BlPLD.mjs → falcon512-C_L8D0FB.mjs} +1 -1
- package/dist/esm/graphql/index.d.mts +1 -1
- package/dist/esm/graphql/index.mjs +1 -1
- package/dist/esm/graphql-CLx7feHg.mjs +1 -0
- package/dist/esm/grpc/index.d.mts +1 -1
- package/dist/esm/grpc/index.mjs +1 -1
- package/dist/esm/grpc-CFPK63nb.mjs +1 -0
- package/dist/esm/{index-BZkrZ63s.d.mts → index-BB-qrJhQ.d.mts} +349 -17
- package/dist/esm/{index-Db8Hn9N8.d.mts → index-BJAN0sGu.d.mts} +2 -1
- package/dist/esm/index.d.mts +8 -8
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/jsonRpc/index.d.mts +1 -1
- package/dist/esm/jsonRpc/index.mjs +1 -1
- package/dist/esm/{keypair-BqNhxtoP.mjs → keypair-CvKz39ZO.mjs} +1 -1
- package/dist/esm/keypairs/ed25519/index.d.mts +1 -1
- package/dist/esm/keypairs/ed25519/index.mjs +1 -1
- package/dist/esm/keypairs/falcon512/index.d.mts +1 -1
- package/dist/esm/keypairs/falcon512/index.mjs +1 -1
- package/dist/esm/keypairs/passkey/index.d.mts +1 -1
- package/dist/esm/keypairs/passkey/index.mjs +1 -1
- package/dist/esm/keypairs/secp256k1/index.d.mts +1 -1
- package/dist/esm/keypairs/secp256k1/index.mjs +1 -1
- package/dist/esm/keypairs/secp256r1/index.d.mts +1 -1
- package/dist/esm/keypairs/secp256r1/index.mjs +1 -1
- package/dist/esm/{messenger-DEHzSxhH.mjs → messenger-CYsysZJH.mjs} +1 -1
- package/dist/esm/messenger-api-BPBtCTWs.mjs +1 -0
- package/dist/esm/multisig/index.d.mts +1 -1
- package/dist/esm/multisig/index.mjs +1 -1
- package/dist/esm/{network-Bgq9iuE4.mjs → network-y8yMus5q.mjs} +1 -1
- package/dist/esm/object-CNbjrx9F.mjs +1 -0
- package/dist/esm/{passkey-CS2Qexll.mjs → passkey-hU0KN8tj.mjs} +1 -1
- package/dist/esm/passport-GNU3ZGa6.mjs +1 -0
- package/dist/esm/{proof-BcyNI5NQ.mjs → proof-BMiHWLfr.mjs} +1 -1
- package/dist/esm/{publickey-DMk4XMWI.mjs → publickey-C1XTriFK.mjs} +1 -1
- package/dist/esm/{publickey-C9TocS69.mjs → publickey-CO7mE1h4.mjs} +1 -1
- package/dist/esm/{publickey-CvCDfw_N.mjs → publickey-CaeLjex_.mjs} +1 -1
- package/dist/esm/{publickey-5xoCmE9g.mjs → publickey-CvsHmrwa.mjs} +1 -1
- package/dist/esm/{publickey-BzPz9Uwr.mjs → publickey-D1qNOZY_.mjs} +1 -1
- package/dist/esm/{publickey-CQWQyM6S.mjs → publickey-DioRydm4.mjs} +1 -1
- package/dist/esm/query-B48akte-.mjs +1 -0
- package/dist/esm/{received-4odTK5AJ.mjs → received-BFjAt453.mjs} +1 -1
- package/dist/esm/{secp256k1-DhrvBMbI.mjs → secp256k1-DbTX5WTS.mjs} +1 -1
- package/dist/esm/{secp256r1-BCaQWLGZ.mjs → secp256r1-tIVPNUMT.mjs} +1 -1
- package/dist/esm/{secure-storage-CJdIxkx3.d.mts → secure-storage-BT8ZocZk.d.mts} +1 -1
- package/dist/esm/service-Cd79DHgS.mjs +1 -0
- package/dist/esm/{storage-DGOllc0e.d.mts → storage-BRIn6pWr.d.mts} +3 -0
- package/dist/esm/transactions/index.d.mts +1 -1
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/{transactions-CkMcWBKS.mjs → transactions-BHqg-1Qx.mjs} +1 -1
- package/dist/esm/{util-BC-TmINX.mjs → util-CGcVewIM.mjs} +1 -1
- package/dist/esm/util-eN75N_r9.d.mts +60 -0
- package/dist/esm/utils/index.d.mts +2 -2
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils-n7rnVRy-.mjs +1 -0
- package/dist/esm/verify/index.d.mts +1 -1
- package/dist/esm/verify/index.mjs +1 -1
- package/dist/esm/w/call/allocation.d.mts +1 -1
- package/dist/esm/w/call/allocation.mjs +1 -1
- package/dist/esm/w/call/arbitration.d.mts +1 -1
- package/dist/esm/w/call/arbitration.mjs +1 -1
- package/dist/esm/w/call/base.d.mts +1 -1
- package/dist/esm/w/call/base.mjs +1 -1
- package/dist/esm/w/call/demand.d.mts +1 -1
- package/dist/esm/w/call/demand.mjs +1 -1
- package/dist/esm/w/call/guard.d.mts +1 -1
- package/dist/esm/w/call/guard.mjs +1 -1
- package/dist/esm/w/call/index.d.mts +2 -2
- package/dist/esm/w/call/index.mjs +1 -1
- package/dist/esm/w/call/machine.d.mts +1 -1
- package/dist/esm/w/call/machine.mjs +1 -1
- package/dist/esm/w/call/passport.d.mts +1 -1
- package/dist/esm/w/call/passport.mjs +1 -1
- package/dist/esm/w/call/payment.d.mts +1 -1
- package/dist/esm/w/call/payment.mjs +1 -1
- package/dist/esm/w/call/permission.d.mts +1 -1
- package/dist/esm/w/call/permission.mjs +1 -1
- package/dist/esm/w/call/progress.d.mts +1 -1
- package/dist/esm/w/call/progress.mjs +1 -1
- package/dist/esm/w/call/repository.d.mts +1 -1
- package/dist/esm/w/call/repository.mjs +1 -1
- package/dist/esm/w/call/reward.d.mts +1 -1
- package/dist/esm/w/call/reward.mjs +1 -1
- package/dist/esm/w/call/service.d.mts +1 -1
- package/dist/esm/w/call/service.mjs +1 -1
- package/dist/esm/w/call/treasury.d.mts +1 -1
- package/dist/esm/w/call/treasury.mjs +1 -1
- package/dist/esm/w/common.d.mts +2 -2
- package/dist/esm/w/common.mjs +1 -1
- package/dist/esm/w/index.d.mts +7 -7
- package/dist/esm/w/index.mjs +1 -1
- package/dist/esm/w/local/account.d.mts +2 -2
- package/dist/esm/w/local/account.mjs +1 -1
- package/dist/esm/w/local/cache.d.mts +1 -1
- package/dist/esm/w/local/cache.mjs +1 -1
- package/dist/esm/w/local/config.mjs +1 -1
- package/dist/esm/w/local/evm-account.d.mts +1 -1
- package/dist/esm/w/local/index.d.mts +7 -7
- package/dist/esm/w/local/index.mjs +1 -1
- package/dist/esm/w/local/local.mjs +1 -1
- package/dist/esm/w/local/secure-storage.d.mts +1 -1
- package/dist/esm/w/local/storage.d.mts +1 -1
- package/dist/esm/w/local/storage.mjs +1 -1
- package/dist/esm/w/local/token.d.mts +1 -1
- package/dist/esm/w/local/token.mjs +1 -1
- package/dist/esm/w/local/util.d.mts +2 -2
- package/dist/esm/w/local/util.mjs +1 -1
- package/dist/esm/w/local/wip.d.mts +1 -1
- package/dist/esm/w/local/wip.mjs +1 -1
- package/dist/esm/w/messenger/index.d.mts +1 -1
- package/dist/esm/w/messenger/index.mjs +1 -1
- package/dist/esm/w/messenger/messenger-api.d.mts +1 -1
- package/dist/esm/w/messenger/messenger-api.mjs +1 -1
- package/dist/esm/w/messenger/messenger.d.mts +1 -1
- package/dist/esm/w/messenger/messenger.mjs +1 -1
- package/dist/esm/w/messenger/reply.d.mts +1 -1
- package/dist/esm/w/messenger/storage.d.mts +1 -1
- package/dist/esm/w/messenger/types.d.mts +1 -1
- package/dist/esm/w/messenger/types.mjs +1 -1
- package/dist/esm/w/query/index.d.mts +2 -2
- package/dist/esm/w/query/index.mjs +1 -1
- package/dist/esm/w/query/object.d.mts +2 -2
- package/dist/esm/w/query/object.mjs +1 -1
- package/dist/esm/{w-Dp4KXRLj.mjs → w-p-VgMmaV.mjs} +1 -1
- package/dist/esm/{wip-NbB1ChbI.d.mts → wip-Cq6OttmQ.d.mts} +1 -1
- package/package.json +1 -1
- package/dist/esm/Transaction-CzqJDezj.mjs +0 -1
- package/dist/esm/arb-UmbIfnyY.mjs +0 -1
- package/dist/esm/base-BzTUCV2r.mjs +0 -1
- package/dist/esm/call-D7-YH2s4.mjs +0 -1
- package/dist/esm/graphql-Bf8yuSuF.mjs +0 -1
- package/dist/esm/grpc-B8ovObdJ.mjs +0 -1
- package/dist/esm/messenger-api-DSPJm9_J.mjs +0 -1
- package/dist/esm/object-Dma1VY-1.mjs +0 -1
- package/dist/esm/passport-CQFR2dfo.mjs +0 -1
- package/dist/esm/query-cAnGkFPh.mjs +0 -1
- package/dist/esm/service-B3jMoJ_p.mjs +0 -1
- package/dist/esm/util-7R_TK4HK.d.mts +0 -18
- package/dist/esm/utils-npJYSbqk.mjs +0 -1
|
@@ -11,6 +11,8 @@ interface IStorage {
|
|
|
11
11
|
get(key: string): Promise<string | undefined>;
|
|
12
12
|
getMany(keys: string[]): Promise<(string | undefined)[]>;
|
|
13
13
|
del(key: string): Promise<void>;
|
|
14
|
+
/** Delete every cache row whose key starts with `prefix`. */
|
|
15
|
+
delByPrefix(prefix: string): Promise<void>;
|
|
14
16
|
clear(): Promise<void>;
|
|
15
17
|
}
|
|
16
18
|
interface IAccountStorage {
|
|
@@ -32,6 +34,7 @@ declare class SQLiteStorage implements IStorage {
|
|
|
32
34
|
value: string;
|
|
33
35
|
}[]): Promise<void>;
|
|
34
36
|
del(key: string): Promise<void>;
|
|
37
|
+
delByPrefix(prefix: string): Promise<void>;
|
|
35
38
|
/**
|
|
36
39
|
* List cache rows, optionally filtered by key prefix.
|
|
37
40
|
* Used by consumers that need enumeration (e.g. persona store listing all
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as TransactionObjectInput,
|
|
1
|
+
import { $ as TransactionObjectInput, Bx as GasData, Fx as SerializedTransactionDataV2, Hx as TransactionData, Ix as SerializedTransactionDataV1, Lx as Argument, Px as TransactionDataBuilder, Q as TransactionObjectArgument, Rx as CallArg, Vx as ObjectRef, Z as Transaction, _ as SerialTransactionExecutor, at as Inputs, b as getPureBcsSchema, ct as TransactionInput, et as TransactionResult, f as isArgument, g as ParallelTransactionExecutorOptions, h as ParallelTransactionExecutor, it as TransactionPlugin, lt as UpgradePolicy, m as coinWithBalance, nt as BuildTransactionOptions, ot as TransactionArgument, p as Arguments, rt as SerializeTransactionOptions, st as TransactionCommands, tt as isTransaction, v as AsyncCache, x as normalizedTypeToMoveTypeSignature, y as ObjectCache, zx as Command } from "../index-BB-qrJhQ.mjs";
|
|
2
2
|
export { type Argument, Arguments, AsyncCache, type BuildTransactionOptions, type CallArg, type Command, type GasData, Inputs, ObjectCache, type ObjectRef, ParallelTransactionExecutor, type ParallelTransactionExecutorOptions, SerialTransactionExecutor, type SerializeTransactionOptions, type SerializedTransactionDataV1, type SerializedTransactionDataV2, Transaction, type TransactionArgument, TransactionCommands, type TransactionData, TransactionDataBuilder, type TransactionInput, type TransactionObjectArgument, type TransactionObjectInput, type TransactionPlugin, type TransactionResult, UpgradePolicy, coinWithBalance, getPureBcsSchema, isArgument, isTransaction, normalizedTypeToMoveTypeSignature };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as a53a,c as a53b,d as a53c,f as a53d,g as a53e,l as a53f,n as a53g,r as a53h,t as a53i,u as a53j}from'../Transaction-
|
|
1
|
+
import{_ as a53a,c as a53b,d as a53c,f as a53d,g as a53e,l as a53f,n as a53g,r as a53h,t as a53i,u as a53j}from'../Transaction-CClYcZIE.mjs';import{a as a53k,i as a53l,n as a53m,r as a53n,t as a53o}from'../transactions-BHqg-1Qx.mjs';export{a53o as Arguments,a53l as AsyncCache,a53j as Inputs,a53k as ObjectCache,a53m as ParallelTransactionExecutor,a53n as SerialTransactionExecutor,a53i as Transaction,a53c as TransactionCommands,a53e as TransactionDataBuilder,a53d as UpgradePolicy,a53h as coinWithBalance,a53b as getPureBcsSchema,a53a as isArgument,a53g as isTransaction,a53f as normalizedTypeToMoveTypeSignature};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a54a}from'./wow-types-DcqbnAaK.mjs';import{o as a54b}from'./bcs-BrmSFFhn.mjs';import{a as a54c,g as a54d,i as a54e,n as a54f,s as a54g,t as a54h}from'./Transaction-CzqJDezj.mjs';import{promiseWithResolvers}from'@mysten/utils';var AsyncCache=class{async['getObject'](a){const [b,c]=await Promise['all']([this['get']('OwnedObject',a),this['get']('SharedOrImmutableObject',a)]);return b??c??null;}async['getObjects'](a){return Promise['all'](a['map'](b=>this['getObject'](b)));}async['addObject'](a){if(a['owner'])await this['set']('OwnedObject',a['objectId'],a);else await this['set']('SharedOrImmutableObject',a['objectId'],a);return a;}async['addObjects'](a){await Promise['all'](a['map'](async b=>this['addObject'](b)));}async['deleteObject'](a){await Promise['all']([this['delete']('OwnedObject',a),this['delete']('SharedOrImmutableObject',a)]);}async['deleteObjects'](a){await Promise['all'](a['map'](b=>this['deleteObject'](b)));}async['getMoveFunctionDefinition'](a){const b=a54a(a['package'])+'::'+a['module']+'::'+a['function'];return this['get']('MoveFunction',b);}async['addMoveFunctionDefinition'](a){const b=a54a(a['package']),c=b+'::'+a['module']+'::'+a['function'],d={...a,'package':b};return await this['set']('MoveFunction',c,d),d;}async['deleteMoveFunctionDefinition'](a){const b=a54a(a['package'])+'::'+a['module']+'::'+a['function'];await this['delete']('MoveFunction',b);}async['getCustom'](a){return this['get']('Custom',a);}async['setCustom'](a,b){return this['set']('Custom',a,b);}async['deleteCustom'](a){return this['delete']('Custom',a);}},InMemoryCache=class extends AsyncCache{#caches={'OwnedObject':new Map(),'SharedOrImmutableObject':new Map(),'MoveFunction':new Map(),'Custom':new Map()};async['get'](a,b){return this.#caches[a]['get'](b)??null;}async['set'](a,b,c){this.#caches[a]['set'](b,c);}async['delete'](a,b){this.#caches[a]['delete'](b);}async['clear'](a){if(a)this.#caches[a]['clear']();else{for(const b of Object['values'](this.#caches))b['clear']();}}},ObjectCache=class{#cache;#onEffects;constructor({cache:cache=new InMemoryCache(),onEffects:a}){this.#cache=cache,this.#onEffects=a;}['asPlugin'](){return async(a,b,c)=>{const d=a['inputs']['filter'](g=>g['UnresolvedObject'])['map'](g=>g['UnresolvedObject']['objectId']),e=(await this.#cache['getObjects'](d))['filter'](g=>g!==null),f=new Map(e['map'](g=>[g['objectId'],g]));for(const g of a['inputs']){if(!g['UnresolvedObject'])continue;const h=f['get'](g['UnresolvedObject']['objectId']);if(!h)continue;if(h['initialSharedVersion']&&!g['UnresolvedObject']['initialSharedVersion'])g['UnresolvedObject']['initialSharedVersion']=h['initialSharedVersion'];else{if(h['version']&&!g['UnresolvedObject']['version'])g['UnresolvedObject']['version']=h['version'];if(h['digest']&&!g['UnresolvedObject']['digest'])g['UnresolvedObject']['digest']=h['digest'];}}await Promise['all'](a['commands']['map'](async i=>{if(i['MoveCall']){const j=await this['getMoveFunctionDefinition']({'package':i['MoveCall']['package'],'module':i['MoveCall']['module'],'function':i['MoveCall']['function']});if(j)i['MoveCall']['_argumentTypes']=j['parameters'];}})),await c(),await Promise['all'](a['commands']['map'](async i=>{if(i['MoveCall']?.['_argumentTypes'])await this.#cache['addMoveFunctionDefinition']({'package':i['MoveCall']['package'],'module':i['MoveCall']['module'],'function':i['MoveCall']['function'],'parameters':i['MoveCall']['_argumentTypes']});}));};}async['clear'](){await this.#cache['clear']();}async['getMoveFunctionDefinition'](a){return this.#cache['getMoveFunctionDefinition'](a);}async['getObjects'](a){return this.#cache['getObjects'](a);}async['deleteObjects'](a){return this.#cache['deleteObjects'](a);}async['clearOwnedObjects'](){await this.#cache['clear']('OwnedObject');}async['clearCustom'](){await this.#cache['clear']('Custom');}async['getCustom'](a){return this.#cache['getCustom'](a);}async['setCustom'](a,b){return this.#cache['setCustom'](a,b);}async['deleteCustom'](a){return this.#cache['deleteCustom'](a);}async['applyEffects'](a){if(!a['V2'])throw new Error('Unsupported\x20transaction\x20effects\x20version\x20'+a['$kind']);const {lamportVersion:b,changedObjects:c}=a['V2'],d=[],e=[];c['forEach'](([f,g])=>{if(g['outputState']['NotExist'])d['push'](f);else{if(g['outputState']['ObjectWrite']){const [h,i]=g['outputState']['ObjectWrite'];e['push']({'objectId':f,'digest':h,'version':b,'owner':i['AddressOwner']??i['ObjectOwner']??null,'initialSharedVersion':i['Shared']?.['initialSharedVersion']??null});}}}),await Promise['all']([this.#cache['addObjects'](e),this.#cache['deleteObjects'](d),this.#onEffects?.(a)]);}},CachingTransactionExecutor=class{#client;#lastDigest=null;constructor({client:a,...b}){this.#client=a,this['cache']=new ObjectCache(b);}async['reset'](){await Promise['all']([this['cache']['clearOwnedObjects'](),this['cache']['clearCustom'](),this['waitForLastTransaction']()]);}async['buildTransaction']({transaction:a,...b}){return a['addBuildPlugin'](this['cache']['asPlugin']()),a['addBuildPlugin'](a54g),a['build']({'client':this.#client,...b});}async['executeTransaction']({transaction:a,signatures:b,include:c}){const d=a54f(a)?await this['buildTransaction']({'transaction':a}):a,e=await this.#client['core']['executeTransaction']({'transaction':d,'signatures':b,'include':{...c,'effects':!![]}}),f=e['$kind']==='Transaction'?e['Transaction']:e['FailedTransaction'];if(f['effects']?.['bcs']){const g=a54b['TransactionEffects']['parse'](f['effects']['bcs']);await this['applyEffects'](g);}return e;}async['signAndExecuteTransaction']({include:a,transaction:b,signer:c}){b['setSenderIfNotSet'](c['toWowAddress']());const d=await this['buildTransaction']({'transaction':b}),{signature:e}=await c['signTransaction'](d);return this['executeTransaction']({'transaction':d,'signatures':[e],'include':a});}async['applyEffects'](a){this.#lastDigest=a['V2']?.['transactionDigest']??null,await this['cache']['applyEffects'](a);}async['waitForLastTransaction'](){this.#lastDigest&&(await this.#client['core']['waitForTransaction']({'digest':this.#lastDigest}),this.#lastDigest=null);}},SerialQueue=class{#queue=[];async['runTask'](a){return new Promise((b,c)=>{this.#queue['push'](()=>{a()['finally'](()=>{this.#queue['shift']();if(this.#queue['length']>0x0)this.#queue[0x0]();})['then'](b,c);});if(this.#queue['length']===0x1)this.#queue[0x0]();});}},ParallelQueue=class{#queue;constructor(a){this.#queue=[],this['activeTasks']=0x0,this['maxTasks']=a;}['runTask'](a){return new Promise((b,c)=>{if(this['activeTasks']<this['maxTasks'])this['activeTasks']++,a()['finally'](()=>{if(this.#queue['length']>0x0)this.#queue['shift']()();else this['activeTasks']--;})['then'](b,c);else this.#queue['push'](()=>{a()['finally'](()=>{if(this.#queue['length']>0x0)this.#queue['shift']()();else this['activeTasks']--;})['then'](b,c);});});}};const EPOCH_BOUNDARY_WINDOW$1=0xea60;var SerialTransactionExecutor=class{#queue=new SerialQueue();#signer;#client;#cache;#defaultGasBudget;#gasMode;#epochInfo=null;#epochInfoPromise=null;constructor(a){const {signer:b,defaultGasBudget:defaultGasBudget=0x2faf080n,client:c,cache:d}=a;this.#signer=b,this.#client=c,this.#defaultGasBudget=defaultGasBudget,this.#gasMode=a['gasMode']??'coins',this.#cache=new CachingTransactionExecutor({'client':c,'cache':d,'onEffects':e=>this.#cacheGasCoin(e)});}async['applyEffects'](a){return this.#cache['applyEffects'](a);}#cacheGasCoin=async a=>{if(this.#gasMode==='addressBalance'||!a['V2'])return;const b=getGasCoinFromEffects(a)['ref'];if(b)this.#cache['cache']['setCustom']('gasCoin',b);else this.#cache['cache']['deleteCustom']('gasCoin');};async['buildTransaction'](a){return this.#queue['runTask'](()=>this.#buildTransaction(a));}#buildTransaction=async a=>{await a['prepareForSerialization']({'client':this.#client,'supportedIntents':['CoinWithBalance']});const b=a54h['from'](a);if(this.#gasMode==='addressBalance')b['setGasPayment']([]),b['setExpiration'](await this.#getValidDuringExpiration());else{const c=await this.#cache['cache']['getCustom']('gasCoin');if(c)b['setGasPayment']([c]);}return b['setGasBudgetIfNotSet'](this.#defaultGasBudget),b['setSenderIfNotSet'](this.#signer['toWowAddress']()),this.#cache['buildTransaction']({'transaction':b});};async #getValidDuringExpiration(){await this.#ensureEpochInfo();const a=BigInt(this.#epochInfo['epoch']);return{'ValidDuring':{'minEpoch':String(a),'maxEpoch':String(a+0x1n),'minTimestamp':null,'maxTimestamp':null,'chain':this.#epochInfo['chainIdentifier'],'nonce':Math['random']()*0x100000000>>>0x0}};}async #ensureEpochInfo(){if(this.#epochInfo&&this.#epochInfo['expiration']-EPOCH_BOUNDARY_WINDOW$1-Date['now']()>0x0)return;if(this.#epochInfoPromise){await this.#epochInfoPromise;return;}this.#epochInfoPromise=this.#fetchEpochInfo();try{await this.#epochInfoPromise;}finally{this.#epochInfoPromise=null;}}async #fetchEpochInfo(){const [{systemState:a},{chainIdentifier:b}]=await Promise['all']([this.#client['core']['getCurrentSystemState'](),this.#client['core']['getChainIdentifier']()]);this.#epochInfo={'epoch':a['epoch'],'expiration':Number(a['epochStartTimestampMs'])+Number(a['parameters']['epochDurationMs']),'chainIdentifier':b};}['resetCache'](){return this.#cache['reset']();}['waitForLastTransaction'](){return this.#cache['waitForLastTransaction']();}['executeTransaction'](a,b,c=[]){return this.#queue['runTask'](async()=>{const d=a54f(a)?await this.#buildTransaction(a):a,{signature:e}=await this.#signer['signTransaction'](d);return this.#cache['executeTransaction']({'signatures':[e,...c],'transaction':d,'include':b})['catch'](async f=>{await this['resetCache']();throw f;});});}};function getGasCoinFromEffects(a){if(!a['V2'])throw new Error('Unexpected\x20effects\x20version');const b=a['V2']['changedObjects'][a['V2']['gasObjectIndex']];if(!b)throw new Error('Gas\x20object\x20not\x20found\x20in\x20effects');const [c,{outputState:d}]=b;if(!d['ObjectWrite'])throw new Error('Unexpected\x20gas\x20object\x20state');const [e,f]=d['ObjectWrite'];return{'ref':{'objectId':c,'digest':e,'version':a['V2']['lamportVersion']},'owner':f['AddressOwner']||f['ObjectOwner']};}const PARALLEL_EXECUTOR_DEFAULTS={'coinBatchSize':0x14,'initialCoinBalance':0xbebc200n,'minimumCoinBalance':0x2faf080n,'maxPoolSize':0x32},EPOCH_BOUNDARY_WINDOW=0xea60;var ParallelTransactionExecutor=class{#signer;#client;#gasMode;#coinBatchSize;#initialCoinBalance;#minimumCoinBalance;#defaultGasBudget;#maxPoolSize;#sourceCoins;#coinPool=[];#cache;#objectIdQueues=new Map();#buildQueue=new SerialQueue();#executeQueue;#lastDigest=null;#cacheLock=null;#pendingTransactions=0x0;#epochInfo=null;#epochInfoPromise=null;constructor(a){this.#signer=a['signer'],this.#client=a['client'],this.#gasMode=a['gasMode']??'coins';if(this.#gasMode==='coins'){const b=a;this.#coinBatchSize=b['coinBatchSize']??PARALLEL_EXECUTOR_DEFAULTS['coinBatchSize'],this.#initialCoinBalance=b['initialCoinBalance']??PARALLEL_EXECUTOR_DEFAULTS['initialCoinBalance'],this.#minimumCoinBalance=b['minimumCoinBalance']??PARALLEL_EXECUTOR_DEFAULTS['minimumCoinBalance'],this.#sourceCoins=b['sourceCoins']?new Map(b['sourceCoins']['map'](c=>[c,null])):null;}else this.#coinBatchSize=0x0,this.#initialCoinBalance=0x0n,this.#minimumCoinBalance=PARALLEL_EXECUTOR_DEFAULTS['minimumCoinBalance'],this.#sourceCoins=null;this.#defaultGasBudget=a['defaultGasBudget']??this.#minimumCoinBalance,this.#maxPoolSize=a['maxPoolSize']??PARALLEL_EXECUTOR_DEFAULTS['maxPoolSize'],this.#cache=new CachingTransactionExecutor({'client':a['client'],'cache':a['cache']}),this.#executeQueue=new ParallelQueue(this.#maxPoolSize);}['resetCache'](){return this.#epochInfo=null,this.#updateCache(()=>this.#cache['reset']());}async['waitForLastTransaction'](){await this.#updateCache(()=>this.#waitForLastDigest());}async['executeTransaction'](a,b,c=[]){const {promise:d,resolve:e,reject:f}=promiseWithResolvers(),g=await this.#getUsedObjects(a),h=()=>{this.#executeQueue['runTask'](()=>{return this.#execute(a,g,b,c)['then'](e,f);});},i=new Set();g['forEach'](j=>{if(this.#objectIdQueues['get'](j))i['add'](j),this.#objectIdQueues['get'](j)['push'](()=>{i['delete'](j);if(i['size']===0x0)h();});else this.#objectIdQueues['set'](j,[]);});if(i['size']===0x0)h();return d;}async #getUsedObjects(a){const b=new Set();let c=![];return a['addSerializationPlugin'](async(d,e,f)=>{await f();if(c)return;c=!![],d['inputs']['forEach'](g=>{if(g['Object']?.['ImmOrOwnedObject']?.['objectId'])b['add'](g['Object']['ImmOrOwnedObject']['objectId']);else{if(g['Object']?.['Receiving']?.['objectId'])b['add'](g['Object']['Receiving']['objectId']);else{if(g['UnresolvedObject']?.['objectId']&&!g['UnresolvedObject']['initialSharedVersion'])b['add'](g['UnresolvedObject']['objectId']);}}});}),await a['prepareForSerialization']({'client':this.#client}),b;}async #execute(a,b,c,d=[]){let e=null;try{a['setSenderIfNotSet'](this.#signer['toWowAddress']()),await this.#buildQueue['runTask'](async()=>{if(!a['getData']()['gasData']['price'])a['setGasPrice'](await this.#getGasPrice());a['setGasBudgetIfNotSet'](this.#defaultGasBudget),await this.#updateCache(),this.#pendingTransactions++,this.#gasMode==='addressBalance'?(a['setGasPayment']([]),a['setExpiration'](await this.#getValidDuringExpiration())):(e=await this.#getGasCoin(),a['setGasPayment']([{'objectId':e['id'],'version':e['version'],'digest':e['digest']}])),await this.#cache['buildTransaction']({'transaction':a,'onlyTransactionKind':!![]});});const f=await a['build']({'client':this.#client}),{signature:g}=await this.#signer['signTransaction'](f),h=await this.#cache['executeTransaction']({'transaction':f,'signatures':[g,...d],'include':c}),i=h['$kind']==='Transaction'?h['Transaction']:h['FailedTransaction'],j=i['effects'],k=j['gasObject'],l=j['gasUsed'];if(e&&l&&k){const m=e;if((k['outputOwner']?.['AddressOwner']??k['outputOwner']?.['ObjectOwner'])===this.#signer['toWowAddress']()){const n=BigInt(l['computationCost'])+BigInt(l['storageCost'])-BigInt(l['storageRebate']),o=m['balance']-n;let p=![];new a54d(a['getData']())['mapArguments'](r=>{if(r['$kind']==='GasCoin')p=!![];return r;});const q={'objectId':k['objectId'],'version':k['outputVersion'],'digest':k['outputDigest']};if(!p&&o>=this.#minimumCoinBalance)this.#coinPool['push']({'id':q['objectId'],'version':q['version'],'digest':q['digest'],'balance':o});else{if(!this.#sourceCoins)this.#sourceCoins=new Map();this.#sourceCoins['set'](q['objectId'],q);}}}return this.#lastDigest=i['digest'],h;}catch(r){if(e){if(!this.#sourceCoins)this.#sourceCoins=new Map();this.#sourceCoins['set'](e['id'],null);}await this.#updateCache(async()=>{await Promise['all']([this.#cache['cache']['deleteObjects']([...b]),this.#waitForLastDigest()]);});throw r;}finally{b['forEach'](s=>{const t=this.#objectIdQueues['get'](s);if(t&&t['length']>0x0)t['shift']()();else{if(t)this.#objectIdQueues['delete'](s);}}),this.#pendingTransactions--;}}async #updateCache(a){if(this.#cacheLock)await this.#cacheLock;this.#cacheLock=a?.()['then'](()=>{this.#cacheLock=null;},()=>{})??null;}async #waitForLastDigest(){const a=this.#lastDigest;a&&(this.#lastDigest=null,await this.#client['core']['waitForTransaction']({'digest':a}));}async #getGasCoin(){if(this.#coinPool['length']===0x0&&this.#pendingTransactions<=this.#maxPoolSize)await this.#refillCoinPool();if(this.#coinPool['length']===0x0)throw new Error('No\x20coins\x20available');return this.#coinPool['shift']();}async #getGasPrice(){return await this.#ensureEpochInfo(),this.#epochInfo['price'];}async #getValidDuringExpiration(){await this.#ensureEpochInfo();const a=BigInt(this.#epochInfo['epoch']);return{'ValidDuring':{'minEpoch':String(a),'maxEpoch':String(a+0x1n),'minTimestamp':null,'maxTimestamp':null,'chain':this.#epochInfo['chainIdentifier'],'nonce':Math['random']()*0x100000000>>>0x0}};}async #ensureEpochInfo(){if(this.#epochInfo&&this.#epochInfo['expiration']-EPOCH_BOUNDARY_WINDOW-Date['now']()>0x0)return;if(this.#epochInfoPromise){await this.#epochInfoPromise;return;}this.#epochInfoPromise=this.#fetchEpochInfo();try{await this.#epochInfoPromise;}finally{this.#epochInfoPromise=null;}}async #fetchEpochInfo(){const [{systemState:a},{chainIdentifier:b}]=await Promise['all']([this.#client['core']['getCurrentSystemState'](),this.#client['core']['getChainIdentifier']()]);this.#epochInfo={'epoch':a['epoch'],'price':BigInt(a['referenceGasPrice']),'expiration':Number(a['epochStartTimestampMs'])+Number(a['parameters']['epochDurationMs']),'chainIdentifier':b};}async #refillCoinPool(){const a=Math['min'](this.#coinBatchSize,this.#maxPoolSize-(this.#coinPool['length']+this.#pendingTransactions)+0x1);if(a===0x0)return;const b=new a54h(),c=this.#signer['toWowAddress']();b['setSender'](c);if(this.#sourceCoins){const n=[],o=[];for(const [p,q]of this.#sourceCoins)if(q)n['push'](q);else o['push'](p);if(o['length']>0x0){const {objects:r}=await this.#client['core']['getObjects']({'objectIds':o});n['push'](...r['filter'](s=>!(s instanceof Error))['map'](s=>({'objectId':s['objectId'],'version':s['version'],'digest':s['digest']})));}b['setGasPayment'](n),this.#sourceCoins=new Map();}const d=new Array(a)['fill'](this.#initialCoinBalance),e=b['splitCoins'](b['gas'],d),f=[];for(let s=0x0;s<d['length'];s++)f['push'](e[s]);b['transferObjects'](f,c),await this['waitForLastTransaction'](),b['addBuildPlugin'](a54g);const g=await b['build']({'client':this.#client}),{signature:h}=await this.#signer['signTransaction'](g),j=await this.#client['core']['executeTransaction']({'transaction':g,'signatures':[h],'include':{'effects':!![]}}),k=j['$kind']==='Transaction'?j['Transaction']:j['FailedTransaction'],l=k['effects'];l['changedObjects']['forEach'](t=>{if(t['objectId']===l['gasObject']?.['objectId']||t['outputState']!=='ObjectWrite')return;this.#coinPool['push']({'id':t['objectId'],'version':t['outputVersion'],'digest':t['outputDigest'],'balance':BigInt(this.#initialCoinBalance)});});if(!this.#sourceCoins)this.#sourceCoins=new Map();const m=l['gasObject'];this.#sourceCoins['set'](m['objectId'],{'objectId':m['objectId'],'version':m['outputVersion'],'digest':m['outputDigest']}),await this.#client['core']['waitForTransaction']({'digest':k['digest']});}};const Arguments={'pure':a54e(a=>b=>b['pure'](a)),'object':a54c(a=>b=>b['object'](a)),'sharedObjectRef':(...a)=>b=>b['sharedObjectRef'](...a),'objectRef':(...a)=>b=>b['objectRef'](...a),'receivingRef':(...a)=>b=>b['receivingRef'](...a)};export{ObjectCache as a,AsyncCache as i,ParallelTransactionExecutor as n,SerialTransactionExecutor as r,Arguments as t};
|
|
1
|
+
import{c as a54a}from'./wow-types-DcqbnAaK.mjs';import{o as a54b}from'./bcs-BrmSFFhn.mjs';import{a as a54c,g as a54d,i as a54e,n as a54f,s as a54g,t as a54h}from'./Transaction-CClYcZIE.mjs';import{promiseWithResolvers}from'@mysten/utils';var AsyncCache=class{async['getObject'](a){const [b,c]=await Promise['all']([this['get']('OwnedObject',a),this['get']('SharedOrImmutableObject',a)]);return b??c??null;}async['getObjects'](a){return Promise['all'](a['map'](b=>this['getObject'](b)));}async['addObject'](a){if(a['owner'])await this['set']('OwnedObject',a['objectId'],a);else await this['set']('SharedOrImmutableObject',a['objectId'],a);return a;}async['addObjects'](a){await Promise['all'](a['map'](async b=>this['addObject'](b)));}async['deleteObject'](a){await Promise['all']([this['delete']('OwnedObject',a),this['delete']('SharedOrImmutableObject',a)]);}async['deleteObjects'](a){await Promise['all'](a['map'](b=>this['deleteObject'](b)));}async['getMoveFunctionDefinition'](a){const b=a54a(a['package'])+'::'+a['module']+'::'+a['function'];return this['get']('MoveFunction',b);}async['addMoveFunctionDefinition'](a){const b=a54a(a['package']),c=b+'::'+a['module']+'::'+a['function'],d={...a,'package':b};return await this['set']('MoveFunction',c,d),d;}async['deleteMoveFunctionDefinition'](a){const b=a54a(a['package'])+'::'+a['module']+'::'+a['function'];await this['delete']('MoveFunction',b);}async['getCustom'](a){return this['get']('Custom',a);}async['setCustom'](a,b){return this['set']('Custom',a,b);}async['deleteCustom'](a){return this['delete']('Custom',a);}},InMemoryCache=class extends AsyncCache{#caches={'OwnedObject':new Map(),'SharedOrImmutableObject':new Map(),'MoveFunction':new Map(),'Custom':new Map()};async['get'](a,b){return this.#caches[a]['get'](b)??null;}async['set'](a,b,c){this.#caches[a]['set'](b,c);}async['delete'](a,b){this.#caches[a]['delete'](b);}async['clear'](a){if(a)this.#caches[a]['clear']();else{for(const b of Object['values'](this.#caches))b['clear']();}}},ObjectCache=class{#cache;#onEffects;constructor({cache:cache=new InMemoryCache(),onEffects:a}){this.#cache=cache,this.#onEffects=a;}['asPlugin'](){return async(a,b,c)=>{const d=a['inputs']['filter'](g=>g['UnresolvedObject'])['map'](g=>g['UnresolvedObject']['objectId']),e=(await this.#cache['getObjects'](d))['filter'](g=>g!==null),f=new Map(e['map'](g=>[g['objectId'],g]));for(const g of a['inputs']){if(!g['UnresolvedObject'])continue;const h=f['get'](g['UnresolvedObject']['objectId']);if(!h)continue;if(h['initialSharedVersion']&&!g['UnresolvedObject']['initialSharedVersion'])g['UnresolvedObject']['initialSharedVersion']=h['initialSharedVersion'];else{if(h['version']&&!g['UnresolvedObject']['version'])g['UnresolvedObject']['version']=h['version'];if(h['digest']&&!g['UnresolvedObject']['digest'])g['UnresolvedObject']['digest']=h['digest'];}}await Promise['all'](a['commands']['map'](async i=>{if(i['MoveCall']){const j=await this['getMoveFunctionDefinition']({'package':i['MoveCall']['package'],'module':i['MoveCall']['module'],'function':i['MoveCall']['function']});if(j)i['MoveCall']['_argumentTypes']=j['parameters'];}})),await c(),await Promise['all'](a['commands']['map'](async i=>{if(i['MoveCall']?.['_argumentTypes'])await this.#cache['addMoveFunctionDefinition']({'package':i['MoveCall']['package'],'module':i['MoveCall']['module'],'function':i['MoveCall']['function'],'parameters':i['MoveCall']['_argumentTypes']});}));};}async['clear'](){await this.#cache['clear']();}async['getMoveFunctionDefinition'](a){return this.#cache['getMoveFunctionDefinition'](a);}async['getObjects'](a){return this.#cache['getObjects'](a);}async['deleteObjects'](a){return this.#cache['deleteObjects'](a);}async['clearOwnedObjects'](){await this.#cache['clear']('OwnedObject');}async['clearCustom'](){await this.#cache['clear']('Custom');}async['getCustom'](a){return this.#cache['getCustom'](a);}async['setCustom'](a,b){return this.#cache['setCustom'](a,b);}async['deleteCustom'](a){return this.#cache['deleteCustom'](a);}async['applyEffects'](a){if(!a['V2'])throw new Error('Unsupported\x20transaction\x20effects\x20version\x20'+a['$kind']);const {lamportVersion:b,changedObjects:c}=a['V2'],d=[],e=[];c['forEach'](([f,g])=>{if(g['outputState']['NotExist'])d['push'](f);else{if(g['outputState']['ObjectWrite']){const [h,i]=g['outputState']['ObjectWrite'];e['push']({'objectId':f,'digest':h,'version':b,'owner':i['AddressOwner']??i['ObjectOwner']??null,'initialSharedVersion':i['Shared']?.['initialSharedVersion']??null});}}}),await Promise['all']([this.#cache['addObjects'](e),this.#cache['deleteObjects'](d),this.#onEffects?.(a)]);}},CachingTransactionExecutor=class{#client;#lastDigest=null;constructor({client:a,...b}){this.#client=a,this['cache']=new ObjectCache(b);}async['reset'](){await Promise['all']([this['cache']['clearOwnedObjects'](),this['cache']['clearCustom'](),this['waitForLastTransaction']()]);}async['buildTransaction']({transaction:a,...b}){return a['addBuildPlugin'](this['cache']['asPlugin']()),a['addBuildPlugin'](a54g),a['build']({'client':this.#client,...b});}async['executeTransaction']({transaction:a,signatures:b,include:c}){const d=a54f(a)?await this['buildTransaction']({'transaction':a}):a,e=await this.#client['core']['executeTransaction']({'transaction':d,'signatures':b,'include':{...c,'effects':!![]}}),f=e['$kind']==='Transaction'?e['Transaction']:e['FailedTransaction'];if(f['effects']?.['bcs']){const g=a54b['TransactionEffects']['parse'](f['effects']['bcs']);await this['applyEffects'](g);}return e;}async['signAndExecuteTransaction']({include:a,transaction:b,signer:c}){b['setSenderIfNotSet'](c['toWowAddress']());const d=await this['buildTransaction']({'transaction':b}),{signature:e}=await c['signTransaction'](d);return this['executeTransaction']({'transaction':d,'signatures':[e],'include':a});}async['applyEffects'](a){this.#lastDigest=a['V2']?.['transactionDigest']??null,await this['cache']['applyEffects'](a);}async['waitForLastTransaction'](){this.#lastDigest&&(await this.#client['core']['waitForTransaction']({'digest':this.#lastDigest}),this.#lastDigest=null);}},SerialQueue=class{#queue=[];async['runTask'](a){return new Promise((b,c)=>{this.#queue['push'](()=>{a()['finally'](()=>{this.#queue['shift']();if(this.#queue['length']>0x0)this.#queue[0x0]();})['then'](b,c);});if(this.#queue['length']===0x1)this.#queue[0x0]();});}},ParallelQueue=class{#queue;constructor(a){this.#queue=[],this['activeTasks']=0x0,this['maxTasks']=a;}['runTask'](a){return new Promise((b,c)=>{if(this['activeTasks']<this['maxTasks'])this['activeTasks']++,a()['finally'](()=>{if(this.#queue['length']>0x0)this.#queue['shift']()();else this['activeTasks']--;})['then'](b,c);else this.#queue['push'](()=>{a()['finally'](()=>{if(this.#queue['length']>0x0)this.#queue['shift']()();else this['activeTasks']--;})['then'](b,c);});});}};const EPOCH_BOUNDARY_WINDOW$1=0xea60;var SerialTransactionExecutor=class{#queue=new SerialQueue();#signer;#client;#cache;#defaultGasBudget;#gasMode;#epochInfo=null;#epochInfoPromise=null;constructor(a){const {signer:b,defaultGasBudget:defaultGasBudget=0x2faf080n,client:c,cache:d}=a;this.#signer=b,this.#client=c,this.#defaultGasBudget=defaultGasBudget,this.#gasMode=a['gasMode']??'coins',this.#cache=new CachingTransactionExecutor({'client':c,'cache':d,'onEffects':e=>this.#cacheGasCoin(e)});}async['applyEffects'](a){return this.#cache['applyEffects'](a);}#cacheGasCoin=async a=>{if(this.#gasMode==='addressBalance'||!a['V2'])return;const b=getGasCoinFromEffects(a)['ref'];if(b)this.#cache['cache']['setCustom']('gasCoin',b);else this.#cache['cache']['deleteCustom']('gasCoin');};async['buildTransaction'](a){return this.#queue['runTask'](()=>this.#buildTransaction(a));}#buildTransaction=async a=>{await a['prepareForSerialization']({'client':this.#client,'supportedIntents':['CoinWithBalance']});const b=a54h['from'](a);if(this.#gasMode==='addressBalance')b['setGasPayment']([]),b['setExpiration'](await this.#getValidDuringExpiration());else{const c=await this.#cache['cache']['getCustom']('gasCoin');if(c)b['setGasPayment']([c]);}return b['setGasBudgetIfNotSet'](this.#defaultGasBudget),b['setSenderIfNotSet'](this.#signer['toWowAddress']()),this.#cache['buildTransaction']({'transaction':b});};async #getValidDuringExpiration(){await this.#ensureEpochInfo();const a=BigInt(this.#epochInfo['epoch']);return{'ValidDuring':{'minEpoch':String(a),'maxEpoch':String(a+0x1n),'minTimestamp':null,'maxTimestamp':null,'chain':this.#epochInfo['chainIdentifier'],'nonce':Math['random']()*0x100000000>>>0x0}};}async #ensureEpochInfo(){if(this.#epochInfo&&this.#epochInfo['expiration']-EPOCH_BOUNDARY_WINDOW$1-Date['now']()>0x0)return;if(this.#epochInfoPromise){await this.#epochInfoPromise;return;}this.#epochInfoPromise=this.#fetchEpochInfo();try{await this.#epochInfoPromise;}finally{this.#epochInfoPromise=null;}}async #fetchEpochInfo(){const [{systemState:a},{chainIdentifier:b}]=await Promise['all']([this.#client['core']['getCurrentSystemState'](),this.#client['core']['getChainIdentifier']()]);this.#epochInfo={'epoch':a['epoch'],'expiration':Number(a['epochStartTimestampMs'])+Number(a['parameters']['epochDurationMs']),'chainIdentifier':b};}['resetCache'](){return this.#cache['reset']();}['waitForLastTransaction'](){return this.#cache['waitForLastTransaction']();}['executeTransaction'](a,b,c=[]){return this.#queue['runTask'](async()=>{const d=a54f(a)?await this.#buildTransaction(a):a,{signature:e}=await this.#signer['signTransaction'](d);return this.#cache['executeTransaction']({'signatures':[e,...c],'transaction':d,'include':b})['catch'](async f=>{await this['resetCache']();throw f;});});}};function getGasCoinFromEffects(a){if(!a['V2'])throw new Error('Unexpected\x20effects\x20version');const b=a['V2']['changedObjects'][a['V2']['gasObjectIndex']];if(!b)throw new Error('Gas\x20object\x20not\x20found\x20in\x20effects');const [c,{outputState:d}]=b;if(!d['ObjectWrite'])throw new Error('Unexpected\x20gas\x20object\x20state');const [e,f]=d['ObjectWrite'];return{'ref':{'objectId':c,'digest':e,'version':a['V2']['lamportVersion']},'owner':f['AddressOwner']||f['ObjectOwner']};}const PARALLEL_EXECUTOR_DEFAULTS={'coinBatchSize':0x14,'initialCoinBalance':0xbebc200n,'minimumCoinBalance':0x2faf080n,'maxPoolSize':0x32},EPOCH_BOUNDARY_WINDOW=0xea60;var ParallelTransactionExecutor=class{#signer;#client;#gasMode;#coinBatchSize;#initialCoinBalance;#minimumCoinBalance;#defaultGasBudget;#maxPoolSize;#sourceCoins;#coinPool=[];#cache;#objectIdQueues=new Map();#buildQueue=new SerialQueue();#executeQueue;#lastDigest=null;#cacheLock=null;#pendingTransactions=0x0;#epochInfo=null;#epochInfoPromise=null;constructor(a){this.#signer=a['signer'],this.#client=a['client'],this.#gasMode=a['gasMode']??'coins';if(this.#gasMode==='coins'){const b=a;this.#coinBatchSize=b['coinBatchSize']??PARALLEL_EXECUTOR_DEFAULTS['coinBatchSize'],this.#initialCoinBalance=b['initialCoinBalance']??PARALLEL_EXECUTOR_DEFAULTS['initialCoinBalance'],this.#minimumCoinBalance=b['minimumCoinBalance']??PARALLEL_EXECUTOR_DEFAULTS['minimumCoinBalance'],this.#sourceCoins=b['sourceCoins']?new Map(b['sourceCoins']['map'](c=>[c,null])):null;}else this.#coinBatchSize=0x0,this.#initialCoinBalance=0x0n,this.#minimumCoinBalance=PARALLEL_EXECUTOR_DEFAULTS['minimumCoinBalance'],this.#sourceCoins=null;this.#defaultGasBudget=a['defaultGasBudget']??this.#minimumCoinBalance,this.#maxPoolSize=a['maxPoolSize']??PARALLEL_EXECUTOR_DEFAULTS['maxPoolSize'],this.#cache=new CachingTransactionExecutor({'client':a['client'],'cache':a['cache']}),this.#executeQueue=new ParallelQueue(this.#maxPoolSize);}['resetCache'](){return this.#epochInfo=null,this.#updateCache(()=>this.#cache['reset']());}async['waitForLastTransaction'](){await this.#updateCache(()=>this.#waitForLastDigest());}async['executeTransaction'](a,b,c=[]){const {promise:d,resolve:e,reject:f}=promiseWithResolvers(),g=await this.#getUsedObjects(a),h=()=>{this.#executeQueue['runTask'](()=>{return this.#execute(a,g,b,c)['then'](e,f);});},i=new Set();g['forEach'](j=>{if(this.#objectIdQueues['get'](j))i['add'](j),this.#objectIdQueues['get'](j)['push'](()=>{i['delete'](j);if(i['size']===0x0)h();});else this.#objectIdQueues['set'](j,[]);});if(i['size']===0x0)h();return d;}async #getUsedObjects(a){const b=new Set();let c=![];return a['addSerializationPlugin'](async(d,e,f)=>{await f();if(c)return;c=!![],d['inputs']['forEach'](g=>{if(g['Object']?.['ImmOrOwnedObject']?.['objectId'])b['add'](g['Object']['ImmOrOwnedObject']['objectId']);else{if(g['Object']?.['Receiving']?.['objectId'])b['add'](g['Object']['Receiving']['objectId']);else{if(g['UnresolvedObject']?.['objectId']&&!g['UnresolvedObject']['initialSharedVersion'])b['add'](g['UnresolvedObject']['objectId']);}}});}),await a['prepareForSerialization']({'client':this.#client}),b;}async #execute(a,b,c,d=[]){let e=null;try{a['setSenderIfNotSet'](this.#signer['toWowAddress']()),await this.#buildQueue['runTask'](async()=>{if(!a['getData']()['gasData']['price'])a['setGasPrice'](await this.#getGasPrice());a['setGasBudgetIfNotSet'](this.#defaultGasBudget),await this.#updateCache(),this.#pendingTransactions++,this.#gasMode==='addressBalance'?(a['setGasPayment']([]),a['setExpiration'](await this.#getValidDuringExpiration())):(e=await this.#getGasCoin(),a['setGasPayment']([{'objectId':e['id'],'version':e['version'],'digest':e['digest']}])),await this.#cache['buildTransaction']({'transaction':a,'onlyTransactionKind':!![]});});const f=await a['build']({'client':this.#client}),{signature:g}=await this.#signer['signTransaction'](f),h=await this.#cache['executeTransaction']({'transaction':f,'signatures':[g,...d],'include':c}),i=h['$kind']==='Transaction'?h['Transaction']:h['FailedTransaction'],j=i['effects'],k=j['gasObject'],l=j['gasUsed'];if(e&&l&&k){const m=e;if((k['outputOwner']?.['AddressOwner']??k['outputOwner']?.['ObjectOwner'])===this.#signer['toWowAddress']()){const n=BigInt(l['computationCost'])+BigInt(l['storageCost'])-BigInt(l['storageRebate']),o=m['balance']-n;let p=![];new a54d(a['getData']())['mapArguments'](r=>{if(r['$kind']==='GasCoin')p=!![];return r;});const q={'objectId':k['objectId'],'version':k['outputVersion'],'digest':k['outputDigest']};if(!p&&o>=this.#minimumCoinBalance)this.#coinPool['push']({'id':q['objectId'],'version':q['version'],'digest':q['digest'],'balance':o});else{if(!this.#sourceCoins)this.#sourceCoins=new Map();this.#sourceCoins['set'](q['objectId'],q);}}}return this.#lastDigest=i['digest'],h;}catch(r){if(e){if(!this.#sourceCoins)this.#sourceCoins=new Map();this.#sourceCoins['set'](e['id'],null);}await this.#updateCache(async()=>{await Promise['all']([this.#cache['cache']['deleteObjects']([...b]),this.#waitForLastDigest()]);});throw r;}finally{b['forEach'](s=>{const t=this.#objectIdQueues['get'](s);if(t&&t['length']>0x0)t['shift']()();else{if(t)this.#objectIdQueues['delete'](s);}}),this.#pendingTransactions--;}}async #updateCache(a){if(this.#cacheLock)await this.#cacheLock;this.#cacheLock=a?.()['then'](()=>{this.#cacheLock=null;},()=>{})??null;}async #waitForLastDigest(){const a=this.#lastDigest;a&&(this.#lastDigest=null,await this.#client['core']['waitForTransaction']({'digest':a}));}async #getGasCoin(){if(this.#coinPool['length']===0x0&&this.#pendingTransactions<=this.#maxPoolSize)await this.#refillCoinPool();if(this.#coinPool['length']===0x0)throw new Error('No\x20coins\x20available');return this.#coinPool['shift']();}async #getGasPrice(){return await this.#ensureEpochInfo(),this.#epochInfo['price'];}async #getValidDuringExpiration(){await this.#ensureEpochInfo();const a=BigInt(this.#epochInfo['epoch']);return{'ValidDuring':{'minEpoch':String(a),'maxEpoch':String(a+0x1n),'minTimestamp':null,'maxTimestamp':null,'chain':this.#epochInfo['chainIdentifier'],'nonce':Math['random']()*0x100000000>>>0x0}};}async #ensureEpochInfo(){if(this.#epochInfo&&this.#epochInfo['expiration']-EPOCH_BOUNDARY_WINDOW-Date['now']()>0x0)return;if(this.#epochInfoPromise){await this.#epochInfoPromise;return;}this.#epochInfoPromise=this.#fetchEpochInfo();try{await this.#epochInfoPromise;}finally{this.#epochInfoPromise=null;}}async #fetchEpochInfo(){const [{systemState:a},{chainIdentifier:b}]=await Promise['all']([this.#client['core']['getCurrentSystemState'](),this.#client['core']['getChainIdentifier']()]);this.#epochInfo={'epoch':a['epoch'],'price':BigInt(a['referenceGasPrice']),'expiration':Number(a['epochStartTimestampMs'])+Number(a['parameters']['epochDurationMs']),'chainIdentifier':b};}async #refillCoinPool(){const a=Math['min'](this.#coinBatchSize,this.#maxPoolSize-(this.#coinPool['length']+this.#pendingTransactions)+0x1);if(a===0x0)return;const b=new a54h(),c=this.#signer['toWowAddress']();b['setSender'](c);if(this.#sourceCoins){const n=[],o=[];for(const [p,q]of this.#sourceCoins)if(q)n['push'](q);else o['push'](p);if(o['length']>0x0){const {objects:r}=await this.#client['core']['getObjects']({'objectIds':o});n['push'](...r['filter'](s=>!(s instanceof Error))['map'](s=>({'objectId':s['objectId'],'version':s['version'],'digest':s['digest']})));}b['setGasPayment'](n),this.#sourceCoins=new Map();}const d=new Array(a)['fill'](this.#initialCoinBalance),e=b['splitCoins'](b['gas'],d),f=[];for(let s=0x0;s<d['length'];s++)f['push'](e[s]);b['transferObjects'](f,c),await this['waitForLastTransaction'](),b['addBuildPlugin'](a54g);const g=await b['build']({'client':this.#client}),{signature:h}=await this.#signer['signTransaction'](g),j=await this.#client['core']['executeTransaction']({'transaction':g,'signatures':[h],'include':{'effects':!![]}}),k=j['$kind']==='Transaction'?j['Transaction']:j['FailedTransaction'],l=k['effects'];l['changedObjects']['forEach'](t=>{if(t['objectId']===l['gasObject']?.['objectId']||t['outputState']!=='ObjectWrite')return;this.#coinPool['push']({'id':t['objectId'],'version':t['outputVersion'],'digest':t['outputDigest'],'balance':BigInt(this.#initialCoinBalance)});});if(!this.#sourceCoins)this.#sourceCoins=new Map();const m=l['gasObject'];this.#sourceCoins['set'](m['objectId'],{'objectId':m['objectId'],'version':m['outputVersion'],'digest':m['outputDigest']}),await this.#client['core']['waitForTransaction']({'digest':k['digest']});}};const Arguments={'pure':a54e(a=>b=>b['pure'](a)),'object':a54c(a=>b=>b['object'](a)),'sharedObjectRef':(...a)=>b=>b['sharedObjectRef'](...a),'objectRef':(...a)=>b=>b['objectRef'](...a),'receivingRef':(...a)=>b=>b['receivingRef'](...a)};export{ObjectCache as a,AsyncCache as i,ParallelTransactionExecutor as n,SerialTransactionExecutor as r,Arguments as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as a55a}from'./exception-C6IYkBi6.mjs';import{
|
|
1
|
+
import{o as a55a}from'./exception-C6IYkBi6.mjs';import{U as a55b,pt as a55c}from'./object-CNbjrx9F.mjs';async function queryObjectWithType(a,b,c,d){const e=await a55b({'objects':[b],'no_cache':a['no_cache'],'network':a['network']});if(!e['objects']||e['objects']['length']!==0x1)a55a('invalid\x20argument\x20type','object\x20'+b+'\x20not\x20found');if(!e['objects'][0x0]['type']||e['objects'][0x0]['type']!==c)a55a('invalid\x20argument\x20type','object\x20'+b+'\x20type\x20'+e['objects'][0x0]['type']+'\x20is\x20not\x20'+c);const f=a55c(e['objects'][0x0]['type_raw'],d);if(!f)a55a('invalid\x20argument\x20type','object\x20'+b+'\x20type_raw\x20'+e['objects'][0x0]['type_raw']+'\x20is\x20not\x20'+d);return{'object':e['objects'][0x0]['object'],'type':f};}async function queryObjectsWithType(a,b,c,d,e){const f=await a55b({'objects':b,'no_cache':a['no_cache'],'network':a['network']}),g=[];if(f['objects'])f['objects']['forEach'](h=>{if(h['type']===c){const i=a55c(h['type_raw'],''+d);if(i)g['push']({'object':h['object'],'type':i});}});if(e&&g['length']!==b['length'])a55a('invalid\x20parameter','founded\x20'+g['length']+'\x20objects\x20'+g['map'](h=>h['object'])+'\x20,\x20expect\x20'+b['length']+':\x20'+b['filter'](h=>!g['map'](i=>i['object'])['includes'](h)));return g;}export{queryObjectsWithType as n,queryObjectWithType as t};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
//#region src/w/local/util.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* 获取跨平台的 .wow 目录路径
|
|
4
|
+
* 支持通过 WOWOK_DATA_DIR 环境变量覆盖默认路径(主要用于测试隔离)
|
|
5
|
+
* 默认使用 V2 子目录以隔离抗量子账号数据
|
|
6
|
+
*/
|
|
7
|
+
declare function getWowDir(): string;
|
|
8
|
+
/**
|
|
9
|
+
* 获取 MCP 运行时数据目录路径(与 getWowDir() 同级,在其父目录下的 mcp/ 子目录)
|
|
10
|
+
* - Windows: %USERPROFILE%\.wow\mcp
|
|
11
|
+
* - macOS: ~/Library/Application Support/.wow/mcp
|
|
12
|
+
* - Linux: ~/.config/.wow/mcp 或 ~/.local/share/.wow/mcp
|
|
13
|
+
*
|
|
14
|
+
* 支持 WOWOK_DATA_DIR 环境变量覆盖(与 getWowDir() 共用,覆盖时 MCP 数据在 <WOWOK_DATA_DIR>/../mcp/)
|
|
15
|
+
*/
|
|
16
|
+
declare function getWowMcpDir(): string;
|
|
17
|
+
/**
|
|
18
|
+
* 获取跨平台的 OS 用户数据目录(非用户主目录):
|
|
19
|
+
* - Windows: %APPDATA%(Roaming)
|
|
20
|
+
* - macOS: ~/Library/Application Support
|
|
21
|
+
* - Linux: ${XDG_DATA_HOME} 或 ~/.local/share
|
|
22
|
+
*
|
|
23
|
+
* 用于存放「用户可编辑内容」——与 getWowDir() 的「关键账号/资金数据(~/.wow/V2)」
|
|
24
|
+
* 彻底隔离,避免用户清理内容时误删账号数据。
|
|
25
|
+
*/
|
|
26
|
+
declare function getWowokUserDataDir(): string;
|
|
27
|
+
/**
|
|
28
|
+
* 获取 WoWok 用户内容根目录(`.wowok`):
|
|
29
|
+
* - Windows: %APPDATA%\.wowok
|
|
30
|
+
* - macOS: ~/Library/Application Support/.wowok
|
|
31
|
+
* - Linux: ${XDG_DATA_HOME:-~/.local/share}/.wowok
|
|
32
|
+
*
|
|
33
|
+
* 支持 WOWOK_USER_DIR 环境变量覆盖(主要用于测试隔离)。
|
|
34
|
+
* 这是 workspace(文件生成/用户数据)与 industry(行业经验/个性化)的统一父目录。
|
|
35
|
+
*/
|
|
36
|
+
declare function getWowokDataDir(): string;
|
|
37
|
+
/**
|
|
38
|
+
* Workspace 目录:文件生成与用户数据存放/管理。
|
|
39
|
+
* 存放 machine/guard/wts/wip 等待审核 JSON、以及用户创建的文档。
|
|
40
|
+
*/
|
|
41
|
+
declare function getWowokWorkspaceDir(): string;
|
|
42
|
+
/**
|
|
43
|
+
* Industry 目录:行业经验、个性化商业实现。
|
|
44
|
+
* 每个行业一个子目录(6 内置 + 新注册行业),优先级 > 内置行业数据/规则。
|
|
45
|
+
*/
|
|
46
|
+
declare function getWowokIndustryDir(): string;
|
|
47
|
+
/**
|
|
48
|
+
* 将名称转为安全文件名片段(仅保留字母、数字、下划线、连字符)。
|
|
49
|
+
* 用于从对象/账户名生成导出文件名的默认值。
|
|
50
|
+
*/
|
|
51
|
+
declare function safeFilename(name: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* 生成 workspace 下的导出文件路径:`<workspace>/<prefix>_<name>.<ext>`。
|
|
54
|
+
*
|
|
55
|
+
* 文件生成类 SDK 函数(guard2file / machineNode2file 等)在调用方未显式
|
|
56
|
+
* 提供文件路径时,统一默认落到用户内容目录的 workspace 子目录。
|
|
57
|
+
*/
|
|
58
|
+
declare function workspaceExportPath(prefix: string, name: string, ext: string): string;
|
|
59
|
+
//#endregion
|
|
60
|
+
export { getWowokUserDataDir as a, workspaceExportPath as c, getWowokIndustryDir as i, getWowMcpDir as n, getWowokWorkspaceDir as o, getWowokDataDir as r, safeFilename as s, getWowDir as t };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as normalizeTypeTag } from "../type-tag-serializer-BOCNO96r.mjs";
|
|
2
|
-
import { A as
|
|
3
|
-
export { MIST_PER_WOW, MOVE_STDLIB_ADDRESS, WOW_ADDRESS_LENGTH, WOW_CLOCK_OBJECT_ID, WOW_COIN_REGISTRY_OBJECT_ID, WOW_DECIMALS, WOW_DENY_LIST_OBJECT_ID, WOW_ENTITY_OBJECT_ID, WOW_FRAMEWORK_ADDRESS, WOW_RANDOM_OBJECT_ID, WOW_REGISTRAR_OBJECT_ID, WOW_SYSTEM_ADDRESS, WOW_SYSTEM_MODULE_NAME, WOW_SYSTEM_STATE_OBJECT_ID, WOW_TYPE_ARG, deriveDynamicFieldID, deriveObjectID, formatAddress, formatDigest, fromBase58, fromBase64, fromHex, isValidNamedPackage, isValidStructTag, isValidTransactionDigest, isValidWowAddress, isValidWowObjectId, normalizeStructTag, normalizeTypeTag, normalizeWowAddress, normalizeWowObjectId, parseStructTag, parseToMist, parseToUnits, toBase58, toBase64, toHex };
|
|
2
|
+
import { A as normalizeStructTag, C as WOW_TYPE_ARG, D as isValidTransactionDigest, E as isValidStructTag, F as formatDigest, I as parseToMist, L as parseToUnits, M as normalizeWowObjectId, N as parseStructTag, O as isValidWowAddress, P as formatAddress, S as WOW_SYSTEM_STATE_OBJECT_ID, T as isValidNamedPackage, _ as WOW_FRAMEWORK_ADDRESS, a as toBase64, b as WOW_SYSTEM_ADDRESS, c as deriveDynamicFieldID, d as WOW_CLOCK_OBJECT_ID, f as WOW_COIN_REGISTRY_OBJECT_ID, g as WOW_ENTITY_PERMISSION_OBJECT_ID, h as WOW_ENTITY_OBJECT_ID, i as toBase58, j as normalizeWowAddress, k as isValidWowObjectId, l as MIST_PER_WOW, m as WOW_DENY_LIST_OBJECT_ID, n as fromBase64, o as toHex, p as WOW_DECIMALS, r as fromHex, s as deriveObjectID, t as fromBase58, u as MOVE_STDLIB_ADDRESS, v as WOW_RANDOM_OBJECT_ID, w as WOW_ADDRESS_LENGTH, x as WOW_SYSTEM_MODULE_NAME, y as WOW_REGISTRAR_OBJECT_ID } from "../index-BJAN0sGu.mjs";
|
|
3
|
+
export { MIST_PER_WOW, MOVE_STDLIB_ADDRESS, WOW_ADDRESS_LENGTH, WOW_CLOCK_OBJECT_ID, WOW_COIN_REGISTRY_OBJECT_ID, WOW_DECIMALS, WOW_DENY_LIST_OBJECT_ID, WOW_ENTITY_OBJECT_ID, WOW_ENTITY_PERMISSION_OBJECT_ID, WOW_FRAMEWORK_ADDRESS, WOW_RANDOM_OBJECT_ID, WOW_REGISTRAR_OBJECT_ID, WOW_SYSTEM_ADDRESS, WOW_SYSTEM_MODULE_NAME, WOW_SYSTEM_STATE_OBJECT_ID, WOW_TYPE_ARG, deriveDynamicFieldID, deriveObjectID, formatAddress, formatDigest, fromBase58, fromBase64, fromHex, isValidNamedPackage, isValidStructTag, isValidTransactionDigest, isValidWowAddress, isValidWowObjectId, normalizeStructTag, normalizeTypeTag, normalizeWowAddress, normalizeWowObjectId, parseStructTag, parseToMist, parseToUnits, toBase58, toBase64, toHex };
|
package/dist/esm/utils/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as a56a,c as a56b,i as a56c,l as a56d,n as a56e,o as a56f,r as a56g,s as a56h,t as a56i,u as a56j}from'../wow-types-DcqbnAaK.mjs';import{d as a56k}from'../bcs-BrmSFFhn.mjs';import{C as a56l,
|
|
1
|
+
import{a as a56a,c as a56b,i as a56c,l as a56d,n as a56e,o as a56f,r as a56g,s as a56h,t as a56i,u as a56j}from'../wow-types-DcqbnAaK.mjs';import{d as a56k}from'../bcs-BrmSFFhn.mjs';import{C as a56l,D as a56m,E as a56n,S as a56o,T as a56p,_ as a56q,a as a56r,b as a56s,c as a56t,d as a56u,f as a56v,g as a56w,h as a56x,i as a56y,l as a56z,m as a56A,n as a56B,o as a56C,p as a56D,r as a56E,s as a56F,t as a56G,u as a56H,v as a56I,w as a56J,x as a56K,y as a56L}from'../utils-n7rnVRy-.mjs';export{a56v as MIST_PER_WOW,a56D as MOVE_STDLIB_ADDRESS,a56i as WOW_ADDRESS_LENGTH,a56A as WOW_CLOCK_OBJECT_ID,a56x as WOW_COIN_REGISTRY_OBJECT_ID,a56w as WOW_DECIMALS,a56q as WOW_DENY_LIST_OBJECT_ID,a56I as WOW_ENTITY_OBJECT_ID,a56L as WOW_ENTITY_PERMISSION_OBJECT_ID,a56s as WOW_FRAMEWORK_ADDRESS,a56K as WOW_RANDOM_OBJECT_ID,a56o as WOW_REGISTRAR_OBJECT_ID,a56l as WOW_SYSTEM_ADDRESS,a56J as WOW_SYSTEM_MODULE_NAME,a56p as WOW_SYSTEM_STATE_OBJECT_ID,a56n as WOW_TYPE_ARG,a56m as deriveDynamicFieldID,a56F as deriveObjectID,a56t as formatAddress,a56z as formatDigest,a56G as fromBase58,a56B as fromBase64,a56E as fromHex,a56e as isValidNamedPackage,a56g as isValidStructTag,a56c as isValidTransactionDigest,a56a as isValidWowAddress,a56f as isValidWowObjectId,a56h as normalizeStructTag,a56k as normalizeTypeTag,a56b as normalizeWowAddress,a56d as normalizeWowObjectId,a56j as parseStructTag,a56H as parseToMist,a56u as parseToUnits,a56y as toBase58,a56r as toBase64,a56C as toHex};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as a57a,u as a57b}from'./bcs-BrmSFFhn.mjs';import{fromBase58 as a57c,fromBase64 as a57d,fromHex as a57e,toBase58 as a57f,toBase64 as a57g,toHex,toHex as a57h}from'@mysten/bcs';import{blake2b}from'@noble/hashes/blake2.js';function deriveDynamicFieldID(a,b,c){const d=a57a['Address']['serialize'](a)['toBytes'](),e=a57a['TypeTag']['serialize'](b)['toBytes'](),f=a57a['u64']()['serialize'](c['length'])['toBytes'](),g=blake2b['create']({'dkLen':0x20});g['update'](new Uint8Array([0xf0])),g['update'](d),g['update'](f),g['update'](c),g['update'](e);const h=g['digest'](),i=new Uint8Array(0x20);return i[0x0]=0xf1,i['set'](h['slice'](0x0,0x1f),0x1),'0x'+toHex(i);}const WOW_DECIMALS=0x9,MIST_PER_WOW=BigInt(0x3b9aca00),MOVE_STDLIB_ADDRESS='0x0000000000000000000000000000000000000000000000000000000000000001',WOW_FRAMEWORK_ADDRESS='0x0000000000000000000000000000000000000000000000000000000000000002',WOW_SYSTEM_ADDRESS='0x0000000000000000000000000000000000000000000000000000000000000003',WOW_CLOCK_OBJECT_ID='0x0000000000000000000000000000000000000000000000000000000000000006',WOW_SYSTEM_MODULE_NAME='wow_system',WOW_TYPE_ARG=WOW_FRAMEWORK_ADDRESS+'::wow::WOW',WOW_SYSTEM_STATE_OBJECT_ID='0x0000000000000000000000000000000000000000000000000000000000000005',WOW_RANDOM_OBJECT_ID='0x0000000000000000000000000000000000000000000000000000000000000008',WOW_COIN_REGISTRY_OBJECT_ID='0x000000000000000000000000000000000000000000000000000000000000000c',WOW_DENY_LIST_OBJECT_ID='0x0000000000000000000000000000000000000000000000000000000000000403',WOW_REGISTRAR_OBJECT_ID='0xaaa',WOW_ENTITY_OBJECT_ID='0xaab',WOW_ENTITY_PERMISSION_OBJECT_ID='0xaad',ELLIPSIS='…';function formatAddress(a){if(a['length']<=0x6)return a;const b=a['startsWith']('0x')?0x2:0x0;return'0x'+a['slice'](b,b+0x4)+ELLIPSIS+a['slice'](-0x4);}function formatDigest(a){return''+a['slice'](0x0,0xa)+ELLIPSIS;}const AMOUNT_REGEX=/^-?(?:[0-9]+(?:\.[0-9]+)?|\.[0-9]+)$/;function parseToUnits(a,b){if(b<0x0||!Number['isInteger'](b))throw new Error('Invalid\x20decimals:\x20'+b);if(!AMOUNT_REGEX['test'](a))throw new Error('Invalid\x20amount:\x20\x22'+a+'\x22');const c=a['startsWith']('-'),[d,e='']=(c?a['slice'](0x1):a)['split']('.');if(e['length']>b)throw new Error('Too\x20many\x20decimal\x20places:\x20\x22'+a+'\x22\x20has\x20'+e['length']+'\x20but\x20max\x20is\x20'+b);const f=e['padEnd'](b,'0')||'0',g=BigInt(d||'0')*0xan**BigInt(b)+BigInt(f);return c?-g:g;}function parseToMist(a){return parseToUnits(a,0x9);}function deriveObjectID(a,b,c){return deriveDynamicFieldID(a,'0x2::derived_object::DerivedObjectKey<'+(typeof b==='string'?b:a57b['tagToString'](b))+'>',c);}export{WOW_SYSTEM_ADDRESS as C,deriveDynamicFieldID as D,WOW_TYPE_ARG as E,WOW_REGISTRAR_OBJECT_ID as S,WOW_SYSTEM_STATE_OBJECT_ID as T,WOW_DENY_LIST_OBJECT_ID as _,a57g as a,WOW_FRAMEWORK_ADDRESS as b,formatAddress as c,parseToUnits as d,MIST_PER_WOW as f,WOW_DECIMALS as g,WOW_COIN_REGISTRY_OBJECT_ID as h,a57f as i,formatDigest as l,WOW_CLOCK_OBJECT_ID as m,a57d as n,a57h as o,MOVE_STDLIB_ADDRESS as p,a57e as r,deriveObjectID as s,a57c as t,parseToMist as u,WOW_ENTITY_OBJECT_ID as v,WOW_SYSTEM_MODULE_NAME as w,WOW_RANDOM_OBJECT_ID as x,WOW_ENTITY_PERMISSION_OBJECT_ID as y};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Gb as verifyPersonalMessageSignature, Kb as verifySignature, Ub as publicKeyFromRawBytes, Wb as publicKeyFromWowBytes, qb as verifyTransactionSignature } from "../index-BB-qrJhQ.mjs";
|
|
2
2
|
export { publicKeyFromRawBytes, publicKeyFromWowBytes, verifyPersonalMessageSignature, verifySignature, verifyTransactionSignature };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as a58a,i as a58b,o as a58c,r as a58d,s as a58e}from'../publickey-
|
|
1
|
+
import{a as a58a,i as a58b,o as a58c,r as a58d,s as a58e}from'../publickey-C1XTriFK.mjs';export{a58d as publicKeyFromRawBytes,a58b as publicKeyFromWowBytes,a58a as verifyPersonalMessageSignature,a58c as verifySignature,a58e as verifyTransactionSignature};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $u as
|
|
1
|
+
import { $u as MAX_ALLOCATOR_COUNT, Qu as CallAllocation_Data, Xu as AllocatorsType, Zu as CallAllocation, ad as receive, ed as alloc, gg as MAX_SHARING_COUNT, id as newAllocation, nd as allocators, od as sharing, rd as create, td as allocationFn } from "../../index-BB-qrJhQ.mjs";
|
|
2
2
|
export { AllocatorsType, CallAllocation, CallAllocation_Data, MAX_ALLOCATOR_COUNT, MAX_SHARING_COUNT, alloc, allocationFn, allocators, create, newAllocation, receive, sharing };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as a59a}from'../../wow-types-DcqbnAaK.mjs';import{B as a59b,J as a59c,Y as a59d,c as a59e,dt as a59f,f as a59g,g as a59h,u as a59i}from'../../common-BDlb-AoC.mjs';import{o as a59j}from'../../exception-C6IYkBi6.mjs';import{LocalMark}from'../local/local.mjs';import{GetAccountOrMark_Address,GetManyAccountOrMark_Address}from'../local/index.mjs';import{ct as a59k,rt as a59l}from'../../object-Dma1VY-1.mjs';import{t as a59m}from'../../received-4odTK5AJ.mjs';import{r as a59n,ut as a59o,w as a59p}from'../../passport-CQFR2dfo.mjs';import{r as a59q,t as a59r}from'../../base-BzTUCV2r.mjs';import{paymentInfo}from'./payment.mjs';var CallAllocation=class extends a59r{constructor(a){super(),this['object_address']=void 0x0,this['type_parameter']=void 0x0,this['data']=a;}async['prepare'](a){await super['prepare'](a);if(!this['object_address'])this['object_address']=await a59i(this['data']?.['object']);if(this['object_address']){this['content']=void 0x0,await this['update_content'](a,'Allocation',this['object_address']);if(!this['content'])a59j('invalid\x20parameter','CallAllocation_Data.data.object:'+this['object_address']);this['type_parameter']=a59l(this['content']['type_raw'],'allocation::Allocation');if(!this['type_parameter'])a59j('invalid\x20argument\x20type','CallAllocation_Data.data.object.type_parameter\x20is\x20empty');}else{const b=a59e(this['data']['object']);if(!b||!a59g(b?.['type_parameter']))a59j('invalid\x20argument\x20type','CallAllocation_Data.data.object.type_parameter\x20is\x20empty');this['type_parameter']=b?.['type_parameter'];}if('alloc_by_guard'in this['data']&&this['data']['alloc_by_guard']!=null&&!a59a(this['data']['alloc_by_guard'])){const c=await LocalMark['Instance']()['get_address'](this['data']['alloc_by_guard']);if(!c||!a59a(c))a59j('invalid\x20address','alloc_by_guard:\x20'+this['data']['alloc_by_guard']);this['data']['alloc_by_guard']=c;}}async['call'](a){await this['prepare'](a);if('alloc_by_guard'in this['data']&&this['data']['alloc_by_guard']!=null){const b=this['data']['alloc_by_guard'];if(this['content']&&!this['content']['allocators']['find'](d=>d['guard']===b))a59j('invalid\x20parameter','alloc_by_guard:\x20'+b+'\x20not\x20found\x20in\x20allocators\x20'+this['content']['allocators']['map'](d=>d['guard']));const c=await a59n(a,[b]);if(c['submission']['length']>0x0)return{'type':'submission','guard':c['guard'],'submission':c['submission']};return await this['check_passport'](a,c);}return await this['exec'](a);}async['operate'](a,b,c){if(this['object_address']){if('received_coins'in this['data']&&this['data']['received_coins']!=null){if(this['data']['received_coins']==='recently'){const d=await a59m({'name_or_address':{'name_or_address':this['object_address'],'local_mark_first':!![]},'type':'CoinWrapper','network':a['network'],'no_cache':a['no_cache']});if(Array['isArray'](d))a59j('invalid\x20parameter','CallAllocation_Data.data.received_coins:\x20received\x20is\x20ReceivedNormal[]');else this['data']['received_coins']=d;}if(typeof this['data']['received_coins']==='object'&&'received'in this['data']['received_coins']&&this['data']['received_coins']['received']?.['length']>0x0){if(this['data']['received_coins']?.['token_type']!==this['type_parameter'])a59j('invalid\x20parameter','CallAllocation_Data.data.received_coins.token_type:'+this['data']['received_coins']?.['token_type']);for(const e of this['data']['received_coins']['received']){if(!a59a(e['id'])||!a59a(e['payment']))a59j('invalid\x20parameter','CallAllocation_Data.data.received_coins:'+e['id']);receive(b,a59f(b,this['object_address']),this['type_parameter'],a59f(b,e['id']),a59f(b,e['payment']));}}}if('alloc_by_guard'in this['data']&&this['data']['alloc_by_guard']!=null){if(!c)a59j('invalid\x20parameter','CallAllocation_Data.data.alloc_by_guard:'+this['data']['alloc_by_guard']);alloc(b,a59f(b,this['object_address']),this['type_parameter'],this['data']['alloc_by_guard'],c);}}else{const f=a59e(this['data']['object']);if(!a59g(f?.['type_parameter']))a59j('invalid\x20argument\x20type','CallAllocation_Data.data.object.type_parameter\x20'+f?.['type_parameter']);this['type_parameter']=f?.['type_parameter'];let g;if('coin'in this['data']&&this['data']['coin'])g=await a59q(a,b,this['data']['coin'],this['type_parameter']);if(g&&'allocators'in this['data']&&this['data']['allocators']&&this['type_parameter']){const h=newAllocation(b,this['type_parameter'],g,await allocators(b,this['data']['allocators']));await this['new_with_mark'](a,b,'Allocation',create(b,h,this['type_parameter'],await paymentInfo(a,b,this['data']['payment_info'])),f);}else a59j('invalid\x20parameter','CallAllocation_Data.data\x20'+JSON['stringify'](this['data']));}}};function allocationFn(a){return'0x2::allocation::'+a;}const MAX_ALLOCATOR_COUNT=a59p,getAllocationModeNumber=a=>{let b;if(typeof a==='number')b=a;else{if(typeof a==='string')switch(a){case'Amount':b=0x0;break;case'Rate':b=0x1;break;case'Surplus':b=0x2;break;default:b=Number(a);}else b=Number(a);}if(b!==0x0&&b!==0x1&&b!==0x2)a59j('invalid\x20parameter','Invalid\x20allocation\x20mode:\x20'+a+'.\x20Only\x200\x20(Amount),\x201\x20(Rate),\x20or\x202\x20(Surplus)\x20are\x20allowed.');return b;},sharing=async(a,b,c)=>{const d=getAllocationModeNumber(b['mode']);if('GuardIdentifier'in b['who']){if(!a59d(b['who']['GuardIdentifier']))a59j('invalid\x20u8','sharing\x20GuardIdentifier:\x20'+b['who']['GuardIdentifier']);return a['moveCall']({'target':allocationFn('sharing_for_guard_identifier'),'arguments':[a['pure']['u8'](b['who']['GuardIdentifier']),a['pure']['u64'](b['sharing']),a['pure']['u8'](d)]});}else{if('Entity'in b['who']){const e=c||await GetAccountOrMark_Address(b['who']['Entity']);if(!e)a59j('invalid\x20address','sharing\x20Entity:\x20'+b['who']['Entity']);return a['moveCall']({'target':allocationFn('sharing_for_address'),'arguments':[a['pure']['address'](e),a['pure']['u64'](b['sharing']),a['pure']['u8'](d)]});}else return a['moveCall']({'target':allocationFn('sharing_for_signer'),'arguments':[a['pure']['u64'](b['sharing']),a['pure']['u8'](d)]});}},allocators=async(a,b)=>{if(!a59b(b['description']))a59j('invalid\x20parameter','Description\x20exceeds\x20maximum\x20length\x20'+a59h);if(b['allocators']['length']>MAX_ALLOCATOR_COUNT)a59j('invalid\x20parameter','Allocator\x20count\x20exceeds\x20maximum\x20limit\x20'+MAX_ALLOCATOR_COUNT);if(b['allocators']['length']===0x0)a59j('invalid\x20parameter','Allocator\x20array\x20cannot\x20be\x20empty');if(!a59c(b['threshold']))a59j('invalid\x20parameter','threshold:\x20'+b['threshold']);const c=a['moveCall']({'target':allocationFn('allocators'),'arguments':[a['pure']['string'](b['description']),a['pure']['u64'](b['threshold'])]});for(let d=0x0;d<b['allocators']['length'];d++){const e=b['allocators'][d];if(e['sharing']['length']===0x0)a59j('invalid\x20parameter','sharing\x20array\x20cannot\x20be\x20empty');if(e['sharing']['length']>a59o)a59j('invalid\x20parameter','sharing\x20count\x20exceeds\x20maximum\x20limit\x20'+a59o);const f=e['sharing']['map'](r=>getAllocationModeNumber(r['mode'])),h=e['sharing']['filter']((r,s)=>f[s]===0x0),j=e['sharing']['filter']((r,s)=>f[s]===0x1),k=e['sharing']['filter']((r,s)=>f[s]===0x2);if(k['length']>0x1)a59j('invalid\x20parameter','Allocator['+d+']:\x20max\x20ONE\x20Surplus\x20item\x20per\x20Allocator\x20(contract\x20EMULTIPLE_SURPLUS=5).\x20Found\x20'+k['length']+'\x20Surplus\x20items.\x20Items:\x20'+e['sharing']['map']((r,t)=>'['+t+']\x20mode='+r['mode']+',\x20sharing='+r['sharing'])['join'](',\x20')+'.\x20Fix:\x20keep\x20only\x20one\x20Surplus\x20item\x20or\x20remove\x20all\x20Surplus\x20items.');if(j['length']>0x0){const r=j['reduce']((t,u)=>t+BigInt(u['sharing']),0x0n),s=j['map'](t=>'['+e['sharing']['indexOf'](t)+']\x20rate='+t['sharing'])['join'](',\x20');if(k['length']>0x0){if(r>0x2710n)a59j('invalid\x20parameter','Allocator['+d+']:\x20Rate\x20sum\x20exceeds\x2010000\x20when\x20Surplus\x20is\x20defined\x20(contract\x20ERATE_EXCEEDS_10000=6).\x20Current\x20sum:\x20'+r+',\x20max\x20allowed:\x2010000.\x20Rate\x20items:\x20'+s+'.\x20Fix:\x20reduce\x20Rate\x20values\x20so\x20sum\x20<=\x2010000,\x20or\x20remove\x20the\x20Surplus\x20item\x20(then\x20sum\x20must\x20==\x2010000).');}else{if(r!==0x2710n)a59j('invalid\x20parameter','Allocator['+d+']:\x20Rate\x20sum\x20must\x20be\x20EXACTLY\x2010000\x20when\x20no\x20Surplus\x20is\x20defined\x20(contract\x20ERATE_NOT_10000=4).\x20Current\x20sum:\x20'+r+',\x20expected:\x2010000.\x20Rate\x20items:\x20'+s+'.\x20Fix:\x20adjust\x20Rate\x20values\x20so\x20sum\x20==\x2010000,\x20or\x20add\x20a\x20Surplus\x20item\x20(then\x20sum\x20can\x20be\x20<=\x2010000).');}}if(h['length']>0x0&&e['max']!=null){const t=h['reduce']((v,w)=>v+BigInt(w['sharing']),0x0n),u=BigInt(e['max']);if(t>u)a59j('invalid\x20parameter','Allocator['+d+']:\x20Amount\x20sum\x20exceeds\x20max\x20(contract\x20EAMOUNT_EXCEEDS_MAX=13).\x20Amount\x20sum:\x20'+t+',\x20max:\x20'+u+'.\x20Amount\x20items:\x20'+h['map'](v=>'['+e['sharing']['indexOf'](v)+']\x20amount='+v['sharing'])['join'](',\x20')+'.\x20Fix:\x20reduce\x20Amount\x20values\x20so\x20sum\x20<=\x20max,\x20or\x20increase/remove\x20max.');}if(h['length']>0x0&&j['length']===0x0&&k['length']===0x0){const v=h['reduce']((x,y)=>x+BigInt(y['sharing']),0x0n),w=BigInt(b['threshold']);if(v<w)a59j('invalid\x20parameter','Allocator['+d+']:\x20Amount\x20sum\x20below\x20threshold\x20(contract\x20EAMOUNT_BELOW_THRESHOLD=12).\x20Amount\x20sum:\x20'+v+',\x20threshold:\x20'+w+'.\x20Amount\x20items:\x20'+h['map'](x=>'['+e['sharing']['indexOf'](x)+']\x20amount='+x['sharing'])['join'](',\x20')+'.\x20Fix:\x20increase\x20Amount\x20values\x20so\x20sum\x20>=\x20threshold,\x20or\x20add\x20Rate/Surplus\x20items\x20(threshold\x20only\x20applies\x20when\x20no\x20Rate\x20and\x20no\x20Surplus).');}const l=e['sharing']['map']((x,y)=>{if('Entity'in x['who'])return{'index':y,'name_or_address':x['who']['Entity']['name_or_address']};else return null;})['filter'](x=>x!==null),[m,n]=await Promise['all']([LocalMark['Instance']()['get_address'](e['guard']),GetManyAccountOrMark_Address({'entities':l,'check_all_founded':!![]})]),o=new Array(e['sharing']['length']);l['forEach']((x,y)=>{o[x['index']]=n[y];});if(!m)a59j('invalid\x20address','guard:\x20'+e['guard']);const p=await Promise['all'](e['sharing']['map'](async(x,y)=>{if('Entity'in x['who']){const z=o[y];if(!z)a59j('invalid\x20address','entity:\x20'+(typeof x['who']['Entity']==='string'?x['who']['Entity']:x['who']['Entity']['name_or_address']));return sharing(a,x,z);}else return sharing(a,x);})),q=a['makeMoveVec']({'elements':p,'type':'0x2::allocation::Sharing'});a['moveCall']({'target':allocationFn('allocator_add'),'arguments':[c,a59f(a,m),q,a['pure']['option']('u64',e?.['max'])]});}return c;};function alloc(a,b,c,d,e){a59k([b,d,e]);if(!a59g(c))a59j('invalid\x20parameter','allocation_type:\x20'+c+'\x20invalid');a['moveCall']({'target':allocationFn('alloc'),'arguments':[b,a59f(a,d),a59f(a,e),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});}function newAllocation(a,b,c,d){return a59k([c,d]),a['moveCall']({'target':allocationFn('new_with_coin'),'arguments':[c,d,a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[b]});}function create(a,b,c,d){a59k([b,d]);if(!a59g(c))a59j('invalid\x20parameter','allocation_type:\x20'+c+'\x20invalid');return a['moveCall']({'target':allocationFn('create'),'arguments':[b,a59f(a,d)],'typeArguments':[c]});}function receive(a,b,c,d,e){a59k([b,e,d]);if(!a59g(c))a59j('invalid\x20parameter','allocation_type:\x20'+c+'\x20invalid');return a['moveCall']({'target':allocationFn('receive'),'arguments':[b,a59f(a,d),a59f(a,e)],'typeArguments':[c]});}export{CallAllocation,MAX_ALLOCATOR_COUNT,a59o as MAX_SHARING_COUNT,alloc,allocationFn,allocators,create,newAllocation,receive,sharing};
|
|
1
|
+
import{a as a59a}from'../../wow-types-DcqbnAaK.mjs';import{$ as a59b,Q as a59c,W as a59d,f as a59e,ht as a59f,m as a59g,u as a59h,v as a59i}from'../../common-ofEOpNis.mjs';import{o as a59j}from'../../exception-C6IYkBi6.mjs';import{LocalMark}from'../local/local.mjs';import{GetAccountOrMark_Address,GetManyAccountOrMark_Address}from'../local/index.mjs';import{pt as a59k,vt as a59l}from'../../object-CNbjrx9F.mjs';import{t as a59m}from'../../received-BFjAt453.mjs';import{dt as a59n,r as a59o,w as a59p}from'../../passport-GNU3ZGa6.mjs';import{r as a59q,t as a59r}from'../../base-34PdEIjR.mjs';import{paymentInfo}from'./payment.mjs';var CallAllocation=class extends a59r{constructor(a){super(),this['object_address']=void 0x0,this['type_parameter']=void 0x0,this['data']=a;}async['prepare'](a){await super['prepare'](a);if(!this['object_address'])this['object_address']=await a59e(this['data']?.['object']);if(this['object_address']){this['content']=void 0x0,await this['update_content'](a,'Allocation',this['object_address']);if(!this['content'])a59j('invalid\x20parameter','CallAllocation_Data.data.object:'+this['object_address']);this['type_parameter']=a59k(this['content']['type_raw'],'allocation::Allocation');if(!this['type_parameter'])a59j('invalid\x20argument\x20type','CallAllocation_Data.data.object.type_parameter\x20is\x20empty');}else{const b=a59h(this['data']['object']);if(!b||!a59g(b?.['type_parameter']))a59j('invalid\x20argument\x20type','CallAllocation_Data.data.object.type_parameter\x20is\x20empty');this['type_parameter']=b?.['type_parameter'];}if('alloc_by_guard'in this['data']&&this['data']['alloc_by_guard']!=null&&!a59a(this['data']['alloc_by_guard'])){const c=await LocalMark['Instance']()['get_address'](this['data']['alloc_by_guard']);if(!c||!a59a(c))a59j('invalid\x20address','alloc_by_guard:\x20'+this['data']['alloc_by_guard']);this['data']['alloc_by_guard']=c;}}async['call'](a){await this['prepare'](a);if('alloc_by_guard'in this['data']&&this['data']['alloc_by_guard']!=null){const b=this['data']['alloc_by_guard'];if(this['content']&&!this['content']['allocators']['find'](d=>d['guard']===b))a59j('invalid\x20parameter','alloc_by_guard:\x20'+b+'\x20not\x20found\x20in\x20allocators\x20'+this['content']['allocators']['map'](d=>d['guard']));const c=await a59o(a,[b]);if(c['submission']['length']>0x0)return{'type':'submission','guard':c['guard'],'submission':c['submission']};return await this['check_passport'](a,c);}return await this['exec'](a);}async['operate'](a,b,c){if(this['object_address']){if('received_coins'in this['data']&&this['data']['received_coins']!=null){if(this['data']['received_coins']==='recently'){const d=await a59m({'name_or_address':{'name_or_address':this['object_address'],'local_mark_first':!![]},'type':'CoinWrapper','network':a['network'],'no_cache':a['no_cache']});if(Array['isArray'](d))a59j('invalid\x20parameter','CallAllocation_Data.data.received_coins:\x20received\x20is\x20ReceivedNormal[]');else this['data']['received_coins']=d;}if(typeof this['data']['received_coins']==='object'&&'received'in this['data']['received_coins']&&this['data']['received_coins']['received']?.['length']>0x0){if(this['data']['received_coins']?.['token_type']!==this['type_parameter'])a59j('invalid\x20parameter','CallAllocation_Data.data.received_coins.token_type:'+this['data']['received_coins']?.['token_type']);for(const e of this['data']['received_coins']['received']){if(!a59a(e['id'])||!a59a(e['payment']))a59j('invalid\x20parameter','CallAllocation_Data.data.received_coins:'+e['id']);receive(b,a59f(b,this['object_address']),this['type_parameter'],a59f(b,e['id']),a59f(b,e['payment']));}}}if('alloc_by_guard'in this['data']&&this['data']['alloc_by_guard']!=null){if(!c)a59j('invalid\x20parameter','CallAllocation_Data.data.alloc_by_guard:'+this['data']['alloc_by_guard']);alloc(b,a59f(b,this['object_address']),this['type_parameter'],this['data']['alloc_by_guard'],c);}}else{const f=a59h(this['data']['object']);if(!a59g(f?.['type_parameter']))a59j('invalid\x20argument\x20type','CallAllocation_Data.data.object.type_parameter\x20'+f?.['type_parameter']);this['type_parameter']=f?.['type_parameter'];let g;if('coin'in this['data']&&this['data']['coin'])g=await a59q(a,b,this['data']['coin'],this['type_parameter']);if(g&&'allocators'in this['data']&&this['data']['allocators']&&this['type_parameter']){const h=newAllocation(b,this['type_parameter'],g,await allocators(b,this['data']['allocators']));await this['new_with_mark'](a,b,'Allocation',create(b,h,this['type_parameter'],await paymentInfo(a,b,this['data']['payment_info'])),f);}else a59j('invalid\x20parameter','CallAllocation_Data.data\x20'+JSON['stringify'](this['data']));}}};function allocationFn(a){return'0x2::allocation::'+a;}const MAX_ALLOCATOR_COUNT=a59p,getAllocationModeNumber=a=>{let b;if(typeof a==='number')b=a;else{if(typeof a==='string')switch(a){case'Amount':b=0x0;break;case'Rate':b=0x1;break;case'Surplus':b=0x2;break;default:b=Number(a);}else b=Number(a);}if(b!==0x0&&b!==0x1&&b!==0x2)a59j('invalid\x20parameter','Invalid\x20allocation\x20mode:\x20'+a+'.\x20Only\x200\x20(Amount),\x201\x20(Rate),\x20or\x202\x20(Surplus)\x20are\x20allowed.');return b;},sharing=async(a,b,c)=>{const d=getAllocationModeNumber(b['mode']);if('GuardIdentifier'in b['who']){if(!a59b(b['who']['GuardIdentifier']))a59j('invalid\x20u8','sharing\x20GuardIdentifier:\x20'+b['who']['GuardIdentifier']);return a['moveCall']({'target':allocationFn('sharing_for_guard_identifier'),'arguments':[a['pure']['u8'](b['who']['GuardIdentifier']),a['pure']['u64'](b['sharing']),a['pure']['u8'](d)]});}else{if('Entity'in b['who']){const e=c||await GetAccountOrMark_Address(b['who']['Entity']);if(!e)a59j('invalid\x20address','sharing\x20Entity:\x20'+b['who']['Entity']);return a['moveCall']({'target':allocationFn('sharing_for_address'),'arguments':[a['pure']['address'](e),a['pure']['u64'](b['sharing']),a['pure']['u8'](d)]});}else return a['moveCall']({'target':allocationFn('sharing_for_signer'),'arguments':[a['pure']['u64'](b['sharing']),a['pure']['u8'](d)]});}},allocators=async(a,b)=>{if(!a59d(b['description']))a59j('invalid\x20parameter','Description\x20exceeds\x20maximum\x20length\x20'+a59i);if(b['allocators']['length']>MAX_ALLOCATOR_COUNT)a59j('invalid\x20parameter','Allocator\x20count\x20exceeds\x20maximum\x20limit\x20'+MAX_ALLOCATOR_COUNT);if(b['allocators']['length']===0x0)a59j('invalid\x20parameter','Allocator\x20array\x20cannot\x20be\x20empty');if(!a59c(b['threshold']))a59j('invalid\x20parameter','threshold:\x20'+b['threshold']);const c=a['moveCall']({'target':allocationFn('allocators'),'arguments':[a['pure']['string'](b['description']),a['pure']['u64'](b['threshold'])]});for(let d=0x0;d<b['allocators']['length'];d++){const e=b['allocators'][d];if(e['sharing']['length']===0x0)a59j('invalid\x20parameter','sharing\x20array\x20cannot\x20be\x20empty');if(e['sharing']['length']>a59n)a59j('invalid\x20parameter','sharing\x20count\x20exceeds\x20maximum\x20limit\x20'+a59n);const f=e['sharing']['map'](r=>getAllocationModeNumber(r['mode'])),h=e['sharing']['filter']((r,s)=>f[s]===0x0),j=e['sharing']['filter']((r,s)=>f[s]===0x1),k=e['sharing']['filter']((r,s)=>f[s]===0x2);if(k['length']>0x1)a59j('invalid\x20parameter','Allocator['+d+']:\x20max\x20ONE\x20Surplus\x20item\x20per\x20Allocator\x20(contract\x20EMULTIPLE_SURPLUS=5).\x20Found\x20'+k['length']+'\x20Surplus\x20items.\x20Items:\x20'+e['sharing']['map']((r,t)=>'['+t+']\x20mode='+r['mode']+',\x20sharing='+r['sharing'])['join'](',\x20')+'.\x20Fix:\x20keep\x20only\x20one\x20Surplus\x20item\x20or\x20remove\x20all\x20Surplus\x20items.');if(j['length']>0x0){const r=j['reduce']((t,u)=>t+BigInt(u['sharing']),0x0n),s=j['map'](t=>'['+e['sharing']['indexOf'](t)+']\x20rate='+t['sharing'])['join'](',\x20');if(k['length']>0x0){if(r>0x2710n)a59j('invalid\x20parameter','Allocator['+d+']:\x20Rate\x20sum\x20exceeds\x2010000\x20when\x20Surplus\x20is\x20defined\x20(contract\x20ERATE_EXCEEDS_10000=6).\x20Current\x20sum:\x20'+r+',\x20max\x20allowed:\x2010000.\x20Rate\x20items:\x20'+s+'.\x20Fix:\x20reduce\x20Rate\x20values\x20so\x20sum\x20<=\x2010000,\x20or\x20remove\x20the\x20Surplus\x20item\x20(then\x20sum\x20must\x20==\x2010000).');}else{if(r!==0x2710n)a59j('invalid\x20parameter','Allocator['+d+']:\x20Rate\x20sum\x20must\x20be\x20EXACTLY\x2010000\x20when\x20no\x20Surplus\x20is\x20defined\x20(contract\x20ERATE_NOT_10000=4).\x20Current\x20sum:\x20'+r+',\x20expected:\x2010000.\x20Rate\x20items:\x20'+s+'.\x20Fix:\x20adjust\x20Rate\x20values\x20so\x20sum\x20==\x2010000,\x20or\x20add\x20a\x20Surplus\x20item\x20(then\x20sum\x20can\x20be\x20<=\x2010000).');}}if(h['length']>0x0&&e['max']!=null){const t=h['reduce']((v,w)=>v+BigInt(w['sharing']),0x0n),u=BigInt(e['max']);if(t>u)a59j('invalid\x20parameter','Allocator['+d+']:\x20Amount\x20sum\x20exceeds\x20max\x20(contract\x20EAMOUNT_EXCEEDS_MAX=13).\x20Amount\x20sum:\x20'+t+',\x20max:\x20'+u+'.\x20Amount\x20items:\x20'+h['map'](v=>'['+e['sharing']['indexOf'](v)+']\x20amount='+v['sharing'])['join'](',\x20')+'.\x20Fix:\x20reduce\x20Amount\x20values\x20so\x20sum\x20<=\x20max,\x20or\x20increase/remove\x20max.');}if(h['length']>0x0&&j['length']===0x0&&k['length']===0x0){const v=h['reduce']((x,y)=>x+BigInt(y['sharing']),0x0n),w=BigInt(b['threshold']);if(v<w)a59j('invalid\x20parameter','Allocator['+d+']:\x20Amount\x20sum\x20below\x20threshold\x20(contract\x20EAMOUNT_BELOW_THRESHOLD=12).\x20Amount\x20sum:\x20'+v+',\x20threshold:\x20'+w+'.\x20Amount\x20items:\x20'+h['map'](x=>'['+e['sharing']['indexOf'](x)+']\x20amount='+x['sharing'])['join'](',\x20')+'.\x20Fix:\x20increase\x20Amount\x20values\x20so\x20sum\x20>=\x20threshold,\x20or\x20add\x20Rate/Surplus\x20items\x20(threshold\x20only\x20applies\x20when\x20no\x20Rate\x20and\x20no\x20Surplus).');}const l=e['sharing']['map']((x,y)=>{if('Entity'in x['who'])return{'index':y,'name_or_address':x['who']['Entity']['name_or_address']};else return null;})['filter'](x=>x!==null),[m,n]=await Promise['all']([LocalMark['Instance']()['get_address'](e['guard']),GetManyAccountOrMark_Address({'entities':l,'check_all_founded':!![]})]),o=new Array(e['sharing']['length']);l['forEach']((x,y)=>{o[x['index']]=n[y];});if(!m)a59j('invalid\x20address','guard:\x20'+e['guard']);const p=await Promise['all'](e['sharing']['map'](async(x,y)=>{if('Entity'in x['who']){const z=o[y];if(!z)a59j('invalid\x20address','entity:\x20'+(typeof x['who']['Entity']==='string'?x['who']['Entity']:x['who']['Entity']['name_or_address']));return sharing(a,x,z);}else return sharing(a,x);})),q=a['makeMoveVec']({'elements':p,'type':'0x2::allocation::Sharing'});a['moveCall']({'target':allocationFn('allocator_add'),'arguments':[c,a59f(a,m),q,a['pure']['option']('u64',e?.['max'])]});}return c;};function alloc(a,b,c,d,e){a59l([b,d,e]);if(!a59g(c))a59j('invalid\x20parameter','allocation_type:\x20'+c+'\x20invalid');a['moveCall']({'target':allocationFn('alloc'),'arguments':[b,a59f(a,d),a59f(a,e),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});}function newAllocation(a,b,c,d){return a59l([c,d]),a['moveCall']({'target':allocationFn('new_with_coin'),'arguments':[c,d,a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[b]});}function create(a,b,c,d){a59l([b,d]);if(!a59g(c))a59j('invalid\x20parameter','allocation_type:\x20'+c+'\x20invalid');return a['moveCall']({'target':allocationFn('create'),'arguments':[b,a59f(a,d)],'typeArguments':[c]});}function receive(a,b,c,d,e){a59l([b,e,d]);if(!a59g(c))a59j('invalid\x20parameter','allocation_type:\x20'+c+'\x20invalid');return a['moveCall']({'target':allocationFn('receive'),'arguments':[b,a59f(a,d),a59f(a,e)],'typeArguments':[c]});}export{CallAllocation,MAX_ALLOCATOR_COUNT,a59n as MAX_SHARING_COUNT,alloc,allocationFn,allocators,create,newAllocation,receive,sharing};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Au as
|
|
1
|
+
import { Au as confirm, Bu as pause, Du as CallArbitration_Data, Eu as CallArbitration, Fu as feedback, Gu as vote, Hu as um_set, Iu as fees_alloc, Ju as voting_guard_clear, Ku as voting_deadline_change, Lu as fees_transfer, Mu as description_set, Nu as dispute, Ou as arb_withdraw, Pu as fee_set, Ru as location_set, Uu as usage_guard_none, Vu as reset, Wu as usage_guard_set, Yu as voting_guard_remove, ju as create, ku as arbitration, qu as voting_guard_add, yg as MAX_VOTING_GUARD_COUNT, zu as newArbitration } from "../../index-BB-qrJhQ.mjs";
|
|
2
2
|
export { CallArbitration, CallArbitration_Data, MAX_VOTING_GUARD_COUNT, arb_withdraw, arbitration, confirm, create, description_set, dispute, fee_set, feedback, fees_alloc, fees_transfer, location_set, newArbitration, pause, reset, um_set, usage_guard_none, usage_guard_set, vote, voting_deadline_change, voting_guard_add, voting_guard_clear, voting_guard_remove };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as a60a}from'../../wow-types-DcqbnAaK.mjs';import{B as a60b,H as a60c,J as a60d,N as a60e,Y as a60f,c as a60g,dt as a60h,f as a60i,g as a60j,l as a60k,q as a60l,u as a60m,z as a60n}from'../../common-BDlb-AoC.mjs';import{o as a60o}from'../../exception-C6IYkBi6.mjs';import{LocalMark}from'../local/local.mjs';import{L as a60p,ct as a60q,nt as a60r,rt as a60s}from'../../object-Dma1VY-1.mjs';import{t as a60t}from'../../received-4odTK5AJ.mjs';import{$ as a60u,M as a60v,pt as a60w}from'../../passport-CQFR2dfo.mjs';import{r as a60x,t as a60y}from'../../base-BzTUCV2r.mjs';import{create as a60z,newPermission}from'./permission.mjs';import{t as a60A}from'../../arb-UmbIfnyY.mjs';var CallArbitration=class extends a60y{constructor(a){super(),this['object_address']=void 0x0,this['permission_address']=void 0x0,this['new_permission_description']=void 0x0,this['parameter_type']=void 0x0,this['data']=a;}async['prepare'](a){await super['prepare'](a);if(!this['object_address'])this['object_address']=await a60m(this['data']?.['object']);if(this['object_address']){this['content']=void 0x0,await this['update_content'](a,'Arbitration',this['object_address']);if(!this['content'])a60o('invalid\x20parameter','CallArbitration_Data.data.object:'+this['object_address']);this['permission_address']=this['content']['permission'],this['parameter_type']=a60s(this['content']['type_raw'],'arbitration::Arbitration');if(!this['permission_address'])a60o('invalid\x20parameter','CallArbitration_Data.data.object.permission\x20is\x20empty');if(!a60i(this['parameter_type']))a60o('invalid\x20argument\x20type','CallArbitration_Data.data.object.type_parameter\x20is\x20empty');}else{const b=a60g(this['data']['object']);this['permission_address']=await a60m(b?.['permission']),this['new_permission_description']=a60k(b),this['parameter_type']=b?.['type_parameter'];if(!a60i(this['parameter_type']))a60o('invalid\x20argument\x20type','CallArbitration_Data.data.object.type_parameter\x20invalid');}if(this['data']['vote']?.['voting_guard']!=null&&!a60a(this['data']['vote']['voting_guard'])){const c=await LocalMark['Instance']()['get_address'](this['data']['vote']['voting_guard']);if(!c||!a60a(c))a60o('invalid\x20address','vote.voting_guard:\x20'+this['data']['vote']['voting_guard']);this['data']['vote']['voting_guard']=c;}}async['call'](a){await this['prepare'](a);const b=[],c=[],d=g=>{if(!b['includes'](g))b['push'](g);},e=g=>{if(this['permission_address']&&!c['includes'](g))c['push'](g);},f=this['content'];if(this['permission_address']&&!this['object_address'])e(0x15e);if(this['data']?.['dispute']!=null){if(f?.['bPaused'])a60o('invalid\x20parameter','Arbitration\x20is\x20paused\x20and\x20cannot\x20be\x20disputed');if(f?.['usage_guard'])d(f['usage_guard']);}if(this['permission_address']&&this['data']?.['description']!=null&&this['object_address'])e(0x15f);if(this['permission_address']&&this['data']?.['location']!=null)e(0x161);if(this['permission_address']&&this['data']?.['fee']!=null)e(0x165);if(this['permission_address']&&this['data']?.['usage_guard']!==void 0x0)e(0x163);if(this['permission_address']&&this['data']?.['vote']!=null){if(this['data']['vote']['voting_guard'])d(this['data']['vote']['voting_guard']);}if(this['permission_address']&&this['data']?.['voting_guard']!=null)e(0x162);if(this['permission_address']&&this['data']?.['pause']!==void 0x0)e(0x164);if(this['permission_address']&&this['data']?.['owner_receive']!=null)e(0x16f);if(this['permission_address']&&this['data']?.['arbitration']!=null)e(0x167);if(this['permission_address']&&this['data']?.['feedback']!=null)e(0x168);if(this['permission_address']&&this['data']?.['confirm']!=null)e(0x169);if(this['permission_address']&&this['data']?.['voting_deadline_change']!=null)e(0x16a);if(this['permission_address']&&this['data']?.['reset']!=null)e(0x16b);if(this['permission_address']&&this['data']?.['arb_withdraw']!=null)e(0x16c);if(this['permission_address']&&this['data']?.['fees_transfer']!=null){if('allocator'in this['data']['fees_transfer']['to'])e(0x16d);else{if('treasury'in this['data']['fees_transfer']['to'])e(0x16e);else a60o('invalid\x20parameter','CallArbitration_Data.data.fees_withdraw.to\x20is\x20invalid');}}if(this['permission_address']&&this['data']['um']!==void 0x0)e(0x170);if(this['permission_address']||b['length']>0x0)return await this['check_permission_and_call'](a,this['permission_address'],c,b);return await this['exec'](a);}async['operate'](b,c,d,e){let f=this['permission_address'],g=this['object_address'];if(!this['object_address']){if(!f)f=newPermission(c,this['new_permission_description']??'');if(f&&this['parameter_type'])g=newArbitration(c,this['parameter_type'],f,this['data']?.['description']??'',d);}if(!g||!f)a60o('invalid\x20parameter','CallArbitration_Data.data.object:'+this['object_address']);if(this['data']['dispute']!=null){const h=await LocalMark['Instance']()['get_address'](this['data']['dispute']['order']);if(!h)a60o('invalid\x20parameter','CallArbitration_Data.data.dispute.order:'+this['data']['dispute']['order']);const i=await a60p({'objects':[h],'no_cache':b['no_cache'],'network':b['network']});if(i['objects']&&i['objects']['length']===0x1){const k=i['objects'][0x0];if(k['claimed_by'])a60o('invalid\x20parameter','Order\x20'+h+'\x20already\x20claimed\x20by\x20'+k['claimed_by']+',\x20cannot\x20dispute');if(k['dispute']&&k['dispute']['length']>=a60v)a60o('invalid\x20parameter','Order\x20'+h+'\x20already\x20has\x20'+k['dispute']['length']+'\x20disputes,\x20maximum\x20'+a60v+'\x20allowed');}const j=await dispute(b,c,g,this['parameter_type'],h,this['data']['dispute']['description'],this['data']['dispute']['proposition'],this['data']['dispute']['fee'],d);await this['new_with_mark'](b,c,'Arb',a60A(c,j,this['parameter_type']),a60g(this['data']?.['dispute']['namedArb']));}if(this['data']['description']!=null&&this['object_address'])description_set(c,g,this['parameter_type'],f,this['data']['description'],d);if(this['data']['location']!=null)location_set(c,g,this['parameter_type'],f,this['data']['location'],d);if(this['data']['fee']!=null)fee_set(c,g,this['parameter_type'],f,this['data']['fee'],d);if(this['data']['pause']!=null)pause(c,g,this['parameter_type'],f,this['data']['pause'],d);if(this['data']['confirm']!=null){const l=await LocalMark['Instance']()['get_address'](this['data']['confirm']['arb']);if(l)confirm(c,g,this['parameter_type'],f,l,this['data']['confirm']['voting_deadline'],d);else a60o('invalid\x20parameter','CallArbitration_Data.data.confirm.arb:'+this['data']['confirm']['arb']);}if(this['data']['voting_deadline_change']!=null){const m=await LocalMark['Instance']()['get_address'](this['data']['voting_deadline_change']['arb']);if(m)voting_deadline_change(c,g,this['parameter_type'],f,m,this['data']['voting_deadline_change']['voting_deadline'],d);else a60o('invalid\x20parameter','CallArbitration_Data.data.voting_deadline_change.arb:'+this['data']['voting_deadline_change']['arb']);}if(this['data']['vote']!=null){const n=await LocalMark['Instance']()['get_address'](this['data']['vote']['arb']);if(n)vote(c,g,this['parameter_type'],f,n,this['data']['vote']['votes'],this['data']['vote']['voting_guard'],d);else a60o('invalid\x20parameter','CallArbitration_Data.data.vote.arb:'+this['data']['vote']['arb']);}if(this['data']['feedback']!=null){const o=await LocalMark['Instance']()['get_address'](this['data']['feedback']['arb']);if(o)feedback(c,g,this['parameter_type'],f,o,this['data']['feedback']['feedback'],d);else a60o('invalid\x20parameter','CallArbitration_Data.data.feedback.arb:'+this['data']['feedback']['arb']);}if(this['data']['arbitration']!=null){const q=await LocalMark['Instance']()['get_address'](this['data']['arbitration']['arb']);if(q)arbitration(c,g,this['parameter_type'],f,q,this['data']['arbitration']['feedback'],this['data']['arbitration']['indemnity'],d);else a60o('invalid\x20parameter','CallArbitration_Data.data.arbitration.arb:'+this['data']['arbitration']['arb']);}if(this['data']['reset']!=null){const r=await LocalMark['Instance']()['get_address'](this['data']['reset']['arb']);if(r)reset(c,g,this['parameter_type'],f,r,this['data']['reset']['feedback'],d);else a60o('invalid\x20parameter','CallArbitration_Data.data.reset.arb:'+this['data']['reset']['arb']);}if(this['data']['arb_withdraw']!=null){const s=await LocalMark['Instance']()['get_address'](this['data']['arb_withdraw']['arb']);if(s)arb_withdraw(c,g,this['parameter_type'],f,s,d);else a60o('invalid\x20parameter','CallArbitration_Data.data.arb_withdraw.arb:'+this['data']['arb_withdraw']['arb']);}if(this['data']['fees_transfer']!=null){let u=void 0x0;if('allocation'in this['data']['fees_transfer']['to']){const v=await LocalMark['Instance']()['get_address'](this['data']['fees_transfer']['to']['allocation']);if(v)u=fees_alloc(c,g,this['parameter_type'],f,v,this['data']['fees_transfer']['payment_remark'],this['data']['fees_transfer']['payment_index']);else a60o('invalid\x20parameter','CallArbitration_Data.data.fees_transfer.to.allocation:'+this['data']['fees_transfer']['to']['allocation']);}else{if('treasury'in this['data']['fees_transfer']['to']){const w=await LocalMark['Instance']()['get_address'](this['data']['fees_transfer']['to']['treasury']);if(w)u=fees_transfer(c,g,this['parameter_type'],f,w,this['data']['fees_transfer']['payment_remark'],this['data']['fees_transfer']['payment_index'],d);else a60o('invalid\x20parameter','CallArbitration_Data.data.fees_transfer.to.treasury:'+this['data']['fees_transfer']['to']['treasury']);}else a60o('invalid\x20parameter','CallArbitration_Data.data.fees_withdraw.to\x20is\x20invalid');}if(this['data']['fees_transfer']['newPayment']!=null&&u)await this['new_with_mark'](b,c,'Payment',u,this['data']['fees_transfer']['newPayment']);}if(this['data']['usage_guard']!==void 0x0){if(this['data']['usage_guard']){const x=await LocalMark['Instance']()['get_address'](this['data']['usage_guard']);if(x)usage_guard_set(c,g,this['parameter_type'],f,x,d);}else usage_guard_none(c,g,this['parameter_type'],f,d);}if(this['data']['voting_guard']!=null)switch(this['data']['voting_guard']['op']){case'add':case'set':{if(this['data']['voting_guard']['guards']['length']>a60w)a60o('invalid\x20parameter','Voting\x20guard\x20count\x20exceeds\x20maximum\x20count\x20'+a60w);if(this['data']['voting_guard']['op']==='set')voting_guard_clear(c,g,this['parameter_type'],f,d);const y=await Promise['all'](this['data']['voting_guard']['guards']['map'](async B=>{const C=await LocalMark['Instance']()['get_address'](B['guard']);return{'originalGuard':B['guard'],'guard':C,'vote_weight':B['vote_weight']};})),z=y['filter'](B=>B['guard']===void 0x0)['map'](B=>B['originalGuard']);if(z['length']>0x0)a60o('invalid\x20parameter','Invalid\x20voting\x20guards:\x20'+z['join'](',\x20')+'\x20could\x20not\x20be\x20resolved\x20to\x20valid\x20addresses');const A=y['map'](B=>({'guard':B['guard'],'vote_weight':B['vote_weight']}));voting_guard_add(c,g,this['parameter_type'],f,A,d);break;}case'remove':{const B=await LocalMark['Instance']()['get_many_address_availables'](this['data']['voting_guard']['guards']);if(B['length']>a60w)a60o('invalid\x20parameter','Voting\x20guard\x20count\x20exceeds\x20maximum\x20count\x20'+a60w);voting_guard_remove(c,g,this['parameter_type'],f,B,d);break;}case'clear':voting_guard_clear(c,g,this['parameter_type'],f,d);break;}if(this['data']['owner_receive']!=null&&this['object_address']){if(this['data']['owner_receive']==='recently')this['data']['owner_receive']=await a60t({'name_or_address':{'name_or_address':this['object_address'],'local_mark_first':!![]},'no_cache':b['no_cache'],'network':b['network']});await a60r(c,g,f,this['data']['owner_receive'],this['parameter_type'],C=>'0x2::arbitration::'+C,d);}if(this['data']['um']!==void 0x0){let C=null;if(this['data']['um']){C=await LocalMark['Instance']()['get_address'](this['data']['um'])||null;if(!C)a60o('invalid\x20parameter','CallArbitration_Data.data.um:'+this['data']['um']);}um_set(c,g,this['parameter_type'],f,C,d);}if(!this['permission_address']){const D=a60g(this['data']?.['object']);await this['new_with_mark'](b,c,'Permission',a60z(c,f),a60g(D['permission']));}if(!this['object_address'])await this['new_with_mark'](b,c,'Arbitration',create(c,g,this['parameter_type']),a60g(this['data']?.['object']));}};function create(a,b,c){a60q([b]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');return a['moveCall']({'target':a60e('create'),'arguments':[a60h(a,b)],'typeArguments':[c]});}function newArbitration(a,b,c,d,e){a60q([c]);if(!a60i(b))a60o('invalid\x20parameter','Arbitration\x20type\x20'+b+'\x20is\x20not\x20valid');if(!a60b(d))a60o('invalid\x20parameter','Arbitration\x20description\x20'+d+'\x20exceeds\x20maximum\x20length\x20'+a60j);if(e)return a['moveCall']({'target':a60e('new_with_passport'),'arguments':[a60h(a,c),e,a['pure']['string'](d),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[b]});else return a['moveCall']({'target':a60e('new'),'arguments':[a60h(a,c),a['pure']['string'](d),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[b]});}function description_set(a,b,c,d,e,f){a60q([b,d]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a60b(e))a60o('invalid\x20parameter','Arbitration\x20description\x20'+e+'\x20exceeds\x20maximum\x20length\x20'+a60j);if(f)a['moveCall']({'target':a60e('description_set_with_passsport'),'arguments':[a60h(a,b),a60h(a,d),f,a['pure']['string'](e)],'typeArguments':[c]});else a['moveCall']({'target':a60e('description_set'),'arguments':[a60h(a,b),a60h(a,d),a['pure']['string'](e)],'typeArguments':[c]});}function location_set(a,b,c,d,e,f){a60q([b,d]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a60c(e))a60o('invalid\x20parameter','Arbitration\x20location\x20'+e+'\x20is\x20exceeds\x20maximum\x20length\x20256');if(f)a['moveCall']({'target':a60e('location_set_with_passport'),'arguments':[a60h(a,b),a60h(a,d),f,a['pure']['string'](e)],'typeArguments':[c]});else a['moveCall']({'target':a60e('location_set'),'arguments':[a60h(a,b),a60h(a,d),a['pure']['string'](e)],'typeArguments':[c]});}function voting_guard_add(a,b,c,d,e,f){a60q([b,d]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');e['forEach'](g=>{if(!a60a(g['guard']))a60o('invalid\x20parameter','Voting\x20guard\x20'+g['guard']+'\x20is\x20not\x20valid');if('GuardIdentifier'in g['vote_weight']){if(!a60f(g['vote_weight']['GuardIdentifier']))a60o('invalid\x20parameter','Voting\x20guard\x20'+g['vote_weight']['GuardIdentifier']+'\x20must\x20be\x20u8\x20number');if(f)a['moveCall']({'target':a60e('voting_guard_add_by_id_add_with_passport'),'arguments':[a60h(a,b),a60h(a,d),f,a['object'](g['guard']),a['pure']['u8'](g['vote_weight']['GuardIdentifier'])],'typeArguments':[c]});else a['moveCall']({'target':a60e('voting_guard_add_by_id_add'),'arguments':[a60h(a,b),a60h(a,d),a['object'](g['guard']),a['pure']['u8'](g['vote_weight']['GuardIdentifier'])],'typeArguments':[c]});}else{if('FixedValue'in g['vote_weight']){if(!a60l(g['vote_weight']['FixedValue']))a60o('invalid\x20parameter','Voting\x20guard\x20'+g['vote_weight']['FixedValue']+'\x20must\x20be\x20u32\x20number');if(f)a['moveCall']({'target':a60e('voting_guard_fixed_add_with_passport'),'arguments':[a60h(a,b),a60h(a,d),f,a['object'](g['guard']),a['pure']['u32'](g['vote_weight']['FixedValue']),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a60e('voting_guard_fixed_add'),'arguments':[a60h(a,b),a60h(a,d),a['object'](g['guard']),a['pure']['u32'](g['vote_weight']['FixedValue']),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});}}});}function voting_guard_remove(a,b,c,d,e,f){if(e['length']===0x0)return;a60q([b,d,...e]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a60e('voting_guard_remove_with_passport'),'arguments':[a60h(a,b),a60h(a,d),f,a['pure']['vector']('address',e),a['object']['mutRegistrar']()],'typeArguments':[c]});else a['moveCall']({'target':a60e('voting_guard_remove'),'arguments':[a60h(a,b),a60h(a,d),a['pure']['vector']('address',e),a['object']['mutRegistrar']()],'typeArguments':[c]});}function voting_guard_clear(a,b,c,d,e){a60q([b,d]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(e)a['moveCall']({'target':a60e('voting_guard_clear_with_passport'),'arguments':[a60h(a,b),a60h(a,d),e,a['object']['mutRegistrar']()],'typeArguments':[c]});else a['moveCall']({'target':a60e('voting_guard_clear'),'arguments':[a60h(a,b),a60h(a,d),a['object']['mutRegistrar']()],'typeArguments':[c]});}function usage_guard_set(a,b,c,d,e,f){a60q([b,d,e]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a60e('usage_guard_set_with_passport'),'arguments':[a60h(a,b),a60h(a,d),f,a['object'](e),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a60e('usage_guard_set'),'arguments':[a60h(a,b),a60h(a,d),a['object'](e),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});}function usage_guard_none(a,b,c,d,e){a60q([b,d]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(e)a['moveCall']({'target':a60e('usage_guard_none_with_passport'),'arguments':[a60h(a,b),a60h(a,d),e,a['object']['mutRegistrar']()],'typeArguments':[c]});else a['moveCall']({'target':a60e('usage_guard_none'),'arguments':[a60h(a,b),a60h(a,d),a['object']['mutRegistrar']()],'typeArguments':[c]});}function pause(a,b,c,d,e,f){a60q([b,d]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a60e('pause_with_passport'),'arguments':[a60h(a,b),a60h(a,d),f,a['pure']['bool'](e)],'typeArguments':[c]});else a['moveCall']({'target':a60e('pause'),'arguments':[a60h(a,b),a60h(a,d),a['pure']['bool'](e)],'typeArguments':[c]});}function fee_set(a,b,c,d,e,f){a60q([b,d]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a60d(e))a60o('invalid\x20parameter','Fee\x20'+e+'\x20is\x20not\x20valid\x20u64');if(f)a['moveCall']({'target':a60e('fee_set_with_passport'),'arguments':[a60h(a,b),a60h(a,d),f,a['pure']['u64'](e)],'typeArguments':[c]});else a['moveCall']({'target':a60e('fee_set'),'arguments':[a60h(a,b),a60h(a,d),a['pure']['u64'](e)],'typeArguments':[c]});}async function dispute(a,b,d,e,f,g,h,i,j){a60q([d,f]);if(!a60i(e))a60o('invalid\x20parameter','Arbitration\x20type\x20'+e+'\x20is\x20not\x20valid');if(!a60b(g))a60o('invalid\x20description','Description\x20exceeds\x20maximum\x20length\x20'+a60j);if(h['length']>a60u)a60o('invalid\x20parameter','Proposition\x20count\x20exceeds\x20maximum\x20count\x20'+a60u);if(!a60n(h,a60c))a60o('invalid\x20parameter','Proposition\x20'+h+'\x20is\x20not\x20valid\x20array\x20of\x20string,\x20each\x20string\x20must\x20less\x20than\x20256');const k=await a60x(a,b,i,e);if(j)return b['moveCall']({'target':a60e('dispute_with_passport'),'arguments':[a60h(b,d),j,a60h(b,f),b['pure']['string'](g),b['pure']['vector']('string',h),k,b['object']['clock']()],'typeArguments':[e]});else return b['moveCall']({'target':a60e('dispute'),'arguments':[a60h(b,d),a60h(b,f),b['pure']['string'](g),b['pure']['vector']('string',h),k,b['object']['clock']()],'typeArguments':[e]});}function vote(a,b,c,d,e,f,g,h){a60q([b,d,e,g]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a60n(f,a60f))a60o('invalid\x20parameter','Votes\x20'+f+'\x20is\x20not\x20valid\x20array\x20of\x20u8');if(h){if(g)a['moveCall']({'target':a60e('vote_with_voting_guard'),'arguments':[a60h(a,b),h,a60h(a,e),a60h(a,g),a['pure']['vector']('u8',f),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a60e('vote_with_passport'),'arguments':[a60h(a,b),a60h(a,d),h,a60h(a,e),a['pure']['vector']('u8',f),a['object']['clock']()],'typeArguments':[c]});}else a['moveCall']({'target':a60e('vote'),'arguments':[a60h(a,b),a60h(a,d),a60h(a,e),a['pure']['vector']('u8',f),a['object']['clock']()],'typeArguments':[c]});}function arbitration(a,b,c,d,e,f,g,h){a60q([b,d,e]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a60b(f))a60o('invalid\x20parameter','Feedback\x20'+f+'\x20exceeds\x20maximum\x20length\x20'+a60j);if(!a60d(g))a60o('invalid\x20parameter','Indemnity\x20'+g+'\x20must\x20be\x20u64\x20number');if(h)a['moveCall']({'target':a60e('arbitration_with_passport'),'arguments':[a60h(a,b),a60h(a,d),h,a60h(a,e),a['pure']['string'](f),a['pure']['u64'](g),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a60e('arbitration'),'arguments':[a60h(a,b),a60h(a,d),a60h(a,e),a['pure']['string'](f),a['pure']['u64'](g),a['object']['clock']()],'typeArguments':[c]});}function feedback(a,b,c,d,e,f,g){a60q([b,d,e]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a60b(f))a60o('invalid\x20parameter','Feedback\x20'+f+'\x20exceeds\x20maximum\x20length\x20'+a60j);if(g)a['moveCall']({'target':a60e('feedback_with_passport'),'arguments':[a60h(a,b),a60h(a,d),g,a60h(a,e),a['pure']['string'](f)],'typeArguments':[c]});else a['moveCall']({'target':a60e('feedback'),'arguments':[a60h(a,b),a60h(a,d),a60h(a,e),a['pure']['string'](f)],'typeArguments':[c]});}function confirm(a,b,c,d,e,f,g){a60q([b,d,e]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(f!==null&&!a60d(f))a60o('invalid\x20parameter','Voting\x20deadline\x20'+f+'\x20must\x20be\x20u64\x20number\x20or\x20null');if(g)a['moveCall']({'target':a60e('confirm_with_passport'),'arguments':[a60h(a,b),a60h(a,d),g,a60h(a,e),a['pure']['option']('u64',f)],'typeArguments':[c]});else a['moveCall']({'target':a60e('confirm'),'arguments':[a60h(a,b),a60h(a,d),a60h(a,e),a['pure']['option']('u64',f)],'typeArguments':[c]});}function voting_deadline_change(a,b,c,d,e,f,g){a60q([b,d,e]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(f!==null&&!a60d(f))a60o('invalid\x20parameter','Voting\x20deadline\x20'+f+'\x20must\x20be\x20u64\x20number\x20or\x20null');if(g)a['moveCall']({'target':a60e('voting_deadline_change_with_passport'),'arguments':[a60h(a,b),a60h(a,d),g,a60h(a,e),a['pure']['option']('u64',f)],'typeArguments':[c]});else a['moveCall']({'target':a60e('voting_deadline_change'),'arguments':[a60h(a,b),a60h(a,d),a60h(a,e),a['pure']['option']('u64',f)],'typeArguments':[c]});}function reset(a,b,c,d,e,f,g){a60q([b,d,e]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a60b(f))a60o('invalid\x20parameter','Feedback\x20'+f+'\x20exceeds\x20maximum\x20length\x20'+a60j);if(g)a['moveCall']({'target':a60e('reset_with_passport'),'arguments':[a60h(a,b),a60h(a,d),g,a60h(a,e),a['pure']['string'](f)],'typeArguments':[c]});else a['moveCall']({'target':a60e('reset'),'arguments':[a60h(a,b),a60h(a,d),a60h(a,e),a['pure']['string'](f)],'typeArguments':[c]});}function arb_withdraw(a,b,c,d,e,f){a60q([b,d,e]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a60e('arb_withdraw_with_passport'),'arguments':[a60h(a,b),a60h(a,d),f,a60h(a,e),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a60e('arb_withdraw'),'arguments':[a60h(a,b),a60h(a,d),a60h(a,e),a['object']['clock']()],'typeArguments':[c]});}function fees_alloc(a,b,c,d,e,f,g,h){a60q([b,d,e]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a60b(f))a60o('invalid\x20parameter','Payment\x20remark\x20'+f+'\x20exceeds\x20maximum\x20length\x20'+a60j);if(!a60d(g))a60o('invalid\x20parameter','Payment\x20index\x20'+g+'\x20must\x20be\x20u64\x20number');if(h)return a['moveCall']({'target':a60e('fees_alloc_with_passport'),'arguments':[a60h(a,b),a60h(a,d),h,a60h(a,e),a['pure']['string'](f),a['pure']['u64'](g),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});else return a['moveCall']({'target':a60e('fees_alloc'),'arguments':[a60h(a,b),a60h(a,d),a60h(a,e),a['pure']['string'](f),a['pure']['u64'](g),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});}function fees_transfer(a,b,c,d,e,f,g,h){a60q([b,d,e]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a60b(f))a60o('invalid\x20parameter','Payment\x20remark\x20'+f+'\x20exceeds\x20maximum\x20length\x20'+a60j);if(!a60d(g))a60o('invalid\x20parameter','Payment\x20index\x20'+g+'\x20must\x20be\x20u64\x20number');if(h)return a['moveCall']({'target':a60e('fees_transfer_with_passport'),'arguments':[a60h(a,b),a60h(a,d),h,a60h(a,e),a['pure']['string'](f),a['pure']['u64'](g),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});else return a['moveCall']({'target':a60e('fees_transfer'),'arguments':[a60h(a,b),a60h(a,d),a60h(a,e),a['pure']['string'](f),a['pure']['u64'](g),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});}function um_set(a,b,c,d,e,f){a60q([b,d]);if(!a60i(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(e){if(f)a['moveCall']({'target':a60e('um_set_with_passport'),'arguments':[a60h(a,b),a60h(a,d),f,a60h(a,e),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a60e('um_set'),'arguments':[a60h(a,b),a60h(a,d),a60h(a,e),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});}else{if(f)a['moveCall']({'target':a60e('um_none_with_passport'),'arguments':[a60h(a,b),a60h(a,d),f,a['object']['mutRegistrar']()],'typeArguments':[c]});else a['moveCall']({'target':a60e('um_none'),'arguments':[a60h(a,b),a60h(a,d),a['object']['mutRegistrar']()],'typeArguments':[c]});}}export{CallArbitration,a60w as MAX_VOTING_GUARD_COUNT,arb_withdraw,arbitration,confirm,create,description_set,dispute,fee_set,feedback,fees_alloc,fees_transfer,location_set,newArbitration,pause,reset,um_set,usage_guard_none,usage_guard_set,vote,voting_deadline_change,voting_guard_add,voting_guard_clear,voting_guard_remove};
|
|
1
|
+
import{a as a60a}from'../../wow-types-DcqbnAaK.mjs';import{$ as a60b,K as a60c,L as a60d,Q as a60e,U as a60f,W as a60g,Z as a60h,d as a60i,f as a60j,ht as a60k,m as a60l,u as a60m,v as a60n}from'../../common-ofEOpNis.mjs';import{o as a60o}from'../../exception-C6IYkBi6.mjs';import{LocalMark}from'../local/local.mjs';import{U as a60p,ft as a60q,pt as a60r,vt as a60s}from'../../object-CNbjrx9F.mjs';import{t as a60t}from'../../received-BFjAt453.mjs';import{M as a60u,et as a60v,mt as a60w}from'../../passport-GNU3ZGa6.mjs';import{r as a60x,t as a60y}from'../../base-34PdEIjR.mjs';import{create as a60z,newPermission}from'./permission.mjs';import{t as a60A}from'../../arb-BzFlUNMS.mjs';var CallArbitration=class extends a60y{constructor(a){super(),this['object_address']=void 0x0,this['permission_address']=void 0x0,this['new_permission_description']=void 0x0,this['parameter_type']=void 0x0,this['data']=a;}async['prepare'](a){await super['prepare'](a);if(!this['object_address'])this['object_address']=await a60j(this['data']?.['object']);if(this['object_address']){this['content']=void 0x0,await this['update_content'](a,'Arbitration',this['object_address']);if(!this['content'])a60o('invalid\x20parameter','CallArbitration_Data.data.object:'+this['object_address']);this['permission_address']=this['content']['permission'],this['parameter_type']=a60r(this['content']['type_raw'],'arbitration::Arbitration');if(!this['permission_address'])a60o('invalid\x20parameter','CallArbitration_Data.data.object.permission\x20is\x20empty');if(!a60l(this['parameter_type']))a60o('invalid\x20argument\x20type','CallArbitration_Data.data.object.type_parameter\x20is\x20empty');}else{const b=a60m(this['data']['object']);this['permission_address']=await a60j(b?.['permission']),this['new_permission_description']=a60i(b),this['parameter_type']=b?.['type_parameter'];if(!a60l(this['parameter_type']))a60o('invalid\x20argument\x20type','CallArbitration_Data.data.object.type_parameter\x20invalid');}if(this['data']['vote']?.['voting_guard']!=null&&!a60a(this['data']['vote']['voting_guard'])){const c=await LocalMark['Instance']()['get_address'](this['data']['vote']['voting_guard']);if(!c||!a60a(c))a60o('invalid\x20address','vote.voting_guard:\x20'+this['data']['vote']['voting_guard']);this['data']['vote']['voting_guard']=c;}}async['call'](a){await this['prepare'](a);const b=[],c=[],d=g=>{if(!b['includes'](g))b['push'](g);},e=g=>{if(this['permission_address']&&!c['includes'](g))c['push'](g);},f=this['content'];if(this['permission_address']&&!this['object_address'])e(0x15e);if(this['data']?.['dispute']!=null){if(f?.['bPaused'])a60o('invalid\x20parameter','Arbitration\x20is\x20paused\x20and\x20cannot\x20be\x20disputed');if(f?.['usage_guard'])d(f['usage_guard']);}if(this['permission_address']&&this['data']?.['description']!=null&&this['object_address'])e(0x15f);if(this['permission_address']&&this['data']?.['location']!=null)e(0x161);if(this['permission_address']&&this['data']?.['fee']!=null)e(0x165);if(this['permission_address']&&this['data']?.['usage_guard']!==void 0x0)e(0x163);if(this['permission_address']&&this['data']?.['vote']!=null){if(this['data']['vote']['voting_guard'])d(this['data']['vote']['voting_guard']);}if(this['permission_address']&&this['data']?.['voting_guard']!=null)e(0x162);if(this['permission_address']&&this['data']?.['pause']!==void 0x0)e(0x164);if(this['permission_address']&&this['data']?.['owner_receive']!=null)e(0x16f);if(this['permission_address']&&this['data']?.['arbitration']!=null)e(0x167);if(this['permission_address']&&this['data']?.['feedback']!=null)e(0x168);if(this['permission_address']&&this['data']?.['confirm']!=null)e(0x169);if(this['permission_address']&&this['data']?.['voting_deadline_change']!=null)e(0x16a);if(this['permission_address']&&this['data']?.['reset']!=null)e(0x16b);if(this['permission_address']&&this['data']?.['arb_withdraw']!=null)e(0x16c);if(this['permission_address']&&this['data']?.['fees_transfer']!=null){if('allocator'in this['data']['fees_transfer']['to'])e(0x16d);else{if('treasury'in this['data']['fees_transfer']['to'])e(0x16e);else a60o('invalid\x20parameter','CallArbitration_Data.data.fees_withdraw.to\x20is\x20invalid');}}if(this['permission_address']&&this['data']['um']!==void 0x0)e(0x170);if(this['permission_address']||b['length']>0x0)return await this['check_permission_and_call'](a,this['permission_address'],c,b);return await this['exec'](a);}async['operate'](b,c,d,e){let f=this['permission_address'],g=this['object_address'];if(!this['object_address']){if(!f)f=newPermission(c,this['new_permission_description']??'');if(f&&this['parameter_type'])g=newArbitration(c,this['parameter_type'],f,this['data']?.['description']??'',d);}if(!g||!f)a60o('invalid\x20parameter','CallArbitration_Data.data.object:'+this['object_address']);if(this['data']['dispute']!=null){const h=await LocalMark['Instance']()['get_address'](this['data']['dispute']['order']);if(!h)a60o('invalid\x20parameter','CallArbitration_Data.data.dispute.order:'+this['data']['dispute']['order']);const i=await a60p({'objects':[h],'no_cache':b['no_cache'],'network':b['network']});if(i['objects']&&i['objects']['length']===0x1){const k=i['objects'][0x0];if(k['claimed_by'])a60o('invalid\x20parameter','Order\x20'+h+'\x20already\x20claimed\x20by\x20'+k['claimed_by']+',\x20cannot\x20dispute');if(k['dispute']&&k['dispute']['length']>=a60u)a60o('invalid\x20parameter','Order\x20'+h+'\x20already\x20has\x20'+k['dispute']['length']+'\x20disputes,\x20maximum\x20'+a60u+'\x20allowed');}const j=await dispute(b,c,g,this['parameter_type'],h,this['data']['dispute']['description'],this['data']['dispute']['proposition'],this['data']['dispute']['fee'],d);await this['new_with_mark'](b,c,'Arb',a60A(c,j,this['parameter_type']),a60m(this['data']?.['dispute']['namedArb']));}if(this['data']['description']!=null&&this['object_address'])description_set(c,g,this['parameter_type'],f,this['data']['description'],d);if(this['data']['location']!=null)location_set(c,g,this['parameter_type'],f,this['data']['location'],d);if(this['data']['fee']!=null)fee_set(c,g,this['parameter_type'],f,this['data']['fee'],d);if(this['data']['pause']!=null)pause(c,g,this['parameter_type'],f,this['data']['pause'],d);if(this['data']['confirm']!=null){const l=await LocalMark['Instance']()['get_address'](this['data']['confirm']['arb']);if(l)confirm(c,g,this['parameter_type'],f,l,this['data']['confirm']['voting_deadline'],d);else a60o('invalid\x20parameter','CallArbitration_Data.data.confirm.arb:'+this['data']['confirm']['arb']);}if(this['data']['voting_deadline_change']!=null){const m=await LocalMark['Instance']()['get_address'](this['data']['voting_deadline_change']['arb']);if(m)voting_deadline_change(c,g,this['parameter_type'],f,m,this['data']['voting_deadline_change']['voting_deadline'],d);else a60o('invalid\x20parameter','CallArbitration_Data.data.voting_deadline_change.arb:'+this['data']['voting_deadline_change']['arb']);}if(this['data']['vote']!=null){const n=await LocalMark['Instance']()['get_address'](this['data']['vote']['arb']);if(n)vote(c,g,this['parameter_type'],f,n,this['data']['vote']['votes'],this['data']['vote']['voting_guard'],d);else a60o('invalid\x20parameter','CallArbitration_Data.data.vote.arb:'+this['data']['vote']['arb']);}if(this['data']['feedback']!=null){const o=await LocalMark['Instance']()['get_address'](this['data']['feedback']['arb']);if(o)feedback(c,g,this['parameter_type'],f,o,this['data']['feedback']['feedback'],d);else a60o('invalid\x20parameter','CallArbitration_Data.data.feedback.arb:'+this['data']['feedback']['arb']);}if(this['data']['arbitration']!=null){const q=await LocalMark['Instance']()['get_address'](this['data']['arbitration']['arb']);if(q)arbitration(c,g,this['parameter_type'],f,q,this['data']['arbitration']['feedback'],this['data']['arbitration']['indemnity'],d);else a60o('invalid\x20parameter','CallArbitration_Data.data.arbitration.arb:'+this['data']['arbitration']['arb']);}if(this['data']['reset']!=null){const r=await LocalMark['Instance']()['get_address'](this['data']['reset']['arb']);if(r)reset(c,g,this['parameter_type'],f,r,this['data']['reset']['feedback'],d);else a60o('invalid\x20parameter','CallArbitration_Data.data.reset.arb:'+this['data']['reset']['arb']);}if(this['data']['arb_withdraw']!=null){const s=await LocalMark['Instance']()['get_address'](this['data']['arb_withdraw']['arb']);if(s)arb_withdraw(c,g,this['parameter_type'],f,s,d);else a60o('invalid\x20parameter','CallArbitration_Data.data.arb_withdraw.arb:'+this['data']['arb_withdraw']['arb']);}if(this['data']['fees_transfer']!=null){let u=void 0x0;if('allocation'in this['data']['fees_transfer']['to']){const v=await LocalMark['Instance']()['get_address'](this['data']['fees_transfer']['to']['allocation']);if(v)u=fees_alloc(c,g,this['parameter_type'],f,v,this['data']['fees_transfer']['payment_remark'],this['data']['fees_transfer']['payment_index']);else a60o('invalid\x20parameter','CallArbitration_Data.data.fees_transfer.to.allocation:'+this['data']['fees_transfer']['to']['allocation']);}else{if('treasury'in this['data']['fees_transfer']['to']){const w=await LocalMark['Instance']()['get_address'](this['data']['fees_transfer']['to']['treasury']);if(w)u=fees_transfer(c,g,this['parameter_type'],f,w,this['data']['fees_transfer']['payment_remark'],this['data']['fees_transfer']['payment_index'],d);else a60o('invalid\x20parameter','CallArbitration_Data.data.fees_transfer.to.treasury:'+this['data']['fees_transfer']['to']['treasury']);}else a60o('invalid\x20parameter','CallArbitration_Data.data.fees_withdraw.to\x20is\x20invalid');}if(this['data']['fees_transfer']['newPayment']!=null&&u)await this['new_with_mark'](b,c,'Payment',u,this['data']['fees_transfer']['newPayment']);}if(this['data']['usage_guard']!==void 0x0){if(this['data']['usage_guard']){const x=await LocalMark['Instance']()['get_address'](this['data']['usage_guard']);if(x)usage_guard_set(c,g,this['parameter_type'],f,x,d);}else usage_guard_none(c,g,this['parameter_type'],f,d);}if(this['data']['voting_guard']!=null)switch(this['data']['voting_guard']['op']){case'add':case'set':{if(this['data']['voting_guard']['guards']['length']>a60w)a60o('invalid\x20parameter','Voting\x20guard\x20count\x20exceeds\x20maximum\x20count\x20'+a60w);if(this['data']['voting_guard']['op']==='set')voting_guard_clear(c,g,this['parameter_type'],f,d);const y=await Promise['all'](this['data']['voting_guard']['guards']['map'](async B=>{const C=await LocalMark['Instance']()['get_address'](B['guard']);return{'originalGuard':B['guard'],'guard':C,'vote_weight':B['vote_weight']};})),z=y['filter'](B=>B['guard']===void 0x0)['map'](B=>B['originalGuard']);if(z['length']>0x0)a60o('invalid\x20parameter','Invalid\x20voting\x20guards:\x20'+z['join'](',\x20')+'\x20could\x20not\x20be\x20resolved\x20to\x20valid\x20addresses');const A=y['map'](B=>({'guard':B['guard'],'vote_weight':B['vote_weight']}));voting_guard_add(c,g,this['parameter_type'],f,A,d);break;}case'remove':{const B=await LocalMark['Instance']()['get_many_address_availables'](this['data']['voting_guard']['guards']);if(B['length']>a60w)a60o('invalid\x20parameter','Voting\x20guard\x20count\x20exceeds\x20maximum\x20count\x20'+a60w);voting_guard_remove(c,g,this['parameter_type'],f,B,d);break;}case'clear':voting_guard_clear(c,g,this['parameter_type'],f,d);break;}if(this['data']['owner_receive']!=null&&this['object_address']){if(this['data']['owner_receive']==='recently')this['data']['owner_receive']=await a60t({'name_or_address':{'name_or_address':this['object_address'],'local_mark_first':!![]},'no_cache':b['no_cache'],'network':b['network']});await a60q(c,g,f,this['data']['owner_receive'],this['parameter_type'],C=>'0x2::arbitration::'+C,d);}if(this['data']['um']!==void 0x0){let C=null;if(this['data']['um']){C=await LocalMark['Instance']()['get_address'](this['data']['um'])||null;if(!C)a60o('invalid\x20parameter','CallArbitration_Data.data.um:'+this['data']['um']);}um_set(c,g,this['parameter_type'],f,C,d);}if(!this['permission_address']){const D=a60m(this['data']?.['object']);await this['new_with_mark'](b,c,'Permission',a60z(c,f),a60m(D['permission']));}if(!this['object_address'])await this['new_with_mark'](b,c,'Arbitration',create(c,g,this['parameter_type']),a60m(this['data']?.['object']));}};function create(a,b,c){a60s([b]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');return a['moveCall']({'target':a60d('create'),'arguments':[a60k(a,b)],'typeArguments':[c]});}function newArbitration(a,b,c,d,e){a60s([c]);if(!a60l(b))a60o('invalid\x20parameter','Arbitration\x20type\x20'+b+'\x20is\x20not\x20valid');if(!a60g(d))a60o('invalid\x20parameter','Arbitration\x20description\x20'+d+'\x20exceeds\x20maximum\x20length\x20'+a60n);if(e)return a['moveCall']({'target':a60d('new_with_passport'),'arguments':[a60k(a,c),e,a['pure']['string'](d),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[b]});else return a['moveCall']({'target':a60d('new'),'arguments':[a60k(a,c),a['pure']['string'](d),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[b]});}function description_set(a,b,c,d,e,f){a60s([b,d]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a60g(e))a60o('invalid\x20parameter','Arbitration\x20description\x20'+e+'\x20exceeds\x20maximum\x20length\x20'+a60n);if(f)a['moveCall']({'target':a60d('description_set_with_passsport'),'arguments':[a60k(a,b),a60k(a,d),f,a['pure']['string'](e)],'typeArguments':[c]});else a['moveCall']({'target':a60d('description_set'),'arguments':[a60k(a,b),a60k(a,d),a['pure']['string'](e)],'typeArguments':[c]});}function location_set(a,b,c,d,e,f){a60s([b,d]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a60c(e))a60o('invalid\x20parameter','Arbitration\x20location\x20'+e+'\x20is\x20exceeds\x20maximum\x20length\x20256');if(f)a['moveCall']({'target':a60d('location_set_with_passport'),'arguments':[a60k(a,b),a60k(a,d),f,a['pure']['string'](e)],'typeArguments':[c]});else a['moveCall']({'target':a60d('location_set'),'arguments':[a60k(a,b),a60k(a,d),a['pure']['string'](e)],'typeArguments':[c]});}function voting_guard_add(a,b,c,d,e,f){a60s([b,d]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');e['forEach'](g=>{if(!a60a(g['guard']))a60o('invalid\x20parameter','Voting\x20guard\x20'+g['guard']+'\x20is\x20not\x20valid');if('GuardIdentifier'in g['vote_weight']){if(!a60b(g['vote_weight']['GuardIdentifier']))a60o('invalid\x20parameter','Voting\x20guard\x20'+g['vote_weight']['GuardIdentifier']+'\x20must\x20be\x20u8\x20number');if(f)a['moveCall']({'target':a60d('voting_guard_add_by_id_add_with_passport'),'arguments':[a60k(a,b),a60k(a,d),f,a['object'](g['guard']),a['pure']['u8'](g['vote_weight']['GuardIdentifier'])],'typeArguments':[c]});else a['moveCall']({'target':a60d('voting_guard_add_by_id_add'),'arguments':[a60k(a,b),a60k(a,d),a['object'](g['guard']),a['pure']['u8'](g['vote_weight']['GuardIdentifier'])],'typeArguments':[c]});}else{if('FixedValue'in g['vote_weight']){if(!a60h(g['vote_weight']['FixedValue']))a60o('invalid\x20parameter','Voting\x20guard\x20'+g['vote_weight']['FixedValue']+'\x20must\x20be\x20u32\x20number');if(f)a['moveCall']({'target':a60d('voting_guard_fixed_add_with_passport'),'arguments':[a60k(a,b),a60k(a,d),f,a['object'](g['guard']),a['pure']['u32'](g['vote_weight']['FixedValue']),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a60d('voting_guard_fixed_add'),'arguments':[a60k(a,b),a60k(a,d),a['object'](g['guard']),a['pure']['u32'](g['vote_weight']['FixedValue']),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});}}});}function voting_guard_remove(a,b,c,d,e,f){if(e['length']===0x0)return;a60s([b,d,...e]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a60d('voting_guard_remove_with_passport'),'arguments':[a60k(a,b),a60k(a,d),f,a['pure']['vector']('address',e),a['object']['mutRegistrar']()],'typeArguments':[c]});else a['moveCall']({'target':a60d('voting_guard_remove'),'arguments':[a60k(a,b),a60k(a,d),a['pure']['vector']('address',e),a['object']['mutRegistrar']()],'typeArguments':[c]});}function voting_guard_clear(a,b,c,d,e){a60s([b,d]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(e)a['moveCall']({'target':a60d('voting_guard_clear_with_passport'),'arguments':[a60k(a,b),a60k(a,d),e,a['object']['mutRegistrar']()],'typeArguments':[c]});else a['moveCall']({'target':a60d('voting_guard_clear'),'arguments':[a60k(a,b),a60k(a,d),a['object']['mutRegistrar']()],'typeArguments':[c]});}function usage_guard_set(a,b,c,d,e,f){a60s([b,d,e]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a60d('usage_guard_set_with_passport'),'arguments':[a60k(a,b),a60k(a,d),f,a['object'](e),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a60d('usage_guard_set'),'arguments':[a60k(a,b),a60k(a,d),a['object'](e),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});}function usage_guard_none(a,b,c,d,e){a60s([b,d]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(e)a['moveCall']({'target':a60d('usage_guard_none_with_passport'),'arguments':[a60k(a,b),a60k(a,d),e,a['object']['mutRegistrar']()],'typeArguments':[c]});else a['moveCall']({'target':a60d('usage_guard_none'),'arguments':[a60k(a,b),a60k(a,d),a['object']['mutRegistrar']()],'typeArguments':[c]});}function pause(a,b,c,d,e,f){a60s([b,d]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a60d('pause_with_passport'),'arguments':[a60k(a,b),a60k(a,d),f,a['pure']['bool'](e)],'typeArguments':[c]});else a['moveCall']({'target':a60d('pause'),'arguments':[a60k(a,b),a60k(a,d),a['pure']['bool'](e)],'typeArguments':[c]});}function fee_set(a,b,c,d,e,f){a60s([b,d]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a60e(e))a60o('invalid\x20parameter','Fee\x20'+e+'\x20is\x20not\x20valid\x20u64');if(f)a['moveCall']({'target':a60d('fee_set_with_passport'),'arguments':[a60k(a,b),a60k(a,d),f,a['pure']['u64'](e)],'typeArguments':[c]});else a['moveCall']({'target':a60d('fee_set'),'arguments':[a60k(a,b),a60k(a,d),a['pure']['u64'](e)],'typeArguments':[c]});}async function dispute(a,b,d,e,f,g,h,i,j){a60s([d,f]);if(!a60l(e))a60o('invalid\x20parameter','Arbitration\x20type\x20'+e+'\x20is\x20not\x20valid');if(!a60g(g))a60o('invalid\x20description','Description\x20exceeds\x20maximum\x20length\x20'+a60n);if(h['length']>a60v)a60o('invalid\x20parameter','Proposition\x20count\x20exceeds\x20maximum\x20count\x20'+a60v);if(!a60f(h,a60c))a60o('invalid\x20parameter','Proposition\x20'+h+'\x20is\x20not\x20valid\x20array\x20of\x20string,\x20each\x20string\x20must\x20less\x20than\x20256');const k=await a60x(a,b,i,e);if(j)return b['moveCall']({'target':a60d('dispute_with_passport'),'arguments':[a60k(b,d),j,a60k(b,f),b['pure']['string'](g),b['pure']['vector']('string',h),k,b['object']['mutRegistrar'](),b['object']['clock']()],'typeArguments':[e]});else return b['moveCall']({'target':a60d('dispute'),'arguments':[a60k(b,d),a60k(b,f),b['pure']['string'](g),b['pure']['vector']('string',h),k,b['object']['mutRegistrar'](),b['object']['clock']()],'typeArguments':[e]});}function vote(a,b,c,d,e,f,g,h){a60s([b,d,e,g]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a60f(f,a60b))a60o('invalid\x20parameter','Votes\x20'+f+'\x20is\x20not\x20valid\x20array\x20of\x20u8');if(h){if(g)a['moveCall']({'target':a60d('vote_with_voting_guard'),'arguments':[a60k(a,b),h,a60k(a,e),a60k(a,g),a['pure']['vector']('u8',f),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a60d('vote_with_passport'),'arguments':[a60k(a,b),a60k(a,d),h,a60k(a,e),a['pure']['vector']('u8',f),a['object']['clock']()],'typeArguments':[c]});}else a['moveCall']({'target':a60d('vote'),'arguments':[a60k(a,b),a60k(a,d),a60k(a,e),a['pure']['vector']('u8',f),a['object']['clock']()],'typeArguments':[c]});}function arbitration(a,b,c,d,e,f,g,h){a60s([b,d,e]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a60g(f))a60o('invalid\x20parameter','Feedback\x20'+f+'\x20exceeds\x20maximum\x20length\x20'+a60n);if(!a60e(g))a60o('invalid\x20parameter','Indemnity\x20'+g+'\x20must\x20be\x20u64\x20number');if(h)a['moveCall']({'target':a60d('arbitration_with_passport'),'arguments':[a60k(a,b),a60k(a,d),h,a60k(a,e),a['pure']['string'](f),a['pure']['u64'](g),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a60d('arbitration'),'arguments':[a60k(a,b),a60k(a,d),a60k(a,e),a['pure']['string'](f),a['pure']['u64'](g),a['object']['clock']()],'typeArguments':[c]});}function feedback(a,b,c,d,e,f,g){a60s([b,d,e]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a60g(f))a60o('invalid\x20parameter','Feedback\x20'+f+'\x20exceeds\x20maximum\x20length\x20'+a60n);if(g)a['moveCall']({'target':a60d('feedback_with_passport'),'arguments':[a60k(a,b),a60k(a,d),g,a60k(a,e),a['pure']['string'](f)],'typeArguments':[c]});else a['moveCall']({'target':a60d('feedback'),'arguments':[a60k(a,b),a60k(a,d),a60k(a,e),a['pure']['string'](f)],'typeArguments':[c]});}function confirm(a,b,c,d,e,f,g){a60s([b,d,e]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(f!==null&&!a60e(f))a60o('invalid\x20parameter','Voting\x20deadline\x20'+f+'\x20must\x20be\x20u64\x20number\x20or\x20null');if(g)a['moveCall']({'target':a60d('confirm_with_passport'),'arguments':[a60k(a,b),a60k(a,d),g,a60k(a,e),a['pure']['option']('u64',f)],'typeArguments':[c]});else a['moveCall']({'target':a60d('confirm'),'arguments':[a60k(a,b),a60k(a,d),a60k(a,e),a['pure']['option']('u64',f)],'typeArguments':[c]});}function voting_deadline_change(a,b,c,d,e,f,g){a60s([b,d,e]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(f!==null&&!a60e(f))a60o('invalid\x20parameter','Voting\x20deadline\x20'+f+'\x20must\x20be\x20u64\x20number\x20or\x20null');if(g)a['moveCall']({'target':a60d('voting_deadline_change_with_passport'),'arguments':[a60k(a,b),a60k(a,d),g,a60k(a,e),a['pure']['option']('u64',f)],'typeArguments':[c]});else a['moveCall']({'target':a60d('voting_deadline_change'),'arguments':[a60k(a,b),a60k(a,d),a60k(a,e),a['pure']['option']('u64',f)],'typeArguments':[c]});}function reset(a,b,c,d,e,f,g){a60s([b,d,e]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a60g(f))a60o('invalid\x20parameter','Feedback\x20'+f+'\x20exceeds\x20maximum\x20length\x20'+a60n);if(g)a['moveCall']({'target':a60d('reset_with_passport'),'arguments':[a60k(a,b),a60k(a,d),g,a60k(a,e),a['pure']['string'](f)],'typeArguments':[c]});else a['moveCall']({'target':a60d('reset'),'arguments':[a60k(a,b),a60k(a,d),a60k(a,e),a['pure']['string'](f)],'typeArguments':[c]});}function arb_withdraw(a,b,c,d,e,f){a60s([b,d,e]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(f)a['moveCall']({'target':a60d('arb_withdraw_with_passport'),'arguments':[a60k(a,b),a60k(a,d),f,a60k(a,e),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a60d('arb_withdraw'),'arguments':[a60k(a,b),a60k(a,d),a60k(a,e),a['object']['clock']()],'typeArguments':[c]});}function fees_alloc(a,b,c,d,e,f,g,h){a60s([b,d,e]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a60g(f))a60o('invalid\x20parameter','Payment\x20remark\x20'+f+'\x20exceeds\x20maximum\x20length\x20'+a60n);if(!a60e(g))a60o('invalid\x20parameter','Payment\x20index\x20'+g+'\x20must\x20be\x20u64\x20number');if(h)return a['moveCall']({'target':a60d('fees_alloc_with_passport'),'arguments':[a60k(a,b),a60k(a,d),h,a60k(a,e),a['pure']['string'](f),a['pure']['u64'](g),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});else return a['moveCall']({'target':a60d('fees_alloc'),'arguments':[a60k(a,b),a60k(a,d),a60k(a,e),a['pure']['string'](f),a['pure']['u64'](g),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});}function fees_transfer(a,b,c,d,e,f,g,h){a60s([b,d,e]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(!a60g(f))a60o('invalid\x20parameter','Payment\x20remark\x20'+f+'\x20exceeds\x20maximum\x20length\x20'+a60n);if(!a60e(g))a60o('invalid\x20parameter','Payment\x20index\x20'+g+'\x20must\x20be\x20u64\x20number');if(h)return a['moveCall']({'target':a60d('fees_transfer_with_passport'),'arguments':[a60k(a,b),a60k(a,d),h,a60k(a,e),a['pure']['string'](f),a['pure']['u64'](g),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});else return a['moveCall']({'target':a60d('fees_transfer'),'arguments':[a60k(a,b),a60k(a,d),a60k(a,e),a['pure']['string'](f),a['pure']['u64'](g),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});}function um_set(a,b,c,d,e,f){a60s([b,d]);if(!a60l(c))a60o('invalid\x20parameter','Arbitration\x20type\x20'+c+'\x20is\x20not\x20valid');if(e){if(f)a['moveCall']({'target':a60d('um_set_with_passport'),'arguments':[a60k(a,b),a60k(a,d),f,a60k(a,e),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});else a['moveCall']({'target':a60d('um_set'),'arguments':[a60k(a,b),a60k(a,d),a60k(a,e),a['object']['mutRegistrar'](),a['object']['clock']()],'typeArguments':[c]});}else{if(f)a['moveCall']({'target':a60d('um_none_with_passport'),'arguments':[a60k(a,b),a60k(a,d),f,a['object']['mutRegistrar']()],'typeArguments':[c]});else a['moveCall']({'target':a60d('um_none'),'arguments':[a60k(a,b),a60k(a,d),a['object']['mutRegistrar']()],'typeArguments':[c]});}}export{CallArbitration,a60w as MAX_VOTING_GUARD_COUNT,arb_withdraw,arbitration,confirm,create,description_set,dispute,fee_set,feedback,fees_alloc,fees_transfer,location_set,newArbitration,pause,reset,um_set,usage_guard_none,usage_guard_set,vote,voting_deadline_change,voting_guard_add,voting_guard_clear,voting_guard_remove};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Cm as isCallResultSubmission, Sm as getCoinParam, _m as CallBase, bm as ObjectsOp, vm as CallResponseError, xm as ResponseData, ym as CallResult } from "../../index-BB-qrJhQ.mjs";
|
|
2
2
|
export { CallBase, CallResponseError, CallResult, ObjectsOp, ResponseData, getCoinParam, isCallResultSubmission };
|
package/dist/esm/w/call/base.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as a61a,n as a61b,r as a61c,t as a61d}from'../../base-
|
|
1
|
+
import{i as a61a,n as a61b,r as a61c,t as a61d}from'../../base-34PdEIjR.mjs';export{a61d as CallBase,a61b as ResponseData,a61c as getCoinParam,a61a as isCallResultSubmission};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Cu as reward_clear, Su as reward_add, Tu as um_set, Uh as MAX_GUARD_COUNT_DEMAND, _u as guard_clear, bu as newDemand, cu as DemandPresent, du as MAX_GUARD_COUNT, fg as MAX_REWARD_COUNT, fu as ServiceInfo, gu as guard_add, hu as feedback, lu as FeedbackInfo, mu as description_set, ou as CallDemand, pu as create, su as CallDemand_Data, uu as MAX_FEEDBACK_COUNT, vu as guard_remove, wu as reward_remove, xu as present, yu as location_set } from "../../index-BB-qrJhQ.mjs";
|
|
2
2
|
export { CallDemand, CallDemand_Data, DemandPresent, FeedbackInfo, MAX_FEEDBACK_COUNT, MAX_GUARD_COUNT, MAX_GUARD_COUNT_DEMAND, MAX_REWARD_COUNT, ServiceInfo, create, description_set, feedback, guard_add, guard_clear, guard_remove, location_set, newDemand, present, reward_add, reward_clear, reward_remove, um_set };
|