{"version":3,"sources":["../../domain/src/blockchain.ts","../../domain/src/wallet-custody.ts","../../../shared-libraries/src/processes/logger.ts","../src/index.ts","../src/common.ts","../src/mutex.ts","../src/monitoring.ts"],"sourcesContent":["import { WalletContent } from \"./wallet-custody\";\n\nexport enum DLTProtocolEnum {\n  Ethererum = \"eth\",\n  Tezos = \"tez\",\n  Polygon = \"matic\"\n}\n\nexport type RawData = Buffer;\nexport type TxSignature = Buffer;\nexport type TransactionId = string;\n\nexport interface TransactionSigner {\n  sign(w: WalletDLT, tx: RawData): Promise<TxSignature>;\n}\n\nexport interface WalletNoncesFields {\n  asOfBlock: number;\n  lastInBlock: bigint;\n  lastPending: bigint;\n  lastReserved: bigint;\n}\n// we use these as constant to avoid creating new BigInt each time and because TS2737: BigInt literals are not available when targeting lower than ES2020.\nconst BI_0 = BigInt(0);\nconst BI_1 = BigInt(1);\n/**\n * The wallet nonces logic need to remain consistent accross the stack\n * asOfBlock is the block number of the last known block\n * lastInBlock is the last nonce used in the last known block\n * lastPending is the last nonce used in the pending transactions when available\n * lastReserved is the last nonce reserved for a transaction if any as saved in cache\n * reservation is a flag to indicate if the WalletNonces is returned for a reserveTransactionCounter call\n * next is the next nonce to use, when after a call to reserveTransactionCounter, it is the actually last reserved nonce\n * \n * The idea with next it to get the api user always use next to fill the nonce field of the transaction\n * This class is implementing the next logic so it remains consistent accross the stack\n */\nexport class WalletNonces {\n  static from(fields: Partial<WalletNoncesFields>, asReservation=false): WalletNonces {\n    const n = new WalletNonces();\n    n.asOfBlock = fields.asOfBlock;\n    n.lastInBlock = fields.lastInBlock;\n    n.lastPending = fields.lastPending;\n    n.lastReserved = fields.lastReserved;\n    n.reservation = asReservation;\n    return n;\n  }\n  asOfBlock: number | undefined;\n  lastInBlock: bigint | undefined;\n  lastPending: bigint | undefined;\n  lastReserved: bigint | undefined;\n  reservation: boolean = false;\n\n  get next(): bigint {\n    // by default the next nonce is the lastInBlock + 1, or zero if it is the first time we use the wallet\n    let next = this.lastInBlock !== undefined? this.lastInBlock + BI_1 : BI_0;\n    // if there is pending transactions, they must have a nonce greater than the lastInBlock, and we want the next to be just after the lastPending\n    next = this.lastPending !== undefined && this.lastPending > next? this.lastPending + BI_1 : next;\n    if (this.reservation)\n      // if there are reservation the last reserved nonce is the next (it must exsits but in case not we use the calculated one)\n      next = this.lastReserved !== undefined ? this.lastReserved : next;\n    else \n      // if there are no reservation, the lastReserved is a previously used one and we want the next to be just after\n      next = this.lastReserved !== undefined && this.lastReserved > next? this.lastReserved + BI_1 : next;\n\n    return next;\n  }\n}\nexport interface DLTInfo {\n  [key: string]: any;\n}\n\nexport interface WalletDLT {\n  get protocol(): DLTProtocolEnum;\n  get signer(): TransactionSigner;\n  getInfo(): Promise<DLTInfo>;\n  getAddress(): string;\n  getBalance(): Promise<bigint>;\n  getTransactionCounter(reset?: boolean): Promise<WalletNonces>;\n  reserveTransactionCounter(reset?: boolean): Promise<WalletNonces>;\n}\n\nexport type TransactionDLTStatus =\n  | \"unknown\"\n  | \"created\"\n  | \"initialized\"\n  | \"linked\"\n  | \"priced\"\n  | \"signed\"\n  | \"submitted\"\n  | \"recorded\"\n  | \"failed\";\n\n  /** this type should be serializable in DB so no bigint */\nexport interface TransactionDecoded {\n  /** the blockchain transaction id, typically a hash. Optional because not available if not signed */\n  txId?: string;\n  from: string;\n  to?: string;\n  nonce: number,\n  amount: string; // hex form or decimal form\n  data: Buffer;\n  gas: string; // hex form or decimal form\n  gasPrice: string; // hex form or decimal form\n  protocol: DLTProtocolEnum;\n  chainId: number;\n  r?: string; s?: string; v?: string;\n  [key: string]: unknown;\n}\n\nexport interface TransactionDLTDetails {\n  id: string,\n  status: TransactionDLTStatus,\n  block?: number,\n  index?: number,\n  from: string,\n  to?: string,\n  nonce: number,\n  amount: bigint,\n  data: Buffer,\n  fee: bigint,\n  gasPrice: bigint,\n  contractCreated?: string,\n  protocol: DLTProtocolEnum,\n  // dlt?: DLTInfo,\n  // timeout?: boolean\n}\n\nexport interface DLTBlockDetails {\n  block: number,\n  hash: string,\n  parentHash?: string,\n  time: number,\n  nbTransactions: number,\n  transactions?: TransactionDLTDetails[]\n}\n\n\nexport interface TransactionDLT {\n  get id(): TransactionId;\n  get status(): TransactionDLTStatus;\n  get raw(): Buffer;\n  set raw(v: Buffer);\n  get details(): TransactionDLTDetails;\n  init(to: string, data: RawData, amount: bigint): void;\n  link(w: WalletDLT, maxGas: bigint, nonce: bigint): void;\n  call(): Promise<string>;\n  price(check?: (price: bigint)=>Promise<bigint>): Promise<bigint>;\n  sign(): Promise<void>;\n  submit(): Promise<TransactionDLT>;\n  waitFor(nbBlocks: number, timeout?: number): Promise<TransactionDLT>;\n}\n\nexport interface DLTNode {\n  get protocol(): DLTProtocolEnum;\n  getInfo(): Promise<DLTInfo>;\n  newTransaction(to?: string, data?: RawData, amount?: bigint): TransactionDLT;\n  getTransaction(id: string): Promise<TransactionDLT>;\n  getWallet(address: string, signer?: TransactionSigner): WalletDLT;\n  getLastBlockNumber(): Promise<number>;\n  getBasePrice(): Promise<bigint>;\n  getDLTBlockReader(): Promise<DLTBlockReader>;\n  close(): Promise<void>;\n}\n\nexport interface EventLogDetails {\n  uniqueId: string;\n  block: number;\n  transactionIndex: number;\n  logIndex: number;\n  transactionId: string;\n  /** the address of the smart contract creating that log */\n  origin: string;\n  state: \"mined\" | \"removed\";\n  data: string;\n  topics: string[];\n  protocol: DLTProtocolEnum;\n}\n\nexport function calcEventLogUniqueId(protocol: DLTProtocolEnum, block: number, transaction: number, log: number): string {\n  return (\n    protocol + \":\" +\n    String(block).padStart(8, \"0\") +\n    String(transaction).padStart(3, \"0\") +\n    String(log).padStart(3, \"0\")\n  );\n}\n\nexport interface EventLogSubscriptionFilter {\n  origin?: string;\n  topics?: (string|string[])[];\n}\nexport interface EventLogSubscriptionInfo extends EventLogSubscriptionFilter {\n  id: string;\n  protocol: DLTProtocolEnum;\n}\n\nexport interface EventLogSubscriptionQuery {\n  /** id of a created subscription. If specified `filter` can be optional. If missing `filter` is mandatory */\n  idOrFilter: string | EventLogSubscriptionFilter;\n  fromBlock?: \"earliest\"|\"latest\"|number;\n  toBlock?: \"latest\"|number;\n  maxItems?: number;\n}\n\nexport interface EventLogSubscriptionResponse {\n  id: string;\n  logs: EventLogDetails[];\n  /** populated with the query to get the rest, if any */\n  more?: EventLogSubscriptionQuery;\n}\n\nexport interface DLTBlockReader {\n  getBlock(block: number, withTransactions: boolean): Promise<DLTBlockDetails | undefined>;\n  findFirstBlockOfAddress(address: string): Promise<{ firstBlock: number; transactions: TransactionDLTDetails[] }>;\n  buildLogSubscription(filter: EventLogSubscriptionFilter): Promise<EventLogSubscriptionInfo>;\n  getLogs(query: EventLogSubscriptionQuery): Promise<EventLogSubscriptionResponse>;\n  getLogsAsync(query: EventLogSubscriptionQuery, callback: (error:any, res?: EventLogSubscriptionResponse)=>Promise<void>): Promise<EventLogSubscriptionInfo>;\n  clearLogSubscription(filter: EventLogSubscriptionInfo): Promise<EventLogSubscriptionInfo>;\n}\n\nexport type DecryptWalletFunction = (w: WalletContent) => Promise<WalletContent>;\n\nexport interface DLTProtocolServices {\n  get protocol(): DLTProtocolEnum;\n  generateNewWallet(): Promise<WalletContent>;\n  addWallet(privateKey: string): WalletContent;\n  getWalletDLT(address: string, info: DLTInfo): Promise<WalletDLT>;\n  getSigner(decryptWallet?: DecryptWalletFunction): TransactionSigner;\n  sign(privateKey: string, data: Buffer): Promise<Buffer>;\n  verify(publicKey: string, data: Buffer, signature: Buffer): Promise<boolean>;\n}\n\nexport interface DLTProtocolEncoder {\n  get protocol(): DLTProtocolEnum;\n  from(from: WalletDLT, raw: Buffer): Promise<TransactionDecoded>;\n  to(tx: TransactionDecoded): Promise<Buffer>;\n}\n\nexport interface ContractDefinitionGeneric {\n  key: string;\n  name: string;\n  nbArguments?: number;\n  [key: string]: any;\n}\n\nexport interface ContractDefinitionServices {\n  get protocol(): DLTProtocolEnum;\n  addFile(file: string | any): Promise<void>;\n  list(): Promise<ContractDefinitionGeneric[]>;\n}","import { CredentialDeviceType, PublicKeyCredentialCreationOptionsJSON, RegistrationResponseJSON } from \"@simplewebauthn/server\";\nimport { DLTInfo, DLTProtocolEnum, TransactionDecoded, TransactionSigner, WalletDLT } from \"./blockchain\";\n\nexport type AttributeValueType = string|number|boolean;\nexport interface WalletPublicInfo {\n  chain: DLTProtocolEnum,\n  address: string;\n  publicKey?: string;\n  dateCreation?: string;\n  backupAddress: string;\n  isMasterWallet?: boolean; // used to represent the master wallet of the instance for the chain\n  nbConsecutiveFailure?: number; // count the number of password check failure happening in a row\n  lastFailureTimestamp?: number; // millisec timestamp of the last recorded failure\n  attributes: Record<string, AttributeValueType>;\n}\n\ninterface WebAuthnAuthenticator {\n  rpId?: string;\n  credentialID: Uint8Array;\n  credentialPublicKey: Uint8Array;\n  counter: number;\n  // Ex: 'singleDevice' | 'multiDevice'\n  credentialDeviceType: CredentialDeviceType;\n  credentialBackedUp: boolean;\n  // Ex: ['ble' | 'hybrid' | 'internal' | 'nfc' | 'usb'] (kept as a plain string[] since\n  // @simplewebauthn/server v14+ widened its own transport-related JSON types to string[])\n  transports?: string[];\n};\n\nexport interface WalletContent extends WalletPublicInfo{\n  privateKey: string;\n  passwordHash: string;\n  webauthnChallenge?: string; // if set, the wallet is a webauthn wallet\n  webauthn?: WebAuthnAuthenticator; // if set, the wallet is a webauthn wallet\n}\n\nexport interface WalletCustodyRepo {\n  save(wallet: WalletContent): Promise<WalletContent>;\n  get(chain: DLTProtocolEnum, address: string): Promise<WalletContent|undefined>;\n  getMasterWallets(chain: DLTProtocolEnum): Promise<WalletContent[]|undefined>;\n  delete(chain: DLTProtocolEnum, address: string): Promise<WalletContent|undefined>;\n  findByAttribute<T extends AttributeValueType>(chain: DLTProtocolEnum, attribute: string, value: T): Promise<WalletContent[]>;\n}\n\n\nexport interface TokenPersistence {\n  id: string;\n  /** expiry date as in a jwt */\n  exp: number;\n  /** ony a single use? False by default */\n  once?: boolean;\n}\nexport interface TokenPersistenceRepo {\n  save(token: TokenPersistence): Promise<TokenPersistence>;\n  get(id: string): Promise<TokenPersistence|undefined>;\n  delete(id: string): Promise<TokenPersistence|undefined>;\n}\n\nexport interface WalletAuthenticationActivity {\n  action: \"sign\" | \"password-reset\" | \"delete\" | \"set-attributes\" | \"none\";\n  on?: {\n    address?: string;\n  },\n}\n\nexport const passwordLessIndicator = \"🔐generate-webauthn🔒\";\n\nexport interface TokenPayload {\n  iat: number;\n  exp: number;\n  issuer: string;\n  activities: WalletAuthenticationActivity[];\n  jti:string;\n  persistent?: boolean\n};\n\nexport interface WalletCustody {\n  implement(chain: DLTProtocolEnum): boolean;\n\n  newWallet(chain: DLTProtocolEnum, password: string, attributes: Record<string, AttributeValueType>, backupAddress?: string): Promise<string>;\n  newWebAuthnWallet(chain: DLTProtocolEnum, attributes: Record<string, AttributeValueType>, backupAddress?: string): Promise<PublicKeyCredentialCreationOptionsJSON|undefined>;\n  addWallet(chain: DLTProtocolEnum, password: string, privateKey: string, attributes: Record<string, AttributeValueType>, backupAddress?: string): Promise<string>;\n  getWalletDLT(chain: DLTProtocolEnum, address: string, info: DLTInfo): Promise<WalletDLT|undefined>;\n  registerWebauthn(chain: DLTProtocolEnum, address: string, authenticator: RegistrationResponseJSON): Promise<string|undefined>;\n  /** return a temporary token that should be used to prove that the end-user knows the password */\n  authenticate(chain: DLTProtocolEnum, address: string, password: string, activities:WalletAuthenticationActivity[]): Promise<string>;\n  \n  getSigner(chain: DLTProtocolEnum, address: string, token: string): Promise<TransactionSigner>;\n  \n  deleteWallet(chain: DLTProtocolEnum, address: string, token: string): Promise<string>;\n  \n  updatePassword(chain: DLTProtocolEnum, address: string, newPassword: string, token: string): Promise<string>;\n  updateAttributes(chain: DLTProtocolEnum, address: string, attributes: Record<string, AttributeValueType|undefined>, token: string): Promise<WalletPublicInfo>;\n  \n  publicInfo(chain: DLTProtocolEnum, address: string): Promise<WalletPublicInfo|undefined>;\n  findWallets<T extends AttributeValueType>(chain: DLTProtocolEnum, attribute: string, value: T): Promise<WalletPublicInfo[]>;\n}\n\nexport interface WalletCustodyApi {\n  get protocol(): DLTProtocolEnum;\n  newWallet(password: string, backupAddress?: string): Promise<string>;\n  newWalletWithAttributes(password: string, attributes: Record<string, AttributeValueType>, backupAddress?: string): Promise<string>;\n  newWebauthnWalletWithAttributes(attributes: Record<string, AttributeValueType>, backupAddress?: string): Promise<PublicKeyCredentialCreationOptionsJSON>;\n  publicInfo(address: string): Promise<WalletPublicInfo & {exists: boolean}>;\n  findByAttribute<T extends AttributeValueType>(attribute: string, value: T): Promise<WalletPublicInfo[]>;\n  authenticate(address: string, password: string, activities?:WalletAuthenticationActivity[]): Promise<string>;\n  sign(address: string, token: string, rawTx: string, dltInfo: DLTInfo): Promise<string>;\n  delete(address: string, token: string): Promise<string>;\n  updatePassword(address: string, newPassword: string, token: string): Promise<string>;\n  updateAttributes(address: string, updated: Record<string, AttributeValueType>, deleted: string[], token: string): Promise<WalletPublicInfo>;\n  getSigner(address: string, password: string): TransactionSigner;\n}\n\nexport interface TxMonitorServices {\n  decodeSavedTransactions(): Promise<number>;\n  searchTransactions(filter:any): Promise<TxMonitorRecord[]>;\n}\n\nexport interface TxMonitorRecord {\n  /** Storage id */\n  uid: string;\n  chain: DLTProtocolEnum;\n  address: string;\n  timestamp: number;\n  data: Buffer;\n  signed: boolean;\n  failedRule?: string;\n  decoded?: TransactionDecoded;\n}\nexport interface TxMonitorRepository {\n  save(timestamp: number, from: WalletDLT, tx: Buffer, decoded: TransactionDecoded|undefined, signed: boolean, failedRule?: string): Promise<TxMonitorRecord|undefined>;\n  getTxNotDecoded(chain: DLTProtocolEnum): Promise<TxMonitorRecord[]>;\n  update(record: Partial<TxMonitorRecord>): Promise<TxMonitorRecord>;\n  search(filter:any): Promise<TxMonitorRecord[]>;\n}\n\nexport interface TxMonitorRuleResult {\n  id: string;\n  result: boolean;\n}; \n// export interface TxMonitorRule {\n//   id: string;\n//   impl: (from:WalletDLT, tx:Buffer, decoded?: TransactionDecoded)=>Promise<TxMonitorRuleResult>;\n// }\nexport interface TxMonitorRulesEngine {\n  // list(from: WalletDLT, tx: Buffer, decoded?: TransactionDecoded): Promise<TxMonitorRule[]>;\n  check(from: WalletDLT, tx: Buffer, timestamp:number, decoded?: TransactionDecoded): Promise<TxMonitorRuleResult[]>;\n}\n\n/** Generic storage interface to save and get the ABI elements */\nexport interface ContractDefinitionsRepository<T = any> {\n  save(key: string, definition: T): Promise<T>;\n  get(key: string): Promise<T|undefined>;\n  all(): Promise<T[]>;\n}\n","\ninterface ILevel {txt:string; val:number; key: string};\nconst LevelEnum : {[key: string]: ILevel} = {\n  debug: {txt: \"DEBUG\", val: 0, key: \"debug\"},\n  info: {txt: \"INFO \", val: 1, key: \"info\"},\n  warning: {txt: \"WARNG\", val: 2, key: \"warning\"},\n  error: {txt: \"ERROR\", val: 3, key: \"error\"},\n  critical: {txt: \"CRITC\", val: 4, key: \"critical\"},\n}\n\nexport function isLevelGreaterOrEqual(base: ILevel, level: ILevel): boolean {\n  return base.val<=level.val;\n}\n\nfunction logAny(o:any): string {\n  switch (typeof o) {\n    case \"undefined\":\n      return \"UNDEF\";\n    case \"object\":\n      return JSON.stringify(o);\n    default:\n      return o.toString();\n  }\n}\n\nexport class Logger {\n  static get(name: string): Logger {\n    return new Logger(name);\n  }\n  private static _globalLevel: ILevel|undefined = undefined;\n  public static get level(): ILevel {\n     return Logger._globalLevel || LevelEnum[process.env.LOGGER_LEVEL||\"debug\"];\n  }\n  public static setlevel(level:string) {\n    Logger._globalLevel = LevelEnum[level] || LevelEnum.debug;\n  }\n  private _level: ILevel|undefined;\n  private constructor(private name: string) {\n    if (!this.name) this.name=\"\";\n    this._level = undefined;\n  }\n  public set level(l: string) {this._level = LevelEnum[l]||Logger.level}\n  public get level(): string { return this._level?.key||Logger.level.key }\n  private get iLevel(): ILevel { return this._level||Logger.level }\n\n\n  private log(level: ILevel, ...messages: any[]) {\n    if (isLevelGreaterOrEqual(this.iLevel, level)) {\n      console.log(\n        `${this.name.padEnd(8, ' ')}:${new Date().toISOString()}:${level.txt}:${messages\n          .map((a) => logAny(a))\n          .join(\",\")}`\n      );\n    }\n  }\n  debug(...messages: any[]): void {\n    this.log(LevelEnum.debug, ...messages);\n  }\n  info(...messages: any[]): void {\n    this.log(LevelEnum.info, ...messages);\n  }\n  warn(...messages: any[]): void {\n    this.log(LevelEnum.warning, ...messages);\n  }\n  error(message: string, err?: Error): void {\n    this.log(LevelEnum.error, message, err?err.message:'');\n    if (err instanceof Error && err.stack) this.log(LevelEnum.error, err.stack.substring(0, 600));\n  }\n  critical(message: string, err?: Error): void { \n    this.error(message, err);\n    process.exit(1)\n  }\n\n  measure<T>(message: string, fn: ()=>T|Promise<T>): T|Promise<T> {\n    const start = Date.now();\n    const trace = (err:boolean) => {\n      this.log(LevelEnum.debug, `${message} took ${Date.now() - start} ms`+(err? \" with error\":\"\"));\n    }\n    try {\n      let result = fn();\n      if (result instanceof Promise) {\n        const prom = result;\n        result = new Promise((resolve, reject) => {\n          prom.then((r) => {\n            trace(false);\n            resolve(r);\n          }).catch((e) => {\n            trace(true);\n            reject(e);\n          });\n        });\n      } else {\n        trace(false);\n      }\n      return result;\n    } catch(e) {\n      trace(true);\n      throw e;\n    }\n  }\n\n}","import type { PublicKeyCredentialCreationOptionsJSON, RegistrationResponseJSON } from \"@simplewebauthn/browser\";\nimport axios, { AxiosInstance, AxiosRequestConfig } from \"axios\";\nimport { DLTInfo, DLTProtocolEnum, TransactionSigner, WalletDLT, WalletNonces } from \"@framework/wallet-custody-domain/bin/blockchain.js\";\nimport { AttributeValueType, passwordLessIndicator, WalletAuthenticationActivity, WalletCustodyApi, WalletPublicInfo } from \"@framework/wallet-custody-domain/bin/wallet-custody.js\";\nimport { handleError } from \"./common.js\";\nimport { Mutex } from \"./mutex.js\";\nexport * from \"./monitoring.js\"\nexport type { DLTInfo, TransactionSigner, WalletDLT};\nexport { DLTProtocolEnum, WalletNonces};\n\nexport interface Lockable {\n  unlock(): Promise<boolean>;\n  get locked(): boolean;\n}\n\nfunction base64ToUtf8Json<T = any>(base64: string): T {\n  const binary = atob(base64)\n  const bytes = Uint8Array.from(binary, c => c.charCodeAt(0))\n  const json = new TextDecoder('utf-8').decode(bytes)\n  return JSON.parse(json)\n}\n\nfunction validateToken(token:string|undefined, forAddress: string, marginSec: number = 0): boolean {\n  // token is expected to be a JWT, but lets not use a library\n  if (!token) return false\n  const [header, body, signature] = token.split('.');\n  // log.debug(\"validateToken\", header, body, signature);\n  if (!signature) return false;\n  if (!header) return false;\n  if (!body) return false;\n\n  try {\n    let payload = base64ToUtf8Json(body);\n    // The payload has a base64 header and payload i the challenge field if the token is signed locally\n\n    // log.debug(\"validateToken\", payload);\n    if (!payload.issuer) return false;\n    // commented as it compromize the new functionality of authenticating with the master wallet\n    // if (payload.issuer.toLowerCase() !== forAddress.toLowerCase()) return false;\n    if (!payload.exp) return false;\n    // verify that the token has not expired or will not expire within the next marginSec\n    // as we need to account for the communication delay between the caller and the back end service \n    //\n    // console.log(\"validateToken\", (payload.exp - marginSec) >= Math.ceil(Date.now() / 1000), payload.exp, Math.ceil(Date.now() / 1000), marginSec, );\n    \n    if ( (payload.exp - marginSec) < Math.ceil(Date.now() / 1000) ) return false;\n    return true;\n  } catch (error) {\n    return false;\n  }\n}\n\n// WalletCustodyApiImpl.sign() returns the signed tx as a hex string (see its\n// own \"should not exists in v2\" comment) - decode it back to the Buffer the\n// TransactionSigner interface contract promises.\nfunction hexStringToBuffer(v: string): Buffer {\n  if (v.startsWith('0x')) v = v.slice(2);\n  return Buffer.from(v, 'hex');\n}\n\nclass LockableAbstract implements Lockable {\n  protected currentToken: string|undefined;\n  protected mutex = new Mutex();\n  constructor(protected address: string) {}\n  protected async _authenticate(activities: WalletAuthenticationActivity[]): Promise<string|undefined> {\n    throw new Error(\"Not implemented\");\n  }\n  \n  async unlock(): Promise<boolean> {\n    // First check if token is valid since validateToken is synchronous\n    if (validateToken(this.currentToken, this.address, 2 /* 2 second for processing + communication delay */)) return true;\n    \n    // Token is invalid, need to authenticate\n    // Wait if another thread is already authenticating\n    return this.mutex.withLock(async () => {    \n      // Check if token is valid again after waiting, as another thread may have refreshed it\n      if (validateToken(this.currentToken, this.address, 2 /* 2 second for processing + communication delay */)) return true;\n      \n      const token = await this._authenticate([]);\n      if (token) {\n        this.currentToken = token;\n        return true;\n      } else {\n        return false;\n      }\n    });\n  }\n  \n  get locked(): boolean {\n    return !validateToken(this.currentToken, this.address, 1 /* 1 second for communication delay */);\n  }\n}\nclass WalletCustodyTransactionSignerImpl extends LockableAbstract implements TransactionSigner, Lockable {\n  constructor(private api: WalletCustodyApi, address: string, private password: string) {\n    super(address);\n  }\n  _authenticate(activities: WalletAuthenticationActivity[]): Promise<string|undefined> {\n    return this.api.authenticate(this.address, this.password, activities);\n  }\n  // Forced modification of the api to replace Buffer by hex string\n  async sign(w: WalletDLT, tx: any): Promise<any> {\n    //const token = await this.api.authenticate(w.getAddress(), this.password);\n    if (this.locked) throw new Error(\"You should unlock the signer before signing\");\n    try {\n      const info = await w.getInfo();\n      let signedTx = await this.api.sign(this.address, this.currentToken || '', tx, info);\n      return hexStringToBuffer(signedTx);\n    } catch (error) {\n      if (/token expired/.test((error as any).message)) {\n        this.currentToken = undefined; // force clearing the token since the server didn't like it\n      }\n      throw error;\n    }\n  }\n  \n}\n\nexport type CustodyAuthenticatorFunction = (address: string, api: WalletCustodyApi) => Promise<string|undefined>;\nclass WalletCustodyTransactionSignerWithCallbackImpl extends LockableAbstract implements TransactionSigner, Lockable {\n  constructor(private api: WalletCustodyApi, address: string, private authenticate: CustodyAuthenticatorFunction) {\n    super(address);\n  }\n  _authenticate(): Promise<string|undefined> {\n    return this.authenticate(this.address, this.api);\n  }\n  \n  // Forced modification of the api to replace Buffer by hex string\n  async sign(w: WalletDLT, tx: any): Promise<any> {\n\n    //const token = await this.authenticate(w.getAddress(), this.api);\n    //if (!token) throw new Error(\"Failed to authenticate the wallet\");\n    if (this.locked)\n      throw new Error(\"You should unlock the signer before signing\");\n    try {\n      const info = await w.getInfo();\n      let signedTx = await this.api.sign(w.getAddress(), this.currentToken || '', tx, info);\n      return hexStringToBuffer(signedTx);\n    } catch (error) {\n      if (/token expired/.test((error as any).message)) {\n        this.currentToken = undefined; // force clearing the token since the server didn't like it\n      }\n      throw error;\n    }\n  }\n}\n\nexport class WalletCustodyApiImpl implements WalletCustodyApi {\n  private http: AxiosInstance;\n  constructor(\n    protected baseUrl: string,\n    protected chain: DLTProtocolEnum,\n    // Optional Node-only connection-reuse agents (see #479/#505) - this package also\n    // ships a browser build (wallet-custody/front), so it must never import\n    // node:http/node:https itself; Node callers construct and pass their own.\n    httpAgents?: Pick<AxiosRequestConfig, \"httpAgent\" | \"httpsAgent\">\n  ) {\n    this.http = axios.create({\n      baseURL: new URL(this.baseUrl).href,\n      responseType: \"json\",\n      validateStatus: (status) => status >= 200 && status <= 399,\n      ...httpAgents,\n    });\n  }\n\n  getSigner(address: string, auth: string|CustodyAuthenticatorFunction): TransactionSigner {\n    if (typeof auth === \"string\") {\n      return new WalletCustodyTransactionSignerImpl(this, address, auth);\n    } else {\n      return new WalletCustodyTransactionSignerWithCallbackImpl(this, address, auth);\n    }\n  }\n\n  get protocol(): DLTProtocolEnum {\n    return this.chain;\n  }\n  \n  async newWallet(password: string, backupAddress?: string): Promise<string> {\n    try {\n      const res = await this.http.post(`${this.chain}/wallet/new`,{\n        password,\n        backupAddress\n      })\n      return res.data.address;\n    } catch (error) {\n      handleError(error, \"fail creating a new wallet\");\n    }\n  }\n  \n  async newWebauthnWalletWithAttributes(attributes: Record<string, AttributeValueType>, backupAddress?: string): Promise<PublicKeyCredentialCreationOptionsJSON> {\n    try {\n      const res = await this.http.post(`${this.chain}/wallet/new`,{\n        password: passwordLessIndicator,\n        backupAddress,\n        attributes\n      })\n      return res.data;\n    } catch (error) {\n      handleError(error, \"fail creating a new passwordless wallet\");\n    }\n  }\n\n  async registerWebauthn(address: string, authenticator: RegistrationResponseJSON): Promise<string> {\n    try {\n      const res = await this.http.post(`${this.chain}/wallet/${address}/webauthn-registrer`, {\n        ...authenticator\n      })\n      return res.data;\n    } catch (error) {\n      handleError(error, \"fail creating a new passwordless wallet\");\n    }\n  }\n\n  async newWalletWithAttributes(password: string, attributes: Record<string, AttributeValueType>, backupAddress?: string): Promise<string> {\n    try {\n      const res = await this.http.post(`${this.chain}/wallet/new`,{\n        password,\n        backupAddress,\n        attributes\n      })\n      return res.data.address;\n    } catch (error) {\n      handleError(error, \"fail creating a new wallet with attributes\");\n    }\n  }\n\n  async publicInfo(address: string): Promise<WalletPublicInfo  & {exists: boolean}> {\n    try {\n      const res = await this.http.get(`${this.chain}/wallet/${address}`);\n      return {\n        address: res.data.address,\n        chain: res.data.chain,\n        dateCreation: res.data.dateCreation,\n        publicKey: res.data.publicKey,\n        exists: res.data.exists,\n        backupAddress: res.data.backupAddress,\n        attributes: res.data.attributes || {}\n      }\n    } catch (error) {\n      handleError(error, \"fail getting the wallet public info\")\n    }\n  }\n  async findByAttribute<T extends AttributeValueType>(attribute: string, value: T): Promise<WalletPublicInfo[]> {\n    try {\n      const res = await this.http.post(`${this.chain}/wallet/attribute`, {\n        attribute,\n        value\n      });\n      return res.data;\n    } catch (error) {\n      handleError(error, \"fail finding wallets by attribute\")\n    }\n  }  \n\n  private async createTokenFromWebauthn(address:string, tokenOptions: string): Promise<string> {\n    try {\n      // @simplewebauthn/browser is a pure-ESM-only package; load it dynamically here (instead of a\n      // static top-level import) so that this module's CJS build doesn't fail to `require()` it at\n      // load time for Node.js consumers that never call this webauthn-specific method.\n      const { base64URLStringToBuffer, bufferToBase64URLString, startAuthentication } = await import(\"@simplewebauthn/browser\");\n      // interpret the tokenOptions as a webauthn authentification config\n      const decoder = new TextDecoder(\"utf-8\");\n      const encoder = new TextEncoder();\n      const config = JSON.parse(decoder.decode(base64URLStringToBuffer(tokenOptions)));\n      // console.log(\"authConfig\", config);\n\n      // call the webauthn authenticator in the user's device\n      const authresp = await startAuthentication({ optionsJSON: config });\n\n      // We need to construct a toke that is compatible with validateToken()\n      // it reaquire a 3 part jwt token with a header, a payload and a signature\n      // the payload should contain the issuer, exp to test the token validity\n      // The header should contain the type of the token at least to differentiate easilly from the password based\n\n      console.log(\"authresp\", authresp);\n      // extract the content of the clientDataJSON base64URL encoded string. Attention, we need to keep this clientDataJSON intact because it will be hashed to verify the signature\n      const data = JSON.parse(decoder.decode(base64URLStringToBuffer(authresp.response.clientDataJSON))) as {challenge: string, origin: string, type: string};\n      // decode our chalenge data that contains what we normally want in the token\n      let {header, payload} = JSON.parse(decoder.decode(base64URLStringToBuffer(data.challenge))) as {header: any, payload: any};\n\n      // console.log(\"data\", data, header, payload, authresp.response.signature);\n      header = {\n        type: header.type, // \"webauthn\"\n        typ: authresp.type,\n        id: authresp.id,\n        auth: authresp.response.authenticatorData, // needed to verify the signature\n      }\n      payload = {\n        issuer: payload.issuer || address,\n        exp: payload.exp,\n        data: authresp.response.clientDataJSON // contains the rest we need \n      }\n      const headerB64 = bufferToBase64URLString(encoder.encode(JSON.stringify(header)).buffer);\n      const payloadB64 = bufferToBase64URLString(encoder.encode(JSON.stringify(payload)).buffer);\n      return `${headerB64}.${payloadB64}.${authresp.response.signature}`;\n    } catch (error) {\n      handleError(error, \"fail to create a token from webauthn\")\n    }\n  }\n\n  async authenticate(address: string, password: string, activities?:WalletAuthenticationActivity[]): Promise<string> {\n    try {\n      const res = await this.http.post(`${this.chain}/wallet/${address}/auth`, {\n        password,\n        activities // when not provided or undefined will be handled as `sign` \n      });\n      // see the form of the token \n      const nbParts = res.data.token.split('.').length;\n      if (nbParts !== 3) {\n        return await this.createTokenFromWebauthn(address, res.data.token);\n      } else {\n        return res.data.token;\n      }\n\n    } catch (error) {\n      handleError(error, \"authentication failed\")\n    }\n  }\n\n  async sign(address: string, token: string, rawTx: string, dltInfo: DLTInfo): Promise<string> {\n    try {\n      let raw: string;\n      if (typeof rawTx === \"string\") {\n        if (rawTx.startsWith('0x')) rawTx = rawTx.substr(2);\n        raw = rawTx;\n      } else raw = (rawTx as Buffer).toString(\"hex\"); // should not exists in v2.\n      // log.debug(\"Sending to sign\", \"0x\" + raw.toString(\"hex\"));\n      const res = await this.http.post(`${this.chain}/wallet/${address}/sign`, {\n        raw: '0x'+raw,\n        token,\n        dlt: dltInfo\n      });\n      return res.data.signedTx;\n    } catch (error) {\n      handleError(error, \"fail to sign transaction\")\n    }\n  }\n\n  async delete(address: string, token: string): Promise<string> {\n    try {\n      const res = await this.http.delete(`${this.chain}/wallet/${address}`, {\n        headers: { authorization: 'bearer '+token}\n      });\n      return res.data.deleted;\n    } catch (error) {\n      handleError(error, \"fail to delete wallet\")\n    }\n  }\n\n  async updatePassword(address: string, newPassword: string, token: string): Promise<string> {\n    try {\n      const res = await this.http.post(`${this.chain}/wallet/${address}/update-password`, {\n        newPassword\n      }, {\n        headers: { authorization: 'bearer '+token}\n      });\n      return res.data;\n    } catch (error) {\n      handleError(error, \"fail to update wallet password\")\n    }\n  }\n\n  async updateAttributes(address: string, updated: Record<string, AttributeValueType>, deleted: string[], token: string): Promise<WalletPublicInfo> {\n    try {\n      \n      const res = await this.http.post(`${this.chain}/wallet/${address}/update-attributes`, {\n        updated,\n        deleted\n      }, {\n        headers: {\n          authorization: 'bearer '+token\n        }\n      });\n      return res.data;\n    } catch (error) {\n      handleError(error, \"fail to update wallet attributes\")\n    }\n  }\n\n}\n","import type { AxiosError } from \"axios\";\n\nimport { Logger } from \"@framework/shared/bin/processes/logger.js\";\n\nconst log = Logger.get(\"REST-API-COMMON\");\n\nexport function handleError(error: any, throwMsg?: string): never {\n\tlet reason: string | undefined;\n\tif (error.isAxiosError) {\n\t\tconst ae: AxiosError = error;\n\t\tlet body: any;\n\t\tif (ae.response) {\n\t\t\tbody = ae.response.data;\n\t\t\treason = body.error;\n\t\t}\n\t\tconst baseUrl = ae.config?.baseURL || \"http://missing\";\n\t\tconst path = ae.config?.url || \"/missing/path\";\n\t\tlog.warn(\"fail calling service\", {\n\t\t\turl: new URL(path, baseUrl).toString(),\n\t\t\t// url: buildFullPath(ae.config?.baseURL, ae.config?.url),\n\t\t\tstatus: ae.code,\n\t\t\terror: ae.message,\n\t\t\treason: reason,\n\t\t});\n\t\tif (!reason) reason = ae.message;\n\t}\n\tif (throwMsg) {\n\t\tthrow new Error(`${throwMsg}${reason ? `: ${reason}` : \"\"}`);\n\t}\n\tif (reason) {\n\t\tthrow new Error(reason);\n\t}\n\tthrow error;\n}\n","export class Mutex {\n  // initialize the tail with a resolved promise\n  private tailOfExecution = Promise.resolve();\n\n  async withLock<T>(criticalFunction: () => Promise<T>): Promise<T> {\n    // ssave the tail\n    const previousExecution = this.tailOfExecution;\n\n    let completeTheTail: () => void;\n    // will be awaited by the next call to withLock\n    this.tailOfExecution = new Promise<void>(resolve => (completeTheTail = resolve));\n\n    await previousExecution;\n    try {\n      return await criticalFunction();\n    } finally {\n      completeTheTail!();\n    }\n  }\n\n}","import axios, { AxiosInstance } from \"axios\";\nimport { TransactionRuleEngineRepo, TransactionRuleEngineTesting, RuleSerializable } from \"@framework/wallet-custody-domain/bin/rule-engine.js\";\nimport { ContractDefinitionGeneric, ContractDefinitionServices, DLTProtocolEnum, TransactionDecoded } from \"@framework/wallet-custody-domain/bin/blockchain.js\";\nimport { TxMonitorRecord, TxMonitorServices } from \"@framework/wallet-custody-domain/bin/wallet-custody.js\";\nimport { handleError } from \"./common.js\";\n\n\n\nexport type { TxMonitorServices, TransactionRuleEngineTesting, ContractDefinitionServices, DLTProtocolEnum, RuleSerializable, TransactionDecoded, TransactionRuleEngineRepo, TxMonitorRecord, ContractDefinitionGeneric };\n\n\n\nclass ContractDefinitionServicesApi implements ContractDefinitionServices {\n  constructor(private http: AxiosInstance, private chain: DLTProtocolEnum) {}\n\n  async list(): Promise<ContractDefinitionGeneric[]> {\n    try {\n      const res = await this.http.get<ContractDefinitionGeneric[]>(`${this.chain}/definitions`)\n      return res.data\n    } catch (error) {\n      handleError(error, \"fail uploading the definitions file\");\n    }\n  }\n  \n  get protocol(): DLTProtocolEnum {\n    return this.chain;\n  }\n  async addFile(file: any): Promise<void> {\n    try {\n      const body = (typeof file == \"string\") ? {path: file} : {combined: file}\n      await this.http.post(`${this.chain}/definitions`,body);\n    } catch (error) {\n      handleError(error, \"fail uploading the definitions file\");\n    }\n  }\n  \n}\n\nclass TxMonitorServicesApi implements TxMonitorServices {\n  constructor(private http: AxiosInstance, private chain: DLTProtocolEnum) {}\n\n  decodeSavedTransactions(): Promise<number> {\n    throw new Error(\"Method not implemented over the REST api.\");\n  }\n\n\n  async searchTransactions(filter: any): Promise<TxMonitorRecord[]> {\n    try {\n      const res = await this.http.request({\n        method: \"SEARCH\" as any,\n        url: `${this.chain}/txs`,\n        data: filter\n      })\n      return res.data;\n    } catch (error) {\n      handleError(error, \"fail search the transactions\");\n    }\n  }\n  \n  get protocol(): DLTProtocolEnum {\n    return this.chain;\n  }\n\n  \n}\n\nexport class MonitoringServicesApi implements TransactionRuleEngineTesting, TransactionRuleEngineRepo {\n  private http: AxiosInstance;\n  constructor(protected baseUrl: string, protected chain: DLTProtocolEnum) {\n    const base = new URL(\"api/monitoring\", baseUrl);\n    this.http = axios.create({\n      baseURL: base.href,\n      responseType: \"json\",\n      validateStatus: (status) => status >= 200 && status <= 399,\n    });\n  }\n\n  getDefinitionServices(chain: DLTProtocolEnum): ContractDefinitionServices {\n    return new ContractDefinitionServicesApi(this.http, chain);\n  }\n  getTxMonitorServices(chain: DLTProtocolEnum): TxMonitorServices {\n    return new TxMonitorServicesApi(this.http, chain);\n  }\n  \n  async test(chain: DLTProtocolEnum, rules: RuleSerializable[], transaction: TransactionDecoded): Promise<any> {\n    try {\n      const res = await this.http.post(`test/rule`,{\n        chain, rules, transaction\n      })\n      return res.data;\n    } catch (error) {\n      handleError(error, \"fail executing the test\");\n    }\n  }\n\n  async load(chain: DLTProtocolEnum): Promise<RuleSerializable[]> {\n    try {\n      const res = await this.http.get(`${chain}/rules`)\n      return res.data;\n    } catch (error) {\n      handleError(error, \"fail getting the rules\");\n    }\n  }\n  async save(chain: DLTProtocolEnum, rule: RuleSerializable): Promise<RuleSerializable> {\n    try {\n      const res = await this.http.post(`${chain}/rules`, [rule])\n      return Array.isArray(res.data) ? res.data.pop() : res.data;\n    } catch (error) {\n      handleError(error, \"fail creating or updating the rule\");\n    }\n  }\n  async get(chain: DLTProtocolEnum, name: string): Promise<RuleSerializable | undefined> {\n    try {\n      const res = await this.http.get(`${chain}/rule/${name}`)\n      return res.data;\n    } catch (error) {\n      handleError(error, \"fail getting the rule\");\n    }\n  }\n  async delete(chain: DLTProtocolEnum, name: string): Promise<RuleSerializable> {\n    try {\n      const res = await this.http.delete(`${chain}/rule/${name}`)\n      return res.data;\n    } catch (error) {\n      handleError(error, \"fail deleting the rule\");\n    }\n  }\n\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmLA,IAAAA,SAAA,uBAAA;AAjLA,QAAYC;AAAZ,KAAA,SAAYA,kBAAe;AACzB,MAAAA,iBAAA,WAAA,IAAA;AACA,MAAAA,iBAAA,OAAA,IAAA;AACA,MAAAA,iBAAA,SAAA,IAAA;IACF,GAJYA,qBAAeD,SAAA,kBAAfC,mBAAe,CAAA,EAAA;AAqB3B,QAAM,OAAO,OAAO,CAAC;AACrB,QAAM,OAAO,OAAO,CAAC;AAarB,QAAaC,gBAAb,MAAa,cAAY;MAAzB,cAAA;AAcE,aAAA,cAAuB;MAgBzB;MA7BE,OAAO,KAAK,QAAqC,gBAAc,OAAK;AAClE,cAAM,IAAI,IAAI,cAAY;AAC1B,UAAE,YAAY,OAAO;AACrB,UAAE,cAAc,OAAO;AACvB,UAAE,cAAc,OAAO;AACvB,UAAE,eAAe,OAAO;AACxB,UAAE,cAAc;AAChB,eAAO;MACT;MAOA,IAAI,OAAI;AAEN,YAAI,OAAO,KAAK,gBAAgB,SAAW,KAAK,cAAc,OAAO;AAErE,eAAO,KAAK,gBAAgB,UAAa,KAAK,cAAc,OAAM,KAAK,cAAc,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AAA,QACD,SAAS;AAAA,UACP,eAAe,YAAU;AAAA,QAC3B;AAAA,MACF,CAAC;AACD,aAAO,IAAI;AAAA,IACb,SAAS,OAAO;AACd,kBAAY,OAAO,kCAAkC;AAAA,IACvD;AAAA,EACF;AAEF;","names":["exports","DLTProtocolEnum","WalletNonces","log","exports","exports","Logger","import_axios","axios","axios"]}