supercolony 0.1.3 → 0.1.5
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/README.md +22 -18
- package/dist/commands/task.mjs +1 -1
- package/dist/commands/wallet.mjs +1 -1
- package/dist/lib/drafts.mjs +1 -0
- package/dist/lib/funding-error.mjs +1 -1
- package/dist/lib/funding-state.mjs +1 -1
- package/dist/lib/funding.mjs +1 -1
- package/dist/lib/local-wallet.mjs +1 -1
- package/dist/lib/payment-coins.mjs +1 -1
- package/dist/lib/payment-networks.mjs +1 -1
- package/dist/lib/payment-options.mjs +1 -0
- package/dist/lib/publish.mjs +1 -1
- package/dist/lib/submission-attribution.mjs +1 -0
- package/dist/lib/support.mjs +1 -1
- package/dist/lib/task-wallet.mjs +1 -1
- package/dist/lib/wallet-receive.mjs +1 -1
- package/dist/lib/wallet-status.mjs +1 -1
- package/dist/program.mjs +1 -1
- package/dist/tui/app.mjs +1 -1
- package/dist/tui/controller.mjs +1 -1
- package/dist/tui/index.mjs +1 -1
- package/dist/tui/presentation.mjs +1 -1
- package/dist/tui/services.mjs +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x1b95d7=_0xed43;import{readFileSync as _0x3c958c,readdirSync as _0x2aafcd}from'node:fs';function _0xed43(_0x1b96a0,_0x29e0e4){_0x1b96a0=_0x1b96a0-0xbe;const _0xed4307=_0x29e0();let _0x40b5af=_0xed4307[_0x1b96a0];return _0x40b5af;}import{copyFile as _0x6c65bf,mkdir as _0x29199e,readFile as _0x43f78d,writeFile as _0x6bc8d1,rename as _0x3cc41a}from'node:fs/promises';import{randomUUID as _0x46ff21}from'node:crypto';import{constants as _0xbb59c4}from'node:fs';import{join as _0x42dba5,resolve as _0x571fb4}from'node:path';import{getAddress as _0x4fd9f1}from'viem';import{generatePrivateKey as _0x2ba976,privateKeyToAccount as _0x40ac50}from'viem/accounts';import{readPassword as _0x129e05}from'./password.mjs';const v=new Map(),k=new Map();let i=0x0;function E(_0x2fdd7f){const _0x41eede=_0xed43,_0x3c9d99=k[_0x41eede(0xf0)](_0x571fb4(_0x2fdd7f));return _0x3c9d99?.[_0x41eede(0xd4)]===g(_0x42dba5(_0x2fdd7f,_0x41eede(0xe3)))?_0x3c9d99:null;}async function O(_0x438871,_0x3c57a1){const _0x3e8e2a=_0xed43,{home:_0x906b1c,signal:_0x2fccc3}=_0x438871;if(E(_0x906b1c))return E(_0x906b1c)[_0x3e8e2a(0xcb)];const _0x141e34=x(_0x42dba5(_0x906b1c,_0x3e8e2a(0xe3)),_0x3c958c(_0x42dba5(_0x906b1c,_0x3e8e2a(0xe3)),_0x3e8e2a(0xcd))),_0x5a2b11=i;_0x3c57a1??=await(_0x438871['requestPassword']??_0x129e05)(_0x3e8e2a(0xe8),{'signal':_0x2fccc3});const {decryptKeystoreJson:_0x251cd6}=await import('ethers');let _0x413d97;try{_0x413d97=await _0x251cd6(_0x141e34[_0x3e8e2a(0xed)],_0x3c57a1);}catch{throw new Error(_0x3e8e2a(0xd7));}if(_0x2fccc3?.['throwIfAborted'](),_0x5a2b11!==i)throw new Error(_0x3e8e2a(0xd9));if(u(_0x413d97[_0x3e8e2a(0xe9)])[_0x3e8e2a(0xeb)]!==_0x141e34[_0x3e8e2a(0xeb)])throw new Error('Wallet\x20address\x20does\x20not\x20match\x20its\x20encrypted\x20key.');return k[_0x3e8e2a(0xda)](_0x571fb4(_0x906b1c),{'password':_0x3c57a1,'root':_0x141e34[_0x3e8e2a(0xed)]}),_0x3c57a1;}function g(_0x503a4d){const _0x4b10f1=_0xed43;try{return _0x3c958c(_0x503a4d,'utf8');}catch(_0x48019b){if(_0x48019b[_0x4b10f1(0xd3)]===_0x4b10f1(0xea))return null;throw _0x48019b;}}function x(_0x3089b9,_0x1a32b0){const _0x569e68=_0xed43,_0x3f4c63=JSON[_0x569e68(0xbf)](_0x1a32b0);if(_0x3f4c63[_0x569e68(0xc5)]!==0x3)throw new Error(_0x569e68(0xd1));return{'file':_0x3089b9,'json':_0x1a32b0,'address':_0x4fd9f1('0x'+_0x3f4c63[_0x569e68(0xeb)]['replace'](/^0x/,''))};}function d(_0x72d9cb){const _0x28e66d=_0xed43;if(!_0x72d9cb)return[];const _0x13d38b=_0x42dba5(_0x72d9cb,_0x28e66d(0xe3)),_0x24837d=g(_0x13d38b),_0x44e8f3=_0x24837d?[x(_0x13d38b,_0x24837d)]:[];let _0x1f8328;try{_0x1f8328=_0x2aafcd(_0x42dba5(_0x72d9cb,_0x28e66d(0xdf)));}catch(_0x4501f3){if(_0x4501f3[_0x28e66d(0xd3)]!==_0x28e66d(0xea))throw _0x4501f3;_0x1f8328=[];}for(const _0x5a8dd6 of _0x1f8328[_0x28e66d(0xc8)](_0x5b7fa6=>/^0x[0-9a-f]{40}\.json$/[_0x28e66d(0xe7)](_0x5b7fa6))[_0x28e66d(0xec)]()){const _0x29861d=_0x42dba5(_0x72d9cb,_0x28e66d(0xdf),_0x5a8dd6);_0x44e8f3[_0x28e66d(0xca)](x(_0x29861d,_0x3c958c(_0x29861d,'utf8')));}return _0x44e8f3;}function j(_0x41bc4e,_0x342e5e=d(_0x41bc4e)){const _0x329da7=_0xed43;if(!_0x41bc4e)return null;const _0x1b5539=g(_0x42dba5(_0x41bc4e,_0x329da7(0xe2)));if(!_0x1b5539)return _0x342e5e[0x0]??null;const {address:_0x3528a3}=JSON[_0x329da7(0xbf)](_0x1b5539),_0x1768a1=_0x342e5e[_0x329da7(0xe0)](_0x544fe3=>_0x544fe3[_0x329da7(0xeb)]===_0x3528a3);if(!_0x1768a1)throw new Error('The\x20selected\x20wallet\x20file\x20is\x20missing.\x20Use\x20wallet\x20list\x20and\x20wallet\x20use\x20to\x20select\x20another\x20wallet.');return _0x1768a1;}const R=_0x41edeb=>j(_0x41edeb)?.[_0x1b95d7(0xe4)]??_0x42dba5(_0x41edeb,_0x1b95d7(0xe3));function B(_0xb068ca){const _0x508fce=_0x1b95d7,_0x7df83a=d(_0xb068ca),_0x33fa35=_0xb068ca?g(_0x42dba5(_0xb068ca,'wallet-selection.json')):null,_0xc9982c=_0x33fa35?JSON['parse'](_0x33fa35)[_0x508fce(0xeb)]:_0x7df83a[0x0]?.[_0x508fce(0xeb)];return _0x7df83a['map'](_0xb400f0=>({'address':_0xb400f0['address'],'active':_0xb400f0[_0x508fce(0xeb)]===_0xc9982c,'locked':!E(_0xb068ca)}));}async function T(_0x90643,_0x2564ca){const _0x2cd930=_0x1b95d7,_0x240fcb=_0x4fd9f1(_0x2564ca);if(!d(_0x90643)[_0x2cd930(0xe1)](_0x2197eb=>_0x2197eb['address']===_0x240fcb))throw new Error(_0x2cd930(0xde));const _0x1b1cbb=_0x42dba5(_0x90643,'wallet-selection.json'),_0x4cc0e0=_0x42dba5(_0x90643,'.wallet-selection-'+_0x46ff21()+_0x2cd930(0xdc));return await _0x6bc8d1(_0x4cc0e0,JSON['stringify']({'address':_0x240fcb})+'\x0a',{'flag':'wx','mode':0x180}),await _0x3cc41a(_0x4cc0e0,_0x1b1cbb),m({'home':_0x90643});}function _0x29e0(){const _0x43da34=['toLowerCase','parse','keyEnv','Private\x20key','signal','expectedWallet','This\x20wallet\x20already\x20exists.\x20Select\x20it\x20in\x20Wallets\x20and\x20press\x20u,\x20or\x20use\x20colony\x20wallet\x20use\x20<address>.\x20Its\x20encrypted\x20file\x20will\x20not\x20be\x20overwritten.','version','Incorrect\x20wallet\x20password.','Wallet\x20address\x20does\x20not\x20match\x20its\x20encrypted\x20key.','filter','Payment\x20wallet\x20changed.\x20Review\x20the\x20order\x20with\x20the\x20intended\x20wallet\x20before\x20paying.','push','password','length','utf8','Could\x20not\x20restore\x20wallet.\x20Check\x20the\x20backup\x20file\x20and\x20password.','Saved\x20wallet\x20not\x20found.','account','Unsupported\x20wallet\x20file.\x20Restore\x20a\x20JSON\x20keystore\x20backup.','Could\x20not\x20unlock\x20wallet.\x20Check\x20your\x20password\x20and\x20wallet\x20file.','code','root','trim','Use\x20a\x20wallet\x20password\x20with\x20at\x20least\x208\x20characters.','Could\x20not\x20unlock\x20wallets.\x20Check\x20your\x20local\x20wallet\x20password.','clear','Wallets\x20were\x20locked.\x20Unlock\x20again\x20to\x20continue.','set','COLONY_PRIVATE_KEY','.tmp','environment','Wallet\x20not\x20found.\x20Create,\x20import\x20or\x20restore\x20it\x20first.','wallets','find','some','wallet-selection.json','wallet.json','file','\x20is\x20not\x20a\x20valid\x20wallet\x20private\x20key.','COPYFILE_EXCL','test','Local\x20wallet\x20password','privateKey','ENOENT','address','sort','json','home','local','get','.json','throwIfAborted'];_0x29e0=function(){return _0x43da34;};return _0x29e0();}function u(_0x3521fb,_0xb0394a=_0x1b95d7(0xc1)){const _0x570f04=_0x1b95d7,_0x1a61fd=_0x3521fb['trim']();if(!/^0x[0-9a-fA-F]{64}$/[_0x570f04(0xe7)](_0x1a61fd))throw new Error(_0xb0394a+'\x20must\x20be\x20a\x200x-prefixed\x2032-byte\x20hex\x20private\x20key');try{return _0x40ac50(_0x1a61fd);}catch{throw new Error(_0xb0394a+_0x570f04(0xe5));}}function m(_0x354ee2={}){const _0x1c29de=_0x1b95d7,_0x5a94ff=j(_0x354ee2[_0x1c29de(0xee)]);if(_0x5a94ff)return{'configured':!0x0,'address':_0x5a94ff[_0x1c29de(0xeb)],'source':_0x1c29de(0xef),'locked':!E(_0x354ee2[_0x1c29de(0xee)])};const _0xce3977=_0x354ee2[_0x1c29de(0xc0)]??_0x1c29de(0xdb),_0x3fafe4=process.env[_0xce3977];return _0x3fafe4?{'configured':!0x0,'address':u(_0x3fafe4,_0xce3977)[_0x1c29de(0xeb)],'source':_0x1c29de(0xdd),'locked':!0x1}:{'configured':!0x1,'address':null,'source':null,'locked':!0x0};}function G(){const _0x1ff6d5=_0x1b95d7;v[_0x1ff6d5(0xd8)](),k[_0x1ff6d5(0xd8)](),i++;}async function H(_0x1d8a1c={}){const _0x357ee3=_0x1b95d7;if(_0x1d8a1c[_0x357ee3(0xc3)]&&m(_0x1d8a1c)['address']!==_0x4fd9f1(_0x1d8a1c[_0x357ee3(0xc3)]))throw new Error(_0x357ee3(0xc9));const _0x2d9c0c=j(_0x1d8a1c[_0x357ee3(0xee)]);if(!_0x2d9c0c){const _0x58d36e=_0x1d8a1c[_0x357ee3(0xc0)]??_0x357ee3(0xdb);if(!process.env[_0x58d36e])throw new Error('No\x20wallet\x20configured.\x20Open\x20Wallet\x20to\x20create\x20or\x20import\x20one,\x20or\x20run\x20colony\x20wallet\x20create.');return u(process.env[_0x58d36e],_0x58d36e);}const {json:_0x5ec626}=_0x2d9c0c,_0xfa7a36=_0x571fb4(_0x2d9c0c['file']),_0x41ab90=i,_0x507181=await O(_0x1d8a1c);if(m(_0x1d8a1c)[_0x357ee3(0xeb)]!==_0x2d9c0c[_0x357ee3(0xeb)])throw new Error('Active\x20wallet\x20changed\x20while\x20unlocking.\x20Review\x20the\x20payment\x20again.');if(v['get'](_0xfa7a36)?.[_0x357ee3(0xed)]===_0x5ec626)return v[_0x357ee3(0xf0)](_0xfa7a36)[_0x357ee3(0xd0)];const {decryptKeystoreJson:_0x13c41f}=await import('ethers');let _0x504069;try{_0x504069=await _0x13c41f(_0x5ec626,_0x507181);}catch{throw new Error(_0x357ee3(0xd2));}if(_0x1d8a1c[_0x357ee3(0xc2)]?.['throwIfAborted'](),_0x41ab90!==i)throw new Error(_0x357ee3(0xd9));const _0x105c1f=u(_0x504069[_0x357ee3(0xe9)]);if(_0x105c1f['address']!==_0x2d9c0c['address'])throw new Error(_0x357ee3(0xc7));if(m(_0x1d8a1c)[_0x357ee3(0xeb)]!==_0x105c1f['address'])throw new Error('Active\x20wallet\x20changed\x20while\x20unlocking.\x20Review\x20the\x20payment\x20again.');return v[_0x357ee3(0xda)](_0xfa7a36,{'json':_0x5ec626,'account':_0x105c1f}),_0x105c1f;}async function Y(_0xe2a269,_0x1bb6d9,_0x4555a2=_0x2ba976(),_0x8c1961={}){const _0x5e977f=_0x1b95d7,{signal:_0x19164a}=_0x8c1961,_0x3d226b=u(_0x4555a2),_0xe6b0d3=d(_0xe2a269);if(_0xe6b0d3[_0x5e977f(0xe1)](_0x21cce6=>_0x21cce6[_0x5e977f(0xeb)]===_0x3d226b[_0x5e977f(0xeb)]))throw new Error(_0x5e977f(0xc4));if(_0xe6b0d3['length']&&(_0x1bb6d9=await O({..._0x8c1961,'home':_0xe2a269},_0x1bb6d9)),!_0x1bb6d9||_0x1bb6d9[_0x5e977f(0xcc)]<0x8)throw new Error(_0x5e977f(0xd6));const _0x3d50d0=i,{encryptKeystoreJson:_0x37f130}=await import('ethers'),_0x4c4101=await _0x37f130({'address':_0x3d226b[_0x5e977f(0xeb)],'privateKey':_0x4555a2[_0x5e977f(0xd5)]()},_0x1bb6d9);if(_0x19164a?.['throwIfAborted'](),_0x3d50d0!==i)throw new Error('Wallets\x20were\x20locked.\x20Unlock\x20again\x20to\x20continue.');await _0x29199e(_0xe2a269,{'recursive':!0x0,'mode':0x1c0});const _0xd7fd79=_0xe6b0d3[_0x5e977f(0xcc)]===0x0?_0x42dba5(_0xe2a269,_0x5e977f(0xe3)):_0x42dba5(_0xe2a269,'wallets',_0x3d226b[_0x5e977f(0xeb)][_0x5e977f(0xbe)]()+_0x5e977f(0xf1));return _0xe6b0d3[_0x5e977f(0xcc)]&&await _0x29199e(_0x42dba5(_0xe2a269,_0x5e977f(0xdf)),{'recursive':!0x0,'mode':0x1c0}),await _0x6bc8d1(_0xd7fd79,_0x4c4101+'\x0a',{'flag':'wx','mode':0x180}),k['set'](_0x571fb4(_0xe2a269),{'password':_0x1bb6d9,'root':_0x3c958c(_0x42dba5(_0xe2a269,_0x5e977f(0xe3)),_0x5e977f(0xcd))}),T(_0xe2a269,_0x3d226b[_0x5e977f(0xeb)]);}async function Q(_0xa1b725,_0x56f51b,_0x5555fe){const _0x52194e=_0x1b95d7,_0x102ca7=_0x571fb4(_0x56f51b),_0x55dca2=_0x5555fe?d(_0xa1b725)[_0x52194e(0xe0)](_0x130d2a=>_0x130d2a[_0x52194e(0xeb)]===_0x4fd9f1(_0x5555fe))?.['file']:R(_0xa1b725);if(!_0x55dca2)throw new Error(_0x52194e(0xcf));return await _0x6c65bf(_0x55dca2,_0x102ca7,_0xbb59c4[_0x52194e(0xe6)]),{'path':_0x102ca7};}async function Z(_0x1c01e5,_0x191856,_0x2e58d9,{signal:_0x432512}={}){const _0x4e1dda=_0x1b95d7,_0x5894bc=d(_0x1c01e5)['find'](_0x3139b4=>_0x3139b4[_0x4e1dda(0xeb)]===_0x4fd9f1(_0x191856));if(!_0x5894bc)throw new Error(_0x4e1dda(0xcf));const {decryptKeystoreJson:_0x1a25cc}=await import('ethers');let _0x48df6b;try{_0x48df6b=await _0x1a25cc(_0x5894bc[_0x4e1dda(0xed)],_0x2e58d9);}catch{throw new Error(_0x4e1dda(0xc6));}if(_0x432512?.[_0x4e1dda(0xf2)](),u(_0x48df6b[_0x4e1dda(0xe9)])[_0x4e1dda(0xeb)]!==_0x5894bc[_0x4e1dda(0xeb)])throw new Error(_0x4e1dda(0xc7));return{'address':_0x5894bc[_0x4e1dda(0xeb)],'privateKey':_0x48df6b[_0x4e1dda(0xe9)]};}async function ee(_0x332d74,_0x718481,_0x1f4712,_0x4ff26e={}){const _0x9c3d4=_0x1b95d7,_0x3bf93a=await _0x43f78d(_0x718481,_0x9c3d4(0xcd)),{decryptKeystoreJson:_0x528c3e}=await import('ethers');let _0x4ef66c;try{_0x4ef66c=await _0x528c3e(_0x3bf93a,_0x1f4712);}catch{throw new Error(_0x9c3d4(0xce));}return Y(_0x332d74,d(_0x332d74)['length']?void 0x0:_0x1f4712,_0x4ef66c[_0x9c3d4(0xe9)],_0x4ff26e);}export{Q as backupWallet,u as keyAccount,B as listWallets,G as lockWallet,ee as restoreWallet,Z as revealPrivateKey,Y as saveLocalWallet,T as selectWallet,O as unlockWallet,R as walletFile,m as walletInfo,H as walletSigner};
|
|
1
|
+
const _0x4544be=_0x3a10;import{readFileSync as _0x28a39b,readdirSync as _0x1c7d7e}from'node:fs';import{copyFile as _0xed6d74,mkdir as _0x2b5b36,readFile as _0x44647d,writeFile as _0x44c976,rename as _0x222ac7,unlink as _0x5b3a9,rm as _0x5499f1}from'node:fs/promises';import{randomUUID as _0x5d459d}from'node:crypto';import{constants as _0x389611}from'node:fs';function _0x3a10(_0x422e9a,_0x29979d){_0x422e9a=_0x422e9a-0xae;const _0x3a108d=_0x2997();let _0x36c768=_0x3a108d[_0x422e9a];return _0x36c768;}import{join as _0xa758eb,resolve as _0x34b4c3}from'node:path';import{getAddress as _0x326dbf}from'viem';import{generatePrivateKey as _0x3f8fee,privateKeyToAccount as _0x193ef7}from'viem/accounts';import{readPassword as _0x43c267}from'./password.mjs';const v=new Map(),k=new Map();let w=0x0;function E(_0x22f0c){const _0x3ef9e2=_0x3a10,_0x43a139=k[_0x3ef9e2(0xb2)](_0x34b4c3(_0x22f0c));return _0x43a139?.[_0x3ef9e2(0xb7)]===g(_0xa758eb(_0x22f0c,_0x3ef9e2(0xc6)))?_0x43a139:null;}async function O(_0x6b3a5,_0x1a0f1f){const _0x1c2024=_0x3a10,{home:_0x778007,signal:_0x34693c}=_0x6b3a5;if(E(_0x778007))return E(_0x778007)['password'];const _0x2d5f92=j(_0xa758eb(_0x778007,_0x1c2024(0xc6)),_0x28a39b(_0xa758eb(_0x778007,_0x1c2024(0xc6)),'utf8')),_0x2c77a1=w;_0x1a0f1f??=await(_0x6b3a5['requestPassword']??_0x43c267)(_0x1c2024(0xb3),{'signal':_0x34693c});const {decryptKeystoreJson:_0x536e64}=await import('ethers');let _0x46a44c;try{_0x46a44c=await _0x536e64(_0x2d5f92[_0x1c2024(0xbb)],_0x1a0f1f);}catch{throw new Error(_0x1c2024(0xd7));}if(_0x34693c?.['throwIfAborted'](),_0x2c77a1!==w)throw new Error('Wallets\x20were\x20locked.\x20Unlock\x20again\x20to\x20continue.');if(u(_0x46a44c[_0x1c2024(0xe3)])['address']!==_0x2d5f92[_0x1c2024(0xc2)])throw new Error(_0x1c2024(0xd6));return k[_0x1c2024(0xce)](_0x34b4c3(_0x778007),{'password':_0x1a0f1f,'root':_0x2d5f92[_0x1c2024(0xbb)]}),_0x1a0f1f;}function g(_0x3a01a5){const _0x1befa3=_0x3a10;try{return _0x28a39b(_0x3a01a5,_0x1befa3(0xd9));}catch(_0x15e1c1){if(_0x15e1c1[_0x1befa3(0xd8)]===_0x1befa3(0xbc))return null;throw _0x15e1c1;}}function j(_0x4b7a24,_0x1ea5f1){const _0x5da1a1=_0x3a10,_0xb7df21=JSON[_0x5da1a1(0xba)](_0x1ea5f1);if(_0xb7df21[_0x5da1a1(0xda)]!==0x3)throw new Error(_0x5da1a1(0xb9));return{'file':_0x4b7a24,'json':_0x1ea5f1,'address':_0x326dbf('0x'+_0xb7df21['address'][_0x5da1a1(0xc8)](/^0x/,''))};}function i(_0x2579f0){const _0x38975d=_0x3a10;if(!_0x2579f0)return[];const _0x524158=_0xa758eb(_0x2579f0,_0x38975d(0xc6)),_0x53a7cb=g(_0x524158),_0x921e12=_0x53a7cb?[j(_0x524158,_0x53a7cb)]:[];let _0x4ed3f0;try{_0x4ed3f0=_0x1c7d7e(_0xa758eb(_0x2579f0,_0x38975d(0xe2)));}catch(_0x1e078a){if(_0x1e078a['code']!==_0x38975d(0xbc))throw _0x1e078a;_0x4ed3f0=[];}for(const _0x316295 of _0x4ed3f0[_0x38975d(0xcf)](_0xb5f068=>/^0x[0-9a-f]{40}\.json$/[_0x38975d(0xd1)](_0xb5f068))[_0x38975d(0xb4)]()){const _0x1763b4=_0xa758eb(_0x2579f0,_0x38975d(0xe2),_0x316295);_0x921e12[_0x38975d(0xcc)](j(_0x1763b4,_0x28a39b(_0x1763b4,_0x38975d(0xd9))));}return _0x921e12;}function m(_0x9b8d6e,_0x402716=i(_0x9b8d6e)){const _0x25891d=_0x3a10;if(!_0x9b8d6e)return null;const _0x4ccddf=g(_0xa758eb(_0x9b8d6e,_0x25891d(0xc7)));if(!_0x4ccddf)return _0x402716[0x0]??null;const {address:_0xe7d655}=JSON[_0x25891d(0xba)](_0x4ccddf),_0x1d0b30=_0x402716['find'](_0x2c0534=>_0x2c0534[_0x25891d(0xc2)]===_0xe7d655);if(!_0x1d0b30)throw new Error(_0x25891d(0xd5));return _0x1d0b30;}const _=_0x4a35bd=>m(_0x4a35bd)?.[_0x4544be(0xd2)]??_0xa758eb(_0x4a35bd,_0x4544be(0xc6));function Q(_0xa4b668){const _0x1661f6=_0x4544be,_0x213c0b=i(_0xa4b668),_0x2c400e=_0xa4b668?g(_0xa758eb(_0xa4b668,_0x1661f6(0xc7))):null,_0x221cdf=_0x2c400e?JSON[_0x1661f6(0xba)](_0x2c400e)[_0x1661f6(0xc2)]:_0x213c0b[0x0]?.[_0x1661f6(0xc2)];return _0x213c0b[_0x1661f6(0xdf)](_0x46efb6=>({'address':_0x46efb6[_0x1661f6(0xc2)],'active':_0x46efb6[_0x1661f6(0xc2)]===_0x221cdf,'locked':!E(_0xa4b668)}));}async function C(_0x15906d,_0x405078){const _0x4d9b86=_0x4544be,_0x850335=_0x326dbf(_0x405078);if(!i(_0x15906d)[_0x4d9b86(0xe4)](_0x7365a4=>_0x7365a4[_0x4d9b86(0xc2)]===_0x850335))throw new Error(_0x4d9b86(0xc3));const _0x340a68=_0xa758eb(_0x15906d,'wallet-selection.json'),_0x391157=_0xa758eb(_0x15906d,_0x4d9b86(0xb5)+_0x5d459d()+'.tmp');return await _0x44c976(_0x391157,JSON[_0x4d9b86(0xbf)]({'address':_0x850335})+'\x0a',{'flag':'wx','mode':0x180}),await _0x222ac7(_0x391157,_0x340a68),x({'home':_0x15906d});}async function Z(_0x3b82ae,_0x5bfe31){const _0x57568e=_0x4544be,_0x59a7c4=_0x326dbf(_0x5bfe31),_0x319bba=i(_0x3b82ae),_0x48c89e=_0x319bba[_0x57568e(0xde)](_0x2f4db2=>_0x2f4db2['address']===_0x59a7c4);if(!_0x48c89e)throw new Error(_0x57568e(0xcd));const _0x385c26=m(_0x3b82ae,_0x319bba),_0x21f915=_0x319bba[_0x57568e(0xcf)](_0x14a645=>_0x14a645!==_0x48c89e),_0x5345c5=_0x385c26[_0x57568e(0xc2)]===_0x48c89e[_0x57568e(0xc2)]?_0x21f915[0x0]:_0x385c26;return $(),_0x48c89e[_0x57568e(0xd2)]===_0xa758eb(_0x3b82ae,_0x57568e(0xc6))&&_0x5345c5?await _0x222ac7(_0x5345c5[_0x57568e(0xd2)],_0x48c89e['file']):await _0x5b3a9(_0x48c89e[_0x57568e(0xd2)]),_0x5345c5?await C(_0x3b82ae,_0x5345c5[_0x57568e(0xc2)]):await _0x5499f1(_0xa758eb(_0x3b82ae,'wallet-selection.json'),{'force':!0x0}),{'deletedAddress':_0x48c89e['address'],'currentAddress':_0x5345c5?.[_0x57568e(0xc2)]??null};}function u(_0x151604,_0x2a7d76=_0x4544be(0xcb)){const _0x25eaa5=_0x4544be,_0x126c4a=_0x151604[_0x25eaa5(0xc0)]();if(!/^0x[0-9a-fA-F]{64}$/[_0x25eaa5(0xd1)](_0x126c4a))throw new Error(_0x2a7d76+'\x20must\x20be\x20a\x200x-prefixed\x2032-byte\x20hex\x20private\x20key');try{return _0x193ef7(_0x126c4a);}catch{throw new Error(_0x2a7d76+_0x25eaa5(0xc1));}}function x(_0x253d42={}){const _0x5dc590=_0x4544be,_0x31f24e=m(_0x253d42[_0x5dc590(0xd0)]);if(_0x31f24e)return{'configured':!0x0,'address':_0x31f24e[_0x5dc590(0xc2)],'source':_0x5dc590(0xb1),'locked':!E(_0x253d42['home'])};const _0x21880d=_0x253d42[_0x5dc590(0xb6)]??'COLONY_PRIVATE_KEY',_0xefcde6=process.env[_0x21880d];return _0xefcde6?{'configured':!0x0,'address':u(_0xefcde6,_0x21880d)[_0x5dc590(0xc2)],'source':'environment','locked':!0x1}:{'configured':!0x1,'address':null,'source':null,'locked':!0x0};}function $(){const _0x249eab=_0x4544be;v['clear'](),k[_0x249eab(0xb0)](),w++;}async function ee(_0x48ba45={}){const _0x1263b5=_0x4544be;if(_0x48ba45[_0x1263b5(0xaf)]&&x(_0x48ba45)[_0x1263b5(0xc2)]!==_0x326dbf(_0x48ba45['expectedWallet']))throw new Error(_0x1263b5(0xc9));const _0x459f75=m(_0x48ba45['home']);if(!_0x459f75){const _0x4a8825=_0x48ba45[_0x1263b5(0xb6)]??_0x1263b5(0xe1);if(!process.env[_0x4a8825])throw new Error(_0x1263b5(0xdb));return u(process.env[_0x4a8825],_0x4a8825);}const {json:_0x286880}=_0x459f75,_0x53ca97=_0x34b4c3(_0x459f75[_0x1263b5(0xd2)]),_0x4759df=w,_0x196eb5=await O(_0x48ba45);if(x(_0x48ba45)[_0x1263b5(0xc2)]!==_0x459f75['address'])throw new Error(_0x1263b5(0xca));if(v[_0x1263b5(0xb2)](_0x53ca97)?.[_0x1263b5(0xbb)]===_0x286880)return v[_0x1263b5(0xb2)](_0x53ca97)[_0x1263b5(0xbe)];const {decryptKeystoreJson:_0x5b36c2}=await import('ethers');let _0x41f96b;try{_0x41f96b=await _0x5b36c2(_0x286880,_0x196eb5);}catch{throw new Error(_0x1263b5(0xdc));}if(_0x48ba45[_0x1263b5(0xe0)]?.[_0x1263b5(0xd4)](),_0x4759df!==w)throw new Error(_0x1263b5(0xae));const _0x3adbb0=u(_0x41f96b[_0x1263b5(0xe3)]);if(_0x3adbb0[_0x1263b5(0xc2)]!==_0x459f75['address'])throw new Error(_0x1263b5(0xd6));if(x(_0x48ba45)[_0x1263b5(0xc2)]!==_0x3adbb0[_0x1263b5(0xc2)])throw new Error(_0x1263b5(0xca));return v[_0x1263b5(0xce)](_0x53ca97,{'json':_0x286880,'account':_0x3adbb0}),_0x3adbb0;}async function V(_0x228d9c,_0x21aaca,_0x3de37c=_0x3f8fee(),_0x5f2dc8={}){const _0x582f88=_0x4544be,{signal:_0x2424d7}=_0x5f2dc8,_0x56b301=u(_0x3de37c),_0x5c3be2=i(_0x228d9c);if(_0x5c3be2['some'](_0x5abfdc=>_0x5abfdc[_0x582f88(0xc2)]===_0x56b301[_0x582f88(0xc2)]))throw new Error('This\x20wallet\x20already\x20exists.\x20Select\x20it\x20in\x20Wallets\x20and\x20press\x20u,\x20or\x20use\x20colony\x20wallet\x20use\x20<address>.\x20Its\x20encrypted\x20file\x20will\x20not\x20be\x20overwritten.');if(_0x5c3be2[_0x582f88(0xe5)]&&(_0x21aaca=await O({..._0x5f2dc8,'home':_0x228d9c},_0x21aaca)),!_0x21aaca||_0x21aaca[_0x582f88(0xe5)]<0x8)throw new Error(_0x582f88(0xbd));const _0x291ade=w,{encryptKeystoreJson:_0x32555c}=await import('ethers'),_0xb698c=await _0x32555c({'address':_0x56b301[_0x582f88(0xc2)],'privateKey':_0x3de37c['trim']()},_0x21aaca);if(_0x2424d7?.[_0x582f88(0xd4)](),_0x291ade!==w)throw new Error(_0x582f88(0xae));await _0x2b5b36(_0x228d9c,{'recursive':!0x0,'mode':0x1c0});const _0xfa0b53=_0x5c3be2[_0x582f88(0xe5)]===0x0?_0xa758eb(_0x228d9c,_0x582f88(0xc6)):_0xa758eb(_0x228d9c,'wallets',_0x56b301['address'][_0x582f88(0xd3)]()+_0x582f88(0xb8));return _0x5c3be2[_0x582f88(0xe5)]&&await _0x2b5b36(_0xa758eb(_0x228d9c,_0x582f88(0xe2)),{'recursive':!0x0,'mode':0x1c0}),await _0x44c976(_0xfa0b53,_0xb698c+'\x0a',{'flag':'wx','mode':0x180}),k[_0x582f88(0xce)](_0x34b4c3(_0x228d9c),{'password':_0x21aaca,'root':_0x28a39b(_0xa758eb(_0x228d9c,_0x582f88(0xc6)),_0x582f88(0xd9))}),C(_0x228d9c,_0x56b301[_0x582f88(0xc2)]);}async function te(_0x3f3289,_0x36065a,_0x1a22b6){const _0x1f79d6=_0x4544be,_0x53588c=_0x34b4c3(_0x36065a),_0x14bbf3=_0x1a22b6?i(_0x3f3289)[_0x1f79d6(0xde)](_0x2f0697=>_0x2f0697[_0x1f79d6(0xc2)]===_0x326dbf(_0x1a22b6))?.[_0x1f79d6(0xd2)]:_(_0x3f3289);if(!_0x14bbf3)throw new Error('Saved\x20wallet\x20not\x20found.');return await _0xed6d74(_0x14bbf3,_0x53588c,_0x389611[_0x1f79d6(0xc4)]),{'path':_0x53588c};}async function re(_0x17ccd1,_0x5db2bc,_0x21a282,{signal:_0x3f37a6}={}){const _0xba8052=_0x4544be,_0x4eb222=i(_0x17ccd1)[_0xba8052(0xde)](_0x1848d7=>_0x1848d7[_0xba8052(0xc2)]===_0x326dbf(_0x5db2bc));if(!_0x4eb222)throw new Error(_0xba8052(0xcd));const {decryptKeystoreJson:_0x1f9321}=await import('ethers');let _0x51cf84;try{_0x51cf84=await _0x1f9321(_0x4eb222['json'],_0x21a282);}catch{throw new Error(_0xba8052(0xdd));}if(_0x3f37a6?.[_0xba8052(0xd4)](),u(_0x51cf84[_0xba8052(0xe3)])[_0xba8052(0xc2)]!==_0x4eb222[_0xba8052(0xc2)])throw new Error(_0xba8052(0xd6));return{'address':_0x4eb222[_0xba8052(0xc2)],'privateKey':_0x51cf84[_0xba8052(0xe3)]};}async function ne(_0x276a3b,_0x4030f4,_0xa8fe8a,_0x3e2565={}){const _0x592735=_0x4544be,_0x574394=await _0x44647d(_0x4030f4,_0x592735(0xd9)),{decryptKeystoreJson:_0x9eebc7}=await import('ethers');let _0xcfbea9;try{_0xcfbea9=await _0x9eebc7(_0x574394,_0xa8fe8a);}catch{throw new Error(_0x592735(0xc5));}return V(_0x276a3b,i(_0x276a3b)[_0x592735(0xe5)]?void 0x0:_0xa8fe8a,_0xcfbea9[_0x592735(0xe3)],_0x3e2565);}function _0x2997(){const _0x1c386f=['Wallets\x20were\x20locked.\x20Unlock\x20again\x20to\x20continue.','expectedWallet','clear','local','get','Local\x20wallet\x20password','sort','.wallet-selection-','keyEnv','root','.json','Unsupported\x20wallet\x20file.\x20Restore\x20a\x20JSON\x20keystore\x20backup.','parse','json','ENOENT','Use\x20a\x20wallet\x20password\x20with\x20at\x20least\x208\x20characters.','account','stringify','trim','\x20is\x20not\x20a\x20valid\x20wallet\x20private\x20key.','address','Wallet\x20not\x20found.\x20Create,\x20import\x20or\x20restore\x20it\x20first.','COPYFILE_EXCL','Could\x20not\x20restore\x20wallet.\x20Check\x20the\x20backup\x20file\x20and\x20password.','wallet.json','wallet-selection.json','replace','Payment\x20wallet\x20changed.\x20Review\x20the\x20order\x20with\x20the\x20intended\x20wallet\x20before\x20paying.','Active\x20wallet\x20changed\x20while\x20unlocking.\x20Review\x20the\x20payment\x20again.','Private\x20key','push','Saved\x20wallet\x20not\x20found.','set','filter','home','test','file','toLowerCase','throwIfAborted','The\x20selected\x20wallet\x20file\x20is\x20missing.\x20Use\x20wallet\x20list\x20and\x20wallet\x20use\x20to\x20select\x20another\x20wallet.','Wallet\x20address\x20does\x20not\x20match\x20its\x20encrypted\x20key.','Could\x20not\x20unlock\x20wallets.\x20Check\x20your\x20local\x20wallet\x20password.','code','utf8','version','No\x20wallet\x20configured.\x20Open\x20Wallet\x20to\x20create\x20or\x20import\x20one,\x20or\x20run\x20colony\x20wallet\x20create.','Could\x20not\x20unlock\x20wallet.\x20Check\x20your\x20password\x20and\x20wallet\x20file.','Incorrect\x20wallet\x20password.','find','map','signal','COLONY_PRIVATE_KEY','wallets','privateKey','some','length'];_0x2997=function(){return _0x1c386f;};return _0x2997();}export{te as backupWallet,Z as deleteLocalWallet,u as keyAccount,Q as listWallets,$ as lockWallet,ne as restoreWallet,re as revealPrivateKey,V as saveLocalWallet,C as selectWallet,O as unlockWallet,_ as walletFile,x as walletInfo,ee as walletSigner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x461343=_0x34ac;import{formatUnits as _0x67049b}from'viem';function _0x34ac(_0x42cefb,_0x57bfc2){_0x42cefb=_0x42cefb-0x9e;const _0x34ac4e=_0x57bf();let _0x5d8ece=_0x34ac4e[_0x42cefb];return _0x5d8ece;}function _0x57bf(){const _0x58ef2e=['find','IMD','name','toUpperCase','length','0xdac17f958d2ee523a2206206994597c13d831ec7','ETH','0x5f7bb59365ce557c26dbcaa4ee9d39a4b95b7127','USDT','entries','Choose\x20a\x20payment\x20coin:\x20IMD,\x20ETH,\x20USDC,\x20USDT\x20or\x20USDG.','toString','USDG','symbol'];_0x57bf=function(){return _0x58ef2e;};return _0x57bf();}import{paymentNetwork as _0x40ed50}from'./payment-networks.mjs';const p='0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',D={'ethereum':'0xd34a99bc0f67ae1bbd63c660e6d0b0dd03e263b7','robinhood':_0x461343(0xa5)},x={'ethereum':{'USDC':'0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48','USDT':_0x461343(0xa3)},'robinhood':{'USDG':'0x5fc5360d0400a0fd4f2af552add042d716f1d168'}};function i(_0x415550='IMD'){const _0x31a72e=_0x461343,_0x536cc8=_0x415550[_0x31a72e(0xa1)]();if(![_0x31a72e(0x9f),_0x31a72e(0xa4),'USDC',_0x31a72e(0xa6),_0x31a72e(0xaa)]['includes'](_0x536cc8))throw new Error(_0x31a72e(0xa8));return _0x536cc8;}function l(_0x50dfe6){const _0x2d20d6=_0x461343;return[_0x2d20d6(0x9f),_0x2d20d6(0xa4)]['includes'](i(_0x50dfe6))?0x12:0x6;}function S(_0x500353){const _0x52e680=_0x461343;return _0x40ed50(_0x500353),[{'symbol':_0x52e680(0x9f),'address':D[_0x500353],'decimals':0x12},{'symbol':_0x52e680(0xa4),'address':p,'decimals':0x12},...Object[_0x52e680(0xa7)](x[_0x500353])['map'](([_0x4214a7,_0x5157a0])=>({'symbol':_0x4214a7,'address':_0x5157a0,'decimals':0x6}))];}function U(_0x31dddf,_0x4c0267){const _0x5a6dff=_0x461343,_0x576a0c=i(_0x4c0267),_0x4aaf1c=S(_0x31dddf)[_0x5a6dff(0x9e)](_0x2ef116=>_0x2ef116[_0x5a6dff(0xab)]===_0x576a0c);if(!_0x4aaf1c)throw new Error(_0x576a0c+'\x20payments\x20are\x20not\x20supported\x20on\x20'+_0x40ed50(_0x31dddf)['chain'][_0x5a6dff(0xa0)]+'.');return _0x4aaf1c;}function y(_0x2d70c6,_0x58763f){return _0x67049b(BigInt(_0x2d70c6),l(_0x58763f))+'\x20'+i(_0x58763f);}function E(_0x57f923,_0x567b0d,{up:_0x30c783=!0x1}={}){const _0x447138=_0x461343,_0xfdf0a5=BigInt(_0x57f923),_0x5a9dea=l(_0x567b0d),_0x119b09=i(_0x567b0d);if(_0xfdf0a5===0x0n)return'0\x20'+_0x119b09;const _0x2e289f=_0xfdf0a5[_0x447138(0xa9)]()[_0x447138(0xa2)];let _0x2c5403=_0x5a9dea===0x6&&_0xfdf0a5>=0xan**BigInt(_0x5a9dea-0x2)?0x2:Math['max'](0x0,0x4-_0x2e289f+_0x5a9dea);_0x2c5403=Math['min'](_0x2c5403,_0x5a9dea);const _0x2069b1=0xan**BigInt(_0x5a9dea-_0x2c5403);let _0x255c89=_0xfdf0a5/_0x2069b1;const _0x3f7c85=_0xfdf0a5%_0x2069b1;return(_0x30c783?_0x3f7c85>0x0n:_0x3f7c85*0x2n>=_0x2069b1)&&(_0x255c89+=0x1n),_0x67049b(_0x255c89,_0x2c5403)+'\x20'+_0x119b09;}export{D as IMD_TOKENS,p as NATIVE_TOKEN,y as coinAmount,l as coinDecimals,i as coinSymbol,E as friendlyAmount,U as paymentCoin,S as paymentCoins};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x644b78=_0x2d84;function _0x2d84(_0x34da4c,_0x557d58){_0x34da4c=_0x34da4c-0x9a;const _0x2d84f1=_0x557d();let _0x5605f2=_0x2d84f1[_0x34da4c];return _0x5605f2;}import{mainnet as _0x139002,robinhood as _0x5a0d5c}from'viem/chains';function _0x557d(){const _0x1f09e5=['robinhood','chain','find','name','Choose\x20a\x20payment\x20network:\x20ethereum\x20or\x20robinhood.','ethereum','key'];_0x557d=function(){return _0x1f09e5;};return _0x557d();}const h=[{'key':_0x644b78(0x9f),'chain':_0x139002},{'key':_0x644b78(0x9a),'chain':_0x5a0d5c}];function o(_0x26a45d){const _0x3ca12d=_0x644b78,_0x3df0bb=h[_0x3ca12d(0x9c)](_0x48cee9=>_0x48cee9[_0x3ca12d(0xa0)]===_0x26a45d);if(!_0x3df0bb)throw new Error(_0x3ca12d(0x9e));return _0x3df0bb;}function a(_0x812585){const _0x295a19=_0x644b78;return o(_0x812585??_0x295a19(0x9f))[_0x295a19(0x9b)][_0x295a19(0x9d)];}function u(_0x5e25c4){const _0x17c8d7=_0x644b78;return o(_0x5e25c4['paymentChain']??_0x17c8d7(0x9f));}export{h as PAYMENT_NETWORKS,a as networkName,o as paymentNetwork,u as selectedPaymentNetwork};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getPublicRpcClient as _0x5e997d}from'../shared.mjs';function _0x57a5(){const _0x182270=['push','filter','amount','best','\x20or\x20','key','option','name','funded','message','api','map','chain','nativeBalance','symbol','error','paymentChain','options','now','find','all','gas','chainName','signal','Create\x20or\x20import\x20a\x20wallet\x20in\x20Wallets\x20before\x20creating\x20a\x20task.','throwIfAborted','assign','floor','job.open','payWith','address','every','price','\x20on\x20','payment','action','networks','wallet_required','join','length','sort'];_0x57a5=function(){return _0x182270;};return _0x57a5();}import{planFunding as _0x1fa3ec}from'./funding.mjs';import{fundingRequiredOptions as _0x163590}from'./funding-error.mjs';import{walletInfo as _0x32a056}from'./local-wallet.mjs';import{coinSymbol as _0x516980,paymentCoins as _0x3cbbe5}from'./payment-coins.mjs';import{PAYMENT_NETWORKS as _0x3f832d,paymentNetwork as _0x45199c}from'./payment-networks.mjs';import{loadPaymentConfig as _0x5e3ef8}from'./payments.mjs';const l={'IMD':0x0,'USDC':0x1,'USDT':0x1,'USDG':0x1,'ETH':0x2};async function B(_0xbe05d4,_0x4490ac,_0x26ba9a,_0x1836b9,_0x637a83){const _0x230c99=_0x24a2,_0x20f128={'key':_0x4490ac[_0x230c99(0xf8)],'chainName':_0x4490ac['chain'][_0x230c99(0xfa)],'chainId':_0x4490ac[_0x230c99(0xff)]['id'],'options':[]},_0x46b215=_0x3cbbe5(_0x4490ac[_0x230c99(0xf8)])[_0x230c99(0xf4)](_0x28a789=>!_0xbe05d4['payWith']||_0x28a789[_0x230c99(0x101)]===_0x516980(_0xbe05d4[_0x230c99(0x110)]));if(!_0x46b215['length'])return null;try{const [_0x39b304,_0xa09d6]=await Promise[_0x230c99(0x107)]([_0x5e3ef8(_0xbe05d4[_0x230c99(0xfd)],_0x1836b9,_0x4490ac['key'],_0xbe05d4),_0x5e997d(_0xbe05d4,_0x4490ac[_0x230c99(0xff)]['id'])]);_0x20f128[_0x230c99(0x113)]=String(_0x39b304[_0x230c99(0x115)][_0x230c99(0xf5)]);const _0x9d2e8a=Math[_0x230c99(0x10e)](Date[_0x230c99(0x105)]()/0x3e8)+0x12c;if(_0x20f128['options']=await Promise[_0x230c99(0x107)](_0x46b215[_0x230c99(0xfe)](async _0x5e802f=>{const _0x38458f=_0x230c99,_0x5936dc={'action':_0x1836b9,'paymentChain':_0x4490ac[_0x38458f(0xf8)],'payWith':_0x5e802f[_0x38458f(0x101)],'quote':{'payment':_0x39b304[_0x38458f(0x115)],'expiresAt':_0x9d2e8a}};try{const {requirement:_0xc77f7,shortages:_0xf1160f}=await _0x1fa3ec(_0x5936dc,_0xbe05d4,_0xa09d6,_0x26ba9a,_0x39b304);return{..._0xc77f7,'funded':_0xf1160f[_0x38458f(0x11a)]===0x0,'shortages':_0xf1160f};}catch(_0x3c0626){return _0xbe05d4['signal']?.['throwIfAborted'](),{'coin':_0x5e802f['symbol'],'error':_0x3c0626['message']};}})),_0x20f128[_0x230c99(0x104)][_0x230c99(0x112)](_0x21c4fe=>_0x21c4fe[_0x230c99(0x102)]))throw new Error(_0x20f128['options'][0x0][_0x230c99(0x102)]);_0x20f128[_0x230c99(0x100)]=_0x20f128[_0x230c99(0x104)][_0x230c99(0x106)](_0x4cd0bd=>_0x4cd0bd[_0x230c99(0x100)]!==void 0x0)?.[_0x230c99(0x100)];}catch(_0x424afa){_0xbe05d4[_0x230c99(0x10a)]?.[_0x230c99(0x10c)](),_0x637a83[_0x230c99(0xf3)](_0x424afa),_0x20f128[_0x230c99(0x102)]=_0x424afa[_0x230c99(0xfc)];}return _0x20f128;}function _0x24a2(_0x2febdd,_0x57a5a1){_0x2febdd=_0x2febdd-0xf3;const _0x24a20c=_0x57a5();let _0x1734a1=_0x24a20c[_0x2febdd];return _0x1734a1;}function O(_0x53765d,_0x3d3d8b){const _0x56e9de=_0x24a2,_0x400967=_0x53765d['flatMap'](_0x349d3c=>(_0x349d3c[_0x56e9de(0x104)]??[])[_0x56e9de(0xf4)](_0xd84384=>_0xd84384[_0x56e9de(0xfb)])[_0x56e9de(0xfe)](_0x4b0774=>({'paymentChain':_0x349d3c['key'],'payWith':_0x4b0774['coin'],'chainName':_0x349d3c['chainName'],'option':_0x4b0774}))),_0x2ea6ed=_0x3d3d8b&&_0x400967[_0x56e9de(0x106)](_0x1a14dd=>_0x1a14dd[_0x56e9de(0x103)]===_0x3d3d8b['paymentChain']&&_0x1a14dd['payWith']===_0x3d3d8b[_0x56e9de(0x110)]);return _0x2ea6ed||(_0x400967[_0x56e9de(0x11b)]((_0x4e3b47,_0xdf75d7)=>l[_0x4e3b47[_0x56e9de(0x110)]]-l[_0xdf75d7[_0x56e9de(0x110)]]||(BigInt(_0x4e3b47[_0x56e9de(0xf9)]['gas'])<BigInt(_0xdf75d7['option'][_0x56e9de(0x108)])?-0x1:BigInt(_0x4e3b47[_0x56e9de(0xf9)][_0x56e9de(0x108)])>BigInt(_0xdf75d7['option'][_0x56e9de(0x108)])?0x1:0x0))[0x0]??null);}async function P(_0x3875a4){const _0x4878d0=_0x24a2,_0x266169=_0x32a056(_0x3875a4);if(!_0x266169['configured'])throw Object[_0x4878d0(0x10d)](new Error(_0x4878d0(0x10b)),{'code':_0x4878d0(0x118)});const _0x15c004=_0x3875a4[_0x4878d0(0x116)]??_0x4878d0(0x10f),_0x734db1=_0x3875a4[_0x4878d0(0x103)]?[_0x45199c(_0x3875a4['paymentChain'])]:_0x3f832d,_0x4ffbba=[],_0x23f8cc=(await Promise[_0x4878d0(0x107)](_0x734db1[_0x4878d0(0xfe)](_0x167dfd=>B(_0x3875a4,_0x167dfd,_0x266169,_0x15c004,_0x4ffbba))))[_0x4878d0(0xf4)](Boolean);if(!_0x23f8cc[_0x4878d0(0x11a)])throw new Error(_0x516980(_0x3875a4[_0x4878d0(0x110)])+'\x20payments\x20are\x20not\x20supported\x20on\x20'+_0x734db1[_0x4878d0(0xfe)](_0x36f90b=>_0x36f90b['chain'][_0x4878d0(0xfa)])[_0x4878d0(0x119)](_0x4878d0(0xf7))+'.');if(_0x4ffbba['length']===_0x23f8cc['length'])throw _0x4ffbba[_0x4878d0(0x11a)]===0x1?_0x4ffbba[0x0]:new Error(_0x23f8cc[_0x4878d0(0xfe)](_0x193928=>_0x193928[_0x4878d0(0x109)]+':\x20'+_0x193928['error'])[_0x4878d0(0x119)]('\x0a'),{'cause':_0x4ffbba[0x0]});return{'address':_0x266169[_0x4878d0(0x111)],'networks':_0x23f8cc,'best':O(_0x23f8cc,_0x3875a4['prefer'])};}function q(_0x223b02){const _0x144ff7=_0x24a2;return _0x223b02['payWith']+_0x144ff7(0x114)+_0x223b02[_0x144ff7(0x109)];}async function v(_0x3f0a30){const _0x1764ed=_0x24a2,_0x56e78e=await P(_0x3f0a30);if(!_0x56e78e['best'])throw _0x163590(_0x56e78e[_0x1764ed(0x111)],_0x56e78e[_0x1764ed(0x117)]);return{'address':_0x56e78e[_0x1764ed(0x111)],'paymentChain':_0x56e78e['best'][_0x1764ed(0x103)],'payWith':_0x56e78e[_0x1764ed(0xf6)][_0x1764ed(0x110)],'chainName':_0x56e78e[_0x1764ed(0xf6)]['chainName'],'networks':_0x56e78e[_0x1764ed(0x117)]};}export{O as bestPaymentOption,v as choosePayment,q as paymentOptionLabel,P as paymentOptions};
|
package/dist/lib/publish.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x310ac4=_0xab11;import{createHash as _0x3c6ef5,randomBytes as _0x4f16b5,randomUUID as _0x355402}from'node:crypto';import{readFile as _0x196a97}from'node:fs/promises';function _0x6822(){const _0x25d2a5=['payment_review_expired','Payment\x20network:\x20','\x20--refresh','requestKey','quoteId','jobId','hex','deliverables','assetTransferMethod','resultUrl','recoveryStatus','Amount:\x20','QuoteApproval','api','\x20--home\x20','networkFeeCap','paymentHash','\x20--file\x20','statusUrl','Prepared\x20input\x20(this\x20is\x20what\x20will\x20be\x20paid\x20for):','hash','quote\x20expires\x20too\x20soon\x20to\x20sign\x20a\x20payment;\x20no\x20payment\x20was\x20signed','requesterScopeHash','Quote\x20expires:\x20','permit2Authorization','Convert\x20at\x20most','ETH','sort','IMD','\x20order\x20show\x20',':\x20the\x20parent\x20job\x20has\x20no\x20paidBy','uint256','payment_reconciling','isArray','unsupported\x20action:\x20','isInteger','toISOString','includes','Payment\x20submitted.\x20Waiting\x20for\x20IMD\x20to\x20accept\x20the\x20task...','refusalProblems','order\x20status\x20response\x20is\x20missing\x20status','funding','<missing>','total','\x20task\x20create\x20--file\x20<saved-input.json>\x20--request-key\x20','parse','saved\x20request\x20key\x20','maximumDebit','data','problems','keys','status','\x20was\x20created\x20for\x20a\x20different\x20input','timed\x20out\x20waiting\x20for\x20order\x20','payWith','parentJobId','quote','admitted','now','\x20\x20-\x20','null','invalid\x20quote\x20network:\x20','paymentHistory','chainId','sha256','\x20IMD\x20+\x20network\x20fees\x0aSupport\x20recipient:\x20','onchain','broadcasting','lastStatus','\x20task\x20continue\x20','accepts','payment_failed','fromConfig','.\x20Do\x20not\x20start\x20a\x20new\x20order.\x20Check\x20it\x20with:\x20colony\x20--api\x20','blockers','\x20at\x20','checking_payment','payment\x20rejected','input','payment\x20requirement\x20is\x20missing\x20maxTimeoutSeconds','function','confirm','amount','payment\x20challenge\x20quoteHash\x20does\x20not\x20match\x20the\x20saved\x20quote','resource','\x20is\x20not\x20the\x20project\x20owner\x20','transaction','object','ethereum','job.continue','Pay\x20to:\x20','paymentStatus','payment','timeoutMs','invalid\x20JSON\x20in\x20','onProgress','refused','lastError','payTo','Order:\x20','steps','owner','Included\x20network\x20fee\x20cap:\x20','\x20belongs\x20to\x20','retryCommand','onchainQuotes','quoteHistory','map','payment\x20challenge\x20belongs\x20to\x20a\x20different\x20order','/requests/quote','asset','Network:\x20','submittedAt','max','floor','colony\x20--api\x20','quote\x20approval','quote\x20has\x20expired;\x20no\x20payment\x20was\x20signed','\x20does\x20not\x20match\x20','recipient','paidBy','plan','payment\x20challenge\x20is\x20missing\x20the\x20prepared\x20input','serverRequestKey','\x20was\x20created\x20for\x20action\x20','payment\x20rejected:\x20','\x0aorder\x20status\x20refresh\x20failed:\x20','created','assign','Estimated\x20payment:\x20','onSaved','network','blocked','min','key','/submit','quote\x20response\x20is\x20missing\x20order\x20or\x20quote','maxTimeoutSeconds','onchainPayment','throwIfAborted','admission','signTypedData','expiresAt','/requests/','Payment\x20total','check\x20response\x20is\x20missing\x20blockers','This\x20order\x20already\x20uses\x20a\x20different\x20payment\x20network.\x20Resume\x20it\x20on\x20its\x20original\x20network.','signal','bytes32','job.open','code','orderId','toLowerCase','expired','expectedWallet','\x20must\x20contain\x20a\x20JSON\x20object','Sign\x20and\x20pay\x20this\x20order?\x0a','objective','estimatedAmount','wallet\x20',';\x20a\x20payment\x20is\x20already\x20signed\x20for\x20order\x20','/jobs/','signed','order','challenge','paymentReview','paymentHeader','rawTransaction','/requests/check','transaction_pending','\x20--request-key\x20','\x20IMD\x20·\x20Help\x20us\x20make\x20Colony\x20better.\x0aTotal:\x20','<parent-job-id>','result','requestToken','string','\x20ETH','Task:\x20','Submitting\x20task\x20payment\x20to\x20IMD...','converted',';\x20last\x20status:\x20','quoteSignature','order\x20','job\x20input\x20must\x20be\x20a\x20JSON\x20object','transactionHash','some','payment\x20challenge',';\x20retry\x20the\x20same\x20order\x20with:\x20','confirmedHash','extra','action','update','message','\x20order\x20submit\x20','kind','length','signing','orderStatus','quoteHash','stringify','job.continue\x20input\x20is\x20missing\x20parentJobId','payment\x20challenge\x20action\x20',';\x20rerun\x20with\x20--api\x20','coin','state','address','pendingTransaction','check','Conversion\x20and\x20task\x20payment\x20are\x20separate\x20transactions.','intervalMs','permit2',';\x20resume\x20with:\x20colony\x20--api\x20','quote_expired','Maximum\x20debit:\x20','paymentChain','onCheck','owner_mismatch','POST','quoted','Action:\x20','\x20(api\x20','saved\x20quote\x20action\x20','join','Conversion\x20already\x20confirmed',';\x20no\x20payment\x20was\x20signed\x20in\x20this\x20attempt','payment\x20deadline\x20','robinhood','order_cancelled'];_0x6822=function(){return _0x25d2a5;};return _0x6822();}import{setTimeout as _0x304ff3}from'node:timers/promises';import{x402Client as _0x4d356e}from'@x402/core/client';import{encodePaymentSignatureHeader as _0x559986}from'@x402/core/http';import{ExactEvmScheme as _0x5cc621}from'@x402/evm/exact/client';import{formatUnits as _0x3e1581,sha256 as _0xcd1d7,stringToBytes as _0x3eb7ad}from'viem';import{confirmAction as _0x5f8710,getPublicRpcClient as _0x5d4478,getSigner as _0x34a856,request as _0x67dcd0}from'../shared.mjs';import{assertOrderNotCancelled as _0x55403c,findOrder as _0x34210c,loadOrder as _0x513298,saveOrder as _0x4666e0}from'./orders.mjs';import{assertQuotePayment as _0x73203a,orderPayment as _0x17ac9b}from'./payments.mjs';import{selectedPaymentNetwork as _0x5ed3a9}from'./payment-networks.mjs';import{signOnchainPayment as _0xa9ff40,submitOnchainPayment as _0x20c1eb}from'./onchain-payment.mjs';function _0xab11(_0x4d3723,_0x6822cf){_0x4d3723=_0x4d3723-0x8c;const _0xab11d2=_0x6822();let _0x5452e4=_0xab11d2[_0x4d3723];return _0x5452e4;}import{coinSymbol as _0x17d848,paymentCoin as _0x3ded5b}from'./payment-coins.mjs';import{fundingSummary as _0x4a8b3e}from'./funding-state.mjs';import{fundOrder as _0x38a682}from'./funding.mjs';import{walletInfo as _0x2800ad}from'./local-wallet.mjs';import{selectSupport as _0x2b5077,supportView as _0x1fd4ac}from'./support.mjs';import{authorizationUnpaid as _0x41e245}from'./payment-recovery.mjs';import{retainExpiredNonce as _0x15cf6d}from'./transaction-recovery.mjs';import{transactionReceipt as _0x13779d}from'./transactions.mjs';function $(_0x2fdbc7){const _0x411d2e=_0xab11;return _0x2fdbc7===null?_0x411d2e(0xc8):Array[_0x411d2e(0xad)](_0x2fdbc7)?'['+_0x2fdbc7[_0x411d2e(0xf7)]($)[_0x411d2e(0x16a)](',')+']':typeof _0x2fdbc7=='object'?'{'+Object[_0x411d2e(0xbe)](_0x2fdbc7)[_0x411d2e(0xa7)]()['map'](_0x48a72a=>JSON[_0x411d2e(0x153)](_0x48a72a)+':'+$(_0x2fdbc7[_0x48a72a]))[_0x411d2e(0x16a)](',')+'}':JSON[_0x411d2e(0x153)](_0x2fdbc7);}function oe(_0x30360c){const _0x247c88=_0xab11;return _0x3c6ef5(_0x247c88(0xcc))[_0x247c88(0x14b)]($(_0x30360c))['digest'](_0x247c88(0x92));}async function se(_0x54c352){const _0x4be75d=_0xab11;let _0x24af38;try{_0x24af38=JSON[_0x4be75d(0xb9)](await _0x196a97(_0x54c352,'utf8'));}catch(_0x57cf6b){throw _0x57cf6b instanceof SyntaxError?new Error(_0x4be75d(0xea)+_0x54c352+':\x20'+_0x57cf6b['message']):_0x57cf6b;}if(!_0x24af38||typeof _0x24af38!=_0x4be75d(0xe3)||Array['isArray'](_0x24af38))throw new Error(_0x54c352+_0x4be75d(0x127));return _0x24af38;}async function ie(_0x2708cd,_0xec5d90,_0x56359c=_0x310ac4(0x121),_0x55fb0a){const _0x30f239=_0x310ac4,_0x158a67=await _0x67dcd0(_0x2708cd,_0x30f239(0x134),{'method':'POST','query':!0x0,'body':{'action':_0x56359c,'input':_0xec5d90},'signal':_0x55fb0a});if(!Array[_0x30f239(0xad)](_0x158a67[_0x30f239(0xbc)]?.[_0x30f239(0xd6)]))throw new Error(_0x30f239(0x11d));return _0x158a67['data'];}async function A(_0x476481,_0x17d6a7,_0x7043d4,_0x2d625f,_0x565a70=_0x310ac4(0x121),_0x4a28ba){const _0x47305d=_0x310ac4,_0x41c777=await _0x67dcd0(_0x476481,_0x47305d(0xf9),{'method':_0x47305d(0x165),'token':_0x17d6a7,'body':{'requestKey':_0x7043d4,'action':_0x565a70,'input':_0x2d625f},'signal':_0x4a28ba}),_0x4a88df=_0x41c777['data']?.[_0x47305d(0x12f)];if(!_0x4a88df?.['id']||!_0x4a88df[_0x47305d(0xc4)]?.[_0x47305d(0xe8)])throw new Error(_0x47305d(0x114));return{..._0x4a88df,'onchain':_0x41c777[_0x47305d(0xbc)][_0x47305d(0xce)]};}async function ue(_0x1155e5,_0x504991,_0x3dae04){const _0xfeed1a=_0x310ac4;if(_0x3dae04?.[_0xfeed1a(0xf1)])return _0x3dae04[_0xfeed1a(0xf1)];const _0x12e6ea=_0x504991?.[_0xfeed1a(0xc3)];if(!_0x12e6ea)throw new Error(_0xfeed1a(0x154));const _0x4bbea6=(await _0x67dcd0(_0x1155e5,_0xfeed1a(0x12d)+encodeURIComponent(_0x12e6ea)))['data']?.[_0xfeed1a(0x104)];if(!_0x4bbea6)throw new Error('cannot\x20verify\x20the\x20project\x20owner\x20for\x20'+_0x12e6ea+_0xfeed1a(0xaa));return _0x4bbea6;}function ce(_0x2d916a,_0xab35c4){const _0x365def=_0x310ac4,_0x2fc247=new Error(_0x365def(0x12b)+_0x2d916a+_0x365def(0xe1)+_0xab35c4+_0x365def(0x16c));return _0x2fc247[_0x365def(0x122)]=_0x365def(0x164),_0x2fc247;}async function P({api:_0x44d211,input:_0x2f7bb6,check:_0x4df268,account:_0x409dd3,owner:_0x2ea780}){const _0x4f19f1=_0x310ac4,_0x437130=_0x2ea780??await ue(_0x44d211,_0x2f7bb6,_0x4df268);if(!_0x409dd3?.[_0x4f19f1(0x159)])throw new Error('missing\x20signer\x20address');if(!T(_0x437130,_0x409dd3[_0x4f19f1(0x159)]))throw ce(_0x409dd3['address'],_0x437130);return _0x437130;}async function de(_0x435da2,_0x476360,_0x249124,_0x27c52c){const _0x14b870=_0x310ac4,_0x1b6a6b=await _0x67dcd0(_0x435da2,_0x14b870(0x11b)+_0x249124+_0x14b870(0x113),{'method':'POST','token':_0x476360,'allowStatuses':[0x192],'signal':_0x27c52c});if(_0x1b6a6b[_0x14b870(0xbf)]!==0x192)throw new Error('expected\x20HTTP\x20402\x20payment\x20challenge,\x20got\x20HTTP\x20'+_0x1b6a6b[_0x14b870(0xbf)]);const _0x37d91b=_0x1b6a6b['data'];if(!Array[_0x14b870(0xad)](_0x37d91b?.['accepts'])||_0x37d91b[_0x14b870(0xd2)][_0x14b870(0x14f)]===0x0)throw new Error('payment\x20challenge\x20is\x20missing\x20accepts');if(!_0x37d91b['resourceUrl']||!_0x37d91b[_0x14b870(0xa2)])throw new Error('payment\x20challenge\x20is\x20missing\x20resourceUrl\x20or\x20requesterScopeHash');return _0x37d91b;}function T(_0x4a4eb9,_0x3b9f0e){const _0x25150a=_0x310ac4;return String(_0x4a4eb9)[_0x25150a(0x124)]()===String(_0x3b9f0e)[_0x25150a(0x124)]();}function v(_0x21e7de,_0x4cec70){const _0x4ba14c=_0x310ac4,_0x540145=_0x21e7de[_0x4ba14c(0xd2)][0x0],_0x1edbda=_0x4cec70[_0x4ba14c(0xc4)]['payment'];if(_0x4cec70[_0x4ba14c(0xc4)]?.[_0x4ba14c(0x14a)]!==_0x4cec70[_0x4ba14c(0x14a)])throw new Error(_0x4ba14c(0x169)+(_0x4cec70['quote']?.['action']??_0x4ba14c(0xb6))+_0x4ba14c(0x102)+_0x4cec70[_0x4ba14c(0x14a)]);if(_0x21e7de[_0x4ba14c(0xc4)]?.[_0x4ba14c(0x14a)]!==_0x4cec70['action'])throw new Error(_0x4ba14c(0x155)+(_0x21e7de['quote']?.[_0x4ba14c(0x14a)]??_0x4ba14c(0xb6))+_0x4ba14c(0x102)+_0x4cec70[_0x4ba14c(0x14a)]);if(_0x21e7de[_0x4ba14c(0xc4)]?.['id']!==_0x4cec70[_0x4ba14c(0x123)])throw new Error(_0x4ba14c(0xf8));if(_0x21e7de[_0x4ba14c(0xc4)]?.[_0x4ba14c(0x152)]!==_0x4cec70[_0x4ba14c(0xc4)][_0x4ba14c(0x152)])throw new Error(_0x4ba14c(0xdf));if(_0x21e7de['quote']?.[_0x4ba14c(0x11a)]!==_0x4cec70['quote'][_0x4ba14c(0x11a)])throw new Error('payment\x20challenge\x20expiry\x20does\x20not\x20match\x20the\x20saved\x20quote');for(const [_0x15e3e1,_0x8ad211]of[[_0x4ba14c(0x146),_0x540145],[_0x4ba14c(0x100),_0x21e7de[_0x4ba14c(0xc4)]['payment']]])for(const _0x430ef9 of[_0x4ba14c(0x10f),_0x4ba14c(0xfa),_0x4ba14c(0xde),_0x4ba14c(0xee)])if(!(_0x430ef9===_0x4ba14c(0xfa)||_0x430ef9===_0x4ba14c(0xee)?T(_0x8ad211?.[_0x430ef9],_0x1edbda[_0x430ef9]):String(_0x8ad211?.[_0x430ef9])===String(_0x1edbda[_0x430ef9])))throw new Error(_0x15e3e1+'\x20'+_0x430ef9+'\x20does\x20not\x20match\x20the\x20saved\x20quote');if(_0x540145[_0x4ba14c(0x149)]?.[_0x4ba14c(0x94)]!==_0x4ba14c(0x15e))throw new Error('payment\x20challenge\x20does\x20not\x20use\x20Permit2');if(!_0x21e7de[_0x4ba14c(0xda)]||typeof _0x21e7de['input']!=_0x4ba14c(0xe3)||Array['isArray'](_0x21e7de[_0x4ba14c(0xda)]))throw new Error('payment\x20challenge\x20is\x20missing\x20the\x20prepared\x20input');if(Number(_0x21e7de['quote'][_0x4ba14c(0x11a)])*0x3e8<=Date['now']()){const _0x113cfe=new Error(_0x4ba14c(0x101));throw _0x113cfe[_0x4ba14c(0x122)]=_0x4ba14c(0x160),_0x113cfe;}}async function me(_0x27eeb8,_0x5bb14a){const _0x1fbe4d=_0x310ac4,_0x2a83fb=_0x5bb14a[_0x1fbe4d(0xd2)][0x0],_0x59958a=Number(_0x5bb14a[_0x1fbe4d(0xc4)][_0x1fbe4d(0x11a)]),_0x1a75b5=_0x59958a-Math[_0x1fbe4d(0xfe)](Date[_0x1fbe4d(0xc6)]()/0x3e8);if(!Number['isInteger'](_0x1a75b5)||_0x1a75b5<=0x1){const _0x2b30fb=new Error(_0x1fbe4d(0xa1));throw _0x2b30fb['code']=_0x1fbe4d(0x160),_0x2b30fb;}if(!Number['isInteger'](Number(_0x2a83fb[_0x1fbe4d(0x115)])))throw new Error(_0x1fbe4d(0xdb));const _0x4531e8=Math[_0x1fbe4d(0xfd)](0x1,Math[_0x1fbe4d(0x111)](Number(_0x2a83fb[_0x1fbe4d(0x115)]),_0x1a75b5-0x1)),_0x15bf31={..._0x2a83fb,'maxTimeoutSeconds':_0x4531e8},_0x37263a=await _0x4d356e[_0x1fbe4d(0xd4)]({'schemes':[{'network':_0x15bf31[_0x1fbe4d(0x10f)],'client':new _0x5cc621(_0x27eeb8)}],'spendControls':{'allowedAssets':[{'network':_0x15bf31['network'],'asset':_0x15bf31[_0x1fbe4d(0xfa)],'maxAmountPerPayment':_0x15bf31[_0x1fbe4d(0xde)]}]}})['createPaymentPayload']({'x402Version':0x2,'resource':_0x5bb14a[_0x1fbe4d(0xe0)],'accepts':[_0x15bf31]}),{extensions:_0x19cb67,..._0x360a38}=_0x37263a,_0x1899cc=JSON[_0x1fbe4d(0xb9)](JSON[_0x1fbe4d(0x153)]({..._0x360a38,'accepted':_0x2a83fb})),_0x3d838a=_0x1899cc['payload']?.[_0x1fbe4d(0xa4)]?.['deadline'];if(_0x3d838a===void 0x0||BigInt(_0x3d838a)>=BigInt(_0x59958a))throw new Error(_0x1fbe4d(0x16d)+_0x3d838a+'\x20is\x20not\x20before\x20quote\x20expiry\x20'+_0x59958a);return{'payment':_0x1899cc,'paymentHeader':_0x559986(_0x1899cc),'paymentHash':_0xcd1d7(_0x3eb7ad($(_0x1899cc)))};}function E(_0xd2ce2e,_0x2e2bf5){const _0x1f0568=String(_0xd2ce2e??'')['replace'](/^0x/,'');if(!/^[0-9a-f]{64}$/i['test'](_0x1f0568))throw new Error('invalid\x20'+_0x2e2bf5+':\x20'+_0xd2ce2e);return'0x'+_0x1f0568;}function pe(_0x558e29,_0x4b720e){const _0x5c7ee9=_0x310ac4,_0x444321=_0x558e29[_0x5c7ee9(0xc4)],_0x489749=Number(String(_0x444321['payment'][_0x5c7ee9(0x10f)])['slice'](0x7));if(!Number[_0x5c7ee9(0xaf)](_0x489749)||_0x489749<=0x0)throw new Error(_0x5c7ee9(0xc9)+_0x444321[_0x5c7ee9(0xe8)][_0x5c7ee9(0x10f)]);return{'domain':{'name':'IdentityMD\x20Paid\x20Action','version':'1','chainId':_0x489749},'types':{'QuoteApproval':[{'name':_0x5c7ee9(0xe0),'type':_0x5c7ee9(0x13b)},{'name':'requesterScopeHash','type':_0x5c7ee9(0x120)},{'name':_0x5c7ee9(0x90),'type':_0x5c7ee9(0x13b)},{'name':_0x5c7ee9(0x152),'type':_0x5c7ee9(0x120)},{'name':_0x5c7ee9(0x9c),'type':_0x5c7ee9(0x120)},{'name':'action','type':_0x5c7ee9(0x13b)},{'name':_0x5c7ee9(0xfa),'type':_0x5c7ee9(0x159)},{'name':'amount','type':_0x5c7ee9(0xab)},{'name':_0x5c7ee9(0xee),'type':_0x5c7ee9(0x159)},{'name':_0x5c7ee9(0x11a),'type':'uint256'}]},'primaryType':_0x5c7ee9(0x98),'message':{'resource':_0x558e29['resourceUrl'],'requesterScopeHash':E(_0x558e29['requesterScopeHash'],'requesterScopeHash'),'quoteId':_0x444321['id'],'quoteHash':E(_0x444321[_0x5c7ee9(0x152)],_0x5c7ee9(0x152)),'paymentHash':E(_0x4b720e,_0x5c7ee9(0x9c)),'action':_0x444321[_0x5c7ee9(0x14a)],'asset':_0x444321[_0x5c7ee9(0xe8)][_0x5c7ee9(0xfa)],'amount':BigInt(_0x444321[_0x5c7ee9(0xe8)][_0x5c7ee9(0xde)]),'payTo':_0x444321['payment'][_0x5c7ee9(0xee)],'expiresAt':BigInt(_0x444321[_0x5c7ee9(0x11a)])}};}async function ye(_0x44c276,_0x22ecdb,_0x2d3683){const _0x551673=_0x310ac4,_0x3d0f8d=pe(_0x22ecdb,_0x2d3683);return _0x44c276[_0x551673(0x119)](_0x3d0f8d);}function he(_0x1266d0){const _0x431332=_0x310ac4,_0x405c3f=_0x17ac9b(_0x1266d0),_0xc4d3cd=_0x3e1581(BigInt(_0x405c3f['amount']),_0x405c3f['decimals']),_0x41b69f=_0x1266d0[_0x431332(0xb5)]?_0x4a8b3e(_0x1266d0[_0x431332(0xb5)]):null,_0x253dc3=_0x1266d0[_0x431332(0x131)]?[(_0x1266d0['payWith']===_0x431332(0xa6)?_0x431332(0xf2):'Additional\x20network\x20fee\x20cap:\x20')+_0x1266d0['paymentReview'][_0x431332(0x9b)]+_0x431332(0x13c)]:[];if(!_0x1266d0[_0x431332(0x130)]?.[_0x431332(0xda)]||typeof _0x1266d0[_0x431332(0x130)][_0x431332(0xda)]!=_0x431332(0xe3))throw new Error(_0x431332(0x106));return _0x1266d0['plan']?[_0x431332(0x13d)+_0x1266d0[_0x431332(0xda)][_0x431332(0x129)],..._0x1266d0[_0x431332(0x105)][_0x431332(0x93)]['map'](_0x2d21f2=>_0x431332(0xc7)+_0x2d21f2),'Price:\x20'+_0xc4d3cd+'\x20IMD',..._0x41b69f?[..._0x41b69f[_0x431332(0x12a)]&&!_0x41b69f['converted']?[_0x431332(0x10d)+_0x41b69f[_0x431332(0x12a)]]:[],(_0x41b69f['coin']===_0x431332(0xa8)?_0x431332(0x11c):_0x41b69f[_0x431332(0x13f)]?_0x431332(0x16b):_0x431332(0xa5))+':\x20'+_0x41b69f[_0x431332(0xde)],_0x431332(0x161)+_0x41b69f['maximumDebit']+(_0x1266d0[_0x431332(0xc2)]==='ETH'?'\x20(network\x20fees\x20included)':'\x20+\x20ETH\x20network\x20fees'),..._0x41b69f[_0x431332(0x157)]!==_0x431332(0xa8)?['Conversion\x20and\x20task\x20payment\x20are\x20separate\x20transactions.']:[]]:[],_0x431332(0x8d)+(_0x1266d0[_0x431332(0x162)]==='robinhood'?'Robinhood\x20Chain':'Ethereum'),..._0x253dc3,'Payment\x20covers\x20task\x20admission;\x20a\x20completed\x20result\x20is\x20not\x20guaranteed.'][_0x431332(0x16a)]('\x0a'):[_0x431332(0xef)+_0x1266d0[_0x431332(0x123)],_0x431332(0x167)+(_0x1266d0[_0x431332(0x14a)]??_0x431332(0x121)),_0x431332(0xfb)+_0x405c3f[_0x431332(0x10f)],_0x431332(0x97)+_0xc4d3cd+'\x20('+_0x405c3f['amount']+'\x20atomic\x20units)','Asset:\x20'+_0x405c3f[_0x431332(0xfa)],_0x431332(0xe6)+_0x405c3f[_0x431332(0xee)],_0x431332(0xa3)+new Date(Number(_0x1266d0[_0x431332(0xc4)][_0x431332(0x11a)])*0x3e8)[_0x431332(0xb0)](),..._0x41b69f?[_0x431332(0x161)+_0x41b69f[_0x431332(0xbb)],..._0x41b69f['coin']!==_0x431332(0xa8)?[_0x431332(0x15c)]:[]]:[],..._0x253dc3,'Requested\x20objective:\x20'+String(_0x1266d0['input']['objective']??''),_0x431332(0x9f),JSON[_0x431332(0x153)](_0x1266d0[_0x431332(0x130)][_0x431332(0xda)],null,0x2)][_0x431332(0x16a)]('\x0a');}async function le(_0x501853,_0x12c403){const _0x3f4b5c=_0x310ac4;if(_0x12c403[_0x3f4b5c(0xdd)])return _0x12c403[_0x3f4b5c(0xdd)](_0x501853);const _0x2506f6=_0x1fd4ac(_0x501853),_0x4df9c8=_0x2506f6?'\x0aOptional\x20support:\x20'+_0x2506f6[_0x3f4b5c(0xde)]+_0x3f4b5c(0x137)+_0x2506f6[_0x3f4b5c(0xb7)]+_0x3f4b5c(0xcd)+_0x2506f6[_0x3f4b5c(0x103)]+'\x0aSupport\x20is\x20sent\x20before\x20task\x20payment\x20and\x20is\x20not\x20refunded\x20if\x20admission\x20fails.':'';await _0x5f8710(_0x3f4b5c(0x128)+he(_0x501853)+_0x4df9c8,_0x12c403);}function fe(_0x579513,_0x3d0733){const _0x1da259=_0x310ac4;if(typeof _0x3d0733[_0x1da259(0xf4)]==_0x1da259(0xdc))return _0x3d0733[_0x1da259(0xf4)](_0x579513);if(_0x3d0733[_0x1da259(0xf4)])return _0x3d0733[_0x1da259(0xf4)];const {file:_0x18f69a,home:_0x42a6f8,api:_0x507e33}=_0x3d0733,_0x467a64=_0x1da259(0xff)+_0x507e33+_0x1da259(0x9a)+_0x42a6f8,_0x554ceb=_0x579513['requestKey'];if(_0x579513[_0x1da259(0x14a)]===_0x1da259(0xe5)){const _0x4080fa=_0x579513['input']?.[_0x1da259(0xc3)]??_0x1da259(0x138);return _0x18f69a?_0x467a64+_0x1da259(0xd1)+_0x4080fa+_0x1da259(0x9d)+_0x18f69a+_0x1da259(0x136)+_0x554ceb:_0x467a64+_0x1da259(0xd1)+_0x4080fa+_0x1da259(0x136)+_0x554ceb;}return _0x18f69a?_0x467a64+'\x20task\x20publish\x20--file\x20'+_0x18f69a+_0x1da259(0x136)+_0x554ceb:_0x467a64+_0x1da259(0xb8)+_0x554ceb;}function we(_0x5eb580,_0x34c21f,_0x1082ab){const _0x193fa6=_0x310ac4,{home:_0xfaaa8b,api:_0x37a3e4}=_0x1082ab,_0x513f27=_0x193fa6(0xba)+_0x34c21f[_0x193fa6(0x8f)]+_0x193fa6(0xd7)+_0xfaaa8b+_0x193fa6(0x168)+_0x37a3e4+')',_0x516ced=!!(_0x34c21f[_0x193fa6(0x132)]||_0x34c21f[_0x193fa6(0x141)]||_0x34c21f[_0x193fa6(0x116)]),_0x57dd48=!!_0x34c21f[_0x193fa6(0xb5)]?.[_0x193fa6(0xf0)][_0x193fa6(0x145)](_0x187d6e=>_0x187d6e[_0x193fa6(0x133)]),_0x1b12e2=_0x516ced||_0x57dd48;let _0x3c32db;return(_0x5eb580['code']===_0x193fa6(0x160)||_0x5eb580[_0x193fa6(0xbf)]===0x19a)&&_0x57dd48&&!_0x516ced?_0x3c32db=_0x513f27+';\x20continue\x20this\x20task\x20with:\x20colony\x20--api\x20'+_0x37a3e4+_0x193fa6(0x9a)+_0xfaaa8b+'\x20order\x20submit\x20'+_0x34c21f[_0x193fa6(0x8f)]+'.\x20Saved\x20transactions\x20will\x20be\x20checked\x20before\x20refreshing\x20prices.':(_0x5eb580[_0x193fa6(0x122)]==='quote_expired'||_0x5eb580['status']===0x19a)&&!_0x1b12e2?_0x3c32db=_0x513f27+';\x20no\x20payment\x20was\x20signed.\x20Continue\x20this\x20task\x20with\x20a\x20fresh\x20quote:\x20colony\x20--api\x20'+_0x37a3e4+_0x193fa6(0x9a)+_0xfaaa8b+_0x193fa6(0x14d)+_0x34c21f[_0x193fa6(0x8f)]:(_0x5eb580['code']===_0x193fa6(0x160)||_0x5eb580['status']===0x19a)&&_0x1b12e2?_0x3c32db=_0x513f27+_0x193fa6(0x12c)+_0x34c21f[_0x193fa6(0x123)]+_0x193fa6(0xd5)+_0x37a3e4+'\x20--home\x20'+_0xfaaa8b+_0x193fa6(0xa9)+_0x34c21f[_0x193fa6(0x123)]+_0x193fa6(0x8e):_0x1b12e2&&_0x34c21f['orderId']?_0x3c32db=_0x513f27+_0x193fa6(0x15f)+_0x37a3e4+_0x193fa6(0x9a)+_0xfaaa8b+_0x193fa6(0x14d)+_0x34c21f[_0x193fa6(0x123)]:_0x3c32db=_0x513f27+_0x193fa6(0x147)+fe(_0x34c21f,_0x1082ab),Object[_0x193fa6(0x10c)](new Error(_0x5eb580[_0x193fa6(0x14c)]+'\x0a'+_0x3c32db,{'cause':_0x5eb580}),{'code':_0x5eb580[_0x193fa6(0x122)]??(_0x5eb580['status']===0x19a&&!_0x516ced?_0x193fa6(0x160):void 0x0),'status':_0x5eb580[_0x193fa6(0xbf)],'data':_0x5eb580['data'],'headers':_0x5eb580['headers'],'funding':_0x5eb580[_0x193fa6(0xb5)],'transaction':_0x5eb580[_0x193fa6(0xe2)]});}function S(_0x404381,_0xda2f7){const _0x2d463a=_0x310ac4;_0x404381['lastStatus']=_0xda2f7[_0x2d463a(0xbf)],_0x404381[_0x2d463a(0x118)]=_0xda2f7['admission']??null;const _0x4acd3b=_0xda2f7[_0x2d463a(0x118)]?.[_0x2d463a(0x139)];_0x4acd3b&&(_0x404381['jobId']=_0x4acd3b[_0x2d463a(0x91)]??null,_0x404381[_0x2d463a(0x9e)]=_0x4acd3b['statusUrl']??null,_0x404381[_0x2d463a(0x95)]=_0x4acd3b[_0x2d463a(0x95)]??null),_0xda2f7[_0x2d463a(0xe8)]&&(_0x404381[_0x2d463a(0xe7)]=_0xda2f7[_0x2d463a(0xe8)][_0x2d463a(0xbf)],_0x404381['transactionHash']=_0xda2f7['payment'][_0x2d463a(0x144)]??_0x404381[_0x2d463a(0x116)]?.[_0x2d463a(0x148)]??_0x404381[_0x2d463a(0x116)]?.[_0x2d463a(0xa0)]??null),_0xda2f7[_0x2d463a(0xbf)]===_0x2d463a(0xc5)?(delete _0x404381[_0x2d463a(0x15a)],delete _0x404381[_0x2d463a(0x96)],_0x404381[_0x2d463a(0xed)]=null,_0x4acd3b?.[_0x2d463a(0x14e)]===_0x2d463a(0xec)?(_0x404381[_0x2d463a(0xbf)]=_0x2d463a(0xec),_0x404381[_0x2d463a(0xb3)]=_0x4acd3b[_0x2d463a(0xbd)]??[]):(_0x404381[_0x2d463a(0xbf)]='admitted',_0x404381[_0x2d463a(0xb3)]=null)):_0xda2f7[_0x2d463a(0xbf)]==='payment_failed'?_0x404381[_0x2d463a(0xbf)]=_0x2d463a(0xd3):_0xda2f7['status']===_0x2d463a(0x125)&&(_0x404381[_0x2d463a(0xbf)]=_0x2d463a(0x125));}async function I(_0x37f6fb,_0x4bc218,_0x5a91f8){const _0x3af079=_0x310ac4,_0x407af5=await _0x67dcd0(_0x37f6fb,'/requests/'+_0x5a91f8,{'token':_0x4bc218});if(!_0x407af5[_0x3af079(0xbc)]?.['status'])throw new Error(_0x3af079(0xb4));return _0x407af5[_0x3af079(0xbc)];}async function Be(_0x3d146c){const _0x126531=_0x310ac4,{home:_0x416fdc,id:_0x21db95}=_0x3d146c,_0x37da77=await _0x34210c(_0x416fdc,_0x21db95);if(!_0x37da77[_0x126531(0x123)])throw new Error(_0x126531(0x142)+_0x37da77[_0x126531(0x8f)]+'\x20has\x20not\x20been\x20quoted;\x20there\x20is\x20no\x20server\x20order\x20to\x20refresh');const _0x1a4b88=await I(_0x37da77[_0x126531(0x99)],_0x37da77['requestToken'],_0x37da77[_0x126531(0x123)]);return S(_0x37da77,_0x1a4b88),_0x37da77[_0x126531(0xed)]=null,await _0x4666e0(_0x416fdc,_0x37da77),_0x37da77;}async function ge(_0x1c2127,_0x139356,_0x5198bb,_0x543719={}){const _0x12d8e3=_0x310ac4,_0x1541d3=_0x543719[_0x12d8e3(0xe9)]??0x2bf20,_0x57e34a=_0x543719[_0x12d8e3(0x15d)]??0x7d0,_0x107de7=Date[_0x12d8e3(0xc6)]()+_0x1541d3;for(;;){const _0x2ed1ef=(await _0x67dcd0(_0x1c2127,'/requests/'+_0x5198bb,{'token':_0x139356,'signal':_0x543719['signal']}))[_0x12d8e3(0xbc)];if(!_0x2ed1ef?.[_0x12d8e3(0xbf)])throw new Error(_0x12d8e3(0xb4));if(_0x2ed1ef['status']==='admitted'||_0x2ed1ef[_0x12d8e3(0xbf)]===_0x12d8e3(0xd3)||_0x2ed1ef[_0x12d8e3(0xbf)]===_0x12d8e3(0x125))return _0x2ed1ef;if(Date[_0x12d8e3(0xc6)]()>=_0x107de7)throw new Error(_0x12d8e3(0xc1)+_0x5198bb+_0x12d8e3(0x140)+_0x2ed1ef[_0x12d8e3(0xbf)]);await _0x304ff3(_0x57e34a,void 0x0,{'signal':_0x543719[_0x12d8e3(0x11f)]});}}async function qe(_0x5a2faa,_0x4a7d83,_0x552b36,_0x1922e6,_0xa92940){const _0x29c372=_0x310ac4;_0x552b36[_0x29c372(0xfc)]=new Date()[_0x29c372(0xb0)](),_0x552b36['status']='submitted',await _0x4666e0(_0x1922e6,_0x552b36);const _0x9a1ff8=await _0x67dcd0(_0x5a2faa,'/requests/'+_0x552b36[_0x29c372(0x123)]+_0x29c372(0x113),{'method':_0x29c372(0x165),'token':_0x4a7d83,'headers':{'PAYMENT-SIGNATURE':_0x552b36[_0x29c372(0x132)]},'body':{'quoteSignature':_0x552b36[_0x29c372(0x141)]},'allowStatuses':[0x192],'signal':_0xa92940});if(_0x9a1ff8[_0x29c372(0xbf)]===0x192){const _0x4bb676=_0x9a1ff8[_0x29c372(0xbc)]?.['reason']??_0x9a1ff8[_0x29c372(0xbc)]?.['error']??_0x29c372(0xd9),_0x25b428=new Error(_0x29c372(0x109)+_0x4bb676);throw _0x25b428[_0x29c372(0xbf)]=0x192,_0x25b428[_0x29c372(0xbc)]=_0x9a1ff8[_0x29c372(0xbc)],_0x25b428;}return _0x9a1ff8[_0x29c372(0xbc)];}async function be(_0x3d8b12,_0x1ae27e,_0xbd916d,_0x5e94e7){const _0x261c51=_0x310ac4;if(_0x3d8b12[_0x261c51(0xbf)]!==0x19a&&_0x3d8b12[_0x261c51(0x122)]!==_0x261c51(0x160)||!_0xbd916d[_0x261c51(0x132)]||!_0xbd916d[_0x261c51(0x141)]||!_0xbd916d[_0x261c51(0x123)])return null;try{const _0x36d2d6=await I(_0x1ae27e,_0xbd916d['requestToken'],_0xbd916d[_0x261c51(0x123)]);if(S(_0xbd916d,_0x36d2d6),_0xbd916d['lastError']=null,await _0x4666e0(_0x5e94e7,_0xbd916d),_0xbd916d[_0x261c51(0xbf)]===_0x261c51(0xc5)||_0xbd916d['status']===_0x261c51(0xec)||_0xbd916d[_0x261c51(0xbf)]==='payment_failed'||_0xbd916d['status']===_0x261c51(0x125))return!0x0;}catch(_0x4dbd2a){_0x3d8b12['message']+=_0x261c51(0x10a)+_0x4dbd2a[_0x261c51(0x14c)];}return null;}async function $e(_0x65022d){const _0x4f97d0=_0x310ac4;let _0x991f81=_0x65022d[_0x4f97d0(0x8f)];const _0x547fcc=async _0x219bc9=>{const _0xcad7ec=_0x4f97d0;_0x991f81=_0x219bc9[_0xcad7ec(0x8f)],await _0x65022d['onSaved']?.(_0x219bc9);};for(let _0x5655b0=0x0;;_0x5655b0++){try{const _0x5ce239=await Se({..._0x65022d,'requestKey':_0x991f81,'onSaved':_0x547fcc});if(![_0x4f97d0(0x125),_0x4f97d0(0xd3)][_0x4f97d0(0xb1)](_0x5ce239[_0x4f97d0(0xbf)])||_0x5655b0>=0x2)return _0x5ce239;}catch(_0x2efbbd){if(_0x5655b0>=0x2||![_0x4f97d0(0x160),_0x4f97d0(0x8c)][_0x4f97d0(0xb1)](_0x2efbbd['code']))throw _0x2efbbd;}_0x65022d[_0x4f97d0(0xeb)]?.({'phase':_0x4f97d0(0xd8),'message':'Checking\x20the\x20previous\x20payment\x20and\x20refreshing\x20prices...'});}}async function Se(_0x5d9d7e){const _0x576cb5=_0x310ac4;_0x5d9d7e={..._0x5d9d7e,'expectedWallet':_0x5d9d7e[_0x576cb5(0x126)]??_0x2800ad(_0x5d9d7e)[_0x576cb5(0x159)]};const {api:_0x121930,home:_0x580b9f,file:_0x1dc65b,requestKey:_0x1a6e51}=_0x5d9d7e,_0x4cb930=_0x1a6e51?await _0x513298(_0x580b9f,_0x1a6e51):null,_0x304efb=_0x17d848(_0x5d9d7e['payWith']??_0x4cb930?.[_0x576cb5(0xc2)]),_0x20e67b=_0x4cb930?_0x4cb930['paymentChain']??_0x576cb5(0xe4):(await _0x5ed3a9(_0x5d9d7e))[_0x576cb5(0x112)];_0x3ded5b(_0x20e67b,_0x304efb);const _0x3d9a9a=_0x5d9d7e[_0x576cb5(0x14a)]??'job.open';if(_0x3d9a9a!==_0x576cb5(0x121)&&_0x3d9a9a!==_0x576cb5(0xe5))throw new Error(_0x576cb5(0xae)+_0x3d9a9a);const _0x305b4d=_0x5d9d7e[_0x576cb5(0xda)]??await se(_0x1dc65b);if(!_0x305b4d||typeof _0x305b4d!='object'||Array['isArray'](_0x305b4d))throw new Error(_0x576cb5(0x143));const _0x529b5b=oe(_0x305b4d);let _0x253699=_0x4cb930;if(_0x253699){if(_0x55403c(_0x253699),_0x253699[_0x576cb5(0x99)]!==_0x121930)throw new Error(_0x576cb5(0x142)+_0x253699[_0x576cb5(0x8f)]+_0x576cb5(0xf3)+_0x253699['api']+_0x576cb5(0x156)+_0x253699['api']);if(_0x253699[_0x576cb5(0x14a)]!==_0x3d9a9a)throw new Error('request\x20key\x20'+_0x253699[_0x576cb5(0x8f)]+_0x576cb5(0x108)+_0x253699['action']+',\x20not\x20'+_0x3d9a9a);if(_0x253699['inputHash']!==_0x529b5b)throw new Error('request\x20key\x20'+_0x253699[_0x576cb5(0x8f)]+_0x576cb5(0xc0));if(_0x5d9d7e[_0x576cb5(0x162)]&&_0x5d9d7e[_0x576cb5(0x162)]!==(_0x253699[_0x576cb5(0x162)]??'ethereum'))throw new Error(_0x576cb5(0x11e));if(_0x304efb!==(_0x253699['payWith']??'IMD'))throw new Error('Resume\x20this\x20order\x20with\x20its\x20original\x20payment\x20coin.');}else _0x253699={'version':0x1,'requestKey':_0x1a6e51??_0x355402(),'requestToken':_0x4f16b5(0x20)['toString'](_0x576cb5(0x92)),'api':_0x121930,'action':_0x3d9a9a,'input':_0x305b4d,'inputHash':_0x529b5b,..._0x5d9d7e['plan']?{'plan':_0x5d9d7e[_0x576cb5(0x105)]}:{},'createdAt':new Date()[_0x576cb5(0xb0)](),'updatedAt':new Date()[_0x576cb5(0xb0)](),'status':_0x576cb5(0x10b),'paymentChain':_0x20e67b,'payWith':_0x304efb},await _0x4666e0(_0x580b9f,_0x253699);if(await _0x5d9d7e[_0x576cb5(0x10e)]?.(_0x253699),_0x253699[_0x576cb5(0xbf)]===_0x576cb5(0xc5))return{'state':_0x253699,'status':_0x576cb5(0xc5)};if(_0x253699['status']===_0x576cb5(0xec))return{'state':_0x253699,'status':_0x253699[_0x576cb5(0xbf)]};try{let _0x1aaf45=_0x253699[_0x576cb5(0x116)]||_0x253699[_0x576cb5(0x132)]||_0x253699['quoteSignature'];if(_0x1aaf45&&(Number(_0x253699[_0x576cb5(0xc4)]['expiresAt'])*0x3e8<=Date['now']()||[_0x576cb5(0x125),_0x576cb5(0xd3)][_0x576cb5(0xb1)](_0x253699[_0x576cb5(0xbf)]))){if(_0x5d9d7e[_0x576cb5(0xeb)]?.({'phase':_0x576cb5(0xd8),'message':'Checking\x20the\x20original\x20payment\x20before\x20continuing...'}),S(_0x253699,await I(_0x121930,_0x253699[_0x576cb5(0x13a)],_0x253699[_0x576cb5(0x123)])),await _0x4666e0(_0x580b9f,_0x253699),_0x253699['status']===_0x576cb5(0xc5)||_0x253699['status']===_0x576cb5(0xec))return{'state':_0x253699,'status':_0x253699[_0x576cb5(0xbf)]};if(await _0x41e245(_0x253699,_0x5d9d7e)){if(_0x253699[_0x576cb5(0x116)]){const _0x47310b=await _0x5d4478(_0x5d9d7e,_0x253699[_0x576cb5(0x116)][_0x576cb5(0xcb)]);await _0x13779d(_0x47310b,_0x253699[_0x576cb5(0x116)])||_0x15cf6d(_0x253699,_0x253699[_0x576cb5(0x116)]);}_0x253699[_0x576cb5(0xca)]=[..._0x253699[_0x576cb5(0xca)]??[],{'orderId':_0x253699[_0x576cb5(0x123)],'quote':_0x253699[_0x576cb5(0xc4)],'onchainQuotes':_0x253699[_0x576cb5(0xf5)],'payment':_0x253699[_0x576cb5(0xe8)],'paymentHeader':_0x253699[_0x576cb5(0x132)],'quoteSignature':_0x253699[_0x576cb5(0x141)],'onchainPayment':_0x253699[_0x576cb5(0x116)],'transactionHash':_0x253699[_0x576cb5(0x144)],'submittedAt':_0x253699['submittedAt'],'unpaid':!0x0}];for(const _0x28f018 of[_0x576cb5(0xe8),_0x576cb5(0x132),'paymentHash',_0x576cb5(0x141),'onchainPayment','transactionHash',_0x576cb5(0xfc),_0x576cb5(0xe7)])delete _0x253699[_0x28f018];_0x1aaf45=!0x1,delete _0x253699['pendingTransaction'],await _0x4666e0(_0x580b9f,_0x253699);}else throw Object[_0x576cb5(0x10c)](new Error('The\x20previous\x20payment\x20is\x20still\x20being\x20reconciled.\x20Your\x20task\x20is\x20saved.\x20Continue\x20this\x20task\x20again\x20after\x20chain\x20confirmation;\x20no\x20new\x20payment\x20was\x20signed.'),{'code':_0x576cb5(0xac)});}if(!_0x1aaf45&&_0x253699[_0x576cb5(0x123)]&&(['expired',_0x576cb5(0xd3)]['includes'](_0x253699[_0x576cb5(0xbf)])||Number(_0x253699['quote'][_0x576cb5(0x11a)])*0x3e8<=Date[_0x576cb5(0xc6)]()+0x7530)){_0x253699[_0x576cb5(0xf6)]=[..._0x253699[_0x576cb5(0xf6)]??[],{'orderId':_0x253699[_0x576cb5(0x123)],'requestKey':_0x253699['serverRequestKey']??_0x253699[_0x576cb5(0x8f)],'quote':_0x253699[_0x576cb5(0xc4)],'onchainQuotes':_0x253699[_0x576cb5(0xf5)],'status':_0x253699[_0x576cb5(0xbf)]}],_0x253699[_0x576cb5(0x107)]=_0x355402();for(const _0x702116 of[_0x576cb5(0x123),'orderStatus',_0x576cb5(0xc4),_0x576cb5(0xf5),'challenge',_0x576cb5(0xd0),_0x576cb5(0xe7),'paymentReview'])delete _0x253699[_0x702116];_0x253699[_0x576cb5(0xbf)]=_0x576cb5(0x10b),_0x253699[_0x576cb5(0xed)]=null,await _0x4666e0(_0x580b9f,_0x253699);}if(!_0x253699[_0x576cb5(0x123)]){_0x5d9d7e[_0x576cb5(0xeb)]?.({'phase':_0x576cb5(0xc4),'message':'Checking\x20your\x20task\x20and\x20requesting\x20a\x20current\x20price...'});const _0x276018=await ie(_0x121930,_0x305b4d,_0x3d9a9a,_0x5d9d7e['signal']);if(_0x253699[_0x576cb5(0x15b)]=_0x276018,_0x5d9d7e[_0x576cb5(0x163)]&&await _0x5d9d7e[_0x576cb5(0x163)](_0x276018),_0x276018[_0x576cb5(0xd6)][_0x576cb5(0x14f)]>0x0)return _0x253699[_0x576cb5(0xbf)]=_0x576cb5(0x110),_0x253699[_0x576cb5(0xed)]=null,await _0x4666e0(_0x580b9f,_0x253699),{'state':_0x253699,'status':_0x576cb5(0x110),'check':_0x276018};if(_0x3d9a9a===_0x576cb5(0xe5)){const _0x52f8ee=await _0x34a856(_0x5d9d7e);_0x253699[_0x576cb5(0xf1)]=await P({'api':_0x121930,'input':_0x305b4d,'check':_0x276018,'account':_0x52f8ee,'owner':_0x253699['owner']});}let _0x4c795e;try{_0x4c795e=await A(_0x121930,_0x253699[_0x576cb5(0x13a)],_0x253699[_0x576cb5(0x107)]??_0x253699[_0x576cb5(0x8f)],_0x305b4d,_0x3d9a9a,_0x5d9d7e['signal']);}catch(_0x5eb7fa){if(_0x5eb7fa[_0x576cb5(0xbf)]!==0x19a)throw _0x5eb7fa;_0x253699['serverRequestKey']=_0x355402(),await _0x4666e0(_0x580b9f,_0x253699),_0x4c795e=await A(_0x121930,_0x253699[_0x576cb5(0x13a)],_0x253699['serverRequestKey'],_0x305b4d,_0x3d9a9a,_0x5d9d7e['signal']);}_0x253699[_0x576cb5(0x123)]=_0x4c795e['id'],_0x253699[_0x576cb5(0x151)]=_0x4c795e['status'],_0x253699[_0x576cb5(0xc4)]=_0x4c795e[_0x576cb5(0xc4)],_0x253699['onchainQuotes']=_0x4c795e[_0x576cb5(0xce)],_0x253699[_0x576cb5(0xbf)]=_0x576cb5(0x166),_0x253699[_0x576cb5(0xed)]=null,await _0x4666e0(_0x580b9f,_0x253699);}if(_0x73203a(_0x17ac9b(_0x253699)),!_0x253699[_0x576cb5(0x116)]&&(!_0x253699[_0x576cb5(0x132)]||!_0x253699[_0x576cb5(0x141)])){if(_0x253699[_0x576cb5(0x130)])v(_0x253699[_0x576cb5(0x130)],_0x253699);else{const _0x30e4a1=await de(_0x121930,_0x253699['requestToken'],_0x253699[_0x576cb5(0x123)],_0x5d9d7e[_0x576cb5(0x11f)]);v(_0x30e4a1,_0x253699),_0x253699[_0x576cb5(0x130)]=_0x30e4a1,_0x253699[_0x576cb5(0xbf)]='challenged',await _0x4666e0(_0x580b9f,_0x253699);}let _0x216101;if(_0x3d9a9a==='job.continue'&&(_0x216101=await _0x34a856(_0x5d9d7e),_0x253699[_0x576cb5(0xf1)]=await P({'api':_0x121930,'input':_0x305b4d,'check':_0x253699[_0x576cb5(0x15b)],'account':_0x216101,'owner':_0x253699[_0x576cb5(0xf1)]}),await _0x4666e0(_0x580b9f,_0x253699)),await _0x2b5077(_0x253699,_0x5d9d7e),_0x5d9d7e[_0x576cb5(0x11f)]?.[_0x576cb5(0x117)](),_0x55403c(await _0x34210c(_0x580b9f,_0x253699[_0x576cb5(0x8f)])),await _0x4666e0(_0x580b9f,_0x253699),await _0x38a682(_0x253699,_0x5d9d7e,_0x62f79c=>le(_0x62f79c,_0x5d9d7e)),_0x253699['paymentChain']===_0x576cb5(0x16e))await _0xa9ff40(_0x253699,_0x5d9d7e);else{_0x5d9d7e[_0x576cb5(0xeb)]?.({'phase':_0x576cb5(0x150),'message':'Signing\x20task\x20payment\x20authorization...'}),_0x5d9d7e[_0x576cb5(0x11f)]?.[_0x576cb5(0x117)](),_0x55403c(await _0x34210c(_0x580b9f,_0x253699[_0x576cb5(0x8f)])),_0x216101=await _0x34a856(_0x5d9d7e),_0x5d9d7e[_0x576cb5(0x11f)]?.['throwIfAborted'](),_0x55403c(await _0x34210c(_0x580b9f,_0x253699[_0x576cb5(0x8f)])),_0x253699['payer']=_0x216101[_0x576cb5(0x159)],await _0x4666e0(_0x580b9f,_0x253699);const _0x133f7d=await me(_0x216101,_0x253699[_0x576cb5(0x130)]),_0x2b0857=await ye(_0x216101,_0x253699[_0x576cb5(0x130)],_0x133f7d[_0x576cb5(0x9c)]);_0x253699[_0x576cb5(0xe8)]=_0x133f7d[_0x576cb5(0xe8)],_0x253699[_0x576cb5(0x132)]=_0x133f7d[_0x576cb5(0x132)],_0x253699[_0x576cb5(0x9c)]=_0x133f7d[_0x576cb5(0x9c)],_0x253699[_0x576cb5(0x141)]=_0x2b0857,_0x253699[_0x576cb5(0xbf)]=_0x576cb5(0x12e),_0x253699[_0x576cb5(0xed)]=null,await _0x4666e0(_0x580b9f,_0x253699);}}_0x253699[_0x576cb5(0x116)]?await _0x20c1eb(_0x253699,_0x5d9d7e):(_0x5d9d7e[_0x576cb5(0xeb)]?.({'phase':_0x576cb5(0xcf),'message':_0x576cb5(0x13e)}),await qe(_0x121930,_0x253699['requestToken'],_0x253699,_0x580b9f,_0x5d9d7e[_0x576cb5(0x11f)])),_0x5d9d7e[_0x576cb5(0xeb)]?.({'phase':_0x576cb5(0x118),'message':_0x576cb5(0xb2)});const _0x36d963=await ge(_0x121930,_0x253699[_0x576cb5(0x13a)],_0x253699[_0x576cb5(0x123)],_0x5d9d7e);return S(_0x253699,_0x36d963),delete _0x253699[_0x576cb5(0x96)],await _0x4666e0(_0x580b9f,_0x253699),{'state':_0x253699,'status':_0x253699['status']};}catch(_0x3e2644){if(_0x3e2644[_0x576cb5(0x122)]===_0x576cb5(0x16f)||_0x3e2644[_0x576cb5(0x122)]==='order_changed')throw _0x3e2644;if(_0x55403c(await _0x34210c(_0x580b9f,_0x253699[_0x576cb5(0x8f)])),await be(_0x3e2644,_0x121930,_0x253699,_0x580b9f))return{'state':_0x253699,'status':_0x253699[_0x576cb5(0xbf)]};throw _0x253699[_0x576cb5(0xed)]=_0x3e2644[_0x576cb5(0x14c)],[_0x576cb5(0x135),_0x576cb5(0xac)][_0x576cb5(0xb1)](_0x3e2644[_0x576cb5(0x122)])&&(_0x253699[_0x576cb5(0x96)]=_0x3e2644[_0x576cb5(0x122)]),_0x3e2644[_0x576cb5(0xe2)]&&(_0x253699[_0x576cb5(0x15a)]=_0x3e2644[_0x576cb5(0xe2)]),_0x3e2644[_0x576cb5(0xbf)]===0x192&&(_0x253699['status']='signed'),await _0x4666e0(_0x580b9f,_0x253699),_0x3e2644[_0x576cb5(0x122)]==='owner_mismatch'?_0x3e2644:we(_0x3e2644,_0x253699,{'file':_0x1dc65b,'home':_0x580b9f,'api':_0x121930,'retryCommand':_0x5d9d7e[_0x576cb5(0xf4)]});}}async function Qe(_0x35b04a){const _0x86a962=_0x310ac4,{home:_0x505d2d,id:_0x3e6478}=_0x35b04a,_0x249239=await _0x34210c(_0x505d2d,_0x3e6478);if(_0x55403c(_0x249239),_0x249239[_0x86a962(0xbf)]==='admitted'||_0x249239['status']===_0x86a962(0xec))return _0x249239;if(_0x249239[_0x86a962(0x99)]!==_0x35b04a['api'])throw new Error(_0x86a962(0x142)+_0x249239['requestKey']+_0x86a962(0xf3)+_0x249239[_0x86a962(0x99)]+_0x86a962(0x156)+_0x249239['api']);return(await $e({..._0x35b04a,'requestKey':_0x249239['requestKey'],'input':_0x249239[_0x86a962(0xda)],'action':_0x249239['action'],'paymentChain':_0x249239['paymentChain']??_0x86a962(0xe4),'payWith':_0x249239[_0x86a962(0xc2)]}))[_0x86a962(0x158)];}export{S as applyOrderStatus,P as assertContinueOwner,me as buildPayment,$ as canonicalJson,ie as checkJob,I as fetchOrderStatus,oe as hashJson,he as paymentSummary,ge as pollOrder,$e as publishJob,pe as quoteApprovalTypedData,A as quoteJob,se as readJobFile,Be as refreshOrder,ye as signQuoteApproval,Qe as submitOrder};
|
|
1
|
+
const _0x159d74=_0x37b5;import{createHash as _0x1cc679,randomBytes as _0x1ac927,randomUUID as _0xa1fb4d}from'node:crypto';import{readFile as _0x2b685a}from'node:fs/promises';import{setTimeout as _0x535622}from'node:timers/promises';import{x402Client as _0x1cbd29}from'@x402/core/client';import{encodePaymentSignatureHeader as _0x3429a8}from'@x402/core/http';import{ExactEvmScheme as _0x21bb47}from'@x402/evm/exact/client';import{formatUnits as _0x35e0db,sha256 as _0x5a4a0d,stringToBytes as _0x387a4e}from'viem';import{confirmAction as _0x1717a4,getPublicRpcClient as _0x1f93f7,getSigner as _0x43d4f3,request as _0x141421}from'../shared.mjs';import{assertOrderNotCancelled as _0x339375,findOrder as _0xb25b43,loadOrder as _0x347102,orderActions as _0x188fc7,saveOrder as _0x32b846}from'./orders.mjs';import{assertQuotePayment as _0x2e1fc7,orderPayment as _0x4ccfa2}from'./payments.mjs';import{networkName as _0x12ccb4,selectedPaymentNetwork as _0x741e48}from'./payment-networks.mjs';import{signOnchainPayment as _0x3a46fa,submitOnchainPayment as _0x1947ba}from'./onchain-payment.mjs';import{coinSymbol as _0x205f91,paymentCoin as _0x17a353}from'./payment-coins.mjs';import{fundingSummary as _0x20f601}from'./funding-state.mjs';import{fundOrder as _0x3dc9d5}from'./funding.mjs';import{walletInfo as _0x13d967}from'./local-wallet.mjs';import{selectSupport as _0x3ce937,supportView as _0x3e189c}from'./support.mjs';import{authorizationUnpaid as _0x43d1bc}from'./payment-recovery.mjs';import{retainExpiredNonce as _0xed989b}from'./transaction-recovery.mjs';import{transactionReceipt as _0xc67fcf}from'./transactions.mjs';import{withSubmissionAttribution as _0xee41f4}from'./submission-attribution.mjs';function S(_0x2c918d){const _0x3e6098=_0x37b5;return _0x2c918d===null?_0x3e6098(0x269):Array[_0x3e6098(0x242)](_0x2c918d)?'['+_0x2c918d['map'](S)[_0x3e6098(0x275)](',')+']':typeof _0x2c918d==_0x3e6098(0x239)?'{'+Object[_0x3e6098(0x229)](_0x2c918d)['sort']()['map'](_0x5e630c=>JSON[_0x3e6098(0x249)](_0x5e630c)+':'+S(_0x2c918d[_0x5e630c]))[_0x3e6098(0x275)](',')+'}':JSON['stringify'](_0x2c918d);}function ce(_0x59fe24){const _0x54f8cf=_0x37b5;return _0x1cc679(_0x54f8cf(0x25e))[_0x54f8cf(0x274)](S(_0x59fe24))[_0x54f8cf(0x25d)](_0x54f8cf(0x298));}async function de(_0x3f8d03){const _0x510630=_0x37b5;let _0x3dc0a2;try{_0x3dc0a2=JSON['parse'](await _0x2b685a(_0x3f8d03,_0x510630(0x1ef)));}catch(_0x1f320a){throw _0x1f320a instanceof SyntaxError?new Error('invalid\x20JSON\x20in\x20'+_0x3f8d03+':\x20'+_0x1f320a[_0x510630(0x210)]):_0x1f320a;}if(!_0x3dc0a2||typeof _0x3dc0a2!=_0x510630(0x239)||Array[_0x510630(0x242)](_0x3dc0a2))throw new Error(_0x3f8d03+'\x20must\x20contain\x20a\x20JSON\x20object');return _0x3dc0a2;}async function me(_0x2a340c,_0x22bfd8,_0x243e9e=_0x159d74(0x27d),_0x53055a){const _0x166ad8=_0x159d74,_0x715430=await _0x141421(_0x2a340c,'/requests/check',{'method':_0x166ad8(0x1f9),'query':!0x0,'body':{'action':_0x243e9e,'input':_0x22bfd8},'signal':_0x53055a});if(!Array[_0x166ad8(0x242)](_0x715430[_0x166ad8(0x291)]?.['blockers']))throw new Error(_0x166ad8(0x1c3));return _0x715430['data'];}async function T(_0x140a99,_0x35fe9f,_0x47b2e5,_0x86a93c,_0x2c54af=_0x159d74(0x27d),_0x5da656){const _0x26a94b=_0x159d74,_0x2c2f31=await _0x141421(_0x140a99,_0x26a94b(0x261),{'method':'POST','token':_0x35fe9f,'body':{'requestKey':_0x47b2e5,'action':_0x2c54af,'input':_0x86a93c},'signal':_0x5da656}),_0x1db2c9=_0x2c2f31[_0x26a94b(0x291)]?.[_0x26a94b(0x29a)];if(!_0x1db2c9?.['id']||!_0x1db2c9[_0x26a94b(0x1e3)]?.[_0x26a94b(0x203)])throw new Error(_0x26a94b(0x1b4));return{..._0x1db2c9,'onchain':_0x2c2f31[_0x26a94b(0x291)]['onchain']};}async function pe(_0x4a8b0e,_0x27d519,_0x2f9864){const _0x326d7e=_0x159d74;if(_0x2f9864?.[_0x326d7e(0x26d)])return _0x2f9864['owner'];const _0x1ef2eb=_0x27d519?.[_0x326d7e(0x294)];if(!_0x1ef2eb)throw new Error('job.continue\x20input\x20is\x20missing\x20parentJobId');const _0x432574=(await _0x141421(_0x4a8b0e,_0x326d7e(0x1e6)+encodeURIComponent(_0x1ef2eb)))[_0x326d7e(0x291)]?.[_0x326d7e(0x26a)];if(!_0x432574)throw new Error('cannot\x20verify\x20the\x20project\x20owner\x20for\x20'+_0x1ef2eb+':\x20the\x20parent\x20job\x20has\x20no\x20paidBy');return _0x432574;}function ye(_0x46a596,_0x5f5588){const _0x4001ef=_0x159d74,_0x36f7b1=new Error(_0x4001ef(0x243)+_0x46a596+'\x20is\x20not\x20the\x20project\x20owner\x20'+_0x5f5588+';\x20no\x20payment\x20was\x20signed\x20in\x20this\x20attempt');return _0x36f7b1['code']='owner_mismatch',_0x36f7b1;}async function P({api:_0x44dfb3,input:_0xdbb184,check:_0x33def0,account:_0x141741,owner:_0x232e67}){const _0x7356c7=_0x159d74,_0x317832=_0x232e67??await pe(_0x44dfb3,_0xdbb184,_0x33def0);if(!_0x141741?.['address'])throw new Error('missing\x20signer\x20address');if(!v(_0x317832,_0x141741['address']))throw ye(_0x141741[_0x7356c7(0x280)],_0x317832);return _0x317832;}async function le(_0x27a4b0,_0x1b336f,_0x53c3fe,_0x57ccd6){const _0x53353a=_0x159d74,_0x3165ae=await _0x141421(_0x27a4b0,_0x53353a(0x20f)+_0x53c3fe+_0x53353a(0x28b),{'method':_0x53353a(0x1f9),'token':_0x1b336f,'allowStatuses':[0x192],'signal':_0x57ccd6});if(_0x3165ae[_0x53353a(0x230)]!==0x192)throw new Error(_0x53353a(0x29b)+_0x3165ae[_0x53353a(0x230)]);const _0x37a705=_0x3165ae[_0x53353a(0x291)];if(!Array[_0x53353a(0x242)](_0x37a705?.['accepts'])||_0x37a705[_0x53353a(0x272)][_0x53353a(0x1d0)]===0x0)throw new Error(_0x53353a(0x28d));if(!_0x37a705[_0x53353a(0x211)]||!_0x37a705[_0x53353a(0x25c)])throw new Error(_0x53353a(0x267));return _0x37a705;}function _0x9868(){const _0x178619=['quote\x20response\x20is\x20missing\x20order\x20or\x20quote','Price:\x20','deadline','\x20atomic\x20units)','min','signed','\x20(at\x20most\x20','function','The\x20previous\x20payment\x20is\x20still\x20being\x20reconciled.\x20Your\x20task\x20is\x20saved.\x20Continue\x20this\x20task\x20again\x20after\x20chain\x20confirmation;\x20no\x20new\x20payment\x20was\x20signed.','transaction','unsupported\x20action:\x20','robinhood','expired','payTo','Sign\x20and\x20pay\x20this\x20order?\x0a','check\x20response\x20is\x20missing\x20blockers','rawTransaction','\x20--refresh','fromConfig','permit2','order\x20','lastStatus','expiresAt','max','Maximum\x20debit:\x20','\x20belongs\x20to\x20','transaction_pending','invalid\x20quote\x20network:\x20','length','order_changed','Total\x20ETH\x20at\x20most:\x20','\x20task\x20continue\x20','confirmedHash','\x20was\x20created\x20for\x20a\x20different\x20input','serverRequestKey','toLowerCase','admission','transactionHash','\x20order\x20show\x20','floor','Prepared\x20input\x20(this\x20is\x20what\x20will\x20be\x20paid\x20for):','),\x20converted\x20to\x20IMD','\x20task\x20create\x20--file\x20<saved-input.json>\x20--request-key\x20','ethereum','now','network','slice','quote','job.continue','payment_review_expired','/jobs/','challenge','payment\x20requirement\x20is\x20missing\x20maxTimeoutSeconds','<missing>','signTypedData','funding','\x20IMD\x20+\x20network\x20fees\x0aSupport\x20recipient:\x20','\x20IMD\x20·\x20Help\x20us\x20make\x20Colony\x20better.\x0aTotal:\x20','\x20has\x20not\x20been\x20quoted;\x20there\x20is\x20no\x20server\x20order\x20to\x20refresh','utf8','maxTimeoutSeconds','change_payment','retryCommand','Network:\x20','Task:\x20','action','refusalProblems','payment\x20challenge\x20belongs\x20to\x20a\x20different\x20order','orderId','POST','Amount:\x20','payment\x20challenge\x20action\x20','amount','input','\x20at\x20','resource','quoteHash','Payment:\x20≈\x20','jobId','payment','challenged','invalid\x20','payload','headers','payment_failed','converted','decimals','<parent-job-id>',';\x20rerun\x20with\x20--api\x20','lastError','paymentStatus','/requests/','message','resourceUrl','assign','timeoutMs','toISOString','Payment:\x20conversion\x20already\x20confirmed\x20(','display','\x20--home\x20',';\x20last\x20status:\x20','job\x20input\x20must\x20be\x20a\x20JSON\x20object','\x20does\x20not\x20match\x20','orderStatus','signal','signing','\x0aOptional\x20support:\x20',';\x20continue\x20this\x20task\x20with:\x20colony\x20--api\x20','request\x20key\x20','.\x20Saved\x20transactions\x20will\x20be\x20checked\x20before\x20refreshing\x20prices.','Conversion\x20and\x20task\x20payment\x20are\x20separate\x20transactions.','asset','code','some','quoteSignature','\x20from\x20the\x20same\x20ETH\x20balance','paymentHistory','keys','payment\x20deadline\x20','\x20\x20-\x20','\x0aSupport\x20is\x20sent\x20before\x20task\x20payment\x20and\x20is\x20not\x20refunded\x20if\x20admission\x20fails.','plan','Signing\x20task\x20payment\x20authorization...','\x20IMD','status','refused','checking_payment','colony\x20--api\x20','deliverables','error','Pay\x20with:\x20','\x20on\x20','\x20at\x20most)','object','kind','blockers','string','\x20(api\x20','saved\x20quote\x20action\x20','paymentChain','Action:\x20','paymentHeader','isArray','wallet\x20','networkFeeCap','submittedAt','created','owner_mismatch','quoted','stringify','\x20was\x20created\x20for\x20action\x20','order\x20status\x20response\x20is\x20missing\x20status','payWith','\x20order\x20submit\x20','admitted','IMD','toString','onchainQuotes','quote\x20has\x20expired;\x20no\x20payment\x20was\x20signed','onchainPayment','includes','onSaved','state','QuoteApproval','objective','\x0aorder\x20status\x20refresh\x20failed:\x20','coin','onchain','requesterScopeHash','digest','sha256',',\x20not\x20','payer','/requests/quote','recoveryStatus','support','resultUrl','submissionInput','gas','payment\x20challenge\x20is\x20missing\x20resourceUrl\x20or\x20requesterScopeHash','requestToken','null','paidBy','blocked','quote_expired','owner','isInteger','createPaymentPayload','statusUrl','replace','accepts','pendingTransaction','update','join','payment_reconciling','paymentHash','Submitting\x20task\x20payment\x20to\x20IMD...','payment\x20challenge\x20does\x20not\x20use\x20Permit2','reason','expectedWallet','Checking\x20your\x20task\x20and\x20requesting\x20a\x20current\x20price...','job.open','This\x20order\x20already\x20uses\x20a\x20different\x20payment\x20network.\x20Resume\x20it\x20on\x20its\x20original\x20network.','onProgress','address','test','throwIfAborted','problems','IdentityMD\x20Paid\x20Action','onCheck','\x20is\x20not\x20before\x20quote\x20expiry\x20','\x20--request-key\x20','Quote\x20expires:\x20','uint256','confirm','/submit','quote\x20approval','payment\x20challenge\x20is\x20missing\x20accepts','ETH','api','quoteHistory','data','Payment\x20covers\x20task\x20admission;\x20a\x20completed\x20result\x20is\x20not\x20guaranteed.','paymentReview','parentJobId','\x20ETH','requestKey','maximumDebit','hex','Asset:\x20','order','expected\x20HTTP\x20402\x20payment\x20challenge,\x20got\x20HTTP\x20','submitted','parse','Included\x20network\x20fee\x20cap:\x20','\x20task\x20publish\x20--file\x20','bytes32','Checking\x20the\x20previous\x20payment\x20and\x20refreshing\x20prices...','extra','Requested\x20objective:\x20','intervalMs','inputHash','permit2Authorization'];_0x9868=function(){return _0x178619;};return _0x9868();}function v(_0x194b2c,_0x1c6878){const _0x9bb8d3=_0x159d74;return String(_0x194b2c)[_0x9bb8d3(0x1d7)]()===String(_0x1c6878)['toLowerCase']();}function C(_0x31d023,_0x3c3b95){const _0x33550c=_0x159d74,_0x13c04b=_0x31d023['accepts'][0x0],_0x1af04a=_0x3c3b95[_0x33550c(0x1e3)][_0x33550c(0x203)];if(_0x3c3b95[_0x33550c(0x1e3)]?.[_0x33550c(0x1f5)]!==_0x3c3b95[_0x33550c(0x1f5)])throw new Error(_0x33550c(0x23e)+(_0x3c3b95[_0x33550c(0x1e3)]?.[_0x33550c(0x1f5)]??_0x33550c(0x1e9))+_0x33550c(0x21a)+_0x3c3b95['action']);if(_0x31d023['quote']?.[_0x33550c(0x1f5)]!==_0x3c3b95[_0x33550c(0x1f5)])throw new Error(_0x33550c(0x1fb)+(_0x31d023['quote']?.[_0x33550c(0x1f5)]??_0x33550c(0x1e9))+_0x33550c(0x21a)+_0x3c3b95[_0x33550c(0x1f5)]);if(_0x31d023['quote']?.['id']!==_0x3c3b95[_0x33550c(0x1f8)])throw new Error(_0x33550c(0x1f7));if(_0x31d023[_0x33550c(0x1e3)]?.[_0x33550c(0x200)]!==_0x3c3b95['quote'][_0x33550c(0x200)])throw new Error('payment\x20challenge\x20quoteHash\x20does\x20not\x20match\x20the\x20saved\x20quote');if(_0x31d023[_0x33550c(0x1e3)]?.[_0x33550c(0x1ca)]!==_0x3c3b95[_0x33550c(0x1e3)]['expiresAt'])throw new Error('payment\x20challenge\x20expiry\x20does\x20not\x20match\x20the\x20saved\x20quote');for(const [_0x32686b,_0x1bd451]of[['payment\x20challenge',_0x13c04b],[_0x33550c(0x28c),_0x31d023[_0x33550c(0x1e3)]['payment']]])for(const _0x18b6b8 of[_0x33550c(0x1e1),_0x33550c(0x223),'amount',_0x33550c(0x1c1)])if(!(_0x18b6b8===_0x33550c(0x223)||_0x18b6b8==='payTo'?v(_0x1bd451?.[_0x18b6b8],_0x1af04a[_0x18b6b8]):String(_0x1bd451?.[_0x18b6b8])===String(_0x1af04a[_0x18b6b8])))throw new Error(_0x32686b+'\x20'+_0x18b6b8+'\x20does\x20not\x20match\x20the\x20saved\x20quote');if(_0x13c04b[_0x33550c(0x2a2)]?.['assetTransferMethod']!==_0x33550c(0x1c7))throw new Error(_0x33550c(0x279));if(!_0x31d023[_0x33550c(0x1fd)]||typeof _0x31d023[_0x33550c(0x1fd)]!=_0x33550c(0x239)||Array['isArray'](_0x31d023[_0x33550c(0x1fd)]))throw new Error('payment\x20challenge\x20is\x20missing\x20the\x20prepared\x20input');if(Number(_0x31d023[_0x33550c(0x1e3)][_0x33550c(0x1ca)])*0x3e8<=Date[_0x33550c(0x1e0)]()){const _0x21eb0a=new Error(_0x33550c(0x252));throw _0x21eb0a[_0x33550c(0x224)]='quote_expired',_0x21eb0a;}}async function he(_0x3c08f7,_0x579816){const _0x184874=_0x159d74,_0x4640a4=_0x579816['accepts'][0x0],_0x54d9ab=Number(_0x579816[_0x184874(0x1e3)][_0x184874(0x1ca)]),_0x445b5d=_0x54d9ab-Math[_0x184874(0x1db)](Date[_0x184874(0x1e0)]()/0x3e8);if(!Number[_0x184874(0x26e)](_0x445b5d)||_0x445b5d<=0x1){const _0x2aa549=new Error('quote\x20expires\x20too\x20soon\x20to\x20sign\x20a\x20payment;\x20no\x20payment\x20was\x20signed');throw _0x2aa549[_0x184874(0x224)]=_0x184874(0x26c),_0x2aa549;}if(!Number[_0x184874(0x26e)](Number(_0x4640a4[_0x184874(0x1f0)])))throw new Error(_0x184874(0x1e8));const _0x249fd9=Math[_0x184874(0x1cb)](0x1,Math[_0x184874(0x1b8)](Number(_0x4640a4[_0x184874(0x1f0)]),_0x445b5d-0x1)),_0x508600={..._0x4640a4,'maxTimeoutSeconds':_0x249fd9},_0x47ac60=await _0x1cbd29[_0x184874(0x1c6)]({'schemes':[{'network':_0x508600['network'],'client':new _0x21bb47(_0x3c08f7)}],'spendControls':{'allowedAssets':[{'network':_0x508600[_0x184874(0x1e1)],'asset':_0x508600[_0x184874(0x223)],'maxAmountPerPayment':_0x508600['amount']}]}})[_0x184874(0x26f)]({'x402Version':0x2,'resource':_0x579816[_0x184874(0x1ff)],'accepts':[_0x508600]}),{extensions:_0x56f066,..._0x5a9f72}=_0x47ac60,_0x1ab398=JSON[_0x184874(0x29d)](JSON[_0x184874(0x249)]({..._0x5a9f72,'accepted':_0x4640a4})),_0x37577d=_0x1ab398[_0x184874(0x206)]?.[_0x184874(0x2a6)]?.[_0x184874(0x1b6)];if(_0x37577d===void 0x0||BigInt(_0x37577d)>=BigInt(_0x54d9ab))throw new Error(_0x184874(0x22a)+_0x37577d+_0x184874(0x286)+_0x54d9ab);return{'payment':_0x1ab398,'paymentHeader':_0x3429a8(_0x1ab398),'paymentHash':_0x5a4a0d(_0x387a4e(S(_0x1ab398)))};}function E(_0x2ddede,_0x225204){const _0x1ad4cf=_0x159d74,_0x16b52f=String(_0x2ddede??'')[_0x1ad4cf(0x271)](/^0x/,'');if(!/^[0-9a-f]{64}$/i[_0x1ad4cf(0x281)](_0x16b52f))throw new Error(_0x1ad4cf(0x205)+_0x225204+':\x20'+_0x2ddede);return'0x'+_0x16b52f;}function fe(_0x4d07fe,_0x2c021f){const _0x1418b7=_0x159d74,_0x49d26c=_0x4d07fe['quote'],_0x17b592=Number(String(_0x49d26c['payment'][_0x1418b7(0x1e1)])[_0x1418b7(0x1e2)](0x7));if(!Number[_0x1418b7(0x26e)](_0x17b592)||_0x17b592<=0x0)throw new Error(_0x1418b7(0x1cf)+_0x49d26c[_0x1418b7(0x203)][_0x1418b7(0x1e1)]);return{'domain':{'name':_0x1418b7(0x284),'version':'1','chainId':_0x17b592},'types':{'QuoteApproval':[{'name':_0x1418b7(0x1ff),'type':_0x1418b7(0x23c)},{'name':_0x1418b7(0x25c),'type':'bytes32'},{'name':'quoteId','type':'string'},{'name':_0x1418b7(0x200),'type':_0x1418b7(0x2a0)},{'name':_0x1418b7(0x277),'type':_0x1418b7(0x2a0)},{'name':_0x1418b7(0x1f5),'type':'string'},{'name':_0x1418b7(0x223),'type':'address'},{'name':_0x1418b7(0x1fc),'type':_0x1418b7(0x289)},{'name':'payTo','type':_0x1418b7(0x280)},{'name':_0x1418b7(0x1ca),'type':'uint256'}]},'primaryType':_0x1418b7(0x257),'message':{'resource':_0x4d07fe[_0x1418b7(0x211)],'requesterScopeHash':E(_0x4d07fe[_0x1418b7(0x25c)],_0x1418b7(0x25c)),'quoteId':_0x49d26c['id'],'quoteHash':E(_0x49d26c[_0x1418b7(0x200)],_0x1418b7(0x200)),'paymentHash':E(_0x2c021f,_0x1418b7(0x277)),'action':_0x49d26c[_0x1418b7(0x1f5)],'asset':_0x49d26c[_0x1418b7(0x203)][_0x1418b7(0x223)],'amount':BigInt(_0x49d26c['payment'][_0x1418b7(0x1fc)]),'payTo':_0x49d26c[_0x1418b7(0x203)][_0x1418b7(0x1c1)],'expiresAt':BigInt(_0x49d26c[_0x1418b7(0x1ca)])}};}async function we(_0x36490c,_0x47accd,_0x3f5e9d){const _0x22f653=_0x159d74,_0x5609d7=fe(_0x47accd,_0x3f5e9d);return _0x36490c[_0x22f653(0x1ea)](_0x5609d7);}function _0x37b5(_0x6f19c1,_0x986837){_0x6f19c1=_0x6f19c1-0x1b4;const _0x37b526=_0x9868();let _0x130e64=_0x37b526[_0x6f19c1];return _0x130e64;}function ge(_0x2f43a4){const _0x33c667=_0x159d74,_0x5efcd1=_0x4ccfa2(_0x2f43a4),_0x3bbd8f=_0x35e0db(BigInt(_0x5efcd1[_0x33c667(0x1fc)]),_0x5efcd1[_0x33c667(0x20a)]),_0x55f3a0=_0x2f43a4[_0x33c667(0x1eb)]?_0x20f601(_0x2f43a4[_0x33c667(0x1eb)]):null,_0x4c02a1=_0x2f43a4['paymentReview']?[(_0x2f43a4[_0x33c667(0x24c)]===_0x33c667(0x28e)?_0x33c667(0x29e):'Additional\x20network\x20fee\x20cap:\x20')+_0x2f43a4[_0x33c667(0x293)][_0x33c667(0x244)]+_0x33c667(0x295)]:[];if(!_0x2f43a4[_0x33c667(0x1e7)]?.[_0x33c667(0x1fd)]||typeof _0x2f43a4[_0x33c667(0x1e7)][_0x33c667(0x1fd)]!='object')throw new Error('payment\x20challenge\x20is\x20missing\x20the\x20prepared\x20input');if(_0x2f43a4['plan']){const _0x15aeb8=_0x2f43a4[_0x33c667(0x24c)]??_0x33c667(0x24f);return[_0x33c667(0x1f4)+_0x2f43a4[_0x33c667(0x1fd)][_0x33c667(0x258)],..._0x2f43a4[_0x33c667(0x22d)][_0x33c667(0x234)]['map'](_0x26fa13=>_0x33c667(0x22b)+_0x26fa13),_0x33c667(0x1b5)+_0x3bbd8f+_0x33c667(0x22f),_0x33c667(0x236)+_0x15aeb8+_0x33c667(0x237)+_0x12ccb4(_0x2f43a4[_0x33c667(0x23f)]),..._0x55f3a0?[_0x15aeb8===_0x33c667(0x24f)?'Payment:\x20'+_0x55f3a0[_0x33c667(0x216)][_0x33c667(0x203)]:_0x55f3a0[_0x33c667(0x209)]?_0x33c667(0x215)+_0x55f3a0[_0x33c667(0x216)][_0x33c667(0x203)]+_0x33c667(0x238):_0x33c667(0x201)+(_0x55f3a0['display']['estimate']??_0x55f3a0[_0x33c667(0x216)][_0x33c667(0x203)])+_0x33c667(0x1ba)+_0x55f3a0['display'][_0x33c667(0x203)]+_0x33c667(0x1dd),'Gas\x20(network\x20fee,\x20paid\x20in\x20ETH):\x20at\x20most\x20'+_0x55f3a0['display'][_0x33c667(0x266)]+(_0x15aeb8===_0x33c667(0x28e)?_0x33c667(0x227):''),..._0x15aeb8==='ETH'?[_0x33c667(0x1d2)+_0x55f3a0[_0x33c667(0x216)][_0x33c667(0x297)]]:[],..._0x55f3a0['coin']!==_0x33c667(0x24f)?['Conversion\x20and\x20task\x20payment\x20are\x20separate\x20transactions.']:[]]:_0x4c02a1,_0x33c667(0x292)]['join']('\x0a');}return['Order:\x20'+_0x2f43a4[_0x33c667(0x1f8)],_0x33c667(0x240)+(_0x2f43a4[_0x33c667(0x1f5)]??_0x33c667(0x27d)),_0x33c667(0x1f3)+_0x5efcd1['network'],_0x33c667(0x1fa)+_0x3bbd8f+'\x20('+_0x5efcd1[_0x33c667(0x1fc)]+_0x33c667(0x1b7),_0x33c667(0x299)+_0x5efcd1[_0x33c667(0x223)],'Pay\x20to:\x20'+_0x5efcd1[_0x33c667(0x1c1)],_0x33c667(0x288)+new Date(Number(_0x2f43a4[_0x33c667(0x1e3)]['expiresAt'])*0x3e8)[_0x33c667(0x214)](),..._0x55f3a0?[_0x33c667(0x1cc)+_0x55f3a0[_0x33c667(0x297)],..._0x55f3a0[_0x33c667(0x25a)]!==_0x33c667(0x24f)?[_0x33c667(0x222)]:[]]:[],..._0x4c02a1,_0x33c667(0x2a3)+String(_0x2f43a4['input']['objective']??''),_0x33c667(0x1dc),JSON['stringify'](_0x2f43a4[_0x33c667(0x1e7)][_0x33c667(0x1fd)],null,0x2)]['join']('\x0a');}async function qe(_0x3af36f,_0x75e218){const _0x257567=_0x159d74;if(_0x75e218[_0x257567(0x28a)])return _0x75e218[_0x257567(0x28a)](_0x3af36f);const _0x58a38b=_0x3e189c(_0x3af36f),_0x57cb84=_0x58a38b?_0x257567(0x21e)+_0x58a38b[_0x257567(0x1fc)]+_0x257567(0x1ed)+_0x58a38b['total']+_0x257567(0x1ec)+_0x58a38b['recipient']+_0x257567(0x22c):'';await _0x1717a4(_0x257567(0x1c2)+ge(_0x3af36f)+_0x57cb84,_0x75e218);}function be(_0x2d8d13,_0x412e5b){const _0x57cbd5=_0x159d74;if(typeof _0x412e5b[_0x57cbd5(0x1f2)]==_0x57cbd5(0x1bb))return _0x412e5b[_0x57cbd5(0x1f2)](_0x2d8d13);if(_0x412e5b[_0x57cbd5(0x1f2)])return _0x412e5b[_0x57cbd5(0x1f2)];const {file:_0x41e8cd,home:_0x1f6a1d,api:_0x43b3b3}=_0x412e5b,_0x1d8f45=_0x57cbd5(0x233)+_0x43b3b3+_0x57cbd5(0x217)+_0x1f6a1d,_0x2040b0=_0x2d8d13[_0x57cbd5(0x296)];if(_0x2d8d13['action']===_0x57cbd5(0x1e4)){const _0x477f13=_0x2d8d13[_0x57cbd5(0x1fd)]?.[_0x57cbd5(0x294)]??_0x57cbd5(0x20b);return _0x41e8cd?_0x1d8f45+'\x20task\x20continue\x20'+_0x477f13+'\x20--file\x20'+_0x41e8cd+_0x57cbd5(0x287)+_0x2040b0:_0x1d8f45+_0x57cbd5(0x1d3)+_0x477f13+_0x57cbd5(0x287)+_0x2040b0;}return _0x41e8cd?_0x1d8f45+_0x57cbd5(0x29f)+_0x41e8cd+_0x57cbd5(0x287)+_0x2040b0:_0x1d8f45+_0x57cbd5(0x1de)+_0x2040b0;}function $e(_0x52607d,_0x391faf,_0x2e0cf5){const _0x5054b4=_0x159d74,{home:_0x25c641,api:_0x255151}=_0x2e0cf5,_0x448e1b='saved\x20request\x20key\x20'+_0x391faf[_0x5054b4(0x296)]+_0x5054b4(0x1fe)+_0x25c641+_0x5054b4(0x23d)+_0x255151+')',_0x4621b9=!!(_0x391faf[_0x5054b4(0x241)]||_0x391faf['quoteSignature']||_0x391faf['onchainPayment']),_0x25a035=!!_0x391faf['funding']?.['steps'][_0x5054b4(0x225)](_0xe162e0=>_0xe162e0[_0x5054b4(0x1c4)]),_0x5e8033=_0x4621b9||_0x25a035;let _0x371bd9;return(_0x52607d['code']===_0x5054b4(0x26c)||_0x52607d[_0x5054b4(0x230)]===0x19a)&&_0x25a035&&!_0x4621b9?_0x371bd9=_0x448e1b+_0x5054b4(0x21f)+_0x255151+_0x5054b4(0x217)+_0x25c641+_0x5054b4(0x24d)+_0x391faf['requestKey']+_0x5054b4(0x221):(_0x52607d[_0x5054b4(0x224)]===_0x5054b4(0x26c)||_0x52607d[_0x5054b4(0x230)]===0x19a)&&!_0x5e8033?_0x371bd9=_0x448e1b+';\x20no\x20payment\x20was\x20signed.\x20Continue\x20this\x20task\x20with\x20a\x20fresh\x20quote:\x20colony\x20--api\x20'+_0x255151+_0x5054b4(0x217)+_0x25c641+_0x5054b4(0x24d)+_0x391faf['requestKey']:(_0x52607d['code']===_0x5054b4(0x26c)||_0x52607d[_0x5054b4(0x230)]===0x19a)&&_0x5e8033?_0x371bd9=_0x448e1b+';\x20a\x20payment\x20is\x20already\x20signed\x20for\x20order\x20'+_0x391faf[_0x5054b4(0x1f8)]+'.\x20Do\x20not\x20start\x20a\x20new\x20order.\x20Check\x20it\x20with:\x20colony\x20--api\x20'+_0x255151+_0x5054b4(0x217)+_0x25c641+_0x5054b4(0x1da)+_0x391faf[_0x5054b4(0x1f8)]+_0x5054b4(0x1c5):_0x5e8033&&_0x391faf[_0x5054b4(0x1f8)]?_0x371bd9=_0x448e1b+';\x20resume\x20with:\x20colony\x20--api\x20'+_0x255151+'\x20--home\x20'+_0x25c641+_0x5054b4(0x24d)+_0x391faf[_0x5054b4(0x1f8)]:_0x371bd9=_0x448e1b+';\x20retry\x20the\x20same\x20order\x20with:\x20'+be(_0x391faf,_0x2e0cf5),Object['assign'](new Error(_0x52607d[_0x5054b4(0x210)]+'\x0a'+_0x371bd9,{'cause':_0x52607d}),{'code':_0x52607d['code']??(_0x52607d['status']===0x19a&&!_0x4621b9?'quote_expired':void 0x0),'status':_0x52607d[_0x5054b4(0x230)],'data':_0x52607d[_0x5054b4(0x291)],'headers':_0x52607d[_0x5054b4(0x207)],'funding':_0x52607d[_0x5054b4(0x1eb)],'transaction':_0x52607d[_0x5054b4(0x1bd)]});}function k(_0x5e6fcb,_0x2200fc){const _0x29d172=_0x159d74;_0x5e6fcb[_0x29d172(0x1c9)]=_0x2200fc[_0x29d172(0x230)],_0x5e6fcb[_0x29d172(0x1d8)]=_0x2200fc[_0x29d172(0x1d8)]??null;const _0xfd8feb=_0x2200fc[_0x29d172(0x1d8)]?.['result'];_0xfd8feb&&(_0x5e6fcb['jobId']=_0xfd8feb[_0x29d172(0x202)]??null,_0x5e6fcb[_0x29d172(0x270)]=_0xfd8feb[_0x29d172(0x270)]??null,_0x5e6fcb[_0x29d172(0x264)]=_0xfd8feb[_0x29d172(0x264)]??null),_0x2200fc[_0x29d172(0x203)]&&(_0x5e6fcb[_0x29d172(0x20e)]=_0x2200fc[_0x29d172(0x203)][_0x29d172(0x230)],_0x5e6fcb['transactionHash']=_0x2200fc[_0x29d172(0x203)][_0x29d172(0x1d9)]??_0x5e6fcb[_0x29d172(0x253)]?.[_0x29d172(0x1d4)]??_0x5e6fcb[_0x29d172(0x253)]?.['hash']??null),_0x2200fc[_0x29d172(0x230)]===_0x29d172(0x24e)?(delete _0x5e6fcb[_0x29d172(0x273)],delete _0x5e6fcb['recoveryStatus'],_0x5e6fcb['lastError']=null,_0xfd8feb?.[_0x29d172(0x23a)]===_0x29d172(0x231)?(_0x5e6fcb['status']='refused',_0x5e6fcb[_0x29d172(0x1f6)]=_0xfd8feb[_0x29d172(0x283)]??[]):(_0x5e6fcb[_0x29d172(0x230)]=_0x29d172(0x24e),_0x5e6fcb[_0x29d172(0x1f6)]=null)):_0x2200fc[_0x29d172(0x230)]===_0x29d172(0x208)?_0x5e6fcb[_0x29d172(0x230)]=_0x29d172(0x208):_0x2200fc[_0x29d172(0x230)]===_0x29d172(0x1c0)&&(_0x5e6fcb[_0x29d172(0x230)]=_0x29d172(0x1c0));}async function H(_0x147214,_0x4c135f,_0x53990e){const _0x5738b2=_0x159d74,_0x36b0eb=await _0x141421(_0x147214,'/requests/'+_0x53990e,{'token':_0x4c135f});if(!_0x36b0eb['data']?.[_0x5738b2(0x230)])throw new Error(_0x5738b2(0x24b));return _0x36b0eb[_0x5738b2(0x291)];}async function Ge(_0x3dc2a9){const _0x36056c=_0x159d74,{home:_0x32e35e,id:_0x9f8505}=_0x3dc2a9,_0x2da584=await _0xb25b43(_0x32e35e,_0x9f8505);if(!_0x2da584[_0x36056c(0x1f8)])throw new Error(_0x36056c(0x1c8)+_0x2da584['requestKey']+_0x36056c(0x1ee));const _0x49d01f=await H(_0x2da584[_0x36056c(0x28f)],_0x2da584[_0x36056c(0x268)],_0x2da584['orderId']);return k(_0x2da584,_0x49d01f),_0x2da584['lastError']=null,await _0x32b846(_0x32e35e,_0x2da584),_0x2da584;}async function Se(_0x1ba1bb,_0x3533e2,_0x50dc60,_0x2f1c42={}){const _0x3d1a53=_0x159d74,_0x5c69be=_0x2f1c42[_0x3d1a53(0x213)]??0x2bf20,_0x40ff9e=_0x2f1c42[_0x3d1a53(0x2a4)]??0x7d0,_0x33a3cc=Date['now']()+_0x5c69be;for(;;){const _0x24dea7=(await _0x141421(_0x1ba1bb,_0x3d1a53(0x20f)+_0x50dc60,{'token':_0x3533e2,'signal':_0x2f1c42['signal']}))[_0x3d1a53(0x291)];if(!_0x24dea7?.['status'])throw new Error(_0x3d1a53(0x24b));if(_0x24dea7[_0x3d1a53(0x230)]===_0x3d1a53(0x24e)||_0x24dea7['status']==='payment_failed'||_0x24dea7[_0x3d1a53(0x230)]==='expired')return _0x24dea7;if(Date[_0x3d1a53(0x1e0)]()>=_0x33a3cc)throw new Error('timed\x20out\x20waiting\x20for\x20order\x20'+_0x50dc60+_0x3d1a53(0x218)+_0x24dea7[_0x3d1a53(0x230)]);await _0x535622(_0x40ff9e,void 0x0,{'signal':_0x2f1c42[_0x3d1a53(0x21c)]});}}async function ke(_0x195c85,_0x88f778,_0x192edd,_0x4bd9d8,_0x1cf42f){const _0x66fc66=_0x159d74;_0x192edd[_0x66fc66(0x245)]=new Date()[_0x66fc66(0x214)](),_0x192edd[_0x66fc66(0x230)]=_0x66fc66(0x29c),await _0x32b846(_0x4bd9d8,_0x192edd);const _0x259d9b=await _0x141421(_0x195c85,'/requests/'+_0x192edd[_0x66fc66(0x1f8)]+_0x66fc66(0x28b),{'method':'POST','token':_0x88f778,'headers':{'PAYMENT-SIGNATURE':_0x192edd[_0x66fc66(0x241)]},'body':{'quoteSignature':_0x192edd[_0x66fc66(0x226)]},'allowStatuses':[0x192],'signal':_0x1cf42f});if(_0x259d9b[_0x66fc66(0x230)]===0x192){const _0x2b16bb=_0x259d9b[_0x66fc66(0x291)]?.[_0x66fc66(0x27a)]??_0x259d9b[_0x66fc66(0x291)]?.[_0x66fc66(0x235)]??'payment\x20rejected',_0x59d493=new Error('payment\x20rejected:\x20'+_0x2b16bb);throw _0x59d493[_0x66fc66(0x230)]=0x192,_0x59d493[_0x66fc66(0x291)]=_0x259d9b['data'],_0x59d493;}return _0x259d9b[_0x66fc66(0x291)];}async function xe(_0x327ca0,_0x2d258c,_0x5108ac,_0x10786c){const _0x5d3d7e=_0x159d74;if(_0x327ca0[_0x5d3d7e(0x230)]!==0x19a&&_0x327ca0[_0x5d3d7e(0x224)]!==_0x5d3d7e(0x26c)||!_0x5108ac[_0x5d3d7e(0x241)]||!_0x5108ac['quoteSignature']||!_0x5108ac[_0x5d3d7e(0x1f8)])return null;try{const _0x259953=await H(_0x2d258c,_0x5108ac[_0x5d3d7e(0x268)],_0x5108ac[_0x5d3d7e(0x1f8)]);if(k(_0x5108ac,_0x259953),_0x5108ac[_0x5d3d7e(0x20d)]=null,await _0x32b846(_0x10786c,_0x5108ac),_0x5108ac[_0x5d3d7e(0x230)]===_0x5d3d7e(0x24e)||_0x5108ac[_0x5d3d7e(0x230)]===_0x5d3d7e(0x231)||_0x5108ac[_0x5d3d7e(0x230)]==='payment_failed'||_0x5108ac[_0x5d3d7e(0x230)]===_0x5d3d7e(0x1c0))return!0x0;}catch(_0x14c3c8){_0x327ca0[_0x5d3d7e(0x210)]+=_0x5d3d7e(0x259)+_0x14c3c8[_0x5d3d7e(0x210)];}return null;}async function Ie(_0xabad5b){const _0x44e918=_0x159d74;let _0xab4215=_0xabad5b[_0x44e918(0x296)];const _0x139e64=async _0xaf2ca2=>{const _0x17341c=_0x44e918;_0xab4215=_0xaf2ca2[_0x17341c(0x296)],await _0xabad5b[_0x17341c(0x255)]?.(_0xaf2ca2);};for(let _0x5d901e=0x0;;_0x5d901e++){try{const _0x5465fb=await Ee({..._0xabad5b,'requestKey':_0xab4215,'onSaved':_0x139e64});if(![_0x44e918(0x1c0),_0x44e918(0x208)][_0x44e918(0x254)](_0x5465fb[_0x44e918(0x230)])||_0x5d901e>=0x2)return _0x5465fb;}catch(_0x260335){if(_0x5d901e>=0x2||![_0x44e918(0x26c),_0x44e918(0x1e5)][_0x44e918(0x254)](_0x260335[_0x44e918(0x224)]))throw _0x260335;}_0xabad5b[_0x44e918(0x27f)]?.({'phase':_0x44e918(0x232),'message':_0x44e918(0x2a1)});}}async function Ee(_0xbb8d1e){const _0x2a5bf9=_0x159d74;_0xbb8d1e={..._0xbb8d1e,'expectedWallet':_0xbb8d1e[_0x2a5bf9(0x27b)]??_0x13d967(_0xbb8d1e)[_0x2a5bf9(0x280)]};const {api:_0x4f4c53,home:_0x48b951,file:_0x91fae4,requestKey:_0x4224c7}=_0xbb8d1e,_0x188ac4=_0x4224c7?await _0x347102(_0x48b951,_0x4224c7):null,_0x141020=_0x205f91(_0xbb8d1e[_0x2a5bf9(0x24c)]??_0x188ac4?.[_0x2a5bf9(0x24c)]),_0x112ca7=_0xbb8d1e[_0x2a5bf9(0x23f)]??_0x188ac4?.[_0x2a5bf9(0x23f)]??_0x741e48(_0xbb8d1e)['key'];_0x17a353(_0x112ca7,_0x141020);const _0x6ec779=_0xbb8d1e[_0x2a5bf9(0x1f5)]??_0x2a5bf9(0x27d);if(_0x6ec779!==_0x2a5bf9(0x27d)&&_0x6ec779!==_0x2a5bf9(0x1e4))throw new Error(_0x2a5bf9(0x1be)+_0x6ec779);const _0x3ffdc1=_0xbb8d1e[_0x2a5bf9(0x1fd)]??await de(_0x91fae4);if(!_0x3ffdc1||typeof _0x3ffdc1!=_0x2a5bf9(0x239)||Array[_0x2a5bf9(0x242)](_0x3ffdc1))throw new Error(_0x2a5bf9(0x219));const _0xcd9792=ce(_0x3ffdc1);let _0x3578db=_0x188ac4;if(_0x3578db){if(_0x339375(_0x3578db),_0x3578db[_0x2a5bf9(0x28f)]!==_0x4f4c53)throw new Error('order\x20'+_0x3578db[_0x2a5bf9(0x296)]+'\x20belongs\x20to\x20'+_0x3578db[_0x2a5bf9(0x28f)]+_0x2a5bf9(0x20c)+_0x3578db[_0x2a5bf9(0x28f)]);if(_0x3578db[_0x2a5bf9(0x1f5)]!==_0x6ec779)throw new Error(_0x2a5bf9(0x220)+_0x3578db[_0x2a5bf9(0x296)]+_0x2a5bf9(0x24a)+_0x3578db[_0x2a5bf9(0x1f5)]+_0x2a5bf9(0x25f)+_0x6ec779);if(_0x3578db[_0x2a5bf9(0x2a5)]!==_0xcd9792)throw new Error('request\x20key\x20'+_0x3578db[_0x2a5bf9(0x296)]+_0x2a5bf9(0x1d5));const _0x2fc9ed=_0x112ca7!==(_0x3578db[_0x2a5bf9(0x23f)]??_0x2a5bf9(0x1df));if(_0x2fc9ed||_0x141020!==(_0x3578db['payWith']??'IMD')){if(!_0x188fc7(_0x3578db)['canCancel'])throw new Error(_0x2fc9ed?_0x2a5bf9(0x27e):'Resume\x20this\x20order\x20with\x20its\x20original\x20payment\x20coin.');_0x3578db[_0x2a5bf9(0x23f)]=_0x112ca7,_0x3578db[_0x2a5bf9(0x24c)]=_0x141020;for(const _0x4785ff of['funding',_0x2a5bf9(0x293),_0x2a5bf9(0x263)])delete _0x3578db[_0x4785ff];await _0x32b846(_0x48b951,_0x3578db);}}else _0x3578db={'version':0x1,'requestKey':_0x4224c7??_0xa1fb4d(),'requestToken':_0x1ac927(0x20)[_0x2a5bf9(0x250)](_0x2a5bf9(0x298)),'api':_0x4f4c53,'action':_0x6ec779,'input':_0x3ffdc1,'inputHash':_0xcd9792,'submissionInput':_0xee41f4(_0x3ffdc1),..._0xbb8d1e[_0x2a5bf9(0x22d)]?{'plan':_0xbb8d1e[_0x2a5bf9(0x22d)]}:{},'createdAt':new Date()[_0x2a5bf9(0x214)](),'updatedAt':new Date()[_0x2a5bf9(0x214)](),'status':'created','paymentChain':_0x112ca7,'payWith':_0x141020},await _0x32b846(_0x48b951,_0x3578db);if(await _0xbb8d1e[_0x2a5bf9(0x255)]?.(_0x3578db),_0x3578db[_0x2a5bf9(0x230)]===_0x2a5bf9(0x24e))return{'state':_0x3578db,'status':'admitted'};if(_0x3578db['status']==='refused')return{'state':_0x3578db,'status':_0x3578db['status']};try{let _0x1414f4=_0x3578db[_0x2a5bf9(0x253)]||_0x3578db[_0x2a5bf9(0x241)]||_0x3578db[_0x2a5bf9(0x226)];if(_0x1414f4&&(Number(_0x3578db[_0x2a5bf9(0x1e3)][_0x2a5bf9(0x1ca)])*0x3e8<=Date[_0x2a5bf9(0x1e0)]()||['expired','payment_failed']['includes'](_0x3578db[_0x2a5bf9(0x230)]))){if(_0xbb8d1e[_0x2a5bf9(0x27f)]?.({'phase':_0x2a5bf9(0x232),'message':'Checking\x20the\x20original\x20payment\x20before\x20continuing...'}),k(_0x3578db,await H(_0x4f4c53,_0x3578db['requestToken'],_0x3578db[_0x2a5bf9(0x1f8)])),await _0x32b846(_0x48b951,_0x3578db),_0x3578db[_0x2a5bf9(0x230)]===_0x2a5bf9(0x24e)||_0x3578db[_0x2a5bf9(0x230)]===_0x2a5bf9(0x231))return{'state':_0x3578db,'status':_0x3578db[_0x2a5bf9(0x230)]};if(await _0x43d1bc(_0x3578db,_0xbb8d1e)){if(_0x3578db[_0x2a5bf9(0x253)]){const _0x31e057=await _0x1f93f7(_0xbb8d1e,_0x3578db[_0x2a5bf9(0x253)]['chainId']);await _0xc67fcf(_0x31e057,_0x3578db[_0x2a5bf9(0x253)])||_0xed989b(_0x3578db,_0x3578db[_0x2a5bf9(0x253)]);}_0x3578db[_0x2a5bf9(0x228)]=[..._0x3578db[_0x2a5bf9(0x228)]??[],{'orderId':_0x3578db[_0x2a5bf9(0x1f8)],'quote':_0x3578db[_0x2a5bf9(0x1e3)],'onchainQuotes':_0x3578db['onchainQuotes'],'payment':_0x3578db[_0x2a5bf9(0x203)],'paymentHeader':_0x3578db[_0x2a5bf9(0x241)],'quoteSignature':_0x3578db[_0x2a5bf9(0x226)],'onchainPayment':_0x3578db['onchainPayment'],'transactionHash':_0x3578db[_0x2a5bf9(0x1d9)],'submittedAt':_0x3578db[_0x2a5bf9(0x245)],'unpaid':!0x0}];for(const _0x395db5 of[_0x2a5bf9(0x203),_0x2a5bf9(0x241),'paymentHash',_0x2a5bf9(0x226),'onchainPayment',_0x2a5bf9(0x1d9),'submittedAt',_0x2a5bf9(0x20e)])delete _0x3578db[_0x395db5];_0x1414f4=!0x1,delete _0x3578db[_0x2a5bf9(0x273)],await _0x32b846(_0x48b951,_0x3578db);}else throw Object[_0x2a5bf9(0x212)](new Error(_0x2a5bf9(0x1bc)),{'code':_0x2a5bf9(0x276)});}if(!_0x1414f4&&_0x3578db['orderId']&&([_0x2a5bf9(0x1c0),'payment_failed'][_0x2a5bf9(0x254)](_0x3578db[_0x2a5bf9(0x230)])||Number(_0x3578db[_0x2a5bf9(0x1e3)][_0x2a5bf9(0x1ca)])*0x3e8<=Date[_0x2a5bf9(0x1e0)]()+0x7530)){_0x3578db[_0x2a5bf9(0x290)]=[..._0x3578db[_0x2a5bf9(0x290)]??[],{'orderId':_0x3578db[_0x2a5bf9(0x1f8)],'requestKey':_0x3578db[_0x2a5bf9(0x1d6)]??_0x3578db[_0x2a5bf9(0x296)],'quote':_0x3578db[_0x2a5bf9(0x1e3)],'onchainQuotes':_0x3578db[_0x2a5bf9(0x251)],'status':_0x3578db[_0x2a5bf9(0x230)]}],_0x3578db[_0x2a5bf9(0x1d6)]=_0xa1fb4d();for(const _0x45cccc of[_0x2a5bf9(0x1f8),_0x2a5bf9(0x21b),_0x2a5bf9(0x1e3),_0x2a5bf9(0x251),_0x2a5bf9(0x1e7),_0x2a5bf9(0x1c9),_0x2a5bf9(0x20e),_0x2a5bf9(0x293)])delete _0x3578db[_0x45cccc];_0x3578db[_0x2a5bf9(0x230)]=_0x2a5bf9(0x246),_0x3578db[_0x2a5bf9(0x20d)]=null,await _0x32b846(_0x48b951,_0x3578db);}if(!_0x3578db[_0x2a5bf9(0x1f8)]){_0xbb8d1e[_0x2a5bf9(0x27f)]?.({'phase':_0x2a5bf9(0x1e3),'message':_0x2a5bf9(0x27c)});const _0xc46838=_0x3578db[_0x2a5bf9(0x265)]??_0x3578db[_0x2a5bf9(0x1fd)],_0x2512d4=await me(_0x4f4c53,_0xc46838,_0x6ec779,_0xbb8d1e[_0x2a5bf9(0x21c)]);if(_0x3578db['check']=_0x2512d4,_0xbb8d1e['onCheck']&&await _0xbb8d1e[_0x2a5bf9(0x285)](_0x2512d4),_0x2512d4[_0x2a5bf9(0x23b)][_0x2a5bf9(0x1d0)]>0x0)return _0x3578db[_0x2a5bf9(0x230)]=_0x2a5bf9(0x26b),_0x3578db[_0x2a5bf9(0x20d)]=null,await _0x32b846(_0x48b951,_0x3578db),{'state':_0x3578db,'status':_0x2a5bf9(0x26b),'check':_0x2512d4};if(_0x6ec779==='job.continue'){const _0x47a66a=await _0x43d4f3(_0xbb8d1e);_0x3578db[_0x2a5bf9(0x26d)]=await P({'api':_0x4f4c53,'input':_0x3ffdc1,'check':_0x2512d4,'account':_0x47a66a,'owner':_0x3578db[_0x2a5bf9(0x26d)]});}let _0x169887;try{_0x169887=await T(_0x4f4c53,_0x3578db['requestToken'],_0x3578db[_0x2a5bf9(0x1d6)]??_0x3578db[_0x2a5bf9(0x296)],_0xc46838,_0x6ec779,_0xbb8d1e[_0x2a5bf9(0x21c)]);}catch(_0x103811){if(_0x103811['status']!==0x19a)throw _0x103811;_0x3578db[_0x2a5bf9(0x1d6)]=_0xa1fb4d(),await _0x32b846(_0x48b951,_0x3578db),_0x169887=await T(_0x4f4c53,_0x3578db[_0x2a5bf9(0x268)],_0x3578db[_0x2a5bf9(0x1d6)],_0xc46838,_0x6ec779,_0xbb8d1e[_0x2a5bf9(0x21c)]);}_0x3578db['orderId']=_0x169887['id'],_0x3578db[_0x2a5bf9(0x21b)]=_0x169887[_0x2a5bf9(0x230)],_0x3578db[_0x2a5bf9(0x1e3)]=_0x169887['quote'],_0x3578db[_0x2a5bf9(0x251)]=_0x169887[_0x2a5bf9(0x25b)],_0x3578db[_0x2a5bf9(0x230)]=_0x2a5bf9(0x248),_0x3578db[_0x2a5bf9(0x20d)]=null,await _0x32b846(_0x48b951,_0x3578db);}if(_0x2e1fc7(_0x4ccfa2(_0x3578db)),!_0x3578db[_0x2a5bf9(0x253)]&&(!_0x3578db[_0x2a5bf9(0x241)]||!_0x3578db[_0x2a5bf9(0x226)])){if(_0x3578db[_0x2a5bf9(0x1e7)])C(_0x3578db['challenge'],_0x3578db);else{const _0x28ad6d=await le(_0x4f4c53,_0x3578db[_0x2a5bf9(0x268)],_0x3578db['orderId'],_0xbb8d1e[_0x2a5bf9(0x21c)]);C(_0x28ad6d,_0x3578db),_0x3578db[_0x2a5bf9(0x1e7)]=_0x28ad6d,_0x3578db[_0x2a5bf9(0x230)]=_0x2a5bf9(0x204),await _0x32b846(_0x48b951,_0x3578db);}let _0x16cbc0;if(_0x6ec779===_0x2a5bf9(0x1e4)&&(_0x16cbc0=await _0x43d4f3(_0xbb8d1e),_0x3578db[_0x2a5bf9(0x26d)]=await P({'api':_0x4f4c53,'input':_0x3ffdc1,'check':_0x3578db['check'],'account':_0x16cbc0,'owner':_0x3578db['owner']}),await _0x32b846(_0x48b951,_0x3578db)),await _0x3ce937(_0x3578db,_0xbb8d1e),_0xbb8d1e['signal']?.[_0x2a5bf9(0x282)](),_0x339375(await _0xb25b43(_0x48b951,_0x3578db[_0x2a5bf9(0x296)])),await _0x32b846(_0x48b951,_0x3578db),await _0x3dc9d5(_0x3578db,_0xbb8d1e,_0x629c1a=>qe(_0x629c1a,_0xbb8d1e)),_0x3578db[_0x2a5bf9(0x23f)]===_0x2a5bf9(0x1bf))await _0x3a46fa(_0x3578db,_0xbb8d1e);else{_0xbb8d1e[_0x2a5bf9(0x27f)]?.({'phase':_0x2a5bf9(0x21d),'message':_0x2a5bf9(0x22e)}),_0xbb8d1e['signal']?.[_0x2a5bf9(0x282)](),_0x339375(await _0xb25b43(_0x48b951,_0x3578db[_0x2a5bf9(0x296)])),_0x16cbc0=await _0x43d4f3(_0xbb8d1e),_0xbb8d1e['signal']?.['throwIfAborted'](),_0x339375(await _0xb25b43(_0x48b951,_0x3578db['requestKey'])),_0x3578db[_0x2a5bf9(0x260)]=_0x16cbc0['address'],await _0x32b846(_0x48b951,_0x3578db);const _0x16f1fb=await he(_0x16cbc0,_0x3578db[_0x2a5bf9(0x1e7)]),_0x1de306=await we(_0x16cbc0,_0x3578db['challenge'],_0x16f1fb[_0x2a5bf9(0x277)]);_0x3578db[_0x2a5bf9(0x203)]=_0x16f1fb[_0x2a5bf9(0x203)],_0x3578db[_0x2a5bf9(0x241)]=_0x16f1fb[_0x2a5bf9(0x241)],_0x3578db['paymentHash']=_0x16f1fb[_0x2a5bf9(0x277)],_0x3578db['quoteSignature']=_0x1de306,_0x3578db[_0x2a5bf9(0x230)]=_0x2a5bf9(0x1b9),_0x3578db[_0x2a5bf9(0x20d)]=null,await _0x32b846(_0x48b951,_0x3578db);}}_0x3578db[_0x2a5bf9(0x253)]?await _0x1947ba(_0x3578db,_0xbb8d1e):(_0xbb8d1e[_0x2a5bf9(0x27f)]?.({'phase':'broadcasting','message':_0x2a5bf9(0x278)}),await ke(_0x4f4c53,_0x3578db[_0x2a5bf9(0x268)],_0x3578db,_0x48b951,_0xbb8d1e[_0x2a5bf9(0x21c)])),_0xbb8d1e[_0x2a5bf9(0x27f)]?.({'phase':'admission','message':'Payment\x20submitted.\x20Waiting\x20for\x20IMD\x20to\x20accept\x20the\x20task...'});const _0x2a21ce=await Se(_0x4f4c53,_0x3578db[_0x2a5bf9(0x268)],_0x3578db[_0x2a5bf9(0x1f8)],_0xbb8d1e);return k(_0x3578db,_0x2a21ce),delete _0x3578db[_0x2a5bf9(0x262)],await _0x32b846(_0x48b951,_0x3578db),{'state':_0x3578db,'status':_0x3578db[_0x2a5bf9(0x230)]};}catch(_0x9865db){if(['order_cancelled',_0x2a5bf9(0x1d1),_0x2a5bf9(0x1f1)]['includes'](_0x9865db[_0x2a5bf9(0x224)]))throw _0x9865db;if(_0x339375(await _0xb25b43(_0x48b951,_0x3578db[_0x2a5bf9(0x296)])),await xe(_0x9865db,_0x4f4c53,_0x3578db,_0x48b951))return{'state':_0x3578db,'status':_0x3578db['status']};throw _0x3578db['lastError']=_0x9865db[_0x2a5bf9(0x210)],[_0x2a5bf9(0x1ce),_0x2a5bf9(0x276)][_0x2a5bf9(0x254)](_0x9865db[_0x2a5bf9(0x224)])&&(_0x3578db[_0x2a5bf9(0x262)]=_0x9865db[_0x2a5bf9(0x224)]),_0x9865db[_0x2a5bf9(0x1bd)]&&(_0x3578db['pendingTransaction']=_0x9865db[_0x2a5bf9(0x1bd)]),_0x9865db['status']===0x192&&(_0x3578db[_0x2a5bf9(0x230)]=_0x2a5bf9(0x1b9)),await _0x32b846(_0x48b951,_0x3578db),_0x9865db[_0x2a5bf9(0x224)]===_0x2a5bf9(0x247)?_0x9865db:$e(_0x9865db,_0x3578db,{'file':_0x91fae4,'home':_0x48b951,'api':_0x4f4c53,'retryCommand':_0xbb8d1e[_0x2a5bf9(0x1f2)]});}}async function Le(_0x1813fe){const _0x3014ab=_0x159d74,{home:_0x523ea4,id:_0x2b2ac7}=_0x1813fe,_0xc6da8a=await _0xb25b43(_0x523ea4,_0x2b2ac7);if(_0x339375(_0xc6da8a),_0xc6da8a[_0x3014ab(0x230)]===_0x3014ab(0x24e)||_0xc6da8a[_0x3014ab(0x230)]==='refused')return _0xc6da8a;if(_0xc6da8a[_0x3014ab(0x28f)]!==_0x1813fe[_0x3014ab(0x28f)])throw new Error(_0x3014ab(0x1c8)+_0xc6da8a[_0x3014ab(0x296)]+_0x3014ab(0x1cd)+_0xc6da8a[_0x3014ab(0x28f)]+_0x3014ab(0x20c)+_0xc6da8a['api']);return(await Ie({..._0x1813fe,'requestKey':_0xc6da8a['requestKey'],'input':_0xc6da8a[_0x3014ab(0x1fd)],'action':_0xc6da8a[_0x3014ab(0x1f5)],'paymentChain':_0xc6da8a[_0x3014ab(0x23f)]??'ethereum','payWith':_0xc6da8a[_0x3014ab(0x24c)]}))[_0x3014ab(0x256)];}export{k as applyOrderStatus,P as assertContinueOwner,he as buildPayment,S as canonicalJson,me as checkJob,H as fetchOrderStatus,ce as hashJson,ge as paymentSummary,Se as pollOrder,Ie as publishJob,fe as quoteApprovalTypedData,T as quoteJob,de as readJobFile,Ge as refreshOrder,we as signQuoteApproval,Le as submitOrder};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o='(Submitted\x20via\x20Supercolony)';function i(_0x4ae194){const _0x31aba3=_0x1012;if(typeof _0x4ae194[_0x31aba3(0x11f)]!=_0x31aba3(0x11e)||!_0x4ae194[_0x31aba3(0x11f)]['trim']())return _0x4ae194;const _0x28e3b1=_0x4ae194[_0x31aba3(0x11f)]['trimEnd']();return _0x28e3b1===o||_0x28e3b1['endsWith']('\x0a'+o)?_0x4ae194:{..._0x4ae194,'objective':_0x28e3b1+'\x0a\x0a'+o};}export{o as SUBMISSION_ATTRIBUTION,i as withSubmissionAttribution};function _0x1012(_0x32ecb8,_0x10c230){_0x32ecb8=_0x32ecb8-0x11e;const _0x101298=_0x10c2();let _0xf15e39=_0x101298[_0x32ecb8];return _0xf15e39;}function _0x10c2(){const _0x902b6a=['string','objective'];_0x10c2=function(){return _0x902b6a;};return _0x10c2();}
|
package/dist/lib/support.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createInterface as
|
|
1
|
+
import{createInterface as _0x1d3a48}from'node:readline/promises';import{formatUnits as _0x502e50}from'viem';import{orderPayment as _0x400d67}from'./payments.mjs';import{SUPPORT_RECIPIENT as _0x2ffdff}from'./support-recipient.mjs';function _0x25ec(){const _0x4d00ba=['funding','yes','confirm','chooseSupport','stdin','\x20·\x20Adds\x2010%\x20optional\x20support\x20·\x20Help\x20us\x20make\x20Colony\x20better.','isTTY','stderr','question','signal','Choose\x20payment:\x0a1.\x20','\x20·\x20Original\x20price','close','rawTransaction','steps','amount','some','decimals','recipient','\x20IMD','Payment\x20selection\x20cancelled.','\x0a2.\x20','support'];_0x25ec=function(){return _0x4d00ba;};return _0x25ec();}function m(_0x2021dc){const _0x15651b=_0x211c,_0x27b3b7=_0x400d67(_0x2021dc),_0x290330=BigInt(_0x27b3b7[_0x15651b(0x200)]),_0x435049=_0x290330/0xan,_0x456bae=_0x2af9e9=>_0x502e50(_0x2af9e9,_0x27b3b7[_0x15651b(0x202)])+_0x15651b(0x204);return[{'label':_0x456bae(_0x290330+_0x435049)+_0x15651b(0x1f6),'amount':String(_0x435049),'recipient':_0x2ffdff},{'label':_0x456bae(_0x290330)+_0x15651b(0x1fc),'amount':'0','recipient':_0x2ffdff}];}function _0x211c(_0x312be6,_0x25ecea){_0x312be6=_0x312be6-0x1f1;const _0x211ca1=_0x25ec();let _0x2d044b=_0x211ca1[_0x312be6];return _0x2d044b;}const I=0x0;async function w(_0xaf4448,_0x1e2fb5){const _0xb5fffc=_0x211c;if(_0xaf4448[_0xb5fffc(0x1f1)]?.[_0xb5fffc(0x1ff)][_0xb5fffc(0x201)](_0x126a2f=>_0x126a2f[_0xb5fffc(0x1fe)]))return;const _0x42bfbd=m(_0xaf4448);let _0x1815d3=0x1;if(_0x1e2fb5[_0xb5fffc(0x1f4)])_0x1815d3=await _0x1e2fb5['chooseSupport'](_0x42bfbd);else{if(process[_0xb5fffc(0x1f5)][_0xb5fffc(0x1f7)]&&!_0x1e2fb5[_0xb5fffc(0x1f2)]&&!_0x1e2fb5[_0xb5fffc(0x1f3)]){const _0x211f41=_0x1d3a48({'input':process[_0xb5fffc(0x1f5)],'output':process[_0xb5fffc(0x1f8)]});try{const _0x2e2ca1=await _0x211f41[_0xb5fffc(0x1f9)](_0xb5fffc(0x1fb)+_0x42bfbd[0x0]['label']+_0xb5fffc(0x206)+_0x42bfbd[0x1]['label']+'\x0aChoice\x20[1]:\x20',{'signal':_0x1e2fb5[_0xb5fffc(0x1fa)]});if(!['','1','2']['includes'](_0x2e2ca1['trim']()))throw new Error(_0xb5fffc(0x205));_0x1815d3=_0x2e2ca1['trim']()==='2'?0x1:0x0;}finally{_0x211f41[_0xb5fffc(0x1fd)]();}}}if(_0x1815d3!==0x0&&_0x1815d3!==0x1)throw new Error(_0xb5fffc(0x205));const {amount:_0x57b3dd,recipient:_0x31d251}=_0x42bfbd[_0x1815d3];_0xaf4448['support']={'amount':_0x57b3dd,'recipient':_0x31d251};}function h(_0x4ac729){const _0xbb00a1=_0x211c;if(!_0x4ac729[_0xbb00a1(0x207)]||BigInt(_0x4ac729[_0xbb00a1(0x207)][_0xbb00a1(0x200)])===0x0n)return null;const _0xef9fe1=_0x400d67(_0x4ac729);return{'amount':_0x502e50(BigInt(_0x4ac729[_0xbb00a1(0x207)][_0xbb00a1(0x200)]),_0xef9fe1[_0xbb00a1(0x202)]),'total':_0x502e50(BigInt(_0xef9fe1['amount'])+BigInt(_0x4ac729[_0xbb00a1(0x207)][_0xbb00a1(0x200)]),_0xef9fe1[_0xbb00a1(0x202)]),'recipient':_0x4ac729['support'][_0xbb00a1(0x203)]};}export{I as DEFAULT_SUPPORT_CHOICE,w as selectSupport,m as supportChoices,h as supportView};
|
package/dist/lib/task-wallet.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{choosePayment as _0x2c34d3}from'./payment-options.mjs';function _0x4cd9(_0x4d099e,_0x1c05be){_0x4d099e=_0x4d099e-0x17a;var _0x4cd95f=_0x1c05();var _0x12a889=_0x4cd95f[_0x4d099e];return _0x12a889;}async function n(_0x495378){var _0x2df30d=_0x4cd9;return _0x2c34d3({..._0x495378,'action':_0x495378[_0x2df30d(0x17a)]??'job.open'});}export{n as checkTaskWallet};function _0x1c05(){var _0x4de6e9=['action'];_0x1c05=function(){return _0x4de6e9;};return _0x1c05();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _0x5c5f71 from'qrcode';import{writeFile as _0x828a96}from'node:fs/promises';import{resolve as _0x41cf22}from'node:path';import{walletInfo as _0x266319}from'./local-wallet.mjs';function _0xaac6(_0x303190,_0x24eafe){_0x303190=_0x303190-0xd2;const _0xaac64a=_0x24ea();let _0x55b7f4=_0xaac64a[_0x303190];return _0x55b7f4;}import{PAYMENT_NETWORKS as _0x2bfbb4,paymentNetwork as _0x3f6c7f}from'./payment-networks.mjs';import{paymentCoins as _0x5390c7}from'./payment-coins.mjs';async function v(_0x5f5995,_0x3b6c19=_0x266319(_0x5f5995)){const _0x1ab85e=_0xaac6;if(!_0x3b6c19[_0x1ab85e(0xdf)])throw new Error('Create\x20or\x20import\x20a\x20wallet\x20first.');const _0x45e54c=(_0x5f5995['paymentChain']?[_0x3f6c7f(_0x5f5995[_0x1ab85e(0xd9)])]:_0x2bfbb4)[_0x1ab85e(0xe0)](_0x2c25b6=>({'network':_0x2c25b6[_0x1ab85e(0xda)],'chainName':_0x2c25b6['chain'][_0x1ab85e(0xdc)],'chainId':_0x2c25b6[_0x1ab85e(0xd5)]['id'],'coins':_0x5390c7(_0x2c25b6['key'])['map'](_0x3e993f=>_0x3e993f[_0x1ab85e(0xdd)])}));return{'address':_0x3b6c19[_0x1ab85e(0xd7)],..._0x45e54c['length']===0x1?_0x45e54c[0x0]:{},'networks':_0x45e54c};}function w(_0x51574f){const _0x3911cb=_0xaac6;return _0x5c5f71[_0x3911cb(0xd3)](_0x51574f,{'type':_0x3911cb(0xd2),'small':!0x0,'errorCorrectionLevel':'L'});}function C(_0x40112c){const _0x2e994d=_0xaac6,_0x2aa17b=[{'data':'0x','mode':_0x2e994d(0xde)},{'data':_0x40112c[_0x2e994d(0xd6)](0x2)[_0x2e994d(0xe3)](),'mode':'alphanumeric'}];return _0x5c5f71[_0x2e994d(0xd3)](_0x2aa17b,{'type':_0x2e994d(0xd8),'margin':0x4,'errorCorrectionLevel':'L'});}function _0x24ea(){const _0x46d00e=['terminal','toString','.svg','chain','slice','address','utf8','paymentChain','key','endsWith','name','symbol','byte','configured','map','Use\x20an\x20.svg\x20file\x20for\x20the\x20recharge\x20QR\x20code.','toLowerCase','toUpperCase'];_0x24ea=function(){return _0x46d00e;};return _0x24ea();}async function x(_0x259fd7,_0x368816){const _0x384588=_0xaac6,_0x445158=_0x41cf22(_0x368816);if(!_0x445158[_0x384588(0xe2)]()[_0x384588(0xdb)](_0x384588(0xd4)))throw new Error(_0x384588(0xe1));return await _0x828a96(_0x445158,await _0x5c5f71[_0x384588(0xd3)](_0x259fd7,{'type':'svg','margin':0x4,'errorCorrectionLevel':'L'}),{'flag':'wx'}),{'path':_0x445158};}export{w as receiveQr,C as receiveQrText,v as receiveWallet,x as saveReceiveQr};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{erc20Abi as
|
|
1
|
+
import{erc20Abi as _0xebb73c,formatUnits as _0x2fbdc1}from'viem';import{getPublicRpcClient as _0x296ad2}from'../shared.mjs';function _0x43e5(_0x104197,_0x3f1387){_0x104197=_0x104197-0x191;const _0x43e5c7=_0x3f13();let _0x763a12=_0x43e5c7[_0x104197];return _0x763a12;}function _0x3f13(){const _0x302f09=['message','every','job.open','join','name','address','chain','IMD','allowance','then','key','paymentChain','symbol','all','length','map','any','decimals','readContract','balance','error','Create\x20or\x20import\x20a\x20wallet\x20first.','signal','catch','configured','chainName','amount','timeout'];_0x3f13=function(){return _0x302f09;};return _0x3f13();}import{walletInfo as _0x2dd081}from'./local-wallet.mjs';import{PAYMENT_NETWORKS as _0x2d3736,paymentNetwork as _0x373c64}from'./payment-networks.mjs';import{loadPaymentConfig as _0x10e8dc}from'./payments.mjs';import{walletBalances as _0x72e72}from'./wallet-balances.mjs';async function P(_0x1bf164,_0x362ae8,_0x4a9086){const _0x4284b7=_0x43e5,_0x4501c0=_0x10e8dc(_0x1bf164['api'],_0x4284b7(0x193),_0x362ae8['key'],_0x1bf164),_0x369ca4=_0x296ad2(_0x1bf164,_0x362ae8[_0x4284b7(0x197)]['id']),[_0x3e8a55,_0x2aabd6,_0x2f4bd8]=await Promise['all']([_0x4501c0,_0x369ca4['then'](_0x7c979d=>_0x72e72(_0x7c979d,_0x362ae8['key'],_0x4a9086[_0x4284b7(0x196)])),Promise['all']([_0x4501c0,_0x369ca4])[_0x4284b7(0x19a)](([{payment:_0x56108f,spender:_0x4c7549},_0x9a2b12])=>_0x9a2b12[_0x4284b7(0x1a3)]({'address':_0x56108f['asset'],'abi':_0xebb73c,'functionName':_0x4284b7(0x199),'args':[_0x4a9086[_0x4284b7(0x196)],_0x4c7549]}))]),{payment:_0x4f1749,chainId:_0x2a4757,spender:_0x4ff8a6}=_0x3e8a55,_0xdc59f3=_0x2aabd6['find'](_0xa4b0ae=>_0xa4b0ae[_0x4284b7(0x19d)]===_0x4284b7(0x198));return{'paymentChain':_0x362ae8[_0x4284b7(0x19b)],'chainName':_0x362ae8[_0x4284b7(0x197)][_0x4284b7(0x195)],'chainId':_0x2a4757,'spender':_0x4ff8a6,'asset':_0x4f1749['asset'],'decimals':_0x4f1749['decimals'],'balance':_0xdc59f3[_0x4284b7(0x1a4)],'balanceAtomic':_0xdc59f3['amount'],'allowance':_0x2fbdc1(_0x2f4bd8,_0x4f1749[_0x4284b7(0x1a2)]),'allowanceAtomic':String(_0x2f4bd8),'price':_0x2fbdc1(BigInt(_0x4f1749[_0x4284b7(0x1ab)]),_0x4f1749[_0x4284b7(0x1a2)]),'priceAtomic':_0x4f1749[_0x4284b7(0x1ab)],'coins':_0x2aabd6};}async function x(_0x208ba4,_0x54895b=_0x2dd081(_0x208ba4)){const _0x2354f5=_0x43e5,_0x31ae33=AbortSignal[_0x2354f5(0x1ac)](0x3a98);if(_0x208ba4={..._0x208ba4,'signal':_0x208ba4['signal']?AbortSignal[_0x2354f5(0x1a1)]([_0x208ba4[_0x2354f5(0x1a7)],_0x31ae33]):_0x31ae33},!_0x54895b[_0x2354f5(0x1a9)])throw new Error(_0x2354f5(0x1a6));const _0x63599c=_0x208ba4[_0x2354f5(0x19c)]?[_0x373c64(_0x208ba4[_0x2354f5(0x19c)])]:_0x2d3736,_0x52799d=await Promise[_0x2354f5(0x19e)](_0x63599c[_0x2354f5(0x1a0)](_0x2386d1=>P(_0x208ba4,_0x2386d1,_0x54895b)[_0x2354f5(0x1a8)](_0xb546b5=>{const _0xa74c3e=_0x2354f5;if(_0x63599c[_0xa74c3e(0x19f)]===0x1)throw _0xb546b5;return{'paymentChain':_0x2386d1[_0xa74c3e(0x19b)],'chainName':_0x2386d1[_0xa74c3e(0x197)][_0xa74c3e(0x195)],'chainId':_0x2386d1['chain']['id'],'error':_0xb546b5[_0xa74c3e(0x191)]};})));if(_0x52799d[_0x2354f5(0x192)](_0x1d4efb=>_0x1d4efb['error']))throw new Error(_0x52799d[_0x2354f5(0x1a0)](_0xa3bbbe=>_0xa3bbbe[_0x2354f5(0x1aa)]+':\x20'+_0xa3bbbe[_0x2354f5(0x1a5)])[_0x2354f5(0x194)]('\x0a'));return{..._0x54895b,'networks':_0x52799d};}export{P as networkStatus,x as walletStatus};
|
package/dist/program.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x434444=_0x4a7b;import{writeDiagnostic as _0x37a79f}from'./lib/terminal-text.mjs';function _0x4a7b(_0x2216f7,_0x302b09){_0x2216f7=_0x2216f7-0x141;const _0x4a7b8d=_0x302b();let _0x328d99=_0x4a7b8d[_0x2216f7];return _0x328d99;}import{createRequire as _0x1881ee}from'node:module';import{homedir as _0x5359e6}from'node:os';import{join as _0x227dde}from'node:path';import{Command as _0x40d5b1}from'commander';import{registerTaskCommands as _0x2ec68b}from'./commands/task.mjs';import{registerOrderCommands as _0x56e8e6}from'./commands/order.mjs';import{registerWalletCommands as _0xdd9d58}from'./commands/wallet.mjs';function _0x302b(){const _0x497fb5=['option:','--payment-chain\x20<network>','json','optional\x20custom\x20RPC\x20URL\x20(payment\x20networks\x20have\x20built-in\x20public\x20nodes)','configureHelp','description','use\x20ASCII\x20borders\x20in\x20the\x20interactive\x20dashboard','action','user','skip\x20interactive\x20confirmation','commands','parent','exitCode','parseAsync','publish\x20and\x20browse\x20IMD\x20tasks,\x20and\x20operate\x20IMD\x20workers','.super-colony','--ascii','local\x20state\x20directory','environment\x20variable\x20holding\x20the\x20wallet\x20private\x20key','getOptionValue','option','--json','--api\x20<url>','hidden','outputHelp','function','version','--pay-with\x20<coin>','setOptionValueWithSource','command','../package.json','--rpc\x20<url>','enablePositionalOptions','colony','name','attributeName','createProgram\x20requires\x20registerWorkerCommands','open\x20the\x20interactive\x20task\x20and\x20worker\x20dashboard','isTTY','COLONY_PRIVATE_KEY','Choose\x20a\x20command\x20for\x20JSON\x20output:\x20colony\x20task\x20mine\x20--json','stdin','addOption','cli','options','filter'];_0x302b=function(){return _0x497fb5;};return _0x302b();}import{registerModelCommands as _0x3336ab}from'./commands/model.mjs';const b=_0x1881ee(import.meta.url),w=b(_0x434444(0x15f));function O(_0x4da9ba,{loadPlanner:_0x504d72,startUI:_0x2b00a0}={}){const _0x12b94e=_0x434444;if(typeof _0x4da9ba!=_0x12b94e(0x15a))throw new Error(_0x12b94e(0x165));const _0x3123fd=new _0x40d5b1();_0x3123fd[_0x12b94e(0x163)](_0x12b94e(0x162))[_0x12b94e(0x145)]({'showGlobalOptions':!0x0,'visibleGlobalOptions':_0x2a3a25=>!_0x2a3a25[_0x12b94e(0x14c)]||_0x2a3a25[_0x12b94e(0x14c)]===_0x3123fd?[]:_0x3123fd[_0x12b94e(0x16d)][_0x12b94e(0x16e)](_0x254f32=>!_0x254f32[_0x12b94e(0x158)]&&_0x254f32[_0x12b94e(0x163)]()!=='version')})[_0x12b94e(0x146)](_0x12b94e(0x14f))['enablePositionalOptions']()['version'](w[_0x12b94e(0x15b)])['option'](_0x12b94e(0x157),'IMD\x20API\x20base\x20URL',process.env.COLONY_API_URL??'https://api.imd.fun')[_0x12b94e(0x155)]('--home\x20<dir>',_0x12b94e(0x152),process.env.COLONY_HOME??_0x227dde(_0x5359e6(),_0x12b94e(0x150)))['option'](_0x12b94e(0x160),_0x12b94e(0x144),process.env.COLONY_RPC_URL)[_0x12b94e(0x155)](_0x12b94e(0x142),'only\x20pay\x20on\x20this\x20network:\x20ethereum\x20or\x20robinhood\x20(default:\x20chosen\x20automatically\x20from\x20your\x20balances)')[_0x12b94e(0x155)](_0x12b94e(0x15c),'only\x20pay\x20with\x20this\x20coin:\x20IMD,\x20ETH,\x20USDT,\x20USDC\x20or\x20USDG\x20(default:\x20chosen\x20automatically)')['option']('--key-env\x20<name>',_0x12b94e(0x153),_0x12b94e(0x168))[_0x12b94e(0x155)](_0x12b94e(0x156),'print\x20one\x20JSON\x20document\x20to\x20stdout',!0x1)[_0x12b94e(0x155)]('--yes',_0x12b94e(0x14a),!0x1),_0x3123fd[_0x12b94e(0x155)](_0x12b94e(0x151),_0x12b94e(0x147),!0x1);const _0x1fe1b7=_0x2b00a0??(async _0x41bfc1=>{const {startDashboard:_0x41cce8}=await import('./tui/index.mjs');await _0x41cce8(_0x41bfc1,{'loadPlanner':_0x504d72});});_0x3123fd[_0x12b94e(0x148)](async _0x935a35=>{const _0x3263f7=_0x12b94e;if(!process[_0x3263f7(0x16a)][_0x3263f7(0x167)]||!process['stdout']['isTTY']){if(_0x935a35[_0x3263f7(0x143)])throw new Error(_0x3263f7(0x169));_0x3123fd[_0x3263f7(0x159)]();return;}await _0x1fe1b7(_0x935a35);}),_0x3123fd[_0x12b94e(0x15e)]('ui')[_0x12b94e(0x146)](_0x12b94e(0x166))[_0x12b94e(0x148)](async(_0x84e3d1,_0x37dcf0)=>_0x1fe1b7(_0x37dcf0['optsWithGlobals']())),_0x2ec68b(_0x3123fd,{'loadPlanner':_0x504d72}),_0x56e8e6(_0x3123fd),_0xdd9d58(_0x3123fd),_0x3336ab(_0x3123fd),_0x4da9ba(_0x3123fd);for(const _0x242d2c of _0x3123fd[_0x12b94e(0x14b)]){_0x242d2c[_0x12b94e(0x161)](!0x1);for(const _0x54d99d of _0x3123fd['options'][_0x12b94e(0x16e)](_0x2ec964=>_0x2ec964['name']()!=='version'))_0x242d2c[_0x12b94e(0x16b)](_0x54d99d),_0x242d2c['on'](_0x12b94e(0x141)+_0x54d99d[_0x12b94e(0x163)](),()=>{const _0x3b7735=_0x12b94e,_0xa3f316=_0x54d99d[_0x3b7735(0x164)]();_0x3123fd[_0x3b7735(0x15d)](_0xa3f316,_0x242d2c[_0x3b7735(0x154)](_0xa3f316),_0x3b7735(0x16c));});}return _0x3123fd;}async function T(_0x309271,{registerWorkerCommands:_0xee0369,loadPlanner:_0x21a8f5}){const _0x2057c7=_0x434444,_0x39e1c6=O(_0xee0369,{'loadPlanner':_0x21a8f5});try{await _0x39e1c6[_0x2057c7(0x14e)](_0x309271,{'from':_0x2057c7(0x149)});}catch(_0x2b1f03){process[_0x2057c7(0x14d)]=0x1,_0x37a79f('error:\x20'+_0x2b1f03['message']+'\x0a');}}export{O as createProgram,T as run};
|