wowok_agent 0.1.22 → 0.1.23
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/main-31743c5a.881abad8d11bae30ecbd.js +1 -0
- package/dist/main-43dd7041.6fd7931c9da91a94e7c6.js +1 -0
- package/dist/main-84781932.72561024171864f1592e.js +1 -0
- package/dist/src/account.d.ts +1 -2
- package/dist/src/account.d.ts.map +1 -1
- package/dist/src/call/arbitration.d.ts +0 -1
- package/dist/src/call/arbitration.d.ts.map +1 -1
- package/dist/src/call/arbitration.js +0 -1
- package/dist/src/call/base.d.ts +1 -2
- package/dist/src/call/base.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/account.ts +1 -3
- package/src/call/arbitration.ts +0 -2
- package/src/call/base.ts +1 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunkwowok_agent=this.webpackChunkwowok_agent||[]).push([[428],{300:(a,e,t)=>{t.d(e,{R:()=>i});var r=t(7495),s=t(6401);class i extends s.s{data;constructor(a){super(),this.data=a}async call(a){return await this.exec(a)}async operate(a,e,t){let s,i=r.Entity.From(a);const d=this.data?.object?.address;if(s=d&&(0,r.IsValidAddress)(d)?r.Resource.From(a,d):r.Resource.From(a,i.create_resource2()),"destroy"!==this.data?.mark?.op){if(void 0!==this.data?.information&&i.update(this.data.information),s&&s?.get_object()){if(void 0!==this.data?.mark)switch(this.data.mark.op){case"add or set":this.data.mark.data.forEach((a=>{s?.add(a.address,a.tags,a.name)}));break;case"remove":this.data.mark.data.forEach((a=>{s?.remove(a.address,a.tags)}));break;case"removeall":this.data.mark.addresses.forEach((a=>{s?.removeall(a)}))}"transfer"===this.data?.mark?.op&&s&&(0,r.IsValidAddress)(this.data.mark.address)&&i.transfer_resource(s,this.data.mark.address),"replace"===this.data?.mark?.op&&(0,r.IsValidAddress)(this.data.mark.address)&&i.use_resource(r.Resource.From(a,this.data.mark.address)),!d&&s&&await this.new_with_mark(a,s.launch(),this.data?.object?.namedNew,t)}}else i.destroy_resource(s)}}},3769:(a,e,t)=>{t.d(e,{H:()=>d});var r=t(6401),s=t(7495),i=t(3245);class d extends r.s{data;constructor(a){super(),this.data=a}async call(a){if((0,s.IsValidAddress)(this.data.new_permission)||(0,s.ERROR)(s.Errors.InvalidParam,"CallObjectPermission_Data.new_permission"+this.data.new_permission),this.data?.objects.length>0)return await this.exec(a)}async operate(a,e){const t=await(0,i.w$)({objects:this.data.objects,showContent:!0});t.objects?.forEach((e=>{switch(e.type){case"Demand":const t=e;s.Demand.From(a,s.Demand.parseObjectType(t.type_raw),t.permission,t.object).change_permission(this.data.new_permission);break;case"Machine":const r=e;s.Machine.From(a,r.permission,r.object).change_permission(this.data.new_permission);break;case"Service":const i=e;s.Service.From(a,s.Service.parseObjectType(i.type_raw),i.permission,i.object).change_permission(this.data.new_permission);break;case"Treasury":const d=e;s.Treasury.From(a,s.Treasury.parseObjectType(d.type_raw),d.permission,d.object).change_permission(this.data.new_permission);break;case"Arbitration":const o=e;s.Arbitration.From(a,s.Arbitration.parseObjectType(o.type_raw),o.permission,o.object).change_permission(this.data.new_permission);break;case"Repository":const n=e;s.Repository.From(a,n.permission,n.object).change_permission(this.data.new_permission)}}))}}},4873:(a,e,t)=>{t.d(e,{c:()=>o});var r=t(7495),s=t(3245),i=t(6401),d=t(9766);class o extends i.s{data;constructor(a){super(),this.data=a}async call(a){this.data.type_parameter&&(0,r.IsValidArgType)(this.data.type_parameter)||(0,r.ERROR)(r.Errors.IsValidArgType,"treasury.type_parameter");const e=[],t=[];var i;const d=this.data?.permission?.address,o=this.data?.object?.address;if(d&&(0,r.IsValidAddress)(d)){if(this.data?.object||t.push(r.PermissionIndex.treasury),void 0!==this.data?.description&&o&&t.push(r.PermissionIndex.treasury_descritption),void 0!==this.data?.withdraw_mode&&t.push(r.PermissionIndex.treasury_withdraw_mode),null==this.data?.withdraw_guard&&t.push(r.PermissionIndex.treasury_withdraw_guard),void 0!==this.data?.deposit_guard&&t.push(r.PermissionIndex.treasury_deposit_guard),void 0!==this.data?.deposit_guard&&t.push(r.PermissionIndex.treasury_deposit_guard),void 0!==this.data?.deposit?.guard)if((0,r.IsValidAddress)(this.data.deposit.guard))e.push(this.data.deposit.guard);else if(this.data.object){if(!i){const a=await(0,s.w$)({objects:[o],showContent:!0});a?.objects&&"Treasury"===a.objects[0].type&&(i=a.objects[0])}i?.deposit_guard&&e.push(i?.deposit_guard)}else this.data?.deposit_guard&&(0,r.IsValidAddress)(this.data?.deposit_guard)&&e.push(this.data.deposit_guard);if(void 0!==this.data?.receive&&t.push(r.PermissionIndex.treasury_receive),void 0!==this.data?.withdraw?.withdraw_guard){if("string"==typeof this.data.withdraw.withdraw_guard&&(0,r.IsValidAddress)(this.data.withdraw.withdraw_guard))e.push(this.data.withdraw.withdraw_guard);else if(this.data.object){if(!i){const a=await(0,s.w$)({objects:[o],showContent:!0});a?.objects&&"Treasury"===a.objects[0].type&&(i=a.objects[0])}"string"==typeof i?.withdraw_guard&&e.push(i?.withdraw_guard)}}else t.push(r.PermissionIndex.treasury_withdraw);return await this.check_permission_and_call(d,t,e,!1,void 0,a)}return await this.exec(a)}async operate(a,e,t){let s,i;const o=this.data?.permission?.address,n=this.data?.object?.address;if(n)(0,r.IsValidAddress)(n)&&this.data.type_parameter&&o&&(0,r.IsValidAddress)(o)?s=r.Treasury.From(a,this.data.type_parameter,o,n):(0,r.ERROR)(r.Errors.InvalidParam,"object or permission address invalid.");else{if(!o||!(0,r.IsValidAddress)(o)){const e=this.data?.permission?.description??"";i=r.Permission.New(a,e)}s=r.Treasury.New(a,this.data.type_parameter,i?i.get_object():o,this.data?.description??"",i?void 0:e)}if(s){const r=i?void 0:e;if(void 0!==this.data?.description&&n&&s?.set_description(this.data.description,r),void 0!==this.data.deposit){const e=await d.g.Instance().get_coin_object(a,this.data.deposit.data.balance,t,this.data.type_parameter);if(e){const a=this.data.deposit.data?.index??0;s?.deposit({coin:e,index:BigInt(a),remark:this.data.deposit.data.remark??"",for_guard:this.data.deposit.data?.for_guard,for_object:this.data.deposit.data?.for_object})}}if(void 0!==this.data?.receive&&s?.receive(this.data.receive.payment,this.data.receive.received_object,r),void 0!==this.data?.withdraw&&s?.withdraw(this.data.withdraw,r),void 0!==this.data?.deposit_guard&&s?.set_deposit_guard(this.data.deposit_guard,r),void 0!==this.data?.withdraw_guard)switch(this.data.withdraw_guard.op){case"add":this.data.withdraw_guard.data.forEach((a=>s?.add_withdraw_guard(a.guard,BigInt(a.amount),r)));break;case"remove":s?.remove_withdraw_guard(this.data.withdraw_guard.guards,!1,r);break;case"set":s?.remove_withdraw_guard([],!0,r),this.data.withdraw_guard.data.forEach((a=>s?.add_withdraw_guard(a.guard,BigInt(a.amount),r)));break;case"removeall":s?.remove_withdraw_guard([],!0,r)}void 0!==this.data?.withdraw_mode&&s?.set_withdraw_mode(this.data.withdraw_mode,r),i&&await this.new_with_mark(a,i.launch(),this.data?.permission?.namedNew,t),n||await this.new_with_mark(a,s.launch(),this.data?.object?.namedNew,t)}}}},6701:(a,e,t)=>{t.d(e,{U:()=>o});var r=t(7495),s=t(3245),i=t(6401),d=t(9766);class o extends i.s{data;constructor(a){super(),this.data=a}async call(a){this.data.type_parameter&&(0,r.IsValidArgType)(this.data.type_parameter)||(0,r.ERROR)(r.Errors.IsValidArgType,"service.type_parameter");const e=[],t=[];var i;const d=this.data?.permission?.address,o=this.data?.object?.address,n=this.data?.payee_treasury?.address;if(d&&(0,r.IsValidAddress)(d)){if(this.data?.object||t.push(r.PermissionIndex.service),void 0!==this.data?.description&&o&&t.push(r.PermissionIndex.service_description),void 0!==this.data?.bPaused&&t.push(r.PermissionIndex.service_pause),this.data?.bPublished&&t.push(r.PermissionIndex.service_publish),void 0!==this.data?.endpoint&&t.push(r.PermissionIndex.service_endpoint),void 0!==this.data?.repository&&t.push(r.PermissionIndex.service_repository),void 0!==this.data?.clone_new&&t.push(r.PermissionIndex.service_clone),void 0!==this.data?.gen_discount&&t.push(r.PermissionIndex.service_discount_transfer),void 0!==this.data?.arbitration&&t.push(r.PermissionIndex.service_arbitration),void 0!==this.data?.buy_guard&&t.push(r.PermissionIndex.service_buyer_guard),void 0!==this.data?.endpoint&&t.push(r.PermissionIndex.service_endpoint),void 0!==this.data?.extern_withdraw_treasury&&t.push(r.PermissionIndex.service_treasury),void 0!==this.data?.machine&&t.push(r.PermissionIndex.service_machine),void 0!==n&&o&&t.push(r.PermissionIndex.service_payee),void 0!==this.data?.withdraw_guard&&t.push(r.PermissionIndex.service_withdraw_guards),void 0!==this.data?.refund_guard&&t.push(r.PermissionIndex.service_refund_guards),void 0!==this.data?.customer_required_info&&t.push(r.PermissionIndex.service_customer_required),void 0!==this.data?.sales&&t.push(r.PermissionIndex.service_sales),void 0!==this.data?.order_new?.guard)if((0,r.IsValidAddress)(this.data.order_new.guard))e.push(this.data.order_new.guard);else if(this.data.object){if(!i){const a=await(0,s.w$)({objects:[o],showContent:!0});a?.objects&&"Service"===a.objects[0].type&&(i=a.objects[0])}i?.buy_guard&&e.push(i?.buy_guard)}else this.data?.buy_guard&&(0,r.IsValidAddress)(this.data.buy_guard)&&e.push(this.data?.buy_guard);return(0,r.IsValidAddress)(this.data?.order_refund?.guard)&&e.push(this.data?.order_refund?.guard),void 0!==this.data.order_withdrawl&&t.push(r.PermissionIndex.service_withdraw),"string"==typeof this.data?.order_withdrawl?.data?.withdraw_guard&&(0,r.IsValidAddress)(this.data?.order_withdrawl?.data?.withdraw_guard)&&e.push(this.data?.order_withdrawl?.data?.withdraw_guard),await this.check_permission_and_call(d,t,e,!1,void 0,a)}return await this.exec(a)}async operate(a,e,t){let s,i,o;const n=this.data?.permission?.address,c=this.data?.object?.address,h=this.data?.payee_treasury?.address;if(c)(0,r.IsValidAddress)(c)&&this.data.type_parameter&&n&&(0,r.IsValidAddress)(n)?s=r.Service.From(a,this.data.type_parameter,n,c):(0,r.ERROR)(r.Errors.InvalidParam,"object or permission address invalid.");else{if(!n||!(0,r.IsValidAddress)(n)){const e=this.data?.permission?.description??"";i=r.Permission.New(a,e)}if(!h||!(0,r.IsValidAddress)(h)){const t=this.data?.payee_treasury?.description??"";o=r.Treasury.New(a,this.data?.type_parameter,i??n,t,i?void 0:e)}s=r.Service.New(a,this.data.type_parameter,i?i.get_object():n,this.data?.description??"",o?o.get_object():h,i?void 0:e)}if(s){const n=i?void 0:e;if(void 0!==this.data?.description&&c&&s?.set_description(this.data.description,n),void 0!==this.data?.endpoint&&s?.set_endpoint(this.data.endpoint,n),void 0!==this.data?.payee_treasury&&c&&s?.set_payee(h,n),void 0!==this.data?.gen_discount&&s?.discount_transfer(this.data.gen_discount,n),void 0!==this.data?.repository)switch(this.data.repository.op){case"add":this.data.repository.repositories.forEach((a=>s?.add_repository(a,n)));break;case"remove":s?.remove_repository(this.data.repository.repositories,!1,n);break;case"set":s?.remove_repository([],!0,n),this.data.repository.repositories.forEach((a=>s?.add_repository(a,n)));break;case"removeall":s?.remove_repository([],!0,n)}if(void 0!==this.data?.extern_withdraw_treasury)switch(this.data.extern_withdraw_treasury.op){case"add":this.data.extern_withdraw_treasury.treasuries.forEach((a=>s?.add_treasury(a.token_type,a.address,n)));break;case"set":s?.remove_treasury([],!0,n),this.data.extern_withdraw_treasury.treasuries.forEach((a=>s?.add_treasury(a.token_type,a.address,n)));break;case"remove":s?.remove_treasury(this.data.extern_withdraw_treasury.addresses,!1,n);break;case"removeall":s?.remove_treasury([],!1,n)}if(void 0!==this.data?.machine&&s?.set_machine(this.data.machine,n),void 0!==this.data?.arbitration)switch(this.data.arbitration.op){case"add":this.data.arbitration.arbitrations.forEach((a=>s?.add_arbitration(a.address,a.token_type,n)));break;case"set":s?.remove_arbitration([],!0,n),this.data.arbitration.arbitrations.forEach((a=>s?.add_arbitration(a.address,a.token_type,n)));break;case"remove":s?.remove_arbitration(this.data.arbitration.addresses,!1,n);break;case"removeall":s?.remove_arbitration([],!1,n)}if(void 0!==this.data?.customer_required_info&&(this.data.customer_required_info.required_info&&this.data.customer_required_info.pubkey?s?.set_customer_required(this.data.customer_required_info.pubkey,this.data.customer_required_info.required_info,n):this.data.customer_required_info.pubkey&&s?.change_required_pubkey(this.data.customer_required_info.pubkey,n)),void 0!==this.data?.sales)switch(this.data.sales.op){case"add":s?.add_sales(this.data.sales.sales,!1,n);break;case"remove":s?.remove_sales(this.data.sales.sales_name,n)}if(void 0!==this.data?.withdraw_guard)switch(this.data.withdraw_guard.op){case"add":s?.add_withdraw_guards(this.data.withdraw_guard.guards,n);break;case"set":s?.remove_withdraw_guards([],!0,n),s?.add_withdraw_guards(this.data.withdraw_guard.guards,n);break;case"remove":s?.remove_withdraw_guards(this.data.withdraw_guard.addresses,!1,n);break;case"removeall":s?.remove_withdraw_guards([],!0,n)}if(void 0!==this.data?.refund_guard)switch(this.data.refund_guard.op){case"add":s?.add_refund_guards(this.data.refund_guard.guards,n);break;case"set":s?.remove_refund_guards([],!0,n),s?.add_refund_guards(this.data.refund_guard.guards,n);break;case"remove":s?.remove_refund_guards(this.data.refund_guard.addresses,!1,n);break;case"removeall":s?.remove_refund_guards([],!0,n)}var _;if(this.data?.bPublished&&s?.publish(n),void 0!==this.data?.order_new){let e,r=BigInt(0);this.data.order_new.buy_items.forEach((a=>{r+=BigInt(a.max_price)*BigInt(a.count)})),r>BigInt(0)&&(e=await d.g.Instance().get_coin_object(a,r,t,this.data.type_parameter),e&&(_=s.order(this.data.order_new.buy_items,e,this.data.order_new.discount,this.data.order_new.machine,this.data.order_new.customer_info_crypto,n)))}if(void 0!==this.data?.order_agent){const a=this.data.order_agent.order??_?.order;a||(0,r.ERROR)(r.Errors.Fail,"order invalid: order_agent"),s?.set_order_agent(a,this.data.order_agent.agents,this.data.order_agent.progress)}if(void 0!==this.data?.order_required_info){const a=this.data.order_required_info.order??_?.order;a||(0,r.ERROR)(r.Errors.Fail,"order invalid: order_required_info"),s?.update_order_required_info(a,this.data.order_required_info.info)}if(void 0!==this.data?.order_refund){const a=this.data.order_refund.order??_?.order;a||(0,r.ERROR)(r.Errors.Fail,"order invalid: order_refund"),this.data?.order_refund?.arb&&this.data?.order_refund?.arb_token_type?s?.refund_withArb(a,this.data?.order_refund?.arb,this.data?.order_refund?.arb_token_type):s?.refund(a,this.data?.order_refund?.guard,n)}if(void 0!==this.data?.order_withdrawl&&n){const a=this.data.order_withdrawl.order??_?.order;a||(0,r.ERROR)(r.Errors.Fail,"order invalid: order_withdrawl"),s?.withdraw(a,this.data.order_withdrawl.data,n)}if(void 0!==this.data?.order_payer&&s){const a=this.data.order_payer.order??_?.order;a||(0,r.ERROR)(r.Errors.Fail,"order invalid: order_payer"),s?.change_order_payer(a,this.data.order_payer.payer_new,this.data.order_payer.progress)}if(_&&this?.data?.order_new){const e=s.order_launch(_);await this.new_with_mark(a,e.order,this.data?.order_new?.namedNewOrder,t,[r.TagName.Launch,r.TagName.Order]),e?.progress&&await this.new_with_mark(a,e.progress,this.data?.order_new?.namedNewProgress,t,[r.TagName.Launch])}void 0!==this.data?.buy_guard&&s?.set_buy_guard(this.data.buy_guard,n),void 0!==this.data?.bPaused&&s?.pause(this.data.bPaused,n),void 0!==this.data?.clone_new&&s&&await this.new_with_mark(a,s.clone(this.data.clone_new?.token_type_new,!0,n),this.data?.clone_new?.namedNew,t),o&&await this.new_with_mark(a,o.launch(),this.data?.payee_treasury?.namedNew,t),i&&await this.new_with_mark(a,i.launch(),this.data?.permission?.namedNew,t),c||await this.new_with_mark(a,s.launch(),this.data?.object?.namedNew,t)}}}},7473:(a,e,t)=>{t.d(e,{H9:()=>y,JD:()=>O,Jj:()=>j,Tn:()=>l,U1:()=>u,Um:()=>P,_H:()=>m,bi:()=>R,cW:()=>g,cm:()=>k,h3:()=>x,ho:()=>N,nd:()=>f,os:()=>b,q0:()=>v,q_:()=>w,rL:()=>J,ti:()=>I,vF:()=>S,wi:()=>E});var r=t(6607),s=t(7439),i=t(159),d=t(7923),o=t(300),n=t(7604),c=t(6701),h=t(4873),_=t(3503),p=t(3769);const u=async a=>{try{const e=JSON.parse(a);return JSON.stringify({data:await I(e)})}catch(a){return JSON.stringify({error:a?.toString()})}},w=async a=>{try{const e=JSON.parse(a);return JSON.stringify({data:await N(e)})}catch(a){return JSON.stringify({error:a?.toString()})}},m=async a=>{try{const e=JSON.parse(a);return JSON.stringify({data:await x(e)})}catch(a){return JSON.stringify({error:a?.toString()})}},y=async a=>{try{const e=JSON.parse(a);return JSON.stringify({data:await P(e)})}catch(a){return JSON.stringify({error:a?.toString()})}},v=async a=>{try{const e=JSON.parse(a);return JSON.stringify({data:await S(e)})}catch(a){return JSON.stringify({error:a?.toString()})}},l=async a=>{try{const e=JSON.parse(a);return JSON.stringify({data:await J(e)})}catch(a){return JSON.stringify({error:a?.toString()})}},g=async a=>{try{const e=JSON.parse(a);return JSON.stringify({data:await j(e)})}catch(a){return JSON.stringify({error:a?.toString()})}},b=async a=>{try{const e=JSON.parse(a);return JSON.stringify({data:await R(e)})}catch(a){return JSON.stringify({error:a?.toString()})}},f=async a=>{try{const e=JSON.parse(a);return JSON.stringify({data:await E(e)})}catch(a){return JSON.stringify({error:a?.toString()})}},k=async a=>{try{const e=JSON.parse(a);return JSON.stringify({data:await O(e)})}catch(a){return JSON.stringify({error:a?.toString()})}},I=async a=>{const e=new s.W(a.data);return A(e,a.account,a.witness)},N=async a=>{const e=new c.U(a.data);return A(e,a.account,a.witness)},j=async a=>{const e=new h.c(a.data);return A(e,a.account,a.witness)},P=async a=>{const e=new n.t(a.data);return A(e,a.account,a.witness)},O=async a=>{const e=new _.g(a.data);return A(e,a.account,a.witness)},x=async a=>{const e=new i.g(a.data);return A(e,a.account,a.witness)},E=async a=>{const e=new o.R(a.data);return A(e,a.account,a.witness)},S=async a=>{const e=new d.Q(a.data);return A(e,a.account,a.witness)},J=async a=>{const e=new p.H(a.data);return A(e,a.account,a.witness)},R=async a=>{const e=new r.k(a.data);return A(e,a.account,a.witness)},A=async(a,e,t)=>t?a.call_with_witness(t,e):a.call(e)},7604:(a,e,t)=>{t.d(e,{t:()=>i});var r=t(7495),s=t(6401);class i extends s.s{data;constructor(a){super(),this.data=a}async call(a){const e=[],t=this.data?.permission?.address,s=this.data?.object?.address;return t&&(0,r.IsValidAddress)(t)?(this.data?.object||e.push(r.PermissionIndex.repository),void 0!==this.data?.description&&s&&e.push(r.PermissionIndex.repository_description),void 0!==this.data?.mode&&s&&e.push(r.PermissionIndex.repository_mode),void 0!==this.data?.reference&&e.push(r.PermissionIndex.repository_reference),void 0!==this.data?.policy&&e.push(r.PermissionIndex.repository_policies),await this.check_permission_and_call(t,e,[],!1,void 0,a)):await this.exec(a)}async operate(a,e,t){let s,i;const d=this.data?.permission?.address,o=this.data?.object?.address;if(o)(0,r.IsValidAddress)(o)&&this.data.permission&&(0,r.IsValidAddress)(d)?s=r.Repository.From(a,d,o):(0,r.ERROR)(r.Errors.InvalidParam,"object or permission address invalid.");else{if(!d||!(0,r.IsValidAddress)(d)){const e=this.data?.permission?.description??"";i=r.Permission.New(a,e)}s=r.Repository.New(a,i?i.get_object():d,this.data?.description??"",this.data?.mode,i?void 0:e)}if(s){const r=i?void 0:e;if(void 0!==this.data?.description&&o&&s?.set_description(this.data.description,r),void 0!==this.data?.reference)switch(this.data.reference.op){case"set":s?.remove_reference([],!0,r),s?.add_reference(this.data.reference.addresses,r);break;case"add":s?.add_reference(this.data.reference.addresses,r);break;case"remove":s?.remove_reference(this.data.reference.addresses,!1,r);break;case"removeall":s?.remove_reference([],!0,r)}if(void 0!==this.data?.mode&&o&&s?.set_policy_mode(this.data.mode,r),void 0!==this.data?.policy)switch(this.data.policy.op){case"set":s?.remove_policies([],!0,r),s?.add_policies(this.data.policy.data,r);break;case"add":s?.add_policies(this.data.policy.data,r);break;case"remove":s?.remove_policies(this.data.policy.keys,!1,r);break;case"removeall":s?.remove_policies([],!0,r);break;case"rename":this.data.policy.data.forEach((a=>{s?.rename_policy(a.old,a.new,r)}))}if(void 0!==this.data?.data)switch(this.data.data.op){case"add":void 0!==this.data.data?.data?.key?s?.add_data(this.data.data.data):void 0!==this.data.data?.data?.address&&s?.add_data2(this.data.data.data);break;case"remove":this.data.data.data.forEach((a=>s?.remove(a.address,a.key)))}i&&await this.new_with_mark(a,i.launch(),this.data?.permission?.namedNew,t),this.data.object||await this.new_with_mark(a,s.launch(),this.data?.object?.namedNew,t)}}}},7923:(a,e,t)=>{t.d(e,{Q:()=>i});var r=t(6401),s=t(7495);class i extends r.s{data;constructor(a){super(),this.data=a}async call(a){var e=!1,t=!1;const r=this.data?.object?.address;return r&&(0,s.IsValidAddress)(r)?(void 0===this.data?.builder&&void 0===this.data?.admin||(e=!0),void 0===this.data?.permission&&void 0===this.data?.biz_permission||(t=!0),void 0!==this.data?.description&&(t=!0),await this.check_permission_and_call(r,[],[],e,t,a)):await this.exec(a)}async operate(a,e,t){let r;const i=this.data?.object?.address;if(r=i&&(0,s.IsValidAddress)(i)?s.Permission.From(a,i):s.Permission.New(a,this.data?.description??""),r){if(void 0!==this.data?.description&&this.data.object&&r?.set_description(this.data.description),void 0!==this.data?.admin)switch(this.data.admin?.op){case"add":r?.add_admin(this.data.admin.addresses);break;case"remove":r?.remove_admin(this.data.admin.addresses);break;case"set":r?.remove_admin([],!0),r?.add_admin(this.data.admin.addresses);break;case"removeall":r?.remove_admin([],!0)}if(void 0!==this.data?.biz_permission)switch(this.data.biz_permission.op){case"add":this.data.biz_permission.data.forEach((a=>{r?.add_bizPermission(a.index,a.name)}));break;case"remove":this.data.biz_permission.permissions.forEach((a=>{r?.remove_bizPermission(a)}))}if(void 0!==this.data?.permission)switch(this.data.permission.op){case"add entity":r?.add_entity(this.data.permission.entities);break;case"add permission":r?.add_entity3(this.data.permission.permissions);break;case"remove entity":r?.remove_entity(this.data.permission.addresses);break;case"remove permission":r?.remove_index(this.data.permission.address,this.data.permission.index);break;case"transfer permission":r?.transfer_permission(this.data.permission.from_address,this.data.permission.to_address)}void 0!==this.data?.builder&&r?.change_owner(this.data.builder),i||await this.new_with_mark(a,r.launch(),this.data?.object?.namedNew,t)}}}},9832:(a,e,t)=>{t.d(e,{i:()=>r});var r,s=t(7495);!function(a){a.query_events_json=async e=>{try{const t=JSON.parse(e);return JSON.stringify({data:await a.query_events(t)})}catch(a){return JSON.stringify({error:a?.toString()})}},a.query_events=a=>{switch(a.type){case"OnNewArb":return e(a.cursor,a.limit,a.order);case"OnNewProgress":return r(a.cursor,a.limit,a.order);case"OnPresentService":return t(a.cursor,a.limit,a.order);case"OnNewOrder":return i(a.cursor,a.limit,a.order)}};const e=async(a,e,t)=>await d(s.Protocol.Instance().package("wowok")+"::arb::NewArbEvent",a,e,t),t=async(a,e,t)=>await d(s.Protocol.Instance().package("wowok")+"::demand::PresentEvent",a,e,t),r=async(a,e,t)=>await d(s.Protocol.Instance().package("wowok")+"::progress::NewProgressEvent",a,e,t),i=async(a,e,t)=>await d(s.Protocol.Instance().package("wowok")+"::order::NewOrderEvent",a,e,t),d=async(a,e,t,r)=>{const i=await s.Protocol.Client().queryEvents({query:{MoveEventType:a},cursor:e,limit:t,order:r}),d=i?.data?.map((a=>{if(a?.packageId===s.Protocol.Instance().package("wowok")){if(a?.type?.includes("::order::NewOrderEvent"))return{id:a?.id,time:a?.timestampMs,type_raw:a?.type,sender:a?.sender,type:"NewOrderEvent",order:a?.parsedJson?.object,service:a?.parsedJson?.service,progress:a?.parsedJson?.progress,amount:a?.parsedJson?.amount};if(a?.type?.includes("::demand::PresentEvent"))return{id:a?.id,time:a?.timestampMs,type_raw:a?.type,sender:a?.sender,type:"NewOrderEvent",demand:a?.parsedJson?.object,service:a?.parsedJson?.service,recommendation:a?.parsedJson?.tips};if(a?.type?.includes("::progress::NewProgressEvent"))return{id:a?.id,time:a?.timestampMs,type_raw:a?.type,sender:a?.sender,type:"NewOrderEvent",progress:a?.parsedJson?.object,machine:a?.parsedJson?.machine,task:a?.parsedJson?.task};if(a?.type?.includes("::arb::NewArbEvent"))return{id:a?.id,time:a?.timestampMs,type_raw:a?.type,sender:a?.sender,type:"NewOrderEvent",arb:a?.parsedJson?.object,arbitration:a?.parsedJson?.arbitration,order:a?.parsedJson?.order};if(a?.type?.includes("::entity::NewEntityEvent"))return{id:a?.id,time:a?.timestampMs,type_raw:a?.type,sender:a?.sender,type:"NewOrderEvent",resource:a?.parsedJson?.resource?.some,address:a?.parsedJson?.target}}return{id:a?.id,time:a?.timestampMs,type_raw:a?.type,sender:a?.sender,type:""}}));return{data:d,hasNextPage:i?.hasNextPage,nextCursor:i?.nextCursor}}}(r||(r={}))}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(this.webpackChunkwowok_agent=this.webpackChunkwowok_agent||[]).push([[446],{1281:()=>{},3475:(t,e,a)=>{"use strict";a.d(e,{HL:()=>s,WB:()=>n,a1:()=>o,c7:()=>c,iN:()=>i,z7:()=>d});var i,r=a(7495);class s{constructor(t){this.expire=t}expire_time(){return this.expire}expire}!function(t){t.object="OBJECT",t.personal="PERSONAL",t.table="TABLE"}(i||(i={}));const n=(t,e)=>t+r.Protocol.Instance().package("wowok_origin")+e+"-V2";class o extends s{constructor(t=1e4){super(t)}data=new Map;load(t){return this.data.get(t)}save(t,e){this.data.set(t,e)}remove(t){this.data.delete(t)}}class d extends s{constructor(t=1e4){super(t)}load(t){return localStorage.getItem(t)}save(t,e){return localStorage.setItem(t,e)}remove(t){return localStorage.removeItem(t)}}class c{static _instance;cache=new Map;constructor(){}static Instance(){return c._instance||(c._instance=new c),c._instance}set(t,e){this.cache.set(t,e)}get(t){return this.cache.get(t)}}},6607:(t,e,a)=>{"use strict";a.d(e,{k:()=>o});var i=a(7495),r=a(3245),s=a(6401),n=a(9766);class o extends s.s{data;constructor(t){super(),this.data=t}async call(t){this.data?.type_parameter&&(0,i.IsValidArgType)(this.data.type_parameter)||(0,i.ERROR)(i.Errors.IsValidArgType,"arbitration.type_parameter");const e=[],a=[];var s;const n=this.data?.permission?.address,o=this.data?.object?.address,d=this.data?.fee_treasury?.address;if(n&&(0,i.IsValidAddress)(n)){if(this.data?.object||a.push(i.PermissionIndex.arbitration),void 0!==this.data?.description&&o&&a.push(i.PermissionIndex.arbitration_description),void 0!==this.data?.bPaused&&a.push(i.PermissionIndex.arbitration_pause),null==this.data?.endpoint&&a.push(i.PermissionIndex.arbitration_endpoint),void 0!==this.data?.fee&&o&&a.push(i.PermissionIndex.arbitration_fee),void 0!==d&&o&&a.push(i.PermissionIndex.arbitration_treasury),void 0!==this.data?.guard&&a.push(i.PermissionIndex.arbitration_guard),void 0!==this.data?.voting_guard&&a.push(i.PermissionIndex.arbitration_voting_guard),void 0!==this.data?.arb_arbitration&&a.push(i.PermissionIndex.arbitration_arbitration),void 0!==this.data?.arb_new?.guard)if((0,i.IsValidAddress)(this.data.arb_new.guard))e.push(this.data.arb_new.guard);else if(o){if(!s){const t=await(0,r.w$)({objects:[o],showContent:!0});t?.objects&&"Arbitration"===t.objects[0].type&&(s=t.objects[0])}s?.usage_guard&&e.push(s.usage_guard)}else this.data?.guard&&(0,i.IsValidAddress)(this.data?.guard)&&e.push(this.data.guard);return void 0!==this.data?.arb_vote&&a.push(i.PermissionIndex.treasury_receive),"string"==typeof this.data?.arb_vote?.voting_guard&&(0,i.IsValidAddress)(this.data?.arb_vote?.voting_guard)&&e.push(this.data?.arb_vote?.voting_guard),await this.check_permission_and_call(n,a,e,!1,void 0,t)}return await this.exec(t)}async operate(t,e,a){let r,s,o;const d=this.data?.permission?.address,c=this.data?.object?.address,h=this.data?.fee_treasury?.address;if(c)(0,i.IsValidAddress)(c)&&this.data.type_parameter&&d?r=i.Arbitration.From(t,this.data.type_parameter,d,c):(0,i.ERROR)(i.Errors.InvalidParam,"object or permission address invalid.");else{if(!d||!(0,i.IsValidAddress)(d)){const e=this.data?.permission?.description??"";s=i.Permission.New(t,e)}if(!h||!(0,i.IsValidAddress)(h)){const a=this.data?.fee_treasury?.description??"";o=i.Treasury.New(t,this.data?.type_parameter,s?s.get_object():d,a,s?void 0:e)}r=i.Arbitration.New(t,this.data.type_parameter,s?s.get_object():d,this.data?.description??"",BigInt(this.data?.fee??0),o?o.get_object():h,s?void 0:e)}if(r){const d=s?void 0:e;var u;if(void 0!==this.data?.description&&c&&r?.set_description(this.data.description,d),void 0!==this.data?.endpoint&&r?.set_endpoint(this.data.endpoint,d),void 0!==this.data?.fee&&c&&r?.set_fee(BigInt(this.data.fee),d),void 0!==h&&c&&r?.set_withdrawTreasury(h,d),void 0!==this.data?.arb_new){const e=BigInt(this.data.arb_new.data.fee),i=this.data?.arb_new.data;u=r?.arb({order:i.order,order_token_type:i.order_token_type,description:i.description,votable_proposition:i.votable_proposition,fee:e>BigInt(0)?await n.g.Instance().get_coin_object(t,e,a,this.data.type_parameter):void 0},d)}if(void 0!==this.data?.arb_arbitration){const t=this.data.arb_arbitration.arb??u;t||(0,i.ERROR)(i.Errors.Fail,"arb invalid: arb_arbitration"),r?.arbitration({arb:t,feedback:this.data.arb_arbitration.feedback,indemnity:this.data.arb_arbitration.indemnity},d)}if(void 0!==this.data?.arb_vote){const t=this.data.arb_vote.arb??u;t||(0,i.ERROR)(i.Errors.Fail,"arb invalid: arb_vote"),r?.vote({arb:t,voting_guard:this.data.arb_vote.voting_guard,agrees:this.data.arb_vote.agrees},d)}if(void 0!==this.data?.arb_withdraw_fee){const t=this.data.arb_withdraw_fee.arb??u;t||(0,i.ERROR)(i.Errors.Fail,"arb invalid: arb_withdraw_fee"),r?.withdraw_fee(t,this.data.arb_withdraw_fee.data,d)}if(u&&await this.new_with_mark(t,r?.arb_launch(u),this.data?.arb_new?.namedNew,a),void 0!==this.data?.voting_guard)switch(this.data.voting_guard.op){case"add":r?.add_voting_guard(this.data.voting_guard.data,d);break;case"remove":r?.remove_voting_guard(this.data.voting_guard.guards,!1,d);break;case"set":r?.remove_voting_guard([],!0,d),r?.add_voting_guard(this.data.voting_guard.data,d);break;case"removeall":r?.remove_voting_guard([],!0,d)}void 0!==this.data.guard&&r?.set_guard(this.data.guard,d),void 0!==this.data?.bPaused&&r?.pause(this.data.bPaused,d),o&&await this.new_with_mark(t,o.launch(),this.data?.fee_treasury?.namedNew,a),s&&await this.new_with_mark(t,s.launch(),this.data?.permission?.namedNew,a),c||await this.new_with_mark(t,r.launch(),this.data?.object?.namedNew,a)}}}},9766:(t,e,a)=>{"use strict";a.d(e,{g:()=>n});var i=a(7495);const r="wowok.acc.dat",s="wowok-acc-v1";class n{constructor(t="File"){this.storage=t}static _instance;static Instance(){return n._instance||(n._instance=new n),n._instance}storage="File";_add(t,e,a){var r,s="0x"+(0,i.toHEX)((0,i.decodeSuiPrivateKey)(i.Ed25519Keypair.generate().getSecretKey()).secretKey);try{if(t&&(r=JSON.parse(t))){const t=r.find((t=>t.name===e));return t?t.default=a:(a&&r.forEach((t=>t.default=!1)),r.push({name:e,key:s,default:a})),r}}catch(t){}return[{name:e,key:s,default:a}]}_default(t){var e;try{if(t&&(e=JSON.parse(t))){const t=e.find((t=>t.default));if(t)return t}}catch(t){}}_get(t,e,a){var i;try{if(t&&(i=JSON.parse(t))){const t=i.find((t=>t.name===e));if(t)return t;if(a)return i.find((t=>t.default))}}catch(t){}}_rename(t,e,a,i=!0){var r;try{if(t&&(r=JSON.parse(t)),r){const t=r.find((t=>t.name===e));if(!t)return;const s=r.find((t=>t.name===a));if(!s)return t.name=a,r;if(i)return t.name=a,s.name=e,r}}catch(t){}}set_storage(t="File"){this.storage=t}async gen(t,e){try{if("File"===this.storage){const[i,s,n]=await Promise.all([a.e(734).then(a.t.bind(a,1734,23)),a.e(734).then(a.t.bind(a,1734,23)),a.e(734).then(a.t.bind(a,1734,23))]),o=n.join(s.homedir(),r);i.readFile(o,"utf-8",((a,r)=>{const s=this._add(r,t,e);i.writeFileSync(o,JSON.stringify(s),"utf-8")}))}else if("Explorer"===this.storage){const a=this._add(localStorage.getItem(s),t,e);localStorage.setItem(s,JSON.stringify(a))}}catch(t){}}async default(){try{if("File"===this.storage){const[t,e,i]=await Promise.all([a.e(734).then(a.t.bind(a,1734,23)),a.e(734).then(a.t.bind(a,1734,23)),a.e(734).then(a.t.bind(a,1734,23))]),s=i.join(e.homedir(),r);return this._default(t.readFileSync(s,"utf-8"))}if("Explorer"===this.storage)return this._default(localStorage.getItem(s))}catch(t){}}async get(t,e=!0){try{if("File"===this.storage){const[i,s,n]=await Promise.all([a.e(734).then(a.t.bind(a,1734,23)),a.e(734).then(a.t.bind(a,1734,23)),a.e(734).then(a.t.bind(a,1734,23))]),o=n.join(s.homedir(),r);return this._get(i.readFileSync(o,"utf-8"),t,e)}if("Explorer"===this.storage)return this._get(localStorage.getItem(s),t,e)}catch(t){}}async rename(t,e,i=!0){var n;try{if("File"===this.storage){const[s,o,d]=await Promise.all([a.e(734).then(a.t.bind(a,1734,23)),a.e(734).then(a.t.bind(a,1734,23)),a.e(734).then(a.t.bind(a,1734,23))]),c=d.join(o.homedir(),r);(n=this._rename(s.readFileSync(c,"utf-8"),t,e,i))&&s.writeFileSync(c,JSON.stringify(n),"utf-8")}else"Explorer"===this.storage&&(n=this._rename(localStorage.getItem(s),t,e,i))&&localStorage.setItem(s,JSON.stringify(n))}catch(t){}return!!n}async get_address(t,e=!0){const a=await this.get(t,e);if(a)return i.Ed25519Keypair.fromSecretKey((0,i.fromHEX)(a.key)).getPublicKey().toSuiAddress()}async get_pubkey(t,e=!0){const a=await this.get(t,e);if(a)return i.Ed25519Keypair.fromSecretKey((0,i.fromHEX)(a.key)).getPublicKey().toSuiPublicKey()}async get_pair(t,e=!0){const a=await this.get(t,e);if(a)return i.Ed25519Keypair.fromSecretKey((0,i.fromHEX)(a.key))}async list(){try{if("File"===this.storage){const[t,e,s]=await Promise.all([a.e(734).then(a.t.bind(a,1734,23)),a.e(734).then(a.t.bind(a,1734,23)),a.e(734).then(a.t.bind(a,1734,23))]),n=s.join(e.homedir(),r);return JSON.parse(t.readFileSync(n,"utf-8")).map((t=>({name:t.name,default:t?.default,address:i.Ed25519Keypair.fromSecretKey((0,i.fromHEX)(t.key)).getPublicKey().toSuiAddress()})))}if("Explorer"===this.storage)return JSON.parse(localStorage.getItem(s)??"").map((t=>({name:t.name,default:t?.default,address:i.Ed25519Keypair.fromSecretKey((0,i.fromHEX)(t.key)).getPublicKey().toSuiAddress()})))}catch(t){}return[]}async faucet(t){const e=await this.get_address(t,!0);e&&await(0,i.requestSuiFromFaucetV0)({host:(0,i.getFaucetHost)("testnet"),recipient:e}).catch((t=>{}))}balance=async(t,e)=>{const a=await this.get_address(t);if(a)return await i.Protocol.Client().getBalance({owner:a,coinType:e})};coin=async(t,e)=>{const a=await this.get_address(t);if(a)return(await i.Protocol.Client().getCoins({owner:a,coinType:e})).data};get_coin_object=async(t,e,a,r)=>{const s=await this.get_address(a),n=BigInt(e);if(s&&n>BigInt(0)){if(r&&"0x2::sui::SUI"!==r&&"0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI"!==r){const e=await i.Protocol.Client().getCoins({owner:s,coinType:r}),a=[];var o=BigInt(0);for(let t=0;t<e.data.length&&(o+=BigInt(e.data[t].balance),a.push(e.data[t].coinObjectId),!(o>=n));++t);if(1===a.length)return t.splitCoins(a[0],[n]);{const e=a.pop();return t.mergeCoins(e,a),t.splitCoins(e,[n])}}return t.splitCoins(t.gas,[n])}};coin_with_balance=async(t,e,a)=>{const r=await this.get_pair(e,!0);r||(0,i.ERROR)(i.Errors.Fail,"account invalid");const s=new i.TransactionBlock,o=await n.Instance().get_coin_object(s,t,e,a);if(o){s.transferObjects([o],r?.toSuiAddress());const t=await i.Protocol.Client().signAndExecuteTransaction({transaction:s,signer:r,options:{showObjectChanges:!0}}),e=a??"0x2::sui::SUI";return t?.objectChanges.find((t=>"created"===t?.type&&(t?.objectType).includes(e)))?.objectId}}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var t=r();for(var i in t)("object"==typeof exports?exports:e)[i]=t[i]}}(this,(()=>(()=>{"use strict";var e,r,t,i,s,a={1229:(e,r,t)=>{t.r(r),t.d(r,{Account:()=>v.g,CacheData:()=>n.HL,CacheName:()=>n.iN,CacheType:()=>i.PT,CallArbitration:()=>d.k,CallBase:()=>o.s,CallDemand:()=>u.W,CallGuard:()=>_.g,CallMachine:()=>f.g,CallObjectPermission:()=>p.H,CallPermission:()=>c.Q,CallPersonal:()=>b.R,CallRepository:()=>y.t,CallService:()=>m.U,CallTreasury:()=>l.c,EVENT_QUERY:()=>a.i,LocalStorageCache:()=>n.z7,MemeryCache:()=>n.a1,OBJECT_KEY:()=>n.WB,ResponseData:()=>o.$,WOWOK:()=>w,WowokCache:()=>n.c7,call_arbitration:()=>g.bi,call_arbitration_json:()=>g.os,call_demand:()=>g.ti,call_demand_json:()=>g.U1,call_guard:()=>g.JD,call_guard_json:()=>g.cm,call_machine:()=>g.h3,call_machine_json:()=>g._H,call_permission:()=>g.vF,call_permission_json:()=>g.q0,call_personal:()=>g.wi,call_personal_json:()=>g.nd,call_repository:()=>g.Um,call_repository_json:()=>g.H9,call_service:()=>g.ho,call_service_json:()=>g.q_,call_transfer_permission:()=>g.rL,call_transferpermission_json:()=>g.Tn,call_treasury:()=>g.Jj,call_treasury_json:()=>g.cW,data2object:()=>i.KV,queryTableItem_ArbVote:()=>i.Qe,queryTableItem_DemandPresenter:()=>i.uk,queryTableItem_PermissionEntity:()=>i.fG,queryTableItem_Personal:()=>i.h$,query_objects:()=>i.w$,query_objects_json:()=>i.VB,query_permission:()=>s.l,query_permission_json:()=>s.O,query_personal_json:()=>i.F9,query_table:()=>i.EF,query_table_json:()=>i.LU,raw2type:()=>i.lS,tableItemQuery_MachineNode:()=>i.sm,tableItemQuery_MarkTag:()=>i.m4,tableItemQuery_ProgressHistory:()=>i.WH,tableItemQuery_RepositoryData:()=>i.tS,tableItemQuery_ServiceSale:()=>i.Zz,tableItemQuery_TreasuryHistory:()=>i.aU});var i=t(3245),s=t(1294),a=t(9832),n=t(3475),o=t(6401),c=t(7923),d=t(6607),l=t(4873),p=t(3769),u=t(7439),f=t(159),y=t(7604),m=t(6701),_=t(3503),b=t(300),v=t(9766),g=t(7473),w=t(7495)},1294:(e,r,t)=>{t.d(r,{O:()=>s,l:()=>a});var i=t(7495);const s=async e=>{try{const r=JSON.parse(e);return JSON.stringify({data:await a(r)})}catch(e){return JSON.stringify({error:e})}},a=async e=>{(0,i.IsValidAddress)(e.permission_object)||(0,i.ERROR)(i.Errors.IsValidAddress,"permission.permission_object");const r=new i.TransactionBlock;i.Permission.From(r,e.permission_object).query_permissions_all(e.address);const t=await i.Protocol.Client().devInspectTransactionBlock({sender:e.address,transactionBlock:r});t.results&&t.results[0].returnValues&&2!==t.results[0].returnValues.length&&(0,i.ERROR)(i.Errors.Fail,"permission.retValues");const s=i.Bcs.getInstance().de(i.BCS.U8,Uint8Array.from(t.results[0].returnValues[0][0]));if(s===i.Permission.PERMISSION_ADMIN||s===i.Permission.PERMISSION_OWNER_AND_ADMIN)return{who:e.address,admin:!0,owner:s%2==1,items:[],object:e.permission_object};{const r=i.Bcs.getInstance().de_perms(Uint8Array.from(t.results[0].returnValues[1][0]));return{who:e.address,admin:!1,owner:s%2==1,items:r.map((e=>({query:e?.index,permission:!0,guard:e?.guard}))),object:e.permission_object}}}},3245:(e,r,t)=>{t.d(r,{EF:()=>p,F9:()=>c,KV:()=>O,LU:()=>o,PT:()=>i,Qe:()=>y,VB:()=>n,WH:()=>b,Zz:()=>_,aU:()=>v,fG:()=>f,h$:()=>l,lS:()=>P,m4:()=>w,sm:()=>m,tS:()=>g,uk:()=>u,w$:()=>d});var i,s=t(7495),a=t(3475);!function(e){e.localStorage="localStorage",e.memoryStorage="memoryStorage"}(i||(i={}));const n=async e=>{try{const r=JSON.parse(e);return JSON.stringify({data:await d(r)})}catch(e){return JSON.stringify({error:e?.toString()})}},o=async e=>{try{const r=JSON.parse(e);return JSON.stringify({data:await p(r)})}catch(e){return JSON.stringify({error:e?.toString()})}},c=async e=>{try{const r=JSON.parse(e);return JSON.stringify({data:await l(r)??""})}catch(e){return JSON.stringify({error:e?.toString()})}},d=async e=>{var r=[];const t=[],i=(new Date).getTime(),n=a.c7.Instance().get(a.iN.object);if(n)for(let s=0;s<e.objects.length;++s){try{let o=n.load((0,a.WB)(e.objects[s],a.iN.object));if(o){const a=JSON.parse(o);if("INFINITE"!==a?.expire&&(e?.no_cache||a.expire<=i)&&(e.showOwner||e.showContent))t.push(e.objects[s]);else{const e=O(JSON.parse(a.data));e.cache_expire=a.expire,r.push(e)}}}catch(e){console.log(e)}t.push(e.objects[s])}if(t.length>0){const i=await s.Protocol.Client().multiGetObjects({ids:[...t],options:{showContent:e.showContent,showType:e.showType,showOwner:e.showOwner}}),n=a.c7.Instance().get(a.iN.object);if(n){const e=(new Date).getTime();i.forEach((r=>{try{if(r?.data){const t=r.data?.type??r.data?.content?.type??void 0,i=t?s.Protocol.Instance().object_name_from_type_repr(t):void 0,o={expire:"Guard"===i||"Payment"===i?"INFINITE":n.expire_time()+e,data:JSON.stringify(r.data)};n.save((0,a.WB)(r.data.objectId,a.iN.object),JSON.stringify(o))}}catch(e){console.log(e)}}))}r=r.concat(i.map((e=>O(e?.data))))}return{objects:r}},l=async e=>{(0,s.IsValidAddress)(e.address)||(0,s.ERROR)(s.Errors.IsValidAddress,"entity.address");const r=(new Date).getTime(),t=a.c7.Instance().get(a.iN.personal);if(t&&!e.no_cache)try{let i=t.load((0,a.WB)(e.address,a.iN.personal));if(i){const e=JSON.parse(i);if("INFINITE"===e?.expire||e.expire<=r){const r=JSON.parse(e.data);return r.cache_expire=e.expire,r}}}catch(e){console.log(e)}const i=await k(h(s.Protocol.Instance().objectEntity(),e.address));if("Personal"===i.type){if(t)try{const r=t.expire_time()+(new Date).getTime(),s={expire:r,data:JSON.stringify(i)};t.save((0,a.WB)(e.address,a.iN.personal),JSON.stringify(s)),i.cache_expire=r}catch(e){console.log(e)}return i}},p=async e=>{const r=await s.Protocol.Client().getDynamicFields({parentId:e.parent,cursor:e.cursor,limit:e.limit});return{items:r?.data?.map((e=>({object:e.objectId,type:e.type,version:e.version,key:{type:e.name.type,value:e.name.value}}))),nextCursor:r.nextCursor,hasNextPage:r.hasNextPage}},u=async(e,r)=>await k(h(e,r)),f=async(e,r)=>await k(h(e,r)),y=async(e,r)=>await k(h(e,r)),m=async(e,r)=>await k(j(e,r)),_=async(e,r)=>await k(j(e,r)),b=async(e,r)=>await k(I(e,r)),v=async(e,r)=>await k(I(e,r)),g=async(e,r,t)=>("string"!=typeof e&&(e=e.object),await k({parent:e,key:{type:s.Protocol.Instance().package("wowok")+"::repository::DataKey",value:{id:r,key:t}}})),w=async(e,r)=>await k(h(e,r));function h(e,r){return"string"!=typeof e&&(e=e.object),{parent:e,key:{type:"address",value:r}}}function j(e,r){return"string"!=typeof e&&(e=e.object),{parent:e,key:{type:"0x1::string::String",value:r}}}function I(e,r){return"string"!=typeof e&&(e=e.object),{parent:e,key:{type:"u64",value:r}}}const k=async e=>{const r=await s.Protocol.Client().getDynamicFieldObject({parentId:e.parent,name:{type:e.key.type,value:e.key.value}});return O(r?.data)};function P(e){if(!e)return;const r=s.Protocol.Instance().object_name_from_type_repr(e);if("Permission"===r||"Demand"===r||"Machine"===r||"Progress"===r||"Order"===r||"Service"===r||"Treasury"===r||"Arb"===r||"Repository"===r||"Payment"===r||"Discount"===r||"Guard"===r||"Arbitration"===r)return r;if("Resource"===r)return"PersonalMark";const t=e?.indexOf("0x2::dynamic_field::Field<");if(0===t){const r=e?.substring(26);if(r&&s.Protocol.Instance().hasPackage(r)){if(r.includes("::demand::Tips>"))return"TableItem_DemandPresenter";if(r.includes("::machine::NodePair>>>"))return"TableItem_MachineNode";if(r.includes("::progress::History>"))return"TableItem_ProgressHistory";if(r.includes("::service::Sale>"))return"TableItem_ServiceSale";if(r.includes("::treasury::Record>"))return"TableItem_TreasuryHistory";if(r.includes("::arb::Voted>"))return"TableItem_ArbVote";if(r.includes("::permission::Perm>>"))return"TableItem_PermissionEntity";if(r.includes("::repository::DataKey"))return"TableItem_RepositoryData";if(r.includes("::entity::Ent>"))return"Personal";if(r.includes("::resource::Tags>"))return"TableItem_PersonalMark"}}}function O(e){const r=e?.content?.fields,t=e?.objectId??r?.id?.id??void 0,i=e?.type??e?.content?.type??void 0,a=e?.version??void 0,n=e?.owner??void 0,o=P(i);if(o)switch(o){case"Permission":return{object:t,type:o,type_raw:i,owner:n,version:a,builder:r?.builder??"",admin:r?.admin,description:r?.description??"",entity_count:parseInt(r?.table?.fields?.size),biz_permission:r?.user_define?.fields?.contents?.map((e=>({id:parseInt(e?.fields?.key),name:e?.fields?.value})))};case"Demand":return{object:t,type:o,type_raw:i,owner:n,version:a,permission:r?.permission,description:r?.description,guard:r?.guard?{object:r?.guard,service_id_in_guard:r?.service_identifier}:void 0,time_expire:r?.time_expire,yes:r?.yes,presenter_count:parseInt(r?.presenters?.fields?.size),bounty:r?.bounty?.map((e=>({type:e?.fields?.type,object:e?.fields?.id?.id,balance:e?.fields?.balance})))};case"Machine":return{object:t,type:o,type_raw:i,owner:n,version:a,permission:r?.permission??"",description:r?.description??"",bPaused:r?.bPaused,bPublished:r?.bPublished,endpoint:r?.endpoint,consensus_repository:r?.consensus_repositories,node_count:parseInt(r?.nodes?.fields?.size)};case"Progress":return{object:t,type:o,type_raw:i,owner:n,version:a,machine:r?.machine,current:r?.current,task:r?.task,parent:r?.parent,history_count:parseInt(r?.history?.fields?.contents?.fields?.size),namedOperator:r?.namedOperator?.fields?.contents?.map((e=>({name:e?.fields?.key,operator:e?.fields?.value}))),session:r?.session?.fields?.contents?.map((e=>({weights:e?.fields?.value?.fields?.weight,threshold:e?.fields?.value?.fields?.threshold,next_node:e?.fields?.key,forward:e?.fields?.value?.fields?.forwards?.fields?.contents?.map((e=>({forward_name:e?.fields?.key,accomplished:e?.fields?.value?.fields?.accomplished,msg:e?.fields?.value?.fields?.msg,orders:e?.fields?.value?.fields?.orders,time:e?.fields?.value?.fields?.time,holder:e?.fields?.value?.fields?.who})))})))};case"Order":return{object:t,type:o,type_raw:i,owner:n,version:a,service:r?.service,amount:r?.amount,agent:r?.agent,arb:r?.dispute,payer:r?.payer,progress:r?.progress,discount:r?.discount,balance:r?.payed,required_info:r?.required_info?{pubkey:r?.required_info?.fields?.customer_pub,msg_encrypted:r?.required_info?.fields?.info}:void 0,item:r?.items?.map((e=>({name:e?.fields?.name,price:e?.fields?.price,stock:e?.fields?.stock,endpoint:e?.fields?.endpoint})))};case"Service":return{object:t,type:o,type_raw:i,owner:n,version:a,machine:r?.machine,permission:r?.permission,description:r?.description,arbitration:r?.arbitrations,bPaused:r?.bPaused,bPublished:r?.bPublished,buy_guard:r?.buy_guard,endpoint:r?.endpoint,payee:r?.payee,repository:r?.repositories,withdraw_guard:r?.withdraw_guard?.fields?.contents?.map((e=>({object:e?.fields?.key,percent:e?.fields?.value}))),refund_guard:r?.refund_guard?.fields?.contents?.map((e=>({object:e?.fields?.key,percent:e?.fields?.value}))),sales_count:parseInt(r?.sales?.fields?.size),extern_withdraw_treasury:r?.extern_withdraw_treasuries,customer_required_info:r?.customer_required?{pubkey:r?.customer_required?.fields?.service_pubkey,required_info:r?.customer_required?.fields?.customer_required_info}:void 0};case"Treasury":return{object:t,type:o,type_raw:i,owner:n,version:a,permission:r?.permission,description:r?.description,withdraw_mode:r?.withdraw_mode,history_count:parseInt(r?.history?.fields?.contents?.fields?.size),balance:r?.balance,deposit_guard:r?.deposit_guard,withdraw_guard:r?.withdraw_guard?.fields?.contents?.map((e=>({object:e?.fields?.key,percent:e?.fields?.value})))};case"Arbitration":return{object:t,type:o,type_raw:i,owner:n,version:a,permission:r?.permission,description:r?.description,fee:r?.fee,fee_treasury:r?.fee_treasury,usage_guard:r?.usage_guard,endpoint:r?.endpoint,bPaused:r?.bPaused,voting_guard:r?.voting_guard?.fields?.contents?.map((e=>({object:e?.fields?.key,weights:e?.fields?.value})))};case"Arb":return{object:t,type:o,type_raw:i,owner:n,version:a,arbitration:r?.arbitration,description:r?.description,fee:r?.fee,feedback:r?.feedback,indemnity:r?.indemnity,order:r?.order,voted_count:parseInt(r?.voted?.fields?.size),proposition:r?.proposition?.fields?.contents?.map((e=>({proposition:e?.fields?.key,votes:e?.fields?.value})))};case"Repository":return{object:t,type:o,type_raw:i,owner:n,version:a,permission:r?.permission,description:r?.description,policy_mode:r?.policy_mode,data_count:parseInt(r?.data?.fields?.size),reference:r?.reference,rep_type:r?.type,policy:r?.policies?.fields?.contents?.map((e=>({key:e?.fields?.key,description:e?.fields?.value?.fields?.description,permissionIndex:e?.fields?.value?.fields?.permission_index,dataType:e?.fields?.value?.fields?.value_type})))};case"Payment":return{object:t,type:o,type_raw:i,owner:n,version:a,signer:r?.signer,time:r?.time,remark:r?.remark,from:r?.from,biz_id:r?.index,for_guard:r?.for_guard,for_object:r?.for_object,amount:r?.amount,record:r?.record?.map((e=>({recipient:e?.fields?.recipient,amount:e?.fields?.amount})))};case"Discount":return{object:t,type:o,type_raw:i,owner:n,version:a,service:r?.service,time_start:r?.time_start,time_end:r?.time_end,price_greater:r?.price_greater,off_type:r?.type,off:r?.off,name:r?.name};case"Guard":return{object:t,type:o,type_raw:i,owner:n,version:a,description:r?.description,input:Uint8Array.from(r?.input?.fields?.bytes),identifier:r?.constants?.map((e=>({id:e?.fields?.identifier,bWitness:e?.fields?.bWitness,value:Uint8Array.from(e?.fields?.value)})))};case"PersonalMark":return{object:t,type:o,type_raw:i,owner:n,version:a,tag_count:parseInt(r?.tags?.fields?.size)};case"TableItem_DemandPresenter":return{object:t,type:o,type_raw:i,owner:n,version:a,service:r?.name,presenter:r?.value?.fields?.who,recommendation:r?.value?.fields?.tips};case"TableItem_ProgressHistory":return{object:t,type:o,type_raw:i,owner:n,version:a,history:s.Progress.DeHistory(r)};case"TableItem_ServiceSale":return{object:t,type:o,type_raw:i,owner:n,version:a,item:{item:r?.name,stock:r?.value?.fields?.stock,price:r?.value?.fields?.price,endpoint:r?.value?.fields?.endpoint}};case"TableItem_TreasuryHistory":return{object:t,type:o,type_raw:i,owner:n,version:a,id:r?.name,payment:r?.value?.fields?.payment,signer:r?.value?.fields?.signer,operation:r?.value?.fields?.op,amount:r?.value?.fields?.amount,time:r?.value?.fields?.time};case"TableItem_ArbVote":return{object:t,type:o,type_raw:i,owner:n,version:a,singer:r?.name,vote:r?.value?.fields?.agrees,time:r?.value?.fields?.time,weight:r?.value?.fields?.weight};case"TableItem_PermissionEntity":return{object:t,type:o,type_raw:i,owner:n,version:a,entity:r?.name,permission:r?.value?.map((e=>({id:e?.fields.index,guard:e?.fields.guard})))};case"TableItem_RepositoryData":return{object:t,type:o,type_raw:i,owner:n,version:a,address:r?.name?.fields?.id,key:r?.name?.fields?.key,data:Uint8Array.from(r?.value)};case"Personal":const c=s.Bcs.getInstance().de_entInfo(Uint8Array.from(r?.value?.fields?.avatar));return{object:t,type:o,type_raw:i,owner:n,version:a,address:r?.name,like:r?.value?.fields?.like,dislike:r?.value?.fields?.dislike,mark_object:r?.value?.fields?.resource,lastActive_digest:e?.previousTransaction,info:{homepage:c?.homepage,name:c?.name,avatar:c?.avatar,twitter:c?.twitter,discord:c?.discord,description:c?.description}};case"TableItem_PersonalMark":return{object:t,type:o,type_raw:i,owner:n,version:a,address:r?.name,name:r?.value?.fields?.nick,tags:r?.value?.fields?.tags}}return{object:t,type:void 0,type_raw:i,owner:n,version:a}}}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var t=n[e]={exports:{}};return a[e](t,t.exports,o),t.exports}o.m=a,e=[],o.O=(r,t,i,s)=>{if(!t){var a=1/0;for(l=0;l<e.length;l++){for(var[t,i,s]=e[l],n=!0,c=0;c<t.length;c++)(!1&s||a>=s)&&Object.keys(o.O).every((e=>o.O[e](t[c])))?t.splice(c--,1):(n=!1,s<a&&(a=s));if(n){e.splice(l--,1);var d=i();void 0!==d&&(r=d)}}return r}s=s||0;for(var l=e.length;l>0&&e[l-1][2]>s;l--)e[l]=e[l-1];e[l]=[t,i,s]},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,i){if(1&i&&(e=this(e)),8&i)return e;if("object"==typeof e&&e){if(4&i&&e.__esModule)return e;if(16&i&&"function"==typeof e.then)return e}var s=Object.create(null);o.r(s);var a={};r=r||[null,t({}),t([]),t(t)];for(var n=2&i&&e;"object"==typeof n&&!~r.indexOf(n);n=t(n))Object.getOwnPropertyNames(n).forEach((r=>a[r]=()=>e[r]));return a.default=()=>e,o.d(s,a),s},o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((r,t)=>(o.f[t](e,r),r)),[])),o.u=e=>e+".6489b6fe957095e872d4.js",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),i={},s="wowok_agent:",o.l=(e,r,t,a)=>{if(i[e])i[e].push(r);else{var n,c;if(void 0!==t)for(var d=document.getElementsByTagName("script"),l=0;l<d.length;l++){var p=d[l];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")==s+t){n=p;break}}n||(c=!0,(n=document.createElement("script")).charset="utf-8",n.timeout=120,o.nc&&n.setAttribute("nonce",o.nc),n.setAttribute("data-webpack",s+t),n.src=e),i[e]=[r];var u=(r,t)=>{n.onerror=n.onload=null,clearTimeout(f);var s=i[e];if(delete i[e],n.parentNode&&n.parentNode.removeChild(n),s&&s.forEach((e=>e(t))),r)return r(t)},f=setTimeout(u.bind(null,void 0,{type:"timeout",target:n}),12e4);n.onerror=u.bind(null,n.onerror),n.onload=u.bind(null,n.onload),c&&document.head.appendChild(n)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var r=o.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var i=t.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=t[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{var e={185:0};o.f.j=(r,t)=>{var i=o.o(e,r)?e[r]:void 0;if(0!==i)if(i)t.push(i[2]);else{var s=new Promise(((t,s)=>i=e[r]=[t,s]));t.push(i[2]=s);var a=o.p+o.u(r),n=new Error;o.l(a,(t=>{if(o.o(e,r)&&(0!==(i=e[r])&&(e[r]=void 0),i)){var s=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;n.message="Loading chunk "+r+" failed.\n("+s+": "+a+")",n.name="ChunkLoadError",n.type=s,n.request=a,i[1](n)}}),"chunk-"+r,r)}},o.O.j=r=>0===e[r];var r=(r,t)=>{var i,s,[a,n,c]=t,d=0;if(a.some((r=>0!==e[r]))){for(i in n)o.o(n,i)&&(o.m[i]=n[i]);if(c)var l=c(o)}for(r&&r(t);d<a.length;d++)s=a[d],o.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return o.O(l)},t=this.webpackChunkwowok_agent=this.webpackChunkwowok_agent||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var c=o.O(void 0,[112,30,876,706,658,867,652,412,153,947,620,485,701,495,873,634,253,875,446,181,428],(()=>o(1229)));return o.O(c)})()));
|
package/dist/src/account.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Ed25519Keypair, TransactionBlock } from 'wowok';
|
|
2
|
-
import {
|
|
3
|
-
import { type TransactionResult } from '@mysten/sui/transactions';
|
|
2
|
+
import { CoinBalance, CoinStruct, TransactionResult } from 'wowok';
|
|
4
3
|
export interface AccountData {
|
|
5
4
|
name: string;
|
|
6
5
|
default?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/account.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAiD,gBAAgB,EAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/account.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAiD,gBAAgB,EAAmB,MAAM,OAAO,CAAC;AACzH,OAAO,EAAiE,WAAW,EAAE,UAAU,EAAuB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACvJ,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACnB;AAKD,qBAAa,OAAO;gBACJ,OAAO,GAAE,MAAM,GAAG,UAAmB;IAGjD,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC;IAEtB,MAAM,CAAC,QAAQ,IAAK,OAAO;IAM3B,OAAO,CAAC,OAAO,CAA+B;IAE9C,OAAO,CAAC,IAAI;IAwBZ,OAAO,CAAC,QAAQ;IAchB,OAAO,CAAC,IAAI;IAiBZ,OAAO,CAAC,OAAO;IA0Bf,WAAW,CAAC,OAAO,GAAE,MAAM,GAAG,UAAmB;IAI3C,GAAG,CAAC,IAAI,EAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO;IAenC,OAAO,IAAK,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAW5C,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,sBAAsB,GAAC,OAAY,GAAI,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAW1F,MAAM,CAAC,OAAO,EAAC,MAAM,EAAE,OAAO,EAAC,MAAM,EAAE,cAAc,GAAC,OAAY,GAAI,OAAO,CAAC,OAAO,CAAC;IAgBtF,WAAW,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,sBAAsB,UAAK,GAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAMpF,UAAU,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,sBAAsB,UAAK,GAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAMnF,QAAQ,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,sBAAsB,UAAK,GAAI,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAOzF,IAAI,IAAK,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAmBpC,MAAM,CAAC,IAAI,CAAC,EAAC,MAAM;IAUzB,OAAO,GAAU,OAAM,MAAM,EAAE,aAAY,MAAM,KAAI,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAKpF;IAGD,IAAI,GAAU,OAAM,MAAM,EAAE,aAAY,MAAM,KAAI,OAAO,CAAC,UAAU,EAAE,GAAG,SAAS,CAAC,CAKlF;IAED,eAAe,GAAU,KAAK,gBAAgB,EAAE,kBAAiB,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAM,MAAM,EAAE,aAAY,MAAM,KAAI,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CA2BpK;IACD,iBAAiB,GAAS,kBAAiB,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,UAAS,MAAM,EAAE,aAAY,MAAM,KAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAgBtI;CACJ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TransactionBlock, PassportObject, VotingGuard, WithdrawFee } from 'wowok';
|
|
2
2
|
import { CallBase, CallResult, Namedbject } from "./base";
|
|
3
|
-
export { BCS, getSuiMoveConfig, } from '@mysten/bcs';
|
|
4
3
|
export interface DisputeData {
|
|
5
4
|
order: string;
|
|
6
5
|
order_token_type: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arbitration.d.ts","sourceRoot":"","sources":["../../../src/call/arbitration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAkB,cAAc,EACgB,WAAW,EAAE,WAAW,EAEhG,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAC,MAAM,QAAQ,CAAC;AAEzD,
|
|
1
|
+
{"version":3,"file":"arbitration.d.ts","sourceRoot":"","sources":["../../../src/call/arbitration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAkB,cAAc,EACgB,WAAW,EAAE,WAAW,EAEhG,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAC,MAAM,QAAQ,CAAC;AAEzD,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAGD,MAAM,WAAW,oBAAoB;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE;QAAC,OAAO,EAAC,MAAM,CAAA;KAAC,GAAG;QAAC,QAAQ,EAAE,UAAU,CAAA;KAAC,CAAC;IACnD,UAAU,CAAC,EAAE;QAAC,OAAO,EAAC,MAAM,CAAA;KAAC,GAAG;QAAC,QAAQ,EAAE,UAAU,CAAC;QAAC,WAAW,CAAC,EAAC,MAAM,CAAA;KAAC,CAAC;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE;QAAC,OAAO,EAAC,MAAM,CAAA;KAAC,GAAG;QAAC,QAAQ,EAAE,UAAU,CAAC;QAAC,WAAW,CAAC,EAAC,MAAM,CAAA;KAAC,CAAC;IAC9E,OAAO,CAAC,EAAE;QAAC,IAAI,EAAE,WAAW,CAAC;QAAC,KAAK,CAAC,EAAC,MAAM,GAAG,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,UAAU,CAAA;KAAC,CAAC;IAC9E,gBAAgB,CAAC,EAAE;QAAC,GAAG,CAAC,EAAC,MAAM,CAAC;QAAC,IAAI,EAAC,WAAW,CAAA;KAAC,CAAC;IACnD,QAAQ,CAAC,EAAE;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAC,CAAC;IACnE,eAAe,CAAC,EAAE;QAAC,GAAG,CAAC,EAAC,MAAM,CAAC;QAAC,QAAQ,EAAC,MAAM,CAAC;QAAC,SAAS,CAAC,EAAC,MAAM,GAAC,MAAM,CAAA;KAAC,CAAC;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE;QAAC,EAAE,EAAC,KAAK,GAAG,KAAK,CAAC;QAAC,IAAI,EAAC,WAAW,EAAE,CAAA;KAAC,GAAG;QAAC,EAAE,EAAC,QAAQ,CAAC;QAAC,MAAM,EAAC,MAAM,EAAE,CAAA;KAAC,GAAG;QAAC,EAAE,EAAC,WAAW,CAAA;KAAC,CAAC;IAC1G,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,qBAAa,eAAgB,SAAQ,QAAQ;IACzC,IAAI,EAAE,oBAAoB,CAAC;gBACd,IAAI,EAAE,oBAAoB;IAKjC,IAAI,CAAC,OAAO,CAAC,EAAC,MAAM,GAAI,OAAO,CAAC,UAAU,CAAC;cAwEjC,OAAO,CAAC,GAAG,EAAC,gBAAgB,EAAE,QAAQ,CAAC,EAAC,cAAc,EAAE,OAAO,CAAC,EAAC,MAAM;CA6G1F"}
|
|
@@ -2,7 +2,6 @@ import { IsValidArgType, IsValidAddress, Errors, ERROR, Permission, PermissionIn
|
|
|
2
2
|
import { query_objects, } from '../objects';
|
|
3
3
|
import { CallBase } from "./base";
|
|
4
4
|
import { Account } from '../account';
|
|
5
|
-
export { BCS, getSuiMoveConfig, } from '@mysten/bcs';
|
|
6
5
|
export class CallArbitration extends CallBase {
|
|
7
6
|
data;
|
|
8
7
|
constructor(data) {
|
package/dist/src/call/base.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { TxbAddress, ResourceObject, PassportObject, PermissionIndexType, WitnessFill } from 'wowok';
|
|
1
|
+
import { TxbAddress, ResourceObject, PassportObject, PermissionIndexType, WitnessFill, CallResponse } from 'wowok';
|
|
2
2
|
import { ObjectBase } from '../objects';
|
|
3
3
|
import { Transaction as TransactionBlock } from '@mysten/sui/transactions';
|
|
4
|
-
import { type SuiTransactionBlockResponse as CallResponse } from '@mysten/sui/client';
|
|
5
4
|
export interface Namedbject {
|
|
6
5
|
name?: string;
|
|
7
6
|
tags?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/call/base.ts"],"names":[],"mappings":"AAEA,OAAO,EAA8B,UAAU,EAAyB,cAAc,EAAE,cAAc,EAClG,mBAAmB,EAAyB,WAAW,
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/call/base.ts"],"names":[],"mappings":"AAEA,OAAO,EAA8B,UAAU,EAAyB,cAAc,EAAE,cAAc,EAClG,mBAAmB,EAAyB,WAAW,EAAE,YAAY,EACxE,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,UAAU,EAAoC,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAG1E,MAAM,WAAW,UAAU;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,UAAU,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,EAAE,CAAC;CAClB;AACD,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC5C,MAAM,EAAC,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;CACzC;AACD,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,WAAW,EAAE,CAAC;CAC1B;AAED,MAAM,MAAM,UAAU,GAAG,iBAAiB,GAAG,YAAY,GAAG,SAAS,CAAC;AAGtE,wBAAgB,YAAY,CAAC,QAAQ,EAAE,YAAY,GAAG,SAAS,GAAI,YAAY,EAAE,CAYhF;AAED,qBAAa,QAAQ;IAEjB,aAAa,EAAC,cAAc,GAAG,SAAS,CAAC;cACzB,OAAO,CAAC,GAAG,EAAC,gBAAgB,EAAE,QAAQ,CAAC,EAAC,cAAc,EAAE,OAAO,CAAC,EAAC,MAAM;;IAKjF,IAAI,CAAC,OAAO,CAAC,EAAC,MAAM,GAAI,OAAO,CAAC,UAAU,CAAC;IAC3C,iBAAiB,CAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAC,MAAM,GAAI,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;cAoBtF,yBAAyB,CAAE,UAAU,EAAC,MAAM,EAAE,SAAS,EAAE,mBAAmB,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,EACnH,UAAU,CAAC,EAAC,OAAO,EAAE,UAAU,CAAC,EAAC,OAAO,EAAE,OAAO,CAAC,EAAC,MAAM,GAAI,OAAO,CAAC,UAAU,CAAC;cA0CpE,IAAI,CAAE,OAAO,CAAC,EAAC,MAAM,GAAI,OAAO,CAAC,YAAY,CAAC;cAM9C,aAAa,CAAC,GAAG,EAAC,gBAAgB,EAAE,MAAM,EAAC,UAAU,EAAE,SAAS,CAAC,EAAC,UAAU,EAAE,OAAO,CAAC,EAAC,MAAM,EAAE,SAAS,GAAC,MAAM,EAAmB;cAqBlI,eAAe,CAAC,GAAG,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,MAAM,GAAI,OAAO,CAAC,YAAY,CAAC;CAenG"}
|
package/package.json
CHANGED
package/src/account.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { Ed25519Keypair, fromHEX, toHEX, decodeSuiPrivateKey, Protocol, TransactionBlock, ERROR, Errors, } from 'wowok';
|
|
3
|
-
import { getFaucetHost, requestSuiFromFaucetV0, requestSuiFromFaucetV1 } from 'wowok';
|
|
4
|
-
import { type CoinBalance, type CoinStruct } from '@mysten/sui/client';
|
|
5
|
-
import { type TransactionArgument, type TransactionResult } from '@mysten/sui/transactions';
|
|
3
|
+
import { getFaucetHost, requestSuiFromFaucetV0, requestSuiFromFaucetV1, CoinBalance, CoinStruct, TransactionArgument, TransactionResult } from 'wowok';
|
|
6
4
|
export interface AccountData {
|
|
7
5
|
name: string;
|
|
8
6
|
default?: boolean;
|
package/src/call/arbitration.ts
CHANGED
|
@@ -5,8 +5,6 @@ import { TransactionBlock, IsValidArgType, PassportObject, IsValidAddress, Error
|
|
|
5
5
|
import { query_objects, ObjectArbitration, } from '../objects';
|
|
6
6
|
import { CallBase, CallResult, Namedbject} from "./base";
|
|
7
7
|
import { Account } from '../account';
|
|
8
|
-
export { BCS, getSuiMoveConfig, } from '@mysten/bcs';
|
|
9
|
-
|
|
10
8
|
export interface DisputeData {
|
|
11
9
|
order: string,
|
|
12
10
|
order_token_type: string,
|
package/src/call/base.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
import { Protocol, Entity, Resource, TxbAddress, array_unique, TagName, ResourceObject, PassportObject, Errors, ERROR, Permission,
|
|
4
|
-
PermissionIndexType, GuardParser, Passport, WitnessFill
|
|
4
|
+
PermissionIndexType, GuardParser, Passport, WitnessFill, CallResponse
|
|
5
5
|
} from 'wowok';
|
|
6
6
|
import { query_permission } from '../permission';
|
|
7
7
|
import { Account } from '../account';
|
|
8
8
|
import { ObjectBase, queryTableItem_Personal, raw2type} from '../objects';
|
|
9
9
|
import { Transaction as TransactionBlock} from '@mysten/sui/transactions';
|
|
10
|
-
import { type SuiTransactionBlockResponse as CallResponse} from '@mysten/sui/client';
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
export interface Namedbject {
|