{"version":3,"file":"AmountMismatchError.mjs","sources":["../../../src/errors/AmountMismatchError.ts"],"sourcesContent":["import type { Amount } from '../Amount';\nimport { SdkError } from './SdkError';\n\n/** @category Errors */\nexport class AmountMismatchError extends SdkError {\n  readonly name: string = 'AmountMismatchError';\n\n  readonly left: Amount;\n\n  readonly right: Amount;\n\n  readonly operation?: string;\n\n  constructor(left: Amount, right: Amount, operation?: string) {\n    const wrappedOperation = operation ? ` [${operation}]` : '';\n    const message =\n      `The SDK tried to execute an operation${wrappedOperation} on two amounts of different types: ` +\n      `[${left.identifier} with ${left.decimals} decimals] and ` +\n      `[${right.identifier} with ${right.decimals} decimals]. ` +\n      `Provide both amounts in the same type to perform this operation.`;\n    super(message);\n    this.left = left;\n    this.right = right;\n    this.operation = operation;\n  }\n}\n"],"names":["AmountMismatchError","SdkError","name","constructor","left","right","operation","wrappedOperation","message","identifier","decimals"],"mappings":";;AAGA;AACO,MAAMA,mBAAmB,SAASC,QAAQ,CAAC;AACvCC,EAAAA,IAAI,GAAW,qBAAqB,CAAA;AAQ7CC,EAAAA,WAAW,CAACC,IAAY,EAAEC,KAAa,EAAEC,SAAkB,EAAE;IAC3D,MAAMC,gBAAgB,GAAGD,SAAS,GAAI,KAAIA,SAAU,CAAA,CAAA,CAAE,GAAG,EAAE,CAAA;IAC3D,MAAME,OAAO,GACV,CAAA,qCAAA,EAAuCD,gBAAiB,CAAA,oCAAA,CAAqC,GAC7F,CAAA,CAAA,EAAGH,IAAI,CAACK,UAAW,CAAA,MAAA,EAAQL,IAAI,CAACM,QAAS,CAAgB,eAAA,CAAA,GACzD,CAAGL,CAAAA,EAAAA,KAAK,CAACI,UAAW,CAAQJ,MAAAA,EAAAA,KAAK,CAACK,QAAS,CAAa,YAAA,CAAA,GACxD,CAAiE,gEAAA,CAAA,CAAA;IACpE,KAAK,CAACF,OAAO,CAAC,CAAA;IACd,IAAI,CAACJ,IAAI,GAAGA,IAAI,CAAA;IAChB,IAAI,CAACC,KAAK,GAAGA,KAAK,CAAA;IAClB,IAAI,CAACC,SAAS,GAAGA,SAAS,CAAA;AAC5B,GAAA;AACF;;;;"}