PHP WebShell
Текущая директория: /opt/BitGoJS/node_modules/@aptos-labs/ts-sdk/dist/esm
Просмотр файла: chunk-4XB3BB5Z.mjs
import{a as p,b as u}from"./chunk-KCWRCWNT.mjs";import{b as h,c as d,e as m}from"./chunk-GMKKHGXK.mjs";import{c as s}from"./chunk-H3C3VTHS.mjs";import{c as b,d as K}from"./chunk-V4FKFCBL.mjs";import{a as l}from"./chunk-J3E4UMBB.mjs";import{a as c}from"./chunk-AJ5JHBAE.mjs";import{b as y}from"./chunk-SPRNSFUV.mjs";import{randomBytes as E}from"@noble/hashes/utils";var S=1209600,i=class i extends c{constructor(e){super();let{privateKey:r,expiryDateSecs:a,blinder:n}=e;this.privateKey=r,this.publicKey=new p(r.publicKey()),this.expiryDateSecs=a||K(b()+S),this.blinder=n!==void 0?y.fromHexInput(n).toUint8Array():v();let t=h(this.publicKey.bcsToBytes(),93);t.push(BigInt(this.expiryDateSecs)),t.push(d(this.blinder));let x=m(t);this.nonce=x.toString()}getPublicKey(){return this.publicKey}isExpired(){return Math.floor(Date.now()/1e3)>this.expiryDateSecs}serialize(e){e.serializeU32AsUleb128(this.publicKey.variant),e.serializeBytes(this.privateKey.toUint8Array()),e.serializeU64(this.expiryDateSecs),e.serializeFixedBytes(this.blinder)}static deserialize(e){let r=e.deserializeUleb128AsU32(),a;switch(r){case 0:a=s.deserialize(e);break;default:throw new Error(`Unknown variant index for EphemeralPublicKey: ${r}`)}let n=e.deserializeU64(),t=e.deserializeFixedBytes(31);return new i({privateKey:a,expiryDateSecs:Number(n),blinder:t})}static fromBytes(e){return i.deserialize(new l(e))}static generate(e){let r;switch(e?.scheme){case 0:default:r=s.generate()}return new i({privateKey:r,expiryDateSecs:e?.expiryDateSecs})}sign(e){if(this.isExpired())throw new Error("EphemeralKeyPair has expired");return new u(this.privateKey.sign(e))}};i.BLINDER_LENGTH=31;var o=i;function v(){return E(o.BLINDER_LENGTH)}export{o as a};
//# sourceMappingURL=chunk-4XB3BB5Z.mjs.mapВыполнить команду
Для локальной разработки. Не используйте в интернете!