@hyr0-xyz/program 0.0.1

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../node_modules/decimal.js/decimal.mjs","../src/types/transactionAccount.ts","../src/types/feeCollectionFrequency.ts","../src/types/managerFeeStructure.ts","../src/types/policy.ts","../src/accounts/vault.ts","../src/accounts/transaction.ts","../src/programs/hyroProtocol.ts","../src/programs/dropper.ts","../src/programs/policyPrograms.ts","../src/shared/index.ts","../src/instructions/dropper/transferLamports.ts","../src/instructions/protocol/createTx.ts","../src/instructions/protocol/executeTx.ts","../src/instructions/protocol/initializeVault.ts","../src/instructions/policyLimitTransfer/initializeLimitTransfer.ts","../src/instructions/policyMultisig/approve.ts","../src/instructions/policyMultisig/initializeMultisig.ts","../src/instructions/policyOwners/initializeOwners.ts","../src/utils/pda.ts","../src/sdk/vault.ts"],"names":["min","max","sign","pow","sum","Decimal","i","getStructEncoder","getAddressEncoder","getBooleanEncoder","getStructDecoder","getAddressDecoder","getBooleanDecoder","combineCodec","FeeCollectionFrequency","getEnumEncoder","getEnumDecoder","getU16Encoder","getU64Encoder","getU16Decoder","getU64Decoder","Policy","fixDecoderSize","getBytesDecoder","addDecoderSizePrefix","getUtf8Decoder","getU32Decoder","getOptionDecoder","decodeAccount","config","assertAccountExists","fetchEncodedAccount","getArrayDecoder","AccountRole","upgradeRoleToSigner","kitIsTransactionSigner","fixEncoderSize","getBytesEncoder","transformEncoder","getArrayEncoder","addEncoderSizePrefix","getU32Encoder","getProgramDerivedAddress","getUtf8Encoder"],"mappings":";;;;;;;AAcA,IAAI,SAAA,GAAY,IAAA;AAAhB,IAIE,UAAA,GAAa,GAAA;AAJf,IAOE,QAAA,GAAW,kBAAA;AAPb,IAUE,IAAA,GAAO,ogCAAA;AAVT,IAaE,EAAA,GAAK,ogCAAA;AAbP,IAiBE,QAAA,GAAW;AAAA;AAAA;AAAA;AAAA;AAAA,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A;AAAA,MACF;AAAA,QACE,OAAA,EAAS,uBAAA;AAAA,QACT,MAAMA,eAAAA,CAAY;AAAA;AACpB,KACF;AAEA,IAAA,MAAM,oBAAA,GAAuB,MAAM,4BAAA,CAA6B;AAAA,MAC9D,KAAA,EAAO,SAAS,CAAC,CAAA;AAAA,MACjB,WAAA,EAAa,eAAe,CAAC,CAAA;AAAA,MAC7B,aAAA,EAAgB,IAAA,CAAK,cAAA,IAAkB,IAAA,CAAK,cAAA;AAAA,MAC5C,eAAe,IAAA,CAAK,cAAA;AAAA,MACpB,QAAQ,IAAA,CAAK,OAAA;AAAA,MACb,WAAA,EAAa,aAAa,CAAC;AAAA,KAC5B,CAAA;AACD,IAAC,oBAAA,CAAqB,QAAA,CAA2B,IAAA,CAAK,GAAG,iBAAiB,CAAA;AAE1E,IAAA,OAAO;AAAA,MACL,EAAA,EAAI,oBAAA;AAAA,MACJ,OAAO,QAAA,CAAS;AAAA,KAClB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,MAAM,GAAA,EAA0F;AACpG,IAAA,MAAM,OAAA,GAAU,MAAM,IAAA,CAAK,UAAA,EAAW;AACtC,IAAA,OAAO,UAAA,CAAW,KAAK,OAAO,CAAA;AAAA,EAChC;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,gBAAA,CACJ,GAAA,EACA,KAAA,EACkD;AAClD,IAAA,MAAM,cAAA,GAAiB,MAAM,IAAA,CAAK,iBAAA,CAAkB,KAAK,CAAA;AACzD,IAAA,OAAO,gBAAA,CAAiB,GAAA,EAAK,cAAA,CAAe,CAAC,CAAY,CAAA;AAAA,EAC3D;AACF","file":"index.js","sourcesContent":["/*!\r\n * decimal.js v10.6.0\r\n * An arbitrary-precision Decimal type for JavaScript.\r\n * https://github.com/MikeMcl/decimal.js\r\n * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>\r\n * MIT Licence\r\n */\r\n\r\n\r\n// ----------------------------------- EDITABLE DEFAULTS ------------------------------------ //\r\n\r\n\r\n // The maximum exponent magnitude.\r\n // The limit on the value of `toExpNeg`, `toExpPos`, `minE` and `maxE`.\r\nvar EXP_LIMIT = 9e15, // 0 to 9e15\r\n\r\n // The limit on the value of `precision`, and on the value of the first argument to\r\n // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`.\r\n MAX_DIGITS = 1e9, // 0 to 1e9\r\n\r\n // Base conversion alphabet.\r\n NUMERALS = '0123456789abcdef',\r\n\r\n // The natural logarithm of 10 (1025 digits).\r\n LN10 = '2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058',\r\n\r\n // Pi (1025 digits).\r\n PI = '3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789',\r\n\r\n\r\n // The initial configuration properties of the Decimal constructor.\r\n DEFAULTS = {\r\n\r\n // These values must be integers within the stated ranges (inclusive).\r\n // Most of these values can be changed at run-time using the `Decimal.config` method.\r\n\r\n // The maximum number of significant digits of the result of a calculation or base conversion.\r\n // E.g. `Decimal.config({ precision: 20 });`\r\n precision: 20, // 1 to MAX_DIGITS\r\n\r\n // The rounding mode used when rounding to `precision`.\r\n //\r\n // ROUND_UP 0 Away from zero.\r\n // ROUND_DOWN 1 Towards zero.\r\n // ROUND_CEIL 2 Towards +Infinity.\r\n // ROUND_FLOOR 3 Towards -Infinity.\r\n // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.\r\n // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\r\n // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n //\r\n // E.g.\r\n // `Decimal.rounding = 4;`\r\n // `Decimal.rounding = Decimal.ROUND_HALF_UP;`\r\n rounding: 4, // 0 to 8\r\n\r\n // The modulo mode used when calculating the modulus: a mod n.\r\n // The quotient (q = a / n) is calculated according to the corresponding rounding mode.\r\n // The remainder (r) is calculated as: r = a - n * q.\r\n //\r\n // UP 0 The remainder is positive if the dividend is negative, else is negative.\r\n // DOWN 1 The remainder has the same sign as the dividend (JavaScript %).\r\n // FLOOR 3 The remainder has the same sign as the divisor (Python %).\r\n // HALF_EVEN 6 The IEEE 754 remainder function.\r\n // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive.\r\n //\r\n // Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian\r\n // division (9) are commonly used for the modulus operation. The other rounding modes can also\r\n // be used, but they may not give useful results.\r\n modulo: 1, // 0 to 9\r\n\r\n // The exponent value at and beneath which `toString` returns exponential notation.\r\n // JavaScript numbers: -7\r\n toExpNeg: -7, // 0 to -EXP_LIMIT\r\n\r\n // The exponent value at and above which `toString` returns exponential notation.\r\n // JavaScript numbers: 21\r\n toExpPos: 21, // 0 to EXP_LIMIT\r\n\r\n // The minimum exponent value, beneath which underflow to zero occurs.\r\n // JavaScript numbers: -324 (5e-324)\r\n minE: -EXP_LIMIT, // -1 to -EXP_LIMIT\r\n\r\n // The maximum exponent value, above which overflow to Infinity occurs.\r\n // JavaScript numbers: 308 (1.7976931348623157e+308)\r\n maxE: EXP_LIMIT, // 1 to EXP_LIMIT\r\n\r\n // Whether to use cryptographically-secure random number generation, if available.\r\n crypto: false // true/false\r\n },\r\n\r\n\r\n// ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- //\r\n\r\n\r\n inexact, quadrant,\r\n external = true,\r\n\r\n decimalError = '[DecimalError] ',\r\n invalidArgument = decimalError + 'Invalid argument: ',\r\n precisionLimitExceeded = decimalError + 'Precision limit exceeded',\r\n cryptoUnavailable = decimalError + 'crypto unavailable',\r\n tag = '[object Decimal]',\r\n\r\n mathfloor = Math.floor,\r\n mathpow = Math.pow,\r\n\r\n isBinary = /^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i,\r\n isHex = /^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i,\r\n isOctal = /^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i,\r\n isDecimal = /^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,\r\n\r\n BASE = 1e7,\r\n LOG_BASE = 7,\r\n MAX_SAFE_INTEGER = 9007199254740991,\r\n\r\n LN10_PRECISION = LN10.length - 1,\r\n PI_PRECISION = PI.length - 1,\r\n\r\n // Decimal.prototype object\r\n P = { toStringTag: tag };\r\n\r\n\r\n// Decimal prototype methods\r\n\r\n\r\n/*\r\n * absoluteValue abs\r\n * ceil\r\n * clampedTo clamp\r\n * comparedTo cmp\r\n * cosine cos\r\n * cubeRoot cbrt\r\n * decimalPlaces dp\r\n * dividedBy div\r\n * dividedToIntegerBy divToInt\r\n * equals eq\r\n * floor\r\n * greaterThan gt\r\n * greaterThanOrEqualTo gte\r\n * hyperbolicCosine cosh\r\n * hyperbolicSine sinh\r\n * hyperbolicTangent tanh\r\n * inverseCosine acos\r\n * inverseHyperbolicCosine acosh\r\n * inverseHyperbolicSine asinh\r\n * inverseHyperbolicTangent atanh\r\n * inverseSine asin\r\n * inverseTangent atan\r\n * isFinite\r\n * isInteger isInt\r\n * isNaN\r\n * isNegative isNeg\r\n * isPositive isPos\r\n * isZero\r\n * lessThan lt\r\n * lessThanOrEqualTo lte\r\n * logarithm log\r\n * [maximum] [max]\r\n * [minimum] [min]\r\n * minus sub\r\n * modulo mod\r\n * naturalExponential exp\r\n * naturalLogarithm ln\r\n * negated neg\r\n * plus add\r\n * precision sd\r\n * round\r\n * sine sin\r\n * squareRoot sqrt\r\n * tangent tan\r\n * times mul\r\n * toBinary\r\n * toDecimalPlaces toDP\r\n * toExponential\r\n * toFixed\r\n * toFraction\r\n * toHexadecimal toHex\r\n * toNearest\r\n * toNumber\r\n * toOctal\r\n * toPower pow\r\n * toPrecision\r\n * toSignificantDigits toSD\r\n * toString\r\n * truncated trunc\r\n * valueOf toJSON\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the absolute value of this Decimal.\r\n *\r\n */\r\nP.absoluteValue = P.abs = function () {\r\n var x = new this.constructor(this);\r\n if (x.s < 0) x.s = 1;\r\n return finalise(x);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n * direction of positive Infinity.\r\n *\r\n */\r\nP.ceil = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 2);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal clamped to the range\r\n * delineated by `min` and `max`.\r\n *\r\n * min {number|string|bigint|Decimal}\r\n * max {number|string|bigint|Decimal}\r\n *\r\n */\r\nP.clampedTo = P.clamp = function (min, max) {\r\n var k,\r\n x = this,\r\n Ctor = x.constructor;\r\n min = new Ctor(min);\r\n max = new Ctor(max);\r\n if (!min.s || !max.s) return new Ctor(NaN);\r\n if (min.gt(max)) throw Error(invalidArgument + max);\r\n k = x.cmp(min);\r\n return k < 0 ? min : x.cmp(max) > 0 ? max : new Ctor(x);\r\n};\r\n\r\n\r\n/*\r\n * Return\r\n * 1 if the value of this Decimal is greater than the value of `y`,\r\n * -1 if the value of this Decimal is less than the value of `y`,\r\n * 0 if they have the same value,\r\n * NaN if the value of either Decimal is NaN.\r\n *\r\n */\r\nP.comparedTo = P.cmp = function (y) {\r\n var i, j, xdL, ydL,\r\n x = this,\r\n xd = x.d,\r\n yd = (y = new x.constructor(y)).d,\r\n xs = x.s,\r\n ys = y.s;\r\n\r\n // Either NaN or ±Infinity?\r\n if (!xd || !yd) {\r\n return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1;\r\n }\r\n\r\n // Either zero?\r\n if (!xd[0] || !yd[0]) return xd[0] ? xs : yd[0] ? -ys : 0;\r\n\r\n // Signs differ?\r\n if (xs !== ys) return xs;\r\n\r\n // Compare exponents.\r\n if (x.e !== y.e) return x.e > y.e ^ xs < 0 ? 1 : -1;\r\n\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Compare digit by digit.\r\n for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {\r\n if (xd[i] !== yd[i]) return xd[i] > yd[i] ^ xs < 0 ? 1 : -1;\r\n }\r\n\r\n // Compare lengths.\r\n return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cosine of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * cos(0) = 1\r\n * cos(-0) = 1\r\n * cos(Infinity) = NaN\r\n * cos(-Infinity) = NaN\r\n * cos(NaN) = NaN\r\n *\r\n */\r\nP.cosine = P.cos = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.d) return new Ctor(NaN);\r\n\r\n // cos(0) = cos(-0) = 1\r\n if (!x.d[0]) return new Ctor(1);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n Ctor.rounding = 1;\r\n\r\n x = cosine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n *\r\n * Return a new Decimal whose value is the cube root of the value of this Decimal, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * cbrt(0) = 0\r\n * cbrt(-0) = -0\r\n * cbrt(1) = 1\r\n * cbrt(-1) = -1\r\n * cbrt(N) = N\r\n * cbrt(-I) = -I\r\n * cbrt(I) = I\r\n *\r\n * Math.cbrt(x) = (x < 0 ? -Math.pow(-x, 1/3) : Math.pow(x, 1/3))\r\n *\r\n */\r\nP.cubeRoot = P.cbrt = function () {\r\n var e, m, n, r, rep, s, sd, t, t3, t3plusx,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = x.s * mathpow(x.s * x, 1 / 3);\r\n\r\n // Math.cbrt underflow/overflow?\r\n // Pass x to Math.pow as integer, then adjust the exponent of the result.\r\n if (!s || Math.abs(s) == 1 / 0) {\r\n n = digitsToString(x.d);\r\n e = x.e;\r\n\r\n // Adjust n exponent so it is a multiple of 3 away from x exponent.\r\n if (s = (e - n.length + 1) % 3) n += (s == 1 || s == -2 ? '0' : '00');\r\n s = mathpow(n, 1 / 3);\r\n\r\n // Rarely, e may be one less than the result exponent value.\r\n e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2));\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n r.s = x.s;\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n sd = (e = Ctor.precision) + 3;\r\n\r\n // Halley's method.\r\n // TODO? Compare Newton's method.\r\n for (;;) {\r\n t = r;\r\n t3 = t.times(t).times(t);\r\n t3plusx = t3.plus(x);\r\n r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1);\r\n\r\n // TODO? Replace with for-loop and checkRoundingDigits.\r\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n n = n.slice(sd - 3, sd + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or 4999\r\n // , i.e. approaching a rounding boundary, continue the iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n if (!rep) {\r\n finalise(t, e + 1, 0);\r\n\r\n if (t.times(t).times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n sd += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n // If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n finalise(r, e + 1, 1);\r\n m = !r.times(r).times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, e, Ctor.rounding, m);\r\n};\r\n\r\n\r\n/*\r\n * Return the number of decimal places of the value of this Decimal.\r\n *\r\n */\r\nP.decimalPlaces = P.dp = function () {\r\n var w,\r\n d = this.d,\r\n n = NaN;\r\n\r\n if (d) {\r\n w = d.length - 1;\r\n n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE;\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n w = d[w];\r\n if (w) for (; w % 10 == 0; w /= 10) n--;\r\n if (n < 0) n = 0;\r\n }\r\n\r\n return n;\r\n};\r\n\r\n\r\n/*\r\n * n / 0 = I\r\n * n / N = N\r\n * n / I = 0\r\n * 0 / n = 0\r\n * 0 / 0 = N\r\n * 0 / N = N\r\n * 0 / I = 0\r\n * N / n = N\r\n * N / 0 = N\r\n * N / N = N\r\n * N / I = N\r\n * I / n = I\r\n * I / 0 = I\r\n * I / N = N\r\n * I / I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal divided by `y`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.dividedBy = P.div = function (y) {\r\n return divide(this, new this.constructor(y));\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the integer part of dividing the value of this Decimal\r\n * by the value of `y`, rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.dividedToIntegerBy = P.divToInt = function (y) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false.\r\n *\r\n */\r\nP.equals = P.eq = function (y) {\r\n return this.cmp(y) === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n * direction of negative Infinity.\r\n *\r\n */\r\nP.floor = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 3);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is greater than the value of `y`, otherwise return\r\n * false.\r\n *\r\n */\r\nP.greaterThan = P.gt = function (y) {\r\n return this.cmp(y) > 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is greater than or equal to the value of `y`,\r\n * otherwise return false.\r\n *\r\n */\r\nP.greaterThanOrEqualTo = P.gte = function (y) {\r\n var k = this.cmp(y);\r\n return k == 1 || k === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic cosine of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [1, Infinity]\r\n *\r\n * cosh(x) = 1 + x^2/2! + x^4/4! + x^6/6! + ...\r\n *\r\n * cosh(0) = 1\r\n * cosh(-0) = 1\r\n * cosh(Infinity) = Infinity\r\n * cosh(-Infinity) = Infinity\r\n * cosh(NaN) = NaN\r\n *\r\n * x time taken (ms) result\r\n * 1000 9 9.8503555700852349694e+433\r\n * 10000 25 4.4034091128314607936e+4342\r\n * 100000 171 1.4033316802130615897e+43429\r\n * 1000000 3817 1.5166076984010437725e+434294\r\n * 10000000 abandoned after 2 minute wait\r\n *\r\n * TODO? Compare performance of cosh(x) = 0.5 * (exp(x) + exp(-x))\r\n *\r\n */\r\nP.hyperbolicCosine = P.cosh = function () {\r\n var k, n, pr, rm, len,\r\n x = this,\r\n Ctor = x.constructor,\r\n one = new Ctor(1);\r\n\r\n if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN);\r\n if (x.isZero()) return one;\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n len = x.d.length;\r\n\r\n // Argument reduction: cos(4x) = 1 - 8cos^2(x) + 8cos^4(x) + 1\r\n // i.e. cos(x) = 1 - cos^2(x/4)(8 - 8cos^2(x/4))\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n // TODO? Estimation reused from cosine() and may not be optimal here.\r\n if (len < 32) {\r\n k = Math.ceil(len / 3);\r\n n = (1 / tinyPow(4, k)).toString();\r\n } else {\r\n k = 16;\r\n n = '2.3283064365386962890625e-10';\r\n }\r\n\r\n x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true);\r\n\r\n // Reverse argument reduction\r\n var cosh2_x,\r\n i = k,\r\n d8 = new Ctor(8);\r\n for (; i--;) {\r\n cosh2_x = x.times(x);\r\n x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8))));\r\n }\r\n\r\n return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic sine of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * sinh(x) = x + x^3/3! + x^5/5! + x^7/7! + ...\r\n *\r\n * sinh(0) = 0\r\n * sinh(-0) = -0\r\n * sinh(Infinity) = Infinity\r\n * sinh(-Infinity) = -Infinity\r\n * sinh(NaN) = NaN\r\n *\r\n * x time taken (ms)\r\n * 10 2 ms\r\n * 100 5 ms\r\n * 1000 14 ms\r\n * 10000 82 ms\r\n * 100000 886 ms 1.4033316802130615897e+43429\r\n * 200000 2613 ms\r\n * 300000 5407 ms\r\n * 400000 8824 ms\r\n * 500000 13026 ms 8.7080643612718084129e+217146\r\n * 1000000 48543 ms\r\n *\r\n * TODO? Compare performance of sinh(x) = 0.5 * (exp(x) - exp(-x))\r\n *\r\n */\r\nP.hyperbolicSine = P.sinh = function () {\r\n var k, pr, rm, len,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n len = x.d.length;\r\n\r\n if (len < 3) {\r\n x = taylorSeries(Ctor, 2, x, x, true);\r\n } else {\r\n\r\n // Alternative argument reduction: sinh(3x) = sinh(x)(3 + 4sinh^2(x))\r\n // i.e. sinh(x) = sinh(x/3)(3 + 4sinh^2(x/3))\r\n // 3 multiplications and 1 addition\r\n\r\n // Argument reduction: sinh(5x) = sinh(x)(5 + sinh^2(x)(20 + 16sinh^2(x)))\r\n // i.e. sinh(x) = sinh(x/5)(5 + sinh^2(x/5)(20 + 16sinh^2(x/5)))\r\n // 4 multiplications and 2 additions\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n k = 1.4 * Math.sqrt(len);\r\n k = k > 16 ? 16 : k | 0;\r\n\r\n x = x.times(1 / tinyPow(5, k));\r\n x = taylorSeries(Ctor, 2, x, x, true);\r\n\r\n // Reverse argument reduction\r\n var sinh2_x,\r\n d5 = new Ctor(5),\r\n d16 = new Ctor(16),\r\n d20 = new Ctor(20);\r\n for (; k--;) {\r\n sinh2_x = x.times(x);\r\n x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20))));\r\n }\r\n }\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic tangent of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * tanh(x) = sinh(x) / cosh(x)\r\n *\r\n * tanh(0) = 0\r\n * tanh(-0) = -0\r\n * tanh(Infinity) = 1\r\n * tanh(-Infinity) = -1\r\n * tanh(NaN) = NaN\r\n *\r\n */\r\nP.hyperbolicTangent = P.tanh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(x.s);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 7;\r\n Ctor.rounding = 1;\r\n\r\n return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arccosine (inverse cosine) in radians of the value of\r\n * this Decimal.\r\n *\r\n * Domain: [-1, 1]\r\n * Range: [0, pi]\r\n *\r\n * acos(x) = pi/2 - asin(x)\r\n *\r\n * acos(0) = pi/2\r\n * acos(-0) = pi/2\r\n * acos(1) = 0\r\n * acos(-1) = pi\r\n * acos(1/2) = pi/3\r\n * acos(-1/2) = 2*pi/3\r\n * acos(|x| > 1) = NaN\r\n * acos(NaN) = NaN\r\n *\r\n */\r\nP.inverseCosine = P.acos = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n k = x.abs().cmp(1),\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding;\r\n\r\n if (k !== -1) {\r\n return k === 0\r\n // |x| is 1\r\n ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0)\r\n // |x| > 1 or x is NaN\r\n : new Ctor(NaN);\r\n }\r\n\r\n if (x.isZero()) return getPi(Ctor, pr + 4, rm).times(0.5);\r\n\r\n // TODO? Special case acos(0.5) = pi/3 and acos(-0.5) = 2*pi/3\r\n\r\n Ctor.precision = pr + 6;\r\n Ctor.rounding = 1;\r\n\r\n // See https://github.com/MikeMcl/decimal.js/pull/217\r\n x = new Ctor(1).minus(x).div(x.plus(1)).sqrt().atan();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(2);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic cosine in radians of the\r\n * value of this Decimal.\r\n *\r\n * Domain: [1, Infinity]\r\n * Range: [0, Infinity]\r\n *\r\n * acosh(x) = ln(x + sqrt(x^2 - 1))\r\n *\r\n * acosh(x < 1) = NaN\r\n * acosh(NaN) = NaN\r\n * acosh(Infinity) = Infinity\r\n * acosh(-Infinity) = NaN\r\n * acosh(0) = NaN\r\n * acosh(-0) = NaN\r\n * acosh(1) = 0\r\n * acosh(-1) = NaN\r\n *\r\n */\r\nP.inverseHyperbolicCosine = P.acosh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (x.lte(1)) return new Ctor(x.eq(1) ? 0 : NaN);\r\n if (!x.isFinite()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n external = false;\r\n\r\n x = x.times(x).minus(1).sqrt().plus(x);\r\n\r\n external = true;\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.ln();\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic sine in radians of the value\r\n * of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * asinh(x) = ln(x + sqrt(x^2 + 1))\r\n *\r\n * asinh(NaN) = NaN\r\n * asinh(Infinity) = Infinity\r\n * asinh(-Infinity) = -Infinity\r\n * asinh(0) = 0\r\n * asinh(-0) = -0\r\n *\r\n */\r\nP.inverseHyperbolicSine = P.asinh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6;\r\n Ctor.rounding = 1;\r\n external = false;\r\n\r\n x = x.times(x).plus(1).sqrt().plus(x);\r\n\r\n external = true;\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.ln();\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic tangent in radians of the\r\n * value of this Decimal.\r\n *\r\n * Domain: [-1, 1]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * atanh(x) = 0.5 * ln((1 + x) / (1 - x))\r\n *\r\n * atanh(|x| > 1) = NaN\r\n * atanh(NaN) = NaN\r\n * atanh(Infinity) = NaN\r\n * atanh(-Infinity) = NaN\r\n * atanh(0) = 0\r\n * atanh(-0) = -0\r\n * atanh(1) = Infinity\r\n * atanh(-1) = -Infinity\r\n *\r\n */\r\nP.inverseHyperbolicTangent = P.atanh = function () {\r\n var pr, rm, wpr, xsd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.e >= 0) return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n xsd = x.sd();\r\n\r\n if (Math.max(xsd, pr) < 2 * -x.e - 1) return finalise(new Ctor(x), pr, rm, true);\r\n\r\n Ctor.precision = wpr = xsd - x.e;\r\n\r\n x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1);\r\n\r\n Ctor.precision = pr + 4;\r\n Ctor.rounding = 1;\r\n\r\n x = x.ln();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(0.5);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arcsine (inverse sine) in radians of the value of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi/2, pi/2]\r\n *\r\n * asin(x) = 2*atan(x/(1 + sqrt(1 - x^2)))\r\n *\r\n * asin(0) = 0\r\n * asin(-0) = -0\r\n * asin(1/2) = pi/6\r\n * asin(-1/2) = -pi/6\r\n * asin(1) = pi/2\r\n * asin(-1) = -pi/2\r\n * asin(|x| > 1) = NaN\r\n * asin(NaN) = NaN\r\n *\r\n * TODO? Compare performance of Taylor series.\r\n *\r\n */\r\nP.inverseSine = P.asin = function () {\r\n var halfPi, k,\r\n pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n k = x.abs().cmp(1);\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n if (k !== -1) {\r\n\r\n // |x| is 1\r\n if (k === 0) {\r\n halfPi = getPi(Ctor, pr + 4, rm).times(0.5);\r\n halfPi.s = x.s;\r\n return halfPi;\r\n }\r\n\r\n // |x| > 1 or x is NaN\r\n return new Ctor(NaN);\r\n }\r\n\r\n // TODO? Special case asin(1/2) = pi/6 and asin(-1/2) = -pi/6\r\n\r\n Ctor.precision = pr + 6;\r\n Ctor.rounding = 1;\r\n\r\n x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(2);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent (inverse tangent) in radians of the value\r\n * of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi/2, pi/2]\r\n *\r\n * atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n *\r\n * atan(0) = 0\r\n * atan(-0) = -0\r\n * atan(1) = pi/4\r\n * atan(-1) = -pi/4\r\n * atan(Infinity) = pi/2\r\n * atan(-Infinity) = -pi/2\r\n * atan(NaN) = NaN\r\n *\r\n */\r\nP.inverseTangent = P.atan = function () {\r\n var i, j, k, n, px, t, r, wpr, x2,\r\n x = this,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding;\r\n\r\n if (!x.isFinite()) {\r\n if (!x.s) return new Ctor(NaN);\r\n if (pr + 4 <= PI_PRECISION) {\r\n r = getPi(Ctor, pr + 4, rm).times(0.5);\r\n r.s = x.s;\r\n return r;\r\n }\r\n } else if (x.isZero()) {\r\n return new Ctor(x);\r\n } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) {\r\n r = getPi(Ctor, pr + 4, rm).times(0.25);\r\n r.s = x.s;\r\n return r;\r\n }\r\n\r\n Ctor.precision = wpr = pr + 10;\r\n Ctor.rounding = 1;\r\n\r\n // TODO? if (x >= 1 && pr <= PI_PRECISION) atan(x) = halfPi * x.s - atan(1 / x);\r\n\r\n // Argument reduction\r\n // Ensure |x| < 0.42\r\n // atan(x) = 2 * atan(x / (1 + sqrt(1 + x^2)))\r\n\r\n k = Math.min(28, wpr / LOG_BASE + 2 | 0);\r\n\r\n for (i = k; i; --i) x = x.div(x.times(x).plus(1).sqrt().plus(1));\r\n\r\n external = false;\r\n\r\n j = Math.ceil(wpr / LOG_BASE);\r\n n = 1;\r\n x2 = x.times(x);\r\n r = new Ctor(x);\r\n px = x;\r\n\r\n // atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n for (; i !== -1;) {\r\n px = px.times(x2);\r\n t = r.minus(px.div(n += 2));\r\n\r\n px = px.times(x2);\r\n r = t.plus(px.div(n += 2));\r\n\r\n if (r.d[j] !== void 0) for (i = j; r.d[i] === t.d[i] && i--;);\r\n }\r\n\r\n if (k) r = r.times(2 << (k - 1));\r\n\r\n external = true;\r\n\r\n return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is a finite number, otherwise return false.\r\n *\r\n */\r\nP.isFinite = function () {\r\n return !!this.d;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is an integer, otherwise return false.\r\n *\r\n */\r\nP.isInteger = P.isInt = function () {\r\n return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is NaN, otherwise return false.\r\n *\r\n */\r\nP.isNaN = function () {\r\n return !this.s;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is negative, otherwise return false.\r\n *\r\n */\r\nP.isNegative = P.isNeg = function () {\r\n return this.s < 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is positive, otherwise return false.\r\n *\r\n */\r\nP.isPositive = P.isPos = function () {\r\n return this.s > 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is 0 or -0, otherwise return false.\r\n *\r\n */\r\nP.isZero = function () {\r\n return !!this.d && this.d[0] === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is less than `y`, otherwise return false.\r\n *\r\n */\r\nP.lessThan = P.lt = function (y) {\r\n return this.cmp(y) < 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false.\r\n *\r\n */\r\nP.lessThanOrEqualTo = P.lte = function (y) {\r\n return this.cmp(y) < 1;\r\n};\r\n\r\n\r\n/*\r\n * Return the logarithm of the value of this Decimal to the specified base, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * If no base is specified, return log[10](arg).\r\n *\r\n * log[base](arg) = ln(arg) / ln(base)\r\n *\r\n * The result will always be correctly rounded if the base of the log is 10, and 'almost always'\r\n * otherwise:\r\n *\r\n * Depending on the rounding mode, the result may be incorrectly rounded if the first fifteen\r\n * rounding digits are [49]99999999999999 or [50]00000000000000. In that case, the maximum error\r\n * between the result and the correctly rounded result will be one ulp (unit in the last place).\r\n *\r\n * log[-b](a) = NaN\r\n * log[0](a) = NaN\r\n * log[1](a) = NaN\r\n * log[NaN](a) = NaN\r\n * log[Infinity](a) = NaN\r\n * log[b](0) = -Infinity\r\n * log[b](-0) = -Infinity\r\n * log[b](-a) = NaN\r\n * log[b](1) = 0\r\n * log[b](Infinity) = Infinity\r\n * log[b](NaN) = NaN\r\n *\r\n * [base] {number|string|bigint|Decimal} The base of the logarithm.\r\n *\r\n */\r\nP.logarithm = P.log = function (base) {\r\n var isBase10, d, denominator, k, inf, num, sd, r,\r\n arg = this,\r\n Ctor = arg.constructor,\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding,\r\n guard = 5;\r\n\r\n // Default base is 10.\r\n if (base == null) {\r\n base = new Ctor(10);\r\n isBase10 = true;\r\n } else {\r\n base = new Ctor(base);\r\n d = base.d;\r\n\r\n // Return NaN if base is negative, or non-finite, or is 0 or 1.\r\n if (base.s < 0 || !d || !d[0] || base.eq(1)) return new Ctor(NaN);\r\n\r\n isBase10 = base.eq(10);\r\n }\r\n\r\n d = arg.d;\r\n\r\n // Is arg negative, non-finite, 0 or 1?\r\n if (arg.s < 0 || !d || !d[0] || arg.eq(1)) {\r\n return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0);\r\n }\r\n\r\n // The result will have a non-terminating decimal expansion if base is 10 and arg is not an\r\n // integer power of 10.\r\n if (isBase10) {\r\n if (d.length > 1) {\r\n inf = true;\r\n } else {\r\n for (k = d[0]; k % 10 === 0;) k /= 10;\r\n inf = k !== 1;\r\n }\r\n }\r\n\r\n external = false;\r\n sd = pr + guard;\r\n num = naturalLogarithm(arg, sd);\r\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n\r\n // The result will have 5 rounding digits.\r\n r = divide(num, denominator, sd, 1);\r\n\r\n // If at a rounding boundary, i.e. the result's rounding digits are [49]9999 or [50]0000,\r\n // calculate 10 further digits.\r\n //\r\n // If the result is known to have an infinite decimal expansion, repeat this until it is clear\r\n // that the result is above or below the boundary. Otherwise, if after calculating the 10\r\n // further digits, the last 14 are nines, round up and assume the result is exact.\r\n // Also assume the result is exact if the last 14 are zero.\r\n //\r\n // Example of a result that will be incorrectly rounded:\r\n // log[1048576](4503599627370502) = 2.60000000000000009610279511444746...\r\n // The above result correctly rounded using ROUND_CEIL to 1 decimal place should be 2.7, but it\r\n // will be given as 2.6 as there are 15 zeros immediately after the requested decimal place, so\r\n // the exact result would be assumed to be 2.6, which rounded using ROUND_CEIL to 1 decimal\r\n // place is still 2.6.\r\n if (checkRoundingDigits(r.d, k = pr, rm)) {\r\n\r\n do {\r\n sd += 10;\r\n num = naturalLogarithm(arg, sd);\r\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n r = divide(num, denominator, sd, 1);\r\n\r\n if (!inf) {\r\n\r\n // Check for 14 nines from the 2nd rounding digit, as the first may be 4.\r\n if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) {\r\n r = finalise(r, pr + 1, 0);\r\n }\r\n\r\n break;\r\n }\r\n } while (checkRoundingDigits(r.d, k += 10, rm));\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, pr, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the maximum of the arguments and the value of this Decimal.\r\n *\r\n * arguments {number|string|bigint|Decimal}\r\n *\r\nP.max = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, -1);\r\n};\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the minimum of the arguments and the value of this Decimal.\r\n *\r\n * arguments {number|string|bigint|Decimal}\r\n *\r\nP.min = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, 1);\r\n};\r\n */\r\n\r\n\r\n/*\r\n * n - 0 = n\r\n * n - N = N\r\n * n - I = -I\r\n * 0 - n = -n\r\n * 0 - 0 = 0\r\n * 0 - N = N\r\n * 0 - I = -I\r\n * N - n = N\r\n * N - 0 = N\r\n * N - N = N\r\n * N - I = N\r\n * I - n = I\r\n * I - 0 = I\r\n * I - N = N\r\n * I - I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal minus `y`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.minus = P.sub = function (y) {\r\n var d, e, i, j, k, len, pr, rm, xd, xe, xLTy, yd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // If either is not finite...\r\n if (!x.d || !y.d) {\r\n\r\n // Return NaN if either is NaN.\r\n if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n // Return y negated if x is finite and y is ±Infinity.\r\n else if (x.d) y.s = -y.s;\r\n\r\n // Return x if y is finite and x is ±Infinity.\r\n // Return x if both are ±Infinity with different signs.\r\n // Return NaN if both are ±Infinity with the same sign.\r\n else y = new Ctor(y.d || x.s !== y.s ? x : NaN);\r\n\r\n return y;\r\n }\r\n\r\n // If signs differ...\r\n if (x.s != y.s) {\r\n y.s = -y.s;\r\n return x.plus(y);\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n // If either is zero...\r\n if (!xd[0] || !yd[0]) {\r\n\r\n // Return y negated if x is zero and y is non-zero.\r\n if (yd[0]) y.s = -y.s;\r\n\r\n // Return x if y is zero and x is non-zero.\r\n else if (xd[0]) y = new Ctor(x);\r\n\r\n // Return zero if both are zero.\r\n // From IEEE 754 (2008) 6.3: 0 - 0 = -0 - -0 = -0 when rounding to -Infinity.\r\n else return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n }\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n // Calculate base 1e7 exponents.\r\n e = mathfloor(y.e / LOG_BASE);\r\n xe = mathfloor(x.e / LOG_BASE);\r\n\r\n xd = xd.slice();\r\n k = xe - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (k) {\r\n xLTy = k < 0;\r\n\r\n if (xLTy) {\r\n d = xd;\r\n k = -k;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = xe;\r\n len = xd.length;\r\n }\r\n\r\n // Numbers with massively different exponents would result in a very high number of\r\n // zeros needing to be prepended, but this can be avoided while still ensuring correct\r\n // rounding by limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`.\r\n i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;\r\n\r\n if (k > i) {\r\n k = i;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents.\r\n d.reverse();\r\n for (i = k; i--;) d.push(0);\r\n d.reverse();\r\n\r\n // Base 1e7 exponents equal.\r\n } else {\r\n\r\n // Check digits to determine which is the bigger number.\r\n\r\n i = xd.length;\r\n len = yd.length;\r\n xLTy = i < len;\r\n if (xLTy) len = i;\r\n\r\n for (i = 0; i < len; i++) {\r\n if (xd[i] != yd[i]) {\r\n xLTy = xd[i] < yd[i];\r\n break;\r\n }\r\n }\r\n\r\n k = 0;\r\n }\r\n\r\n if (xLTy) {\r\n d = xd;\r\n xd = yd;\r\n yd = d;\r\n y.s = -y.s;\r\n }\r\n\r\n len = xd.length;\r\n\r\n // Append zeros to `xd` if shorter.\r\n // Don't add zeros to `yd` if shorter as subtraction only needs to start at `yd` length.\r\n for (i = yd.length - len; i > 0; --i) xd[len++] = 0;\r\n\r\n // Subtract yd from xd.\r\n for (i = yd.length; i > k;) {\r\n\r\n if (xd[--i] < yd[i]) {\r\n for (j = i; j && xd[--j] === 0;) xd[j] = BASE - 1;\r\n --xd[j];\r\n xd[i] += BASE;\r\n }\r\n\r\n xd[i] -= yd[i];\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] === 0;) xd.pop();\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xd[0] === 0; xd.shift()) --e;\r\n\r\n // Zero?\r\n if (!xd[0]) return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n y.d = xd;\r\n y.e = getBase10Exponent(xd, e);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n};\r\n\r\n\r\n/*\r\n * n % 0 = N\r\n * n % N = N\r\n * n % I = n\r\n * 0 % n = 0\r\n * -0 % n = -0\r\n * 0 % 0 = N\r\n * 0 % N = N\r\n * 0 % I = 0\r\n * N % n = N\r\n * N % 0 = N\r\n * N % N = N\r\n * N % I = N\r\n * I % n = N\r\n * I % 0 = N\r\n * I % N = N\r\n * I % I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal modulo `y`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * The result depends on the modulo mode.\r\n *\r\n */\r\nP.modulo = P.mod = function (y) {\r\n var q,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // Return NaN if x is ±Infinity or NaN, or y is NaN or ±0.\r\n if (!x.d || !y.s || y.d && !y.d[0]) return new Ctor(NaN);\r\n\r\n // Return x if y is ±Infinity or x is ±0.\r\n if (!y.d || x.d && !x.d[0]) {\r\n return finalise(new Ctor(x), Ctor.precision, Ctor.rounding);\r\n }\r\n\r\n // Prevent rounding of intermediate calculations.\r\n external = false;\r\n\r\n if (Ctor.modulo == 9) {\r\n\r\n // Euclidian division: q = sign(y) * floor(x / abs(y))\r\n // result = x - q * y where 0 <= result < abs(y)\r\n q = divide(x, y.abs(), 0, 3, 1);\r\n q.s *= y.s;\r\n } else {\r\n q = divide(x, y, 0, Ctor.modulo, 1);\r\n }\r\n\r\n q = q.times(y);\r\n\r\n external = true;\r\n\r\n return x.minus(q);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of the value of this Decimal,\r\n * i.e. the base e raised to the power the value of this Decimal, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.naturalExponential = P.exp = function () {\r\n return naturalExponential(this);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of the value of this Decimal,\r\n * rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.naturalLogarithm = P.ln = function () {\r\n return naturalLogarithm(this);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by\r\n * -1.\r\n *\r\n */\r\nP.negated = P.neg = function () {\r\n var x = new this.constructor(this);\r\n x.s = -x.s;\r\n return finalise(x);\r\n};\r\n\r\n\r\n/*\r\n * n + 0 = n\r\n * n + N = N\r\n * n + I = I\r\n * 0 + n = n\r\n * 0 + 0 = 0\r\n * 0 + N = N\r\n * 0 + I = I\r\n * N + n = N\r\n * N + 0 = N\r\n * N + N = N\r\n * N + I = N\r\n * I + n = I\r\n * I + 0 = I\r\n * I + N = N\r\n * I + I = I\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal plus `y`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.plus = P.add = function (y) {\r\n var carry, d, e, i, k, len, pr, rm, xd, yd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // If either is not finite...\r\n if (!x.d || !y.d) {\r\n\r\n // Return NaN if either is NaN.\r\n if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n // Return x if y is finite and x is ±Infinity.\r\n // Return x if both are ±Infinity with the same sign.\r\n // Return NaN if both are ±Infinity with different signs.\r\n // Return y if x is finite and y is ±Infinity.\r\n else if (!x.d) y = new Ctor(y.d || x.s === y.s ? x : NaN);\r\n\r\n return y;\r\n }\r\n\r\n // If signs differ...\r\n if (x.s != y.s) {\r\n y.s = -y.s;\r\n return x.minus(y);\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n // If either is zero...\r\n if (!xd[0] || !yd[0]) {\r\n\r\n // Return x if y is zero.\r\n // Return y if y is non-zero.\r\n if (!yd[0]) y = new Ctor(x);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n }\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n // Calculate base 1e7 exponents.\r\n k = mathfloor(x.e / LOG_BASE);\r\n e = mathfloor(y.e / LOG_BASE);\r\n\r\n xd = xd.slice();\r\n i = k - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (i) {\r\n\r\n if (i < 0) {\r\n d = xd;\r\n i = -i;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = k;\r\n len = xd.length;\r\n }\r\n\r\n // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1.\r\n k = Math.ceil(pr / LOG_BASE);\r\n len = k > len ? k + 1 : len + 1;\r\n\r\n if (i > len) {\r\n i = len;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts.\r\n d.reverse();\r\n for (; i--;) d.push(0);\r\n d.reverse();\r\n }\r\n\r\n len = xd.length;\r\n i = yd.length;\r\n\r\n // If yd is longer than xd, swap xd and yd so xd points to the longer array.\r\n if (len - i < 0) {\r\n i = len;\r\n d = yd;\r\n yd = xd;\r\n xd = d;\r\n }\r\n\r\n // Only start adding at yd.length - 1 as the further digits of xd can be left as they are.\r\n for (carry = 0; i;) {\r\n carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0;\r\n xd[i] %= BASE;\r\n }\r\n\r\n if (carry) {\r\n xd.unshift(carry);\r\n ++e;\r\n }\r\n\r\n // Remove trailing zeros.\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n for (len = xd.length; xd[--len] == 0;) xd.pop();\r\n\r\n y.d = xd;\r\n y.e = getBase10Exponent(xd, e);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n};\r\n\r\n\r\n/*\r\n * Return the number of significant digits of the value of this Decimal.\r\n *\r\n * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.\r\n *\r\n */\r\nP.precision = P.sd = function (z) {\r\n var k,\r\n x = this;\r\n\r\n if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);\r\n\r\n if (x.d) {\r\n k = getPrecision(x.d);\r\n if (z && x.e + 1 > k) k = x.e + 1;\r\n } else {\r\n k = NaN;\r\n }\r\n\r\n return k;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using\r\n * rounding mode `rounding`.\r\n *\r\n */\r\nP.round = function () {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n return finalise(new Ctor(x), x.e + 1, Ctor.rounding);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sine of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * sin(x) = x - x^3/3! + x^5/5! - ...\r\n *\r\n * sin(0) = 0\r\n * sin(-0) = -0\r\n * sin(Infinity) = NaN\r\n * sin(-Infinity) = NaN\r\n * sin(NaN) = NaN\r\n *\r\n */\r\nP.sine = P.sin = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n Ctor.rounding = 1;\r\n\r\n x = sine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of this Decimal, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * sqrt(-n) = N\r\n * sqrt(N) = N\r\n * sqrt(-I) = N\r\n * sqrt(I) = I\r\n * sqrt(0) = 0\r\n * sqrt(-0) = -0\r\n *\r\n */\r\nP.squareRoot = P.sqrt = function () {\r\n var m, n, sd, r, rep, t,\r\n x = this,\r\n d = x.d,\r\n e = x.e,\r\n s = x.s,\r\n Ctor = x.constructor;\r\n\r\n // Negative/NaN/Infinity/zero?\r\n if (s !== 1 || !d || !d[0]) {\r\n return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0);\r\n }\r\n\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = Math.sqrt(+x);\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n if (s == 0 || s == 1 / 0) {\r\n n = digitsToString(d);\r\n\r\n if ((n.length + e) % 2 == 0) n += '0';\r\n s = Math.sqrt(n);\r\n e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n sd = (e = Ctor.precision) + 3;\r\n\r\n // Newton-Raphson iteration.\r\n for (;;) {\r\n t = r;\r\n r = t.plus(divide(x, t, sd + 2, 1)).times(0.5);\r\n\r\n // TODO? Replace with for-loop and checkRoundingDigits.\r\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n n = n.slice(sd - 3, sd + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or\r\n // 4999, i.e. approaching a rounding boundary, continue the iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n if (!rep) {\r\n finalise(t, e + 1, 0);\r\n\r\n if (t.times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n sd += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n // If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n finalise(r, e + 1, 1);\r\n m = !r.times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, e, Ctor.rounding, m);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the tangent of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * tan(0) = 0\r\n * tan(-0) = -0\r\n * tan(Infinity) = NaN\r\n * tan(-Infinity) = NaN\r\n * tan(NaN) = NaN\r\n *\r\n */\r\nP.tangent = P.tan = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 10;\r\n Ctor.rounding = 1;\r\n\r\n x = x.sin();\r\n x.s = 1;\r\n x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0);\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * n * 0 = 0\r\n * n * N = N\r\n * n * I = I\r\n * 0 * n = 0\r\n * 0 * 0 = 0\r\n * 0 * N = N\r\n * 0 * I = N\r\n * N * n = N\r\n * N * 0 = N\r\n * N * N = N\r\n * N * I = N\r\n * I * n = I\r\n * I * 0 = N\r\n * I * N = N\r\n * I * I = I\r\n *\r\n * Return a new Decimal whose value is this Decimal times `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.times = P.mul = function (y) {\r\n var carry, e, i, k, r, rL, t, xdL, ydL,\r\n x = this,\r\n Ctor = x.constructor,\r\n xd = x.d,\r\n yd = (y = new Ctor(y)).d;\r\n\r\n y.s *= x.s;\r\n\r\n // If either is NaN, ±Infinity or ±0...\r\n if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd\r\n\r\n // Return NaN if either is NaN.\r\n // Return NaN if x is ±0 and y is ±Infinity, or y is ±0 and x is ±Infinity.\r\n ? NaN\r\n\r\n // Return ±Infinity if either is ±Infinity.\r\n // Return ±0 if either is ±0.\r\n : !xd || !yd ? y.s / 0 : y.s * 0);\r\n }\r\n\r\n e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE);\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Ensure xd points to the longer array.\r\n if (xdL < ydL) {\r\n r = xd;\r\n xd = yd;\r\n yd = r;\r\n rL = xdL;\r\n xdL = ydL;\r\n ydL = rL;\r\n }\r\n\r\n // Initialise the result array with zeros.\r\n r = [];\r\n rL = xdL + ydL;\r\n for (i = rL; i--;) r.push(0);\r\n\r\n // Multiply!\r\n for (i = ydL; --i >= 0;) {\r\n carry = 0;\r\n for (k = xdL + i; k > i;) {\r\n t = r[k] + yd[i] * xd[k - i - 1] + carry;\r\n r[k--] = t % BASE | 0;\r\n carry = t / BASE | 0;\r\n }\r\n\r\n r[k] = (r[k] + carry) % BASE | 0;\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; !r[--rL];) r.pop();\r\n\r\n if (carry) ++e;\r\n else r.shift();\r\n\r\n y.d = r;\r\n y.e = getBase10Exponent(r, e);\r\n\r\n return external ? finalise(y, Ctor.precision, Ctor.rounding) : y;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 2, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toBinary = function (sd, rm) {\r\n return toStringBinary(this, 2, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp`\r\n * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted.\r\n *\r\n * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toDecimalPlaces = P.toDP = function (dp, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n if (dp === void 0) return x;\r\n\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n return finalise(x, dp + x.e + 1, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in exponential notation rounded to\r\n * `dp` fixed decimal places using rounding mode `rounding`.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toExponential = function (dp, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = finiteToString(x, true);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = finalise(new Ctor(x), dp + 1, rm);\r\n str = finiteToString(x, true, dp + 1);\r\n }\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in normal (fixed-point) notation to\r\n * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is\r\n * omitted.\r\n *\r\n * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\r\n * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\r\n * (-0).toFixed(3) is '0.000'.\r\n * (-0.5).toFixed(0) is '-0'.\r\n *\r\n */\r\nP.toFixed = function (dp, rm) {\r\n var str, y,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = finiteToString(x);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n y = finalise(new Ctor(x), dp + x.e + 1, rm);\r\n str = finiteToString(y, false, dp + y.e + 1);\r\n }\r\n\r\n // To determine whether to add the minus sign look at the value before it was rounded,\r\n // i.e. look at `x` rather than `y`.\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return an array representing the value of this Decimal as a simple fraction with an integer\r\n * numerator and an integer denominator.\r\n *\r\n * The denominator will be a positive non-zero value less than or equal to the specified maximum\r\n * denominator. If a maximum denominator is not specified, the denominator will be the lowest\r\n * value necessary to represent the number exactly.\r\n *\r\n * [maxD] {number|string|bigint|Decimal} Maximum denominator. Integer >= 1 and < Infinity.\r\n *\r\n */\r\nP.toFraction = function (maxD) {\r\n var d, d0, d1, d2, e, k, n, n0, n1, pr, q, r,\r\n x = this,\r\n xd = x.d,\r\n Ctor = x.constructor;\r\n\r\n if (!xd) return new Ctor(x);\r\n\r\n n1 = d0 = new Ctor(1);\r\n d1 = n0 = new Ctor(0);\r\n\r\n d = new Ctor(d1);\r\n e = d.e = getPrecision(xd) - x.e - 1;\r\n k = e % LOG_BASE;\r\n d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k);\r\n\r\n if (maxD == null) {\r\n\r\n // d is 10**e, the minimum max-denominator needed.\r\n maxD = e > 0 ? d : n1;\r\n } else {\r\n n = new Ctor(maxD);\r\n if (!n.isInt() || n.lt(n1)) throw Error(invalidArgument + n);\r\n maxD = n.gt(d) ? (e > 0 ? d : n1) : n;\r\n }\r\n\r\n external = false;\r\n n = new Ctor(digitsToString(xd));\r\n pr = Ctor.precision;\r\n Ctor.precision = e = xd.length * LOG_BASE * 2;\r\n\r\n for (;;) {\r\n q = divide(n, d, 0, 1, 1);\r\n d2 = d0.plus(q.times(d1));\r\n if (d2.cmp(maxD) == 1) break;\r\n d0 = d1;\r\n d1 = d2;\r\n d2 = n1;\r\n n1 = n0.plus(q.times(d2));\r\n n0 = d2;\r\n d2 = d;\r\n d = n.minus(q.times(d2));\r\n n = d2;\r\n }\r\n\r\n d2 = divide(maxD.minus(d0), d1, 0, 1, 1);\r\n n0 = n0.plus(d2.times(n1));\r\n d0 = d0.plus(d2.times(d1));\r\n n0.s = n1.s = x.s;\r\n\r\n // Determine which fraction is closer to x, n0/d0 or n1/d1?\r\n r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1\r\n ? [n1, d1] : [n0, d0];\r\n\r\n Ctor.precision = pr;\r\n external = true;\r\n\r\n return r;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 16, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toHexadecimal = P.toHex = function (sd, rm) {\r\n return toStringBinary(this, 16, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Returns a new Decimal whose value is the nearest multiple of `y` in the direction of rounding\r\n * mode `rm`, or `Decimal.rounding` if `rm` is omitted, to the value of this Decimal.\r\n *\r\n * The return value will always have the same sign as this Decimal, unless either this Decimal\r\n * or `y` is NaN, in which case the return value will be also be NaN.\r\n *\r\n * The return value is not affected by the value of `precision`.\r\n *\r\n * y {number|string|bigint|Decimal} The magnitude to round to a multiple of.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * 'toNearest() rounding mode not an integer: {rm}'\r\n * 'toNearest() rounding mode out of range: {rm}'\r\n *\r\n */\r\nP.toNearest = function (y, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n\r\n if (y == null) {\r\n\r\n // If x is not finite, return x.\r\n if (!x.d) return x;\r\n\r\n y = new Ctor(1);\r\n rm = Ctor.rounding;\r\n } else {\r\n y = new Ctor(y);\r\n if (rm === void 0) {\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(rm, 0, 8);\r\n }\r\n\r\n // If x is not finite, return x if y is not NaN, else NaN.\r\n if (!x.d) return y.s ? x : y;\r\n\r\n // If y is not finite, return Infinity with the sign of x if y is Infinity, else NaN.\r\n if (!y.d) {\r\n if (y.s) y.s = x.s;\r\n return y;\r\n }\r\n }\r\n\r\n // If y is not zero, calculate the nearest multiple of y to x.\r\n if (y.d[0]) {\r\n external = false;\r\n x = divide(x, y, 0, rm, 1).times(y);\r\n external = true;\r\n finalise(x);\r\n\r\n // If y is zero, return zero with the sign of x.\r\n } else {\r\n y.s = x.s;\r\n x = y;\r\n }\r\n\r\n return x;\r\n};\r\n\r\n\r\n/*\r\n * Return the value of this Decimal converted to a number primitive.\r\n * Zero keeps its sign.\r\n *\r\n */\r\nP.toNumber = function () {\r\n return +this;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 8, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toOctal = function (sd, rm) {\r\n return toStringBinary(this, 8, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal raised to the power `y`, rounded\r\n * to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * ECMAScript compliant.\r\n *\r\n * pow(x, NaN) = NaN\r\n * pow(x, ±0) = 1\r\n\r\n * pow(NaN, non-zero) = NaN\r\n * pow(abs(x) > 1, +Infinity) = +Infinity\r\n * pow(abs(x) > 1, -Infinity) = +0\r\n * pow(abs(x) == 1, ±Infinity) = NaN\r\n * pow(abs(x) < 1, +Infinity) = +0\r\n * pow(abs(x) < 1, -Infinity) = +Infinity\r\n * pow(+Infinity, y > 0) = +Infinity\r\n * pow(+Infinity, y < 0) = +0\r\n * pow(-Infinity, odd integer > 0) = -Infinity\r\n * pow(-Infinity, even integer > 0) = +Infinity\r\n * pow(-Infinity, odd integer < 0) = -0\r\n * pow(-Infinity, even integer < 0) = +0\r\n * pow(+0, y > 0) = +0\r\n * pow(+0, y < 0) = +Infinity\r\n * pow(-0, odd integer > 0) = -0\r\n * pow(-0, even integer > 0) = +0\r\n * pow(-0, odd integer < 0) = -Infinity\r\n * pow(-0, even integer < 0) = +Infinity\r\n * pow(finite x < 0, finite non-integer) = NaN\r\n *\r\n * For non-integer or very large exponents pow(x, y) is calculated using\r\n *\r\n * x^y = exp(y*ln(x))\r\n *\r\n * Assuming the first 15 rounding digits are each equally likely to be any digit 0-9, the\r\n * probability of an incorrectly rounded result\r\n * P([49]9{14} | [50]0{14}) = 2 * 0.2 * 10^-14 = 4e-15 = 1/2.5e+14\r\n * i.e. 1 in 250,000,000,000,000\r\n *\r\n * If a result is incorrectly rounded the maximum error will be 1 ulp (unit in last place).\r\n *\r\n * y {number|string|bigint|Decimal} The power to which to raise this Decimal.\r\n *\r\n */\r\nP.toPower = P.pow = function (y) {\r\n var e, k, pr, r, rm, s,\r\n x = this,\r\n Ctor = x.constructor,\r\n yn = +(y = new Ctor(y));\r\n\r\n // Either ±Infinity, NaN or ±0?\r\n if (!x.d || !y.d || !x.d[0] || !y.d[0]) return new Ctor(mathpow(+x, yn));\r\n\r\n x = new Ctor(x);\r\n\r\n if (x.eq(1)) return x;\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n if (y.eq(1)) return finalise(x, pr, rm);\r\n\r\n // y exponent\r\n e = mathfloor(y.e / LOG_BASE);\r\n\r\n // If y is a small integer use the 'exponentiation by squaring' algorithm.\r\n if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {\r\n r = intPow(Ctor, x, k, pr);\r\n return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm);\r\n }\r\n\r\n s = x.s;\r\n\r\n // if x is negative\r\n if (s < 0) {\r\n\r\n // if y is not an integer\r\n if (e < y.d.length - 1) return new Ctor(NaN);\r\n\r\n // Result is positive if x is negative and the last digit of integer y is even.\r\n if ((y.d[e] & 1) == 0) s = 1;\r\n\r\n // if x.eq(-1)\r\n if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) {\r\n x.s = s;\r\n return x;\r\n }\r\n }\r\n\r\n // Estimate result exponent.\r\n // x^y = 10^e, where e = y * log10(x)\r\n // log10(x) = log10(x_significand) + x_exponent\r\n // log10(x_significand) = ln(x_significand) / ln(10)\r\n k = mathpow(+x, yn);\r\n e = k == 0 || !isFinite(k)\r\n ? mathfloor(yn * (Math.log('0.' + digitsToString(x.d)) / Math.LN10 + x.e + 1))\r\n : new Ctor(k + '').e;\r\n\r\n // Exponent estimate may be incorrect e.g. x: 0.999999999999999999, y: 2.29, e: 0, r.e: -1.\r\n\r\n // Overflow/underflow?\r\n if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) return new Ctor(e > 0 ? s / 0 : 0);\r\n\r\n external = false;\r\n Ctor.rounding = x.s = 1;\r\n\r\n // Estimate the extra guard digits needed to ensure five correct rounding digits from\r\n // naturalLogarithm(x). Example of failure without these extra digits (precision: 10):\r\n // new Decimal(2.32456).pow('2087987436534566.46411')\r\n // should be 1.162377823e+764914905173815, but is 1.162355823e+764914905173815\r\n k = Math.min(12, (e + '').length);\r\n\r\n // r = x^y = exp(y*ln(x))\r\n r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr);\r\n\r\n // r may be Infinity, e.g. (0.9999999999999999).pow(-1e+40)\r\n if (r.d) {\r\n\r\n // Truncate to the required precision plus five rounding digits.\r\n r = finalise(r, pr + 5, 1);\r\n\r\n // If the rounding digits are [49]9999 or [50]0000 increase the precision by 10 and recalculate\r\n // the result.\r\n if (checkRoundingDigits(r.d, pr, rm)) {\r\n e = pr + 10;\r\n\r\n // Truncate to the increased precision plus five rounding digits.\r\n r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1);\r\n\r\n // Check for 14 nines from the 2nd rounding digit (the first rounding digit may be 4 or 9).\r\n if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) {\r\n r = finalise(r, pr + 1, 0);\r\n }\r\n }\r\n }\r\n\r\n r.s = s;\r\n external = true;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(r, pr, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal rounded to `sd` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * Return exponential notation if `sd` is less than the number of digits necessary to represent\r\n * the integer part of the value in normal notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toPrecision = function (sd, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = finalise(new Ctor(x), sd, rm);\r\n str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd);\r\n }\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd`\r\n * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if\r\n * omitted.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * 'toSD() digits out of range: {sd}'\r\n * 'toSD() digits not an integer: {sd}'\r\n * 'toSD() rounding mode not an integer: {rm}'\r\n * 'toSD() rounding mode out of range: {rm}'\r\n *\r\n */\r\nP.toSignificantDigits = P.toSD = function (sd, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n }\r\n\r\n return finalise(new Ctor(x), sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal.\r\n *\r\n * Return exponential notation if this Decimal has a positive exponent equal to or greater than\r\n * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`.\r\n *\r\n */\r\nP.toString = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal truncated to a whole number.\r\n *\r\n */\r\nP.truncated = P.trunc = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 1);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal.\r\n * Unlike `toString`, negative zero will include the minus sign.\r\n *\r\n */\r\nP.valueOf = P.toJSON = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n return x.isNeg() ? '-' + str : str;\r\n};\r\n\r\n\r\n// Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers.\r\n\r\n\r\n/*\r\n * digitsToString P.cubeRoot, P.logarithm, P.squareRoot, P.toFraction, P.toPower,\r\n * finiteToString, naturalExponential, naturalLogarithm\r\n * checkInt32 P.toDecimalPlaces, P.toExponential, P.toFixed, P.toNearest,\r\n * P.toPrecision, P.toSignificantDigits, toStringBinary, random\r\n * checkRoundingDigits P.logarithm, P.toPower, naturalExponential, naturalLogarithm\r\n * convertBase toStringBinary, parseOther\r\n * cos P.cos\r\n * divide P.atanh, P.cubeRoot, P.dividedBy, P.dividedToIntegerBy,\r\n * P.logarithm, P.modulo, P.squareRoot, P.tan, P.tanh, P.toFraction,\r\n * P.toNearest, toStringBinary, naturalExponential, naturalLogarithm,\r\n * taylorSeries, atan2, parseOther\r\n * finalise P.absoluteValue, P.atan, P.atanh, P.ceil, P.cos, P.cosh,\r\n * P.cubeRoot, P.dividedToIntegerBy, P.floor, P.logarithm, P.minus,\r\n * P.modulo, P.negated, P.plus, P.round, P.sin, P.sinh, P.squareRoot,\r\n * P.tan, P.times, P.toDecimalPlaces, P.toExponential, P.toFixed,\r\n * P.toNearest, P.toPower, P.toPrecision, P.toSignificantDigits,\r\n * P.truncated, divide, getLn10, getPi, naturalExponential,\r\n * naturalLogarithm, ceil, floor, round, trunc\r\n * finiteToString P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf,\r\n * toStringBinary\r\n * getBase10Exponent P.minus, P.plus, P.times, parseOther\r\n * getLn10 P.logarithm, naturalLogarithm\r\n * getPi P.acos, P.asin, P.atan, toLessThanHalfPi, atan2\r\n * getPrecision P.precision, P.toFraction\r\n * getZeroString digitsToString, finiteToString\r\n * intPow P.toPower, parseOther\r\n * isOdd toLessThanHalfPi\r\n * maxOrMin max, min\r\n * naturalExponential P.naturalExponential, P.toPower\r\n * naturalLogarithm P.acosh, P.asinh, P.atanh, P.logarithm, P.naturalLogarithm,\r\n * P.toPower, naturalExponential\r\n * nonFiniteToString finiteToString, toStringBinary\r\n * parseDecimal Decimal\r\n * parseOther Decimal\r\n * sin P.sin\r\n * taylorSeries P.cosh, P.sinh, cos, sin\r\n * toLessThanHalfPi P.cos, P.sin\r\n * toStringBinary P.toBinary, P.toHexadecimal, P.toOctal\r\n * truncate intPow\r\n *\r\n * Throws: P.logarithm, P.precision, P.toFraction, checkInt32, getLn10, getPi,\r\n * naturalLogarithm, config, parseOther, random, Decimal\r\n */\r\n\r\n\r\nfunction digitsToString(d) {\r\n var i, k, ws,\r\n indexOfLastWord = d.length - 1,\r\n str = '',\r\n w = d[0];\r\n\r\n if (indexOfLastWord > 0) {\r\n str += w;\r\n for (i = 1; i < indexOfLastWord; i++) {\r\n ws = d[i] + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n str += ws;\r\n }\r\n\r\n w = d[i];\r\n ws = w + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n } else if (w === 0) {\r\n return '0';\r\n }\r\n\r\n // Remove trailing zeros of last w.\r\n for (; w % 10 === 0;) w /= 10;\r\n\r\n return str + w;\r\n}\r\n\r\n\r\nfunction checkInt32(i, min, max) {\r\n if (i !== ~~i || i < min || i > max) {\r\n throw Error(invalidArgument + i);\r\n }\r\n}\r\n\r\n\r\n/*\r\n * Check 5 rounding digits if `repeating` is null, 4 otherwise.\r\n * `repeating == null` if caller is `log` or `pow`,\r\n * `repeating != null` if caller is `naturalLogarithm` or `naturalExponential`.\r\n */\r\nfunction checkRoundingDigits(d, i, rm, repeating) {\r\n var di, k, r, rd;\r\n\r\n // Get the length of the first word of the array d.\r\n for (k = d[0]; k >= 10; k /= 10) --i;\r\n\r\n // Is the rounding digit in the first word of d?\r\n if (--i < 0) {\r\n i += LOG_BASE;\r\n di = 0;\r\n } else {\r\n di = Math.ceil((i + 1) / LOG_BASE);\r\n i %= LOG_BASE;\r\n }\r\n\r\n // i is the index (0 - 6) of the rounding digit.\r\n // E.g. if within the word 3487563 the first rounding digit is 5,\r\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\r\n k = mathpow(10, LOG_BASE - i);\r\n rd = d[di] % k | 0;\r\n\r\n if (repeating == null) {\r\n if (i < 3) {\r\n if (i == 0) rd = rd / 100 | 0;\r\n else if (i == 1) rd = rd / 10 | 0;\r\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\r\n } else {\r\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\r\n (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\r\n }\r\n } else {\r\n if (i < 4) {\r\n if (i == 0) rd = rd / 1000 | 0;\r\n else if (i == 1) rd = rd / 100 | 0;\r\n else if (i == 2) rd = rd / 10 | 0;\r\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\r\n } else {\r\n r = ((repeating || rm < 4) && rd + 1 == k ||\r\n (!repeating && rm > 3) && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\r\n }\r\n }\r\n\r\n return r;\r\n}\r\n\r\n\r\n// Convert string of `baseIn` to an array of numbers of `baseOut`.\r\n// Eg. convertBase('255', 10, 16) returns [15, 15].\r\n// Eg. convertBase('ff', 16, 10) returns [2, 5, 5].\r\nfunction convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n}\r\n\r\n\r\n/*\r\n * cos(x) = 1 - x^2/2! + x^4/4! - ...\r\n * |x| < pi/2\r\n *\r\n */\r\nfunction cosine(Ctor, x) {\r\n var k, len, y;\r\n\r\n if (x.isZero()) return x;\r\n\r\n // Argument reduction: cos(4x) = 8*(cos^4(x) - cos^2(x)) + 1\r\n // i.e. cos(x) = 8*(cos^4(x/4) - cos^2(x/4)) + 1\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n len = x.d.length;\r\n if (len < 32) {\r\n k = Math.ceil(len / 3);\r\n y = (1 / tinyPow(4, k)).toString();\r\n } else {\r\n k = 16;\r\n y = '2.3283064365386962890625e-10';\r\n }\r\n\r\n Ctor.precision += k;\r\n\r\n x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1));\r\n\r\n // Reverse argument reduction\r\n for (var i = k; i--;) {\r\n var cos2x = x.times(x);\r\n x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1);\r\n }\r\n\r\n Ctor.precision -= k;\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Perform division in the specified base.\r\n */\r\nvar divide = (function () {\r\n\r\n // Assumes non-zero x and k, and hence non-zero result.\r\n function multiplyInteger(x, k, base) {\r\n var temp,\r\n carry = 0,\r\n i = x.length;\r\n\r\n for (x = x.slice(); i--;) {\r\n temp = x[i] * k + carry;\r\n x[i] = temp % base | 0;\r\n carry = temp / base | 0;\r\n }\r\n\r\n if (carry) x.unshift(carry);\r\n\r\n return x;\r\n }\r\n\r\n function compare(a, b, aL, bL) {\r\n var i, r;\r\n\r\n if (aL != bL) {\r\n r = aL > bL ? 1 : -1;\r\n } else {\r\n for (i = r = 0; i < aL; i++) {\r\n if (a[i] != b[i]) {\r\n r = a[i] > b[i] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return r;\r\n }\r\n\r\n function subtract(a, b, aL, base) {\r\n var i = 0;\r\n\r\n // Subtract b from a.\r\n for (; aL--;) {\r\n a[aL] -= i;\r\n i = a[aL] < b[aL] ? 1 : 0;\r\n a[aL] = i * base + a[aL] - b[aL];\r\n }\r\n\r\n // Remove leading zeros.\r\n for (; !a[0] && a.length > 1;) a.shift();\r\n }\r\n\r\n return function (x, y, pr, rm, dp, base) {\r\n var cmp, e, i, k, logBase, more, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0,\r\n yL, yz,\r\n Ctor = x.constructor,\r\n sign = x.s == y.s ? 1 : -1,\r\n xd = x.d,\r\n yd = y.d;\r\n\r\n // Either NaN, Infinity or 0?\r\n if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n return new Ctor(// Return NaN if either NaN, or both Infinity or 0.\r\n !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN :\r\n\r\n // Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.\r\n xd && xd[0] == 0 || !yd ? sign * 0 : sign / 0);\r\n }\r\n\r\n if (base) {\r\n logBase = 1;\r\n e = x.e - y.e;\r\n } else {\r\n base = BASE;\r\n logBase = LOG_BASE;\r\n e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase);\r\n }\r\n\r\n yL = yd.length;\r\n xL = xd.length;\r\n q = new Ctor(sign);\r\n qd = q.d = [];\r\n\r\n // Result exponent may be one less than e.\r\n // The digit array of a Decimal from toStringBinary may have trailing zeros.\r\n for (i = 0; yd[i] == (xd[i] || 0); i++);\r\n\r\n if (yd[i] > (xd[i] || 0)) e--;\r\n\r\n if (pr == null) {\r\n sd = pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else if (dp) {\r\n sd = pr + (x.e - y.e) + 1;\r\n } else {\r\n sd = pr;\r\n }\r\n\r\n if (sd < 0) {\r\n qd.push(1);\r\n more = true;\r\n } else {\r\n\r\n // Convert precision in number of base 10 digits to base 1e7 digits.\r\n sd = sd / logBase + 2 | 0;\r\n i = 0;\r\n\r\n // divisor < 1e7\r\n if (yL == 1) {\r\n k = 0;\r\n yd = yd[0];\r\n sd++;\r\n\r\n // k is the carry.\r\n for (; (i < xL || k) && sd--; i++) {\r\n t = k * base + (xd[i] || 0);\r\n qd[i] = t / yd | 0;\r\n k = t % yd | 0;\r\n }\r\n\r\n more = k || i < xL;\r\n\r\n // divisor >= 1e7\r\n } else {\r\n\r\n // Normalise xd and yd so highest order digit of yd is >= base/2\r\n k = base / (yd[0] + 1) | 0;\r\n\r\n if (k > 1) {\r\n yd = multiplyInteger(yd, k, base);\r\n xd = multiplyInteger(xd, k, base);\r\n yL = yd.length;\r\n xL = xd.length;\r\n }\r\n\r\n xi = yL;\r\n rem = xd.slice(0, yL);\r\n remL = rem.length;\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; remL < yL;) rem[remL++] = 0;\r\n\r\n yz = yd.slice();\r\n yz.unshift(0);\r\n yd0 = yd[0];\r\n\r\n if (yd[1] >= base / 2) ++yd0;\r\n\r\n do {\r\n k = 0;\r\n\r\n // Compare divisor and remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < remainder.\r\n if (cmp < 0) {\r\n\r\n // Calculate trial digit, k.\r\n rem0 = rem[0];\r\n if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);\r\n\r\n // k will be how many times the divisor goes into the current remainder.\r\n k = rem0 / yd0 | 0;\r\n\r\n // Algorithm:\r\n // 1. product = divisor * trial digit (k)\r\n // 2. if product > remainder: product -= divisor, k--\r\n // 3. remainder -= product\r\n // 4. if product was < remainder at 2:\r\n // 5. compare new remainder and divisor\r\n // 6. If remainder > divisor: remainder -= divisor, k++\r\n\r\n if (k > 1) {\r\n if (k >= base) k = base - 1;\r\n\r\n // product = divisor * trial digit.\r\n prod = multiplyInteger(yd, k, base);\r\n prodL = prod.length;\r\n remL = rem.length;\r\n\r\n // Compare product and remainder.\r\n cmp = compare(prod, rem, prodL, remL);\r\n\r\n // product > remainder.\r\n if (cmp == 1) {\r\n k--;\r\n\r\n // Subtract divisor from product.\r\n subtract(prod, yL < prodL ? yz : yd, prodL, base);\r\n }\r\n } else {\r\n\r\n // cmp is -1.\r\n // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1\r\n // to avoid it. If k is 1 there is a need to compare yd and rem again below.\r\n if (k == 0) cmp = k = 1;\r\n prod = yd.slice();\r\n }\r\n\r\n prodL = prod.length;\r\n if (prodL < remL) prod.unshift(0);\r\n\r\n // Subtract product from remainder.\r\n subtract(rem, prod, remL, base);\r\n\r\n // If product was < previous remainder.\r\n if (cmp == -1) {\r\n remL = rem.length;\r\n\r\n // Compare divisor and new remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < new remainder, subtract divisor from remainder.\r\n if (cmp < 1) {\r\n k++;\r\n\r\n // Subtract divisor from remainder.\r\n subtract(rem, yL < remL ? yz : yd, remL, base);\r\n }\r\n }\r\n\r\n remL = rem.length;\r\n } else if (cmp === 0) {\r\n k++;\r\n rem = [0];\r\n } // if cmp === 1, k will be 0\r\n\r\n // Add the next digit, k, to the result array.\r\n qd[i++] = k;\r\n\r\n // Update the remainder.\r\n if (cmp && rem[0]) {\r\n rem[remL++] = xd[xi] || 0;\r\n } else {\r\n rem = [xd[xi]];\r\n remL = 1;\r\n }\r\n\r\n } while ((xi++ < xL || rem[0] !== void 0) && sd--);\r\n\r\n more = rem[0] !== void 0;\r\n }\r\n\r\n // Leading zero?\r\n if (!qd[0]) qd.shift();\r\n }\r\n\r\n // logBase is 1 when divide is being used for base conversion.\r\n if (logBase == 1) {\r\n q.e = e;\r\n inexact = more;\r\n } else {\r\n\r\n // To calculate q.e, first get the number of digits of qd[0].\r\n for (i = 1, k = qd[0]; k >= 10; k /= 10) i++;\r\n q.e = i + e * logBase - 1;\r\n\r\n finalise(q, dp ? pr + q.e + 1 : pr, rm, more);\r\n }\r\n\r\n return q;\r\n };\r\n})();\r\n\r\n\r\n/*\r\n * Round `x` to `sd` significant digits using rounding mode `rm`.\r\n * Check for over/under-flow.\r\n */\r\n function finalise(x, sd, rm, isTruncated) {\r\n var digits, i, j, k, rd, roundUp, w, xd, xdi,\r\n Ctor = x.constructor;\r\n\r\n // Don't round if sd is null or undefined.\r\n out: if (sd != null) {\r\n xd = x.d;\r\n\r\n // Infinity/NaN.\r\n if (!xd) return x;\r\n\r\n // rd: the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n // w: the word of xd containing rd, a base 1e7 number.\r\n // xdi: the index of w within xd.\r\n // digits: the number of digits of w.\r\n // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if\r\n // they had leading zeros)\r\n // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).\r\n\r\n // Get the length of the first word of the digits array xd.\r\n for (digits = 1, k = xd[0]; k >= 10; k /= 10) digits++;\r\n i = sd - digits;\r\n\r\n // Is the rounding digit in the first word of xd?\r\n if (i < 0) {\r\n i += LOG_BASE;\r\n j = sd;\r\n w = xd[xdi = 0];\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = w / mathpow(10, digits - j - 1) % 10 | 0;\r\n } else {\r\n xdi = Math.ceil((i + 1) / LOG_BASE);\r\n k = xd.length;\r\n if (xdi >= k) {\r\n if (isTruncated) {\r\n\r\n // Needed by `naturalExponential`, `naturalLogarithm` and `squareRoot`.\r\n for (; k++ <= xdi;) xd.push(0);\r\n w = rd = 0;\r\n digits = 1;\r\n i %= LOG_BASE;\r\n j = i - LOG_BASE + 1;\r\n } else {\r\n break out;\r\n }\r\n } else {\r\n w = k = xd[xdi];\r\n\r\n // Get the number of digits of w.\r\n for (digits = 1; k >= 10; k /= 10) digits++;\r\n\r\n // Get the index of rd within w.\r\n i %= LOG_BASE;\r\n\r\n // Get the index of rd within w, adjusted for leading zeros.\r\n // The number of leading zeros of w is given by LOG_BASE - digits.\r\n j = i - LOG_BASE + digits;\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0;\r\n }\r\n }\r\n\r\n // Are there any non-zero digits after the rounding digit?\r\n isTruncated = isTruncated || sd < 0 ||\r\n xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1));\r\n\r\n // The expression `w % mathpow(10, digits - j - 1)` returns all the digits of w to the right\r\n // of the digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression\r\n // will give 714.\r\n\r\n roundUp = rm < 4\r\n ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 &&\r\n\r\n // Check whether the digit to the left of the rounding digit is odd.\r\n ((i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10) & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n if (sd < 1 || !xd[0]) {\r\n xd.length = 0;\r\n if (roundUp) {\r\n\r\n // Convert sd to decimal places.\r\n sd -= x.e + 1;\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);\r\n x.e = -sd || 0;\r\n } else {\r\n\r\n // Zero.\r\n xd[0] = x.e = 0;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n // Remove excess digits.\r\n if (i == 0) {\r\n xd.length = xdi;\r\n k = 1;\r\n xdi--;\r\n } else {\r\n xd.length = xdi + 1;\r\n k = mathpow(10, LOG_BASE - i);\r\n\r\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n // j > 0 means i > number of leading zeros of w.\r\n xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0;\r\n }\r\n\r\n if (roundUp) {\r\n for (;;) {\r\n\r\n // Is the digit to be rounded up in the first word of xd?\r\n if (xdi == 0) {\r\n\r\n // i will be the length of xd[0] before k is added.\r\n for (i = 1, j = xd[0]; j >= 10; j /= 10) i++;\r\n j = xd[0] += k;\r\n for (k = 1; j >= 10; j /= 10) k++;\r\n\r\n // if i != k the length has increased.\r\n if (i != k) {\r\n x.e++;\r\n if (xd[0] == BASE) xd[0] = 1;\r\n }\r\n\r\n break;\r\n } else {\r\n xd[xdi] += k;\r\n if (xd[xdi] != BASE) break;\r\n xd[xdi--] = 0;\r\n k = 1;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xd.length; xd[--i] === 0;) xd.pop();\r\n }\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > Ctor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < Ctor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // Ctor.underflow = true;\r\n } // else Ctor.underflow = false;\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\nfunction finiteToString(x, isExp, sd) {\r\n if (!x.isFinite()) return nonFiniteToString(x);\r\n var k,\r\n e = x.e,\r\n str = digitsToString(x.d),\r\n len = str.length;\r\n\r\n if (isExp) {\r\n if (sd && (k = sd - len) > 0) {\r\n str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k);\r\n } else if (len > 1) {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n\r\n str = str + (x.e < 0 ? 'e' : 'e+') + x.e;\r\n } else if (e < 0) {\r\n str = '0.' + getZeroString(-e - 1) + str;\r\n if (sd && (k = sd - len) > 0) str += getZeroString(k);\r\n } else if (e >= len) {\r\n str += getZeroString(e + 1 - len);\r\n if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k);\r\n } else {\r\n if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k);\r\n if (sd && (k = sd - len) > 0) {\r\n if (e + 1 === len) str += '.';\r\n str += getZeroString(k);\r\n }\r\n }\r\n\r\n return str;\r\n}\r\n\r\n\r\n// Calculate the base 10 exponent from the base 1e7 exponent.\r\nfunction getBase10Exponent(digits, e) {\r\n var w = digits[0];\r\n\r\n // Add the number of digits of the first word of the digits array.\r\n for ( e *= LOG_BASE; w >= 10; w /= 10) e++;\r\n return e;\r\n}\r\n\r\n\r\nfunction getLn10(Ctor, sd, pr) {\r\n if (sd > LN10_PRECISION) {\r\n\r\n // Reset global state in case the exception is caught.\r\n external = true;\r\n if (pr) Ctor.precision = pr;\r\n throw Error(precisionLimitExceeded);\r\n }\r\n return finalise(new Ctor(LN10), sd, 1, true);\r\n}\r\n\r\n\r\nfunction getPi(Ctor, sd, rm) {\r\n if (sd > PI_PRECISION) throw Error(precisionLimitExceeded);\r\n return finalise(new Ctor(PI), sd, rm, true);\r\n}\r\n\r\n\r\nfunction getPrecision(digits) {\r\n var w = digits.length - 1,\r\n len = w * LOG_BASE + 1;\r\n\r\n w = digits[w];\r\n\r\n // If non-zero...\r\n if (w) {\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n for (; w % 10 == 0; w /= 10) len--;\r\n\r\n // Add the number of digits of the first word.\r\n for (w = digits[0]; w >= 10; w /= 10) len++;\r\n }\r\n\r\n return len;\r\n}\r\n\r\n\r\nfunction getZeroString(k) {\r\n var zs = '';\r\n for (; k--;) zs += '0';\r\n return zs;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of Decimal `x` to the power `n`, where `n` is an\r\n * integer of type number.\r\n *\r\n * Implements 'exponentiation by squaring'. Called by `pow` and `parseOther`.\r\n *\r\n */\r\nfunction intPow(Ctor, x, n, pr) {\r\n var isTruncated,\r\n r = new Ctor(1),\r\n\r\n // Max n of 9007199254740991 takes 53 loop iterations.\r\n // Maximum digits array length; leaves [28, 34] guard digits.\r\n k = Math.ceil(pr / LOG_BASE + 4);\r\n\r\n external = false;\r\n\r\n for (;;) {\r\n if (n % 2) {\r\n r = r.times(x);\r\n if (truncate(r.d, k)) isTruncated = true;\r\n }\r\n\r\n n = mathfloor(n / 2);\r\n if (n === 0) {\r\n\r\n // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.\r\n n = r.d.length - 1;\r\n if (isTruncated && r.d[n] === 0) ++r.d[n];\r\n break;\r\n }\r\n\r\n x = x.times(x);\r\n truncate(x.d, k);\r\n }\r\n\r\n external = true;\r\n\r\n return r;\r\n}\r\n\r\n\r\nfunction isOdd(n) {\r\n return n.d[n.d.length - 1] & 1;\r\n}\r\n\r\n\r\n/*\r\n * Handle `max` (`n` is -1) and `min` (`n` is 1).\r\n */\r\nfunction maxOrMin(Ctor, args, n) {\r\n var k, y,\r\n x = new Ctor(args[0]),\r\n i = 0;\r\n\r\n for (; ++i < args.length;) {\r\n y = new Ctor(args[i]);\r\n\r\n // NaN?\r\n if (!y.s) {\r\n x = y;\r\n break;\r\n }\r\n\r\n k = x.cmp(y);\r\n\r\n if (k === n || k === 0 && x.s === n) {\r\n x = y;\r\n }\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of `x` rounded to `sd` significant\r\n * digits.\r\n *\r\n * Taylor/Maclaurin series.\r\n *\r\n * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ...\r\n *\r\n * Argument reduction:\r\n * Repeat x = x / 32, k += 5, until |x| < 0.1\r\n * exp(x) = exp(x / 2^k)^(2^k)\r\n *\r\n * Previously, the argument was initially reduced by\r\n * exp(x) = exp(r) * 10^k where r = x - k * ln10, k = floor(x / ln10)\r\n * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was\r\n * found to be slower than just dividing repeatedly by 32 as above.\r\n *\r\n * Max integer argument: exp('20723265836946413') = 6.3e+9000000000000000\r\n * Min integer argument: exp('-20723265836946411') = 1.2e-9000000000000000\r\n * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324)\r\n *\r\n * exp(Infinity) = Infinity\r\n * exp(-Infinity) = 0\r\n * exp(NaN) = NaN\r\n * exp(±0) = 1\r\n *\r\n * exp(x) is non-terminating for any finite, non-zero x.\r\n *\r\n * The result will always be correctly rounded.\r\n *\r\n */\r\nfunction naturalExponential(x, sd) {\r\n var denominator, guard, j, pow, sum, t, wpr,\r\n rep = 0,\r\n i = 0,\r\n k = 0,\r\n Ctor = x.constructor,\r\n rm = Ctor.rounding,\r\n pr = Ctor.precision;\r\n\r\n // 0/NaN/Infinity?\r\n if (!x.d || !x.d[0] || x.e > 17) {\r\n\r\n return new Ctor(x.d\r\n ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0\r\n : x.s ? x.s < 0 ? 0 : x : 0 / 0);\r\n }\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n t = new Ctor(0.03125);\r\n\r\n // while abs(x) >= 0.1\r\n while (x.e > -2) {\r\n\r\n // x = x / 2^5\r\n x = x.times(t);\r\n k += 5;\r\n }\r\n\r\n // Use 2 * log10(2^k) + 5 (empirically derived) to estimate the increase in precision\r\n // necessary to ensure the first 4 rounding digits are correct.\r\n guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0;\r\n wpr += guard;\r\n denominator = pow = sum = new Ctor(1);\r\n Ctor.precision = wpr;\r\n\r\n for (;;) {\r\n pow = finalise(pow.times(x), wpr, 1);\r\n denominator = denominator.times(++i);\r\n t = sum.plus(divide(pow, denominator, wpr, 1));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n j = k;\r\n while (j--) sum = finalise(sum.times(sum), wpr, 1);\r\n\r\n // Check to see if the first 4 rounding digits are [49]999.\r\n // If so, repeat the summation with a higher precision, otherwise\r\n // e.g. with precision: 18, rounding: 1\r\n // exp(18.404272462595034083567793919843761) = 98372560.1229999999 (should be 98372560.123)\r\n // `wpr - guard` is the index of first rounding digit.\r\n if (sd == null) {\r\n\r\n if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n Ctor.precision = wpr += 10;\r\n denominator = pow = t = new Ctor(1);\r\n i = 0;\r\n rep++;\r\n } else {\r\n return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n }\r\n } else {\r\n Ctor.precision = pr;\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n }\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of `x` rounded to `sd` significant\r\n * digits.\r\n *\r\n * ln(-n) = NaN\r\n * ln(0) = -Infinity\r\n * ln(-0) = -Infinity\r\n * ln(1) = 0\r\n * ln(Infinity) = Infinity\r\n * ln(-Infinity) = NaN\r\n * ln(NaN) = NaN\r\n *\r\n * ln(n) (n != 1) is non-terminating.\r\n *\r\n */\r\nfunction naturalLogarithm(y, sd) {\r\n var c, c0, denominator, e, numerator, rep, sum, t, wpr, x1, x2,\r\n n = 1,\r\n guard = 10,\r\n x = y,\r\n xd = x.d,\r\n Ctor = x.constructor,\r\n rm = Ctor.rounding,\r\n pr = Ctor.precision;\r\n\r\n // Is x negative or Infinity, NaN, 0 or 1?\r\n if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) {\r\n return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x);\r\n }\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n Ctor.precision = wpr += guard;\r\n c = digitsToString(xd);\r\n c0 = c.charAt(0);\r\n\r\n if (Math.abs(e = x.e) < 1.5e15) {\r\n\r\n // Argument reduction.\r\n // The series converges faster the closer the argument is to 1, so using\r\n // ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b\r\n // multiply the argument by itself until the leading digits of the significand are 7, 8, 9,\r\n // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can\r\n // later be divided by this number, then separate out the power of 10 using\r\n // ln(a*10^b) = ln(a) + b*ln(10).\r\n\r\n // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14).\r\n //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) {\r\n // max n is 6 (gives 0.7 - 1.3)\r\n while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) {\r\n x = x.times(y);\r\n c = digitsToString(x.d);\r\n c0 = c.charAt(0);\r\n n++;\r\n }\r\n\r\n e = x.e;\r\n\r\n if (c0 > 1) {\r\n x = new Ctor('0.' + c);\r\n e++;\r\n } else {\r\n x = new Ctor(c0 + '.' + c.slice(1));\r\n }\r\n } else {\r\n\r\n // The argument reduction method above may result in overflow if the argument y is a massive\r\n // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this\r\n // function using ln(x*10^e) = ln(x) + e*ln(10).\r\n t = getLn10(Ctor, wpr + 2, pr).times(e + '');\r\n x = naturalLogarithm(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t);\r\n Ctor.precision = pr;\r\n\r\n return sd == null ? finalise(x, pr, rm, external = true) : x;\r\n }\r\n\r\n // x1 is x reduced to a value near 1.\r\n x1 = x;\r\n\r\n // Taylor series.\r\n // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...)\r\n // where x = (y - 1)/(y + 1) (|x| < 1)\r\n sum = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1);\r\n x2 = finalise(x.times(x), wpr, 1);\r\n denominator = 3;\r\n\r\n for (;;) {\r\n numerator = finalise(numerator.times(x2), wpr, 1);\r\n t = sum.plus(divide(numerator, new Ctor(denominator), wpr, 1));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n sum = sum.times(2);\r\n\r\n // Reverse the argument reduction. Check that e is not 0 because, besides preventing an\r\n // unnecessary calculation, -0 + 0 = +0 and to ensure correct rounding -0 needs to stay -0.\r\n if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ''));\r\n sum = divide(sum, new Ctor(n), wpr, 1);\r\n\r\n // Is rm > 3 and the first 4 rounding digits 4999, or rm < 4 (or the summation has\r\n // been repeated previously) and the first 4 rounding digits 9999?\r\n // If so, restart the summation with a higher precision, otherwise\r\n // e.g. with precision: 12, rounding: 1\r\n // ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463.\r\n // `wpr - guard` is the index of first rounding digit.\r\n if (sd == null) {\r\n if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n Ctor.precision = wpr += guard;\r\n t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1);\r\n x2 = finalise(x.times(x), wpr, 1);\r\n denominator = rep = 1;\r\n } else {\r\n return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n }\r\n } else {\r\n Ctor.precision = pr;\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n denominator += 2;\r\n }\r\n}\r\n\r\n\r\n// ±Infinity, NaN.\r\nfunction nonFiniteToString(x) {\r\n // Unsigned.\r\n return String(x.s * x.s / 0);\r\n}\r\n\r\n\r\n/*\r\n * Parse the value of a new Decimal `x` from string `str`.\r\n */\r\nfunction parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // TODO BigInt str: no need to check for decimal point, exponential form or leading zeros.\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Parse the value of a new Decimal `x` from a string `str`, which is not a decimal value.\r\n */\r\nfunction parseOther(x, str) {\r\n var base, Ctor, divisor, i, isFloat, len, p, xd, xe;\r\n\r\n if (str.indexOf('_') > -1) {\r\n str = str.replace(/(\\d)_(?=\\d)/g, '$1');\r\n if (isDecimal.test(str)) return parseDecimal(x, str);\r\n } else if (str === 'Infinity' || str === 'NaN') {\r\n if (!+str) x.s = NaN;\r\n x.e = NaN;\r\n x.d = null;\r\n return x;\r\n }\r\n\r\n if (isHex.test(str)) {\r\n base = 16;\r\n str = str.toLowerCase();\r\n } else if (isBinary.test(str)) {\r\n base = 2;\r\n } else if (isOctal.test(str)) {\r\n base = 8;\r\n } else {\r\n throw Error(invalidArgument + str);\r\n }\r\n\r\n // Is there a binary exponent part?\r\n i = str.search(/p/i);\r\n\r\n if (i > 0) {\r\n p = +str.slice(i + 1);\r\n str = str.substring(2, i);\r\n } else {\r\n str = str.slice(2);\r\n }\r\n\r\n // Convert `str` as an integer then divide the result by `base` raised to a power such that the\r\n // fraction part will be restored.\r\n i = str.indexOf('.');\r\n isFloat = i >= 0;\r\n Ctor = x.constructor;\r\n\r\n if (isFloat) {\r\n str = str.replace('.', '');\r\n len = str.length;\r\n i = len - i;\r\n\r\n // log[10](16) = 1.2041... , log[10](88) = 1.9444....\r\n divisor = intPow(Ctor, new Ctor(base), i, i * 2);\r\n }\r\n\r\n xd = convertBase(str, base, BASE);\r\n xe = xd.length - 1;\r\n\r\n // Remove trailing zeros.\r\n for (i = xe; xd[i] === 0; --i) xd.pop();\r\n if (i < 0) return new Ctor(x.s * 0);\r\n x.e = getBase10Exponent(xd, xe);\r\n x.d = xd;\r\n external = false;\r\n\r\n // At what precision to perform the division to ensure exact conversion?\r\n // maxDecimalIntegerPartDigitCount = ceil(log[10](b) * otherBaseIntegerPartDigitCount)\r\n // log[10](2) = 0.30103, log[10](8) = 0.90309, log[10](16) = 1.20412\r\n // E.g. ceil(1.2 * 3) = 4, so up to 4 decimal digits are needed to represent 3 hex int digits.\r\n // maxDecimalFractionPartDigitCount = {Hex:4|Oct:3|Bin:1} * otherBaseFractionPartDigitCount\r\n // Therefore using 4 * the number of digits of str will always be enough.\r\n if (isFloat) x = divide(x, divisor, len * 4);\r\n\r\n // Multiply by the binary exponent part if present.\r\n if (p) x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p));\r\n external = true;\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * sin(x) = x - x^3/3! + x^5/5! - ...\r\n * |x| < pi/2\r\n *\r\n */\r\nfunction sine(Ctor, x) {\r\n var k,\r\n len = x.d.length;\r\n\r\n if (len < 3) {\r\n return x.isZero() ? x : taylorSeries(Ctor, 2, x, x);\r\n }\r\n\r\n // Argument reduction: sin(5x) = 16*sin^5(x) - 20*sin^3(x) + 5*sin(x)\r\n // i.e. sin(x) = 16*sin^5(x/5) - 20*sin^3(x/5) + 5*sin(x/5)\r\n // and sin(x) = sin(x/5)(5 + sin^2(x/5)(16sin^2(x/5) - 20))\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n k = 1.4 * Math.sqrt(len);\r\n k = k > 16 ? 16 : k | 0;\r\n\r\n x = x.times(1 / tinyPow(5, k));\r\n x = taylorSeries(Ctor, 2, x, x);\r\n\r\n // Reverse argument reduction\r\n var sin2_x,\r\n d5 = new Ctor(5),\r\n d16 = new Ctor(16),\r\n d20 = new Ctor(20);\r\n for (; k--;) {\r\n sin2_x = x.times(x);\r\n x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20))));\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n// Calculate Taylor series for `cos`, `cosh`, `sin` and `sinh`.\r\nfunction taylorSeries(Ctor, n, x, y, isHyperbolic) {\r\n var j, t, u, x2,\r\n i = 1,\r\n pr = Ctor.precision,\r\n k = Math.ceil(pr / LOG_BASE);\r\n\r\n external = false;\r\n x2 = x.times(x);\r\n u = new Ctor(y);\r\n\r\n for (;;) {\r\n t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1);\r\n u = isHyperbolic ? y.plus(t) : y.minus(t);\r\n y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1);\r\n t = u.plus(y);\r\n\r\n if (t.d[k] !== void 0) {\r\n for (j = k; t.d[j] === u.d[j] && j--;);\r\n if (j == -1) break;\r\n }\r\n\r\n j = u;\r\n u = y;\r\n y = t;\r\n t = j;\r\n i++;\r\n }\r\n\r\n external = true;\r\n t.d.length = k + 1;\r\n\r\n return t;\r\n}\r\n\r\n\r\n// Exponent e must be positive and non-zero.\r\nfunction tinyPow(b, e) {\r\n var n = b;\r\n while (--e) n *= b;\r\n return n;\r\n}\r\n\r\n\r\n// Return the absolute value of `x` reduced to less than or equal to half pi.\r\nfunction toLessThanHalfPi(Ctor, x) {\r\n var t,\r\n isNeg = x.s < 0,\r\n pi = getPi(Ctor, Ctor.precision, 1),\r\n halfPi = pi.times(0.5);\r\n\r\n x = x.abs();\r\n\r\n if (x.lte(halfPi)) {\r\n quadrant = isNeg ? 4 : 1;\r\n return x;\r\n }\r\n\r\n t = x.divToInt(pi);\r\n\r\n if (t.isZero()) {\r\n quadrant = isNeg ? 3 : 2;\r\n } else {\r\n x = x.minus(t.times(pi));\r\n\r\n // 0 <= x < pi\r\n if (x.lte(halfPi)) {\r\n quadrant = isOdd(t) ? (isNeg ? 2 : 3) : (isNeg ? 4 : 1);\r\n return x;\r\n }\r\n\r\n quadrant = isOdd(t) ? (isNeg ? 1 : 4) : (isNeg ? 3 : 2);\r\n }\r\n\r\n return x.minus(pi).abs();\r\n}\r\n\r\n\r\n/*\r\n * Return the value of Decimal `x` as a string in base `baseOut`.\r\n *\r\n * If the optional `sd` argument is present include a binary exponent suffix.\r\n */\r\nfunction toStringBinary(x, baseOut, sd, rm) {\r\n var base, e, i, k, len, roundUp, str, xd, y,\r\n Ctor = x.constructor,\r\n isExp = sd !== void 0;\r\n\r\n if (isExp) {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n } else {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n }\r\n\r\n if (!x.isFinite()) {\r\n str = nonFiniteToString(x);\r\n } else {\r\n str = finiteToString(x);\r\n i = str.indexOf('.');\r\n\r\n // Use exponential notation according to `toExpPos` and `toExpNeg`? No, but if required:\r\n // maxBinaryExponent = floor((decimalExponent + 1) * log[2](10))\r\n // minBinaryExponent = floor(decimalExponent * log[2](10))\r\n // log[2](10) = 3.321928094887362347870319429489390175864\r\n\r\n if (isExp) {\r\n base = 2;\r\n if (baseOut == 16) {\r\n sd = sd * 4 - 3;\r\n } else if (baseOut == 8) {\r\n sd = sd * 3 - 2;\r\n }\r\n } else {\r\n base = baseOut;\r\n }\r\n\r\n // Convert the number as an integer then divide the result by its base raised to a power such\r\n // that the fraction part will be restored.\r\n\r\n // Non-integer.\r\n if (i >= 0) {\r\n str = str.replace('.', '');\r\n y = new Ctor(1);\r\n y.e = str.length - i;\r\n y.d = convertBase(finiteToString(y), 10, base);\r\n y.e = y.d.length;\r\n }\r\n\r\n xd = convertBase(str, 10, base);\r\n e = len = xd.length;\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] == 0;) xd.pop();\r\n\r\n if (!xd[0]) {\r\n str = isExp ? '0p+0' : '0';\r\n } else {\r\n if (i < 0) {\r\n e--;\r\n } else {\r\n x = new Ctor(x);\r\n x.d = xd;\r\n x.e = e;\r\n x = divide(x, y, sd, rm, 0, base);\r\n xd = x.d;\r\n e = x.e;\r\n roundUp = inexact;\r\n }\r\n\r\n // The rounding digit, i.e. the digit after the digit that may be rounded up.\r\n i = xd[sd];\r\n k = base / 2;\r\n roundUp = roundUp || xd[sd + 1] !== void 0;\r\n\r\n roundUp = rm < 4\r\n ? (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2))\r\n : i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 ||\r\n rm === (x.s < 0 ? 8 : 7));\r\n\r\n xd.length = sd;\r\n\r\n if (roundUp) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for (; ++xd[--sd] > base - 1;) {\r\n xd[sd] = 0;\r\n if (!sd) {\r\n ++e;\r\n xd.unshift(1);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for (i = 0, str = ''; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n\r\n // Add binary exponent suffix?\r\n if (isExp) {\r\n if (len > 1) {\r\n if (baseOut == 16 || baseOut == 8) {\r\n i = baseOut == 16 ? 4 : 3;\r\n for (--len; len % i; len++) str += '0';\r\n xd = convertBase(str, base, baseOut);\r\n for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n // xd[0] will always be be 1\r\n for (i = 1, str = '1.'; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n } else {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n }\r\n\r\n str = str + (e < 0 ? 'p' : 'p+') + e;\r\n } else if (e < 0) {\r\n for (; ++e;) str = '0' + str;\r\n str = '0.' + str;\r\n } else {\r\n if (++e > len) for (e -= len; e-- ;) str += '0';\r\n else if (e < len) str = str.slice(0, e) + '.' + str.slice(e);\r\n }\r\n }\r\n\r\n str = (baseOut == 16 ? '0x' : baseOut == 2 ? '0b' : baseOut == 8 ? '0o' : '') + str;\r\n }\r\n\r\n return x.s < 0 ? '-' + str : str;\r\n}\r\n\r\n\r\n// Does not strip trailing zeros.\r\nfunction truncate(arr, len) {\r\n if (arr.length > len) {\r\n arr.length = len;\r\n return true;\r\n }\r\n}\r\n\r\n\r\n// Decimal methods\r\n\r\n\r\n/*\r\n * abs\r\n * acos\r\n * acosh\r\n * add\r\n * asin\r\n * asinh\r\n * atan\r\n * atanh\r\n * atan2\r\n * cbrt\r\n * ceil\r\n * clamp\r\n * clone\r\n * config\r\n * cos\r\n * cosh\r\n * div\r\n * exp\r\n * floor\r\n * hypot\r\n * ln\r\n * log\r\n * log2\r\n * log10\r\n * max\r\n * min\r\n * mod\r\n * mul\r\n * pow\r\n * random\r\n * round\r\n * set\r\n * sign\r\n * sin\r\n * sinh\r\n * sqrt\r\n * sub\r\n * sum\r\n * tan\r\n * tanh\r\n * trunc\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the absolute value of `x`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction abs(x) {\r\n return new this(x).abs();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arccosine in radians of `x`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction acos(x) {\r\n return new this(x).acos();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic cosine of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} A value in radians.\r\n *\r\n */\r\nfunction acosh(x) {\r\n return new this(x).acosh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sum of `x` and `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n * y {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction add(x, y) {\r\n return new this(x).plus(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arcsine in radians of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction asin(x) {\r\n return new this(x).asin();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic sine of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} A value in radians.\r\n *\r\n */\r\nfunction asinh(x) {\r\n return new this(x).asinh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent in radians of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction atan(x) {\r\n return new this(x).atan();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic tangent of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} A value in radians.\r\n *\r\n */\r\nfunction atanh(x) {\r\n return new this(x).atanh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent in radians of `y/x` in the range -pi to pi\r\n * (inclusive), rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi, pi]\r\n *\r\n * y {number|string|bigint|Decimal} The y-coordinate.\r\n * x {number|string|bigint|Decimal} The x-coordinate.\r\n *\r\n * atan2(±0, -0) = ±pi\r\n * atan2(±0, +0) = ±0\r\n * atan2(±0, -x) = ±pi for x > 0\r\n * atan2(±0, x) = ±0 for x > 0\r\n * atan2(-y, ±0) = -pi/2 for y > 0\r\n * atan2(y, ±0) = pi/2 for y > 0\r\n * atan2(±y, -Infinity) = ±pi for finite y > 0\r\n * atan2(±y, +Infinity) = ±0 for finite y > 0\r\n * atan2(±Infinity, x) = ±pi/2 for finite x\r\n * atan2(±Infinity, -Infinity) = ±3*pi/4\r\n * atan2(±Infinity, +Infinity) = ±pi/4\r\n * atan2(NaN, x) = NaN\r\n * atan2(y, NaN) = NaN\r\n *\r\n */\r\nfunction atan2(y, x) {\r\n y = new this(y);\r\n x = new this(x);\r\n var r,\r\n pr = this.precision,\r\n rm = this.rounding,\r\n wpr = pr + 4;\r\n\r\n // Either NaN\r\n if (!y.s || !x.s) {\r\n r = new this(NaN);\r\n\r\n // Both ±Infinity\r\n } else if (!y.d && !x.d) {\r\n r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75);\r\n r.s = y.s;\r\n\r\n // x is ±Infinity or y is ±0\r\n } else if (!x.d || y.isZero()) {\r\n r = x.s < 0 ? getPi(this, pr, rm) : new this(0);\r\n r.s = y.s;\r\n\r\n // y is ±Infinity or x is ±0\r\n } else if (!y.d || x.isZero()) {\r\n r = getPi(this, wpr, 1).times(0.5);\r\n r.s = y.s;\r\n\r\n // Both non-zero and finite\r\n } else if (x.s < 0) {\r\n this.precision = wpr;\r\n this.rounding = 1;\r\n r = this.atan(divide(y, x, wpr, 1));\r\n x = getPi(this, wpr, 1);\r\n this.precision = pr;\r\n this.rounding = rm;\r\n r = y.s < 0 ? r.minus(x) : r.plus(x);\r\n } else {\r\n r = this.atan(divide(y, x, wpr, 1));\r\n }\r\n\r\n return r;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cube root of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction cbrt(x) {\r\n return new this(x).cbrt();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` rounded to an integer using `ROUND_CEIL`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction ceil(x) {\r\n return finalise(x = new this(x), x.e + 1, 2);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` clamped to the range delineated by `min` and `max`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n * min {number|string|bigint|Decimal}\r\n * max {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction clamp(x, min, max) {\r\n return new this(x).clamp(min, max);\r\n}\r\n\r\n\r\n/*\r\n * Configure global settings for a Decimal constructor.\r\n *\r\n * `obj` is an object with one or more of the following properties,\r\n *\r\n * precision {number}\r\n * rounding {number}\r\n * toExpNeg {number}\r\n * toExpPos {number}\r\n * maxE {number}\r\n * minE {number}\r\n * modulo {number}\r\n * crypto {boolean|number}\r\n * defaults {true}\r\n *\r\n * E.g. Decimal.config({ precision: 20, rounding: 4 })\r\n *\r\n */\r\nfunction config(obj) {\r\n if (!obj || typeof obj !== 'object') throw Error(decimalError + 'Object expected');\r\n var i, p, v,\r\n useDefaults = obj.defaults === true,\r\n ps = [\r\n 'precision', 1, MAX_DIGITS,\r\n 'rounding', 0, 8,\r\n 'toExpNeg', -EXP_LIMIT, 0,\r\n 'toExpPos', 0, EXP_LIMIT,\r\n 'maxE', 0, EXP_LIMIT,\r\n 'minE', -EXP_LIMIT, 0,\r\n 'modulo', 0, 9\r\n ];\r\n\r\n for (i = 0; i < ps.length; i += 3) {\r\n if (p = ps[i], useDefaults) this[p] = DEFAULTS[p];\r\n if ((v = obj[p]) !== void 0) {\r\n if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;\r\n else throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n if (p = 'crypto', useDefaults) this[p] = DEFAULTS[p];\r\n if ((v = obj[p]) !== void 0) {\r\n if (v === true || v === false || v === 0 || v === 1) {\r\n if (v) {\r\n if (typeof crypto != 'undefined' && crypto &&\r\n (crypto.getRandomValues || crypto.randomBytes)) {\r\n this[p] = true;\r\n } else {\r\n throw Error(cryptoUnavailable);\r\n }\r\n } else {\r\n this[p] = false;\r\n }\r\n } else {\r\n throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n return this;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cosine of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} A value in radians.\r\n *\r\n */\r\nfunction cos(x) {\r\n return new this(x).cos();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic cosine of `x`, rounded to precision\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} A value in radians.\r\n *\r\n */\r\nfunction cosh(x) {\r\n return new this(x).cosh();\r\n}\r\n\r\n\r\n/*\r\n * Create and return a Decimal constructor with the same configuration properties as this Decimal\r\n * constructor.\r\n *\r\n */\r\nfunction clone(obj) {\r\n var i, p, ps;\r\n\r\n /*\r\n * The Decimal constructor and exported function.\r\n * Return a new Decimal instance.\r\n *\r\n * v {number|string|bigint|Decimal} A numeric value.\r\n *\r\n */\r\n function Decimal(v) {\r\n var e, i, t,\r\n x = this;\r\n\r\n // Decimal called without new.\r\n if (!(x instanceof Decimal)) return new Decimal(v);\r\n\r\n // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor\r\n // which points to Object.\r\n x.constructor = Decimal;\r\n\r\n if (isDecimalInstance(v)) {\r\n x.s = v.s;\r\n\r\n if (external) {\r\n if (!v.d || v.e > Decimal.maxE) {\r\n\r\n // Infinity.\r\n x.e = NaN;\r\n x.d = null;\r\n } else if (v.e < Decimal.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n } else {\r\n x.e = v.e;\r\n x.d = v.d.slice();\r\n }\r\n } else {\r\n x.e = v.e;\r\n x.d = v.d ? v.d.slice() : v.d;\r\n }\r\n\r\n return;\r\n }\r\n\r\n t = typeof v;\r\n\r\n if (t === 'number') {\r\n if (v === 0) {\r\n x.s = 1 / v < 0 ? -1 : 1;\r\n x.e = 0;\r\n x.d = [0];\r\n return;\r\n }\r\n\r\n if (v < 0) {\r\n v = -v;\r\n x.s = -1;\r\n } else {\r\n x.s = 1;\r\n }\r\n\r\n // Fast path for small integers.\r\n if (v === ~~v && v < 1e7) {\r\n for (e = 0, i = v; i >= 10; i /= 10) e++;\r\n\r\n if (external) {\r\n if (e > Decimal.maxE) {\r\n x.e = NaN;\r\n x.d = null;\r\n } else if (e < Decimal.minE) {\r\n x.e = 0;\r\n x.d = [0];\r\n } else {\r\n x.e = e;\r\n x.d = [v];\r\n }\r\n } else {\r\n x.e = e;\r\n x.d = [v];\r\n }\r\n\r\n return;\r\n }\r\n\r\n // Infinity or NaN?\r\n if (v * 0 !== 0) {\r\n if (!v) x.s = NaN;\r\n x.e = NaN;\r\n x.d = null;\r\n return;\r\n }\r\n\r\n return parseDecimal(x, v.toString());\r\n }\r\n\r\n if (t === 'string') {\r\n if ((i = v.charCodeAt(0)) === 45) { // minus sign\r\n v = v.slice(1);\r\n x.s = -1;\r\n } else {\r\n if (i === 43) v = v.slice(1); // plus sign\r\n x.s = 1;\r\n }\r\n\r\n return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);\r\n }\r\n\r\n if (t === 'bigint') {\r\n if (v < 0) {\r\n v = -v;\r\n x.s = -1;\r\n } else {\r\n x.s = 1;\r\n }\r\n\r\n return parseDecimal(x, v.toString());\r\n }\r\n\r\n throw Error(invalidArgument + v);\r\n }\r\n\r\n Decimal.prototype = P;\r\n\r\n Decimal.ROUND_UP = 0;\r\n Decimal.ROUND_DOWN = 1;\r\n Decimal.ROUND_CEIL = 2;\r\n Decimal.ROUND_FLOOR = 3;\r\n Decimal.ROUND_HALF_UP = 4;\r\n Decimal.ROUND_HALF_DOWN = 5;\r\n Decimal.ROUND_HALF_EVEN = 6;\r\n Decimal.ROUND_HALF_CEIL = 7;\r\n Decimal.ROUND_HALF_FLOOR = 8;\r\n Decimal.EUCLID = 9;\r\n\r\n Decimal.config = Decimal.set = config;\r\n Decimal.clone = clone;\r\n Decimal.isDecimal = isDecimalInstance;\r\n\r\n Decimal.abs = abs;\r\n Decimal.acos = acos;\r\n Decimal.acosh = acosh; // ES6\r\n Decimal.add = add;\r\n Decimal.asin = asin;\r\n Decimal.asinh = asinh; // ES6\r\n Decimal.atan = atan;\r\n Decimal.atanh = atanh; // ES6\r\n Decimal.atan2 = atan2;\r\n Decimal.cbrt = cbrt; // ES6\r\n Decimal.ceil = ceil;\r\n Decimal.clamp = clamp;\r\n Decimal.cos = cos;\r\n Decimal.cosh = cosh; // ES6\r\n Decimal.div = div;\r\n Decimal.exp = exp;\r\n Decimal.floor = floor;\r\n Decimal.hypot = hypot; // ES6\r\n Decimal.ln = ln;\r\n Decimal.log = log;\r\n Decimal.log10 = log10; // ES6\r\n Decimal.log2 = log2; // ES6\r\n Decimal.max = max;\r\n Decimal.min = min;\r\n Decimal.mod = mod;\r\n Decimal.mul = mul;\r\n Decimal.pow = pow;\r\n Decimal.random = random;\r\n Decimal.round = round;\r\n Decimal.sign = sign; // ES6\r\n Decimal.sin = sin;\r\n Decimal.sinh = sinh; // ES6\r\n Decimal.sqrt = sqrt;\r\n Decimal.sub = sub;\r\n Decimal.sum = sum;\r\n Decimal.tan = tan;\r\n Decimal.tanh = tanh; // ES6\r\n Decimal.trunc = trunc; // ES6\r\n\r\n if (obj === void 0) obj = {};\r\n if (obj) {\r\n if (obj.defaults !== true) {\r\n ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'maxE', 'minE', 'modulo', 'crypto'];\r\n for (i = 0; i < ps.length;) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];\r\n }\r\n }\r\n\r\n Decimal.config(obj);\r\n\r\n return Decimal;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` divided by `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n * y {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction div(x, y) {\r\n return new this(x).div(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} The power to which to raise the base of the natural log.\r\n *\r\n */\r\nfunction exp(x) {\r\n return new this(x).exp();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` round to an integer using `ROUND_FLOOR`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction floor(x) {\r\n return finalise(x = new this(x), x.e + 1, 3);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of the sum of the squares of the arguments,\r\n * rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * hypot(a, b, ...) = sqrt(a^2 + b^2 + ...)\r\n *\r\n * arguments {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction hypot() {\r\n var i, n,\r\n t = new this(0);\r\n\r\n external = false;\r\n\r\n for (i = 0; i < arguments.length;) {\r\n n = new this(arguments[i++]);\r\n if (!n.d) {\r\n if (n.s) {\r\n external = true;\r\n return new this(1 / 0);\r\n }\r\n t = n;\r\n } else if (t.d) {\r\n t = t.plus(n.times(n));\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return t.sqrt();\r\n}\r\n\r\n\r\n/*\r\n * Return true if object is a Decimal instance (where Decimal is any Decimal constructor),\r\n * otherwise return false.\r\n *\r\n */\r\nfunction isDecimalInstance(obj) {\r\n return obj instanceof Decimal || obj && obj.toStringTag === tag || false;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction ln(x) {\r\n return new this(x).ln();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the log of `x` to the base `y`, or to base 10 if no base\r\n * is specified, rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * log[y](x)\r\n *\r\n * x {number|string|bigint|Decimal} The argument of the logarithm.\r\n * y {number|string|bigint|Decimal} The base of the logarithm.\r\n *\r\n */\r\nfunction log(x, y) {\r\n return new this(x).log(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the base 2 logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction log2(x) {\r\n return new this(x).log(2);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the base 10 logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction log10(x) {\r\n return new this(x).log(10);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the maximum of the arguments.\r\n *\r\n * arguments {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction max() {\r\n return maxOrMin(this, arguments, -1);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the minimum of the arguments.\r\n *\r\n * arguments {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction min() {\r\n return maxOrMin(this, arguments, 1);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` modulo `y`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n * y {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction mod(x, y) {\r\n return new this(x).mod(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` multiplied by `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n * y {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction mul(x, y) {\r\n return new this(x).mul(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` raised to the power `y`, rounded to precision\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} The base.\r\n * y {number|string|bigint|Decimal} The exponent.\r\n *\r\n */\r\nfunction pow(x, y) {\r\n return new this(x).pow(y);\r\n}\r\n\r\n\r\n/*\r\n * Returns a new Decimal with a random value equal to or greater than 0 and less than 1, and with\r\n * `sd`, or `Decimal.precision` if `sd` is omitted, significant digits (or less if trailing zeros\r\n * are produced).\r\n *\r\n * [sd] {number} Significant digits. Integer, 0 to MAX_DIGITS inclusive.\r\n *\r\n */\r\nfunction random(sd) {\r\n var d, e, k, n,\r\n i = 0,\r\n r = new this(1),\r\n rd = [];\r\n\r\n if (sd === void 0) sd = this.precision;\r\n else checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n k = Math.ceil(sd / LOG_BASE);\r\n\r\n if (!this.crypto) {\r\n for (; i < k;) rd[i++] = Math.random() * 1e7 | 0;\r\n\r\n // Browsers supporting crypto.getRandomValues.\r\n } else if (crypto.getRandomValues) {\r\n d = crypto.getRandomValues(new Uint32Array(k));\r\n\r\n for (; i < k;) {\r\n n = d[i];\r\n\r\n // 0 <= n < 4294967296\r\n // Probability n >= 4.29e9, is 4967296 / 4294967296 = 0.00116 (1 in 865).\r\n if (n >= 4.29e9) {\r\n d[i] = crypto.getRandomValues(new Uint32Array(1))[0];\r\n } else {\r\n\r\n // 0 <= n <= 4289999999\r\n // 0 <= (n % 1e7) <= 9999999\r\n rd[i++] = n % 1e7;\r\n }\r\n }\r\n\r\n // Node.js supporting crypto.randomBytes.\r\n } else if (crypto.randomBytes) {\r\n\r\n // buffer\r\n d = crypto.randomBytes(k *= 4);\r\n\r\n for (; i < k;) {\r\n\r\n // 0 <= n < 2147483648\r\n n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 0x7f) << 24);\r\n\r\n // Probability n >= 2.14e9, is 7483648 / 2147483648 = 0.0035 (1 in 286).\r\n if (n >= 2.14e9) {\r\n crypto.randomBytes(4).copy(d, i);\r\n } else {\r\n\r\n // 0 <= n <= 2139999999\r\n // 0 <= (n % 1e7) <= 9999999\r\n rd.push(n % 1e7);\r\n i += 4;\r\n }\r\n }\r\n\r\n i = k / 4;\r\n } else {\r\n throw Error(cryptoUnavailable);\r\n }\r\n\r\n k = rd[--i];\r\n sd %= LOG_BASE;\r\n\r\n // Convert trailing digits to zeros according to sd.\r\n if (k && sd) {\r\n n = mathpow(10, LOG_BASE - sd);\r\n rd[i] = (k / n | 0) * n;\r\n }\r\n\r\n // Remove trailing words which are zero.\r\n for (; rd[i] === 0; i--) rd.pop();\r\n\r\n // Zero?\r\n if (i < 0) {\r\n e = 0;\r\n rd = [0];\r\n } else {\r\n e = -1;\r\n\r\n // Remove leading words which are zero and adjust exponent accordingly.\r\n for (; rd[0] === 0; e -= LOG_BASE) rd.shift();\r\n\r\n // Count the digits of the first word of rd to determine leading zeros.\r\n for (k = 1, n = rd[0]; n >= 10; n /= 10) k++;\r\n\r\n // Adjust the exponent for leading zeros of the first word of rd.\r\n if (k < LOG_BASE) e -= LOG_BASE - k;\r\n }\r\n\r\n r.e = e;\r\n r.d = rd;\r\n\r\n return r;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` rounded to an integer using rounding mode `rounding`.\r\n *\r\n * To emulate `Math.round`, set rounding to 7 (ROUND_HALF_CEIL).\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction round(x) {\r\n return finalise(x = new this(x), x.e + 1, this.rounding);\r\n}\r\n\r\n\r\n/*\r\n * Return\r\n * 1 if x > 0,\r\n * -1 if x < 0,\r\n * 0 if x is 0,\r\n * -0 if x is -0,\r\n * NaN otherwise\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction sign(x) {\r\n x = new this(x);\r\n return x.d ? (x.d[0] ? x.s : 0 * x.s) : x.s || NaN;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sine of `x`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} A value in radians.\r\n *\r\n */\r\nfunction sin(x) {\r\n return new this(x).sin();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic sine of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} A value in radians.\r\n *\r\n */\r\nfunction sinh(x) {\r\n return new this(x).sinh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction sqrt(x) {\r\n return new this(x).sqrt();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` minus `y`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n * y {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction sub(x, y) {\r\n return new this(x).sub(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sum of the arguments, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * Only the result is rounded, not the intermediate calculations.\r\n *\r\n * arguments {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction sum() {\r\n var i = 0,\r\n args = arguments,\r\n x = new this(args[i]);\r\n\r\n external = false;\r\n for (; x.s && ++i < args.length;) x = x.plus(args[i]);\r\n external = true;\r\n\r\n return finalise(x, this.precision, this.rounding);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the tangent of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} A value in radians.\r\n *\r\n */\r\nfunction tan(x) {\r\n return new this(x).tan();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic tangent of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|bigint|Decimal} A value in radians.\r\n *\r\n */\r\nfunction tanh(x) {\r\n return new this(x).tanh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` truncated to an integer.\r\n *\r\n * x {number|string|bigint|Decimal}\r\n *\r\n */\r\nfunction trunc(x) {\r\n return finalise(x = new this(x), x.e + 1, 1);\r\n}\r\n\r\n\r\nP[Symbol.for('nodejs.util.inspect.custom')] = P.toString;\r\nP[Symbol.toStringTag] = 'Decimal';\r\n\r\n// Create and configure initial Decimal constructor.\r\nexport var Decimal = P.constructor = clone(DEFAULTS);\r\n\r\n// Create the internal constants from their string values.\r\nLN10 = new Decimal(LN10);\r\nPI = new Decimal(PI);\r\n\r\nexport default Decimal;\r\n","import {\n combineCodec,\n getAddressDecoder,\n getAddressEncoder,\n getBooleanDecoder,\n getBooleanEncoder,\n getStructDecoder,\n getStructEncoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type TransactionAccount = {\n pubkey: Address;\n isSigner: boolean;\n isWritable: boolean;\n};\n\nexport type TransactionAccountArgs = TransactionAccount;\n\nexport function getTransactionAccountEncoder(): FixedSizeEncoder<TransactionAccountArgs> {\n return getStructEncoder([\n ['pubkey', getAddressEncoder()],\n ['isSigner', getBooleanEncoder()],\n ['isWritable', getBooleanEncoder()],\n ]);\n}\n\nexport function getTransactionAccountDecoder(): FixedSizeDecoder<TransactionAccount> {\n return getStructDecoder([\n ['pubkey', getAddressDecoder()],\n ['isSigner', getBooleanDecoder()],\n ['isWritable', getBooleanDecoder()],\n ]);\n}\n\nexport function getTransactionAccountCodec(): FixedSizeCodec<\n TransactionAccountArgs,\n TransactionAccount\n> {\n return combineCodec(\n getTransactionAccountEncoder(),\n getTransactionAccountDecoder()\n );\n}\n","import {\n combineCodec,\n getEnumDecoder,\n getEnumEncoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport enum FeeCollectionFrequency {\n Monthly,\n Quarterly,\n Annually,\n OnWithdrawal,\n}\n\nexport type FeeCollectionFrequencyArgs = FeeCollectionFrequency;\n\nexport function getFeeCollectionFrequencyEncoder(): FixedSizeEncoder<FeeCollectionFrequencyArgs> {\n return getEnumEncoder(FeeCollectionFrequency);\n}\n\nexport function getFeeCollectionFrequencyDecoder(): FixedSizeDecoder<FeeCollectionFrequency> {\n return getEnumDecoder(FeeCollectionFrequency);\n}\n\nexport function getFeeCollectionFrequencyCodec(): FixedSizeCodec<\n FeeCollectionFrequencyArgs,\n FeeCollectionFrequency\n> {\n return combineCodec(\n getFeeCollectionFrequencyEncoder(),\n getFeeCollectionFrequencyDecoder()\n );\n}\n","import {\n combineCodec,\n getAddressDecoder,\n getAddressEncoder,\n getStructDecoder,\n getStructEncoder,\n getU16Decoder,\n getU16Encoder,\n getU64Decoder,\n getU64Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\nimport {\n getFeeCollectionFrequencyDecoder,\n getFeeCollectionFrequencyEncoder,\n type FeeCollectionFrequency,\n type FeeCollectionFrequencyArgs,\n} from './feeCollectionFrequency';\n\nexport type ManagerFeeStructure = {\n performanceFeeRate: number;\n managementFeeRate: number;\n collectionFrequency: FeeCollectionFrequency;\n highWaterMark: bigint;\n feeRecipient: Address;\n};\n\nexport type ManagerFeeStructureArgs = {\n performanceFeeRate: number;\n managementFeeRate: number;\n collectionFrequency: FeeCollectionFrequencyArgs;\n highWaterMark: number | bigint;\n feeRecipient: Address;\n};\n\nexport function getManagerFeeStructureEncoder(): FixedSizeEncoder<ManagerFeeStructureArgs> {\n return getStructEncoder([\n ['performanceFeeRate', getU16Encoder()],\n ['managementFeeRate', getU16Encoder()],\n ['collectionFrequency', getFeeCollectionFrequencyEncoder()],\n ['highWaterMark', getU64Encoder()],\n ['feeRecipient', getAddressEncoder()],\n ]);\n}\n\nexport function getManagerFeeStructureDecoder(): FixedSizeDecoder<ManagerFeeStructure> {\n return getStructDecoder([\n ['performanceFeeRate', getU16Decoder()],\n ['managementFeeRate', getU16Decoder()],\n ['collectionFrequency', getFeeCollectionFrequencyDecoder()],\n ['highWaterMark', getU64Decoder()],\n ['feeRecipient', getAddressDecoder()],\n ]);\n}\n\nexport function getManagerFeeStructureCodec(): FixedSizeCodec<\n ManagerFeeStructureArgs,\n ManagerFeeStructure\n> {\n return combineCodec(\n getManagerFeeStructureEncoder(),\n getManagerFeeStructureDecoder()\n );\n}\n","/**\n * Policy enum for vault access control\n */\nexport enum Policy {\n AllowAny = 'AllowAny',\n DenyAll = 'DenyAll',\n LimitTransfer = 'LimitTransfer',\n Owners = 'Owners',\n Multisig = 'Multisig',\n}\n\n","import {\n addDecoderSizePrefix,\n addEncoderSizePrefix,\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getOptionDecoder,\n getOptionEncoder,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type Codec,\n type Decoder,\n type EncodedAccount,\n type Encoder,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type Option,\n type OptionOrNullable,\n type ReadonlyUint8Array,\n} from '@solana/kit';\nimport {\n getManagerFeeStructureDecoder,\n getManagerFeeStructureEncoder,\n type ManagerFeeStructure,\n type ManagerFeeStructureArgs,\n} from '../types';\n\nexport const VAULT_DISCRIMINATOR = new Uint8Array([\n 211, 8, 232, 43, 2, 152, 117, 119,\n]);\n\nexport function getVaultDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(VAULT_DISCRIMINATOR);\n}\n\nexport type Vault = {\n discriminator: ReadonlyUint8Array;\n policyProgram: Address;\n seed: string;\n authority: Address;\n shareMint: Address;\n underlyingMint: Address;\n manager: Option<Address>;\n parentVault: Option<Address>;\n allocation: bigint;\n onchainBalance: bigint;\n offchainBalance: bigint;\n totalBalance: bigint;\n lastBalanceUpdate: bigint;\n highWaterMark: bigint;\n totalFeesPaid: bigint;\n managerFees: Option<ManagerFeeStructure>;\n createdAt: bigint;\n lastFeeCollection: bigint;\n};\n\nexport type VaultArgs = {\n policyProgram: Address;\n seed: string;\n authority: Address;\n shareMint: Address;\n underlyingMint: Address;\n manager: OptionOrNullable<Address>;\n parentVault: OptionOrNullable<Address>;\n allocation: number | bigint;\n onchainBalance: number | bigint;\n offchainBalance: number | bigint;\n totalBalance: number | bigint;\n lastBalanceUpdate: number | bigint;\n highWaterMark: number | bigint;\n totalFeesPaid: number | bigint;\n managerFees: OptionOrNullable<ManagerFeeStructureArgs>;\n createdAt: number | bigint;\n lastFeeCollection: number | bigint;\n};\n\nexport function getVaultEncoder(): Encoder<VaultArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['policyProgram', getAddressEncoder()],\n ['seed', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ['authority', getAddressEncoder()],\n ['shareMint', getAddressEncoder()],\n ['underlyingMint', getAddressEncoder()],\n ['manager', getOptionEncoder(getAddressEncoder())],\n ['parentVault', getOptionEncoder(getAddressEncoder())],\n ['allocation', getU64Encoder()],\n ['onchainBalance', getU64Encoder()],\n ['offchainBalance', getU64Encoder()],\n ['totalBalance', getU64Encoder()],\n ['lastBalanceUpdate', getU64Encoder()],\n ['highWaterMark', getU64Encoder()],\n ['totalFeesPaid', getU64Encoder()],\n ['managerFees', getOptionEncoder(getManagerFeeStructureEncoder())],\n ['createdAt', getU64Encoder()],\n ['lastFeeCollection', getU64Encoder()],\n ]),\n (value) => ({ ...value, discriminator: VAULT_DISCRIMINATOR })\n );\n}\n\nexport function getVaultDecoder(): Decoder<Vault> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['policyProgram', getAddressDecoder()],\n ['seed', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['authority', getAddressDecoder()],\n ['shareMint', getAddressDecoder()],\n ['underlyingMint', getAddressDecoder()],\n ['manager', getOptionDecoder(getAddressDecoder())],\n ['parentVault', getOptionDecoder(getAddressDecoder())],\n ['allocation', getU64Decoder()],\n ['onchainBalance', getU64Decoder()],\n ['offchainBalance', getU64Decoder()],\n ['totalBalance', getU64Decoder()],\n ['lastBalanceUpdate', getU64Decoder()],\n ['highWaterMark', getU64Decoder()],\n ['totalFeesPaid', getU64Decoder()],\n ['managerFees', getOptionDecoder(getManagerFeeStructureDecoder())],\n ['createdAt', getU64Decoder()],\n ['lastFeeCollection', getU64Decoder()],\n ]);\n}\n\nexport function getVaultCodec(): Codec<VaultArgs, Vault> {\n return combineCodec(getVaultEncoder(), getVaultDecoder());\n}\n\nexport function decodeVault<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>\n): Account<Vault, TAddress>;\nexport function decodeVault<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>\n): MaybeAccount<Vault, TAddress>;\nexport function decodeVault<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>\n): Account<Vault, TAddress> | MaybeAccount<Vault, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getVaultDecoder()\n );\n}\n\nexport async function fetchVault<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig\n): Promise<Account<Vault, TAddress>> {\n const maybeAccount = await fetchMaybeVault(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeVault<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig\n): Promise<MaybeAccount<Vault, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeVault(maybeAccount);\n}\n\nexport async function fetchAllVault(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig\n): Promise<Account<Vault>[]> {\n const maybeAccounts = await fetchAllMaybeVault(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeVault(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig\n): Promise<MaybeAccount<Vault>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeVault(maybeAccount));\n}\n","import {\n addDecoderSizePrefix,\n addEncoderSizePrefix,\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBooleanDecoder,\n getBooleanEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n transformEncoder,\n type Account,\n type Address,\n type Codec,\n type Decoder,\n type EncodedAccount,\n type Encoder,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from '@solana/kit';\nimport {\n getTransactionAccountDecoder,\n getTransactionAccountEncoder,\n type TransactionAccount,\n type TransactionAccountArgs,\n} from '../types/transactionAccount';\n\nexport const TRANSACTION_DISCRIMINATOR = new Uint8Array([\n 11, 24, 174, 129, 203, 117, 242, 23,\n]);\n\nexport function getTransactionDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(TRANSACTION_DISCRIMINATOR);\n}\n\nexport type Transaction = {\n discriminator: ReadonlyUint8Array;\n nonce: bigint;\n didExecute: boolean;\n vault: Address;\n programId: Address;\n data: ReadonlyUint8Array;\n accounts: Array<TransactionAccount>;\n};\n\nexport type TransactionArgs = {\n nonce: number | bigint;\n didExecute: boolean;\n vault: Address;\n programId: Address;\n data: ReadonlyUint8Array;\n accounts: Array<TransactionAccountArgs>;\n};\n\nexport function getTransactionEncoder(): Encoder<TransactionArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['nonce', getU64Encoder()],\n ['didExecute', getBooleanEncoder()],\n ['vault', getAddressEncoder()],\n ['programId', getAddressEncoder()],\n ['data', addEncoderSizePrefix(getBytesEncoder(), getU32Encoder())],\n ['accounts', getArrayEncoder(getTransactionAccountEncoder())],\n ]),\n (value) => ({ ...value, discriminator: TRANSACTION_DISCRIMINATOR })\n );\n}\n\nexport function getTransactionDecoder(): Decoder<Transaction> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['nonce', getU64Decoder()],\n ['didExecute', getBooleanDecoder()],\n ['vault', getAddressDecoder()],\n ['programId', getAddressDecoder()],\n ['data', addDecoderSizePrefix(getBytesDecoder(), getU32Decoder())],\n ['accounts', getArrayDecoder(getTransactionAccountDecoder())],\n ]);\n}\n\nexport function getTransactionCodec(): Codec<TransactionArgs, Transaction> {\n return combineCodec(getTransactionEncoder(), getTransactionDecoder());\n}\n\nexport function decodeTransaction<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>\n): Account<Transaction, TAddress>;\nexport function decodeTransaction<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>\n): MaybeAccount<Transaction, TAddress>;\nexport function decodeTransaction<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>\n): Account<Transaction, TAddress> | MaybeAccount<Transaction, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getTransactionDecoder()\n );\n}\n\nexport async function fetchTransaction<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig\n): Promise<Account<Transaction, TAddress>> {\n const maybeAccount = await fetchMaybeTransaction(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeTransaction<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig\n): Promise<MaybeAccount<Transaction, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeTransaction(maybeAccount);\n}\n\nexport async function fetchAllTransaction(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig\n): Promise<Account<Transaction>[]> {\n const maybeAccounts = await fetchAllMaybeTransaction(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeTransaction(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig\n): Promise<MaybeAccount<Transaction>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeTransaction(maybeAccount));\n}\n","import type { Address } from '@solana/kit';\n\nexport const HYRO_PROTOCOL_PROGRAM_ADDRESS =\n 'EGfondqUWdztf79joC5CBDi9HQEhgUtSsVmbPK838At4' as Address<'EGfondqUWdztf79joC5CBDi9HQEhgUtSsVmbPK838At4'>;","import type { Address } from '@solana/kit';\n\nexport const DROPPER_PROGRAM_ADDRESS =\n '5Lk3HERSPsH82FQH9xGnp6YXjoTczQs6jpJoyG7M5kiC' as Address<'5Lk3HERSPsH82FQH9xGnp6YXjoTczQs6jpJoyG7M5kiC'>;","import type { Address } from '@solana/kit';\n\n/**\n * Allow Any Policy - Permits all transactions\n */\nexport const POLICY_ALLOW_ANY_PROGRAM_ADDRESS =\n '8PahHajSVz2QZn3cCTVH5Ldq2CJzD1GiPrqAiVmuB91Q' as Address<'8PahHajSVz2QZn3cCTVH5Ldq2CJzD1GiPrqAiVmuB91Q'>;\n\n/**\n * Deny All Policy - Blocks all transactions\n */\nexport const POLICY_DENY_ALL_PROGRAM_ADDRESS =\n 'FK8qiE3SoLfvtoQUXSdTwKEwmcBWjGBteh5m1VrD91zu' as Address<'FK8qiE3SoLfvtoQUXSdTwKEwmcBWjGBteh5m1VrD91zu'>;\n\n/**\n * Limit Transfer Policy - Enforces transfer limits\n */\nexport const POLICY_LIMIT_TRANSFER_PROGRAM_ADDRESS =\n 'BhX5NffdrXhv7sPPBkobYNDQbBLsTQhrcTsTbTYGj389' as Address<'BhX5NffdrXhv7sPPBkobYNDQbBLsTQhrcTsTbTYGj389'>;\n\n/**\n * Owners Policy - Restricts access to specific owners\n */\nexport const POLICY_OWNERS_PROGRAM_ADDRESS =\n 'AgcQY5x8iB3vf2oQwR1V78ZczTkCy5EUP6pZAdrmHbLX' as Address<'AgcQY5x8iB3vf2oQwR1V78ZczTkCy5EUP6pZAdrmHbLX'>;\n\n/**\n * Multisig Policy - Multi-signature policy\n */\nexport const POLICY_MULTISIG_PROGRAM_ADDRESS =\n 'CaiBHtLhiBJJCdzUksjjXWEQfcXpFnCvLDLU6QhstAwE' as Address<'CaiBHtLhiBJJCdzUksjjXWEQfcXpFnCvLDLU6QhstAwE'>;\n\n/**\n * Challenges Policy - Challenge-based verification\n */\nexport const POLICY_CHALLENGES_PROGRAM_ADDRESS =\n '8Vewok54U1fwpbytBX7JDfv2nNTKCEqu93DcFPCRdgWM' as Address<'8Vewok54U1fwpbytBX7JDfv2nNTKCEqu93DcFPCRdgWM'>;\n\n","import {\n AccountRole,\n isProgramDerivedAddress,\n isTransactionSigner as kitIsTransactionSigner,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type ProgramDerivedAddress,\n type TransactionSigner,\n upgradeRoleToSigner,\n} from '@solana/kit';\n\n/**\n * Asserts that the given value is not null or undefined.\n * @internal\n */\nexport function expectSome<T>(value: T | null | undefined): T {\n if (value === null || value === undefined) {\n throw new Error('Expected a value but received null or undefined.');\n }\n return value;\n}\n\n/**\n * Asserts that the given value is a PublicKey.\n * @internal\n */\nexport function expectAddress<T extends string = string>(\n value:\n | Address<T>\n | ProgramDerivedAddress<T>\n | TransactionSigner<T>\n | null\n | undefined\n): Address<T> {\n if (!value) {\n throw new Error('Expected a Address.');\n }\n if (typeof value === 'object' && 'address' in value) {\n return value.address;\n }\n if (Array.isArray(value)) {\n return value[0] as Address<T>;\n }\n return value as Address<T>;\n}\n\n/**\n * Asserts that the given value is a PDA.\n * @internal\n */\nexport function expectProgramDerivedAddress<T extends string = string>(\n value:\n | Address<T>\n | ProgramDerivedAddress<T>\n | TransactionSigner<T>\n | null\n | undefined\n): ProgramDerivedAddress<T> {\n if (!value || !Array.isArray(value) || !isProgramDerivedAddress(value)) {\n throw new Error('Expected a ProgramDerivedAddress.');\n }\n return value;\n}\n\n/**\n * Asserts that the given value is a TransactionSigner.\n * @internal\n */\nexport function expectTransactionSigner<T extends string = string>(\n value:\n | Address<T>\n | ProgramDerivedAddress<T>\n | TransactionSigner<T>\n | null\n | undefined\n): TransactionSigner<T> {\n if (!value || !isTransactionSigner(value)) {\n throw new Error('Expected a TransactionSigner.');\n }\n return value;\n}\n\n/**\n * Defines an instruction account to resolve.\n * @internal\n */\nexport type ResolvedAccount<\n T extends string = string,\n U extends\n | Address<T>\n | ProgramDerivedAddress<T>\n | TransactionSigner<T>\n | null =\n | Address<T>\n | ProgramDerivedAddress<T>\n | TransactionSigner<T>\n | null,\n> = {\n isWritable: boolean;\n value: U;\n};\n\n/**\n * Defines an instruction that stores additional bytes on-chain.\n * @internal\n */\nexport type InstructionWithByteDelta = {\n byteDelta: number;\n};\n\n/**\n * Get account metas and signers from resolved accounts.\n * @internal\n */\nexport function getAccountMetaFactory(\n programAddress: Address,\n optionalAccountStrategy: 'omitted' | 'programId'\n) {\n return (\n account: ResolvedAccount\n ): AccountMeta | AccountSignerMeta | undefined => {\n if (!account.value) {\n if (optionalAccountStrategy === 'omitted') return;\n return Object.freeze({\n address: programAddress,\n role: AccountRole.READONLY,\n });\n }\n\n const writableRole = account.isWritable\n ? AccountRole.WRITABLE\n : AccountRole.READONLY;\n return Object.freeze({\n address: expectAddress(account.value),\n role: isTransactionSigner(account.value)\n ? upgradeRoleToSigner(writableRole)\n : writableRole,\n ...(isTransactionSigner(account.value) ? { signer: account.value } : {}),\n });\n };\n}\n\nexport function isTransactionSigner<TAddress extends string = string>(\n value:\n | Address<TAddress>\n | ProgramDerivedAddress<TAddress>\n | TransactionSigner<TAddress>\n): value is TransactionSigner<TAddress> {\n return (\n !!value &&\n typeof value === 'object' &&\n 'address' in value &&\n kitIsTransactionSigner(value)\n );\n}\n","import {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport { DROPPER_PROGRAM_ADDRESS } from '../../programs';\nimport { getAccountMetaFactory, type ResolvedAccount } from '../../shared';\n\nexport const TRANSFER_LAMPORTS_DISCRIMINATOR = new Uint8Array([\n 62, 53, 201, 68, 102, 134, 83, 103,\n]);\n\nexport function getTransferLamportsDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n TRANSFER_LAMPORTS_DISCRIMINATOR\n );\n}\n\nexport type TransferLamportsInstruction<\n TProgram extends string = typeof DROPPER_PROGRAM_ADDRESS,\n TAccountFrom extends string | AccountMeta<string> = string,\n TAccountTo extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends\n | string\n | AccountMeta<string> = '11111111111111111111111111111111',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountFrom extends string\n ? WritableSignerAccount<TAccountFrom> & AccountSignerMeta<TAccountFrom>\n : TAccountFrom,\n TAccountTo extends string ? WritableAccount<TAccountTo> : TAccountTo,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type TransferLamportsInstructionData = {\n discriminator: ReadonlyUint8Array;\n amount: bigint;\n};\n\nexport type TransferLamportsInstructionDataArgs = { amount: number | bigint };\n\nexport function getTransferLamportsInstructionDataEncoder(): FixedSizeEncoder<TransferLamportsInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['amount', getU64Encoder()],\n ]),\n (value) => ({ ...value, discriminator: TRANSFER_LAMPORTS_DISCRIMINATOR })\n );\n}\n\nexport function getTransferLamportsInstructionDataDecoder(): FixedSizeDecoder<TransferLamportsInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['amount', getU64Decoder()],\n ]);\n}\n\nexport function getTransferLamportsInstructionDataCodec(): FixedSizeCodec<\n TransferLamportsInstructionDataArgs,\n TransferLamportsInstructionData\n> {\n return combineCodec(\n getTransferLamportsInstructionDataEncoder(),\n getTransferLamportsInstructionDataDecoder()\n );\n}\n\nexport type TransferLamportsInput<\n TAccountFrom extends string = string,\n TAccountTo extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n from: TransactionSigner<TAccountFrom>;\n to: Address<TAccountTo>;\n systemProgram?: Address<TAccountSystemProgram>;\n amount: TransferLamportsInstructionDataArgs['amount'];\n};\n\nexport function getTransferLamportsInstruction<\n TAccountFrom extends string,\n TAccountTo extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof DROPPER_PROGRAM_ADDRESS,\n>(\n input: TransferLamportsInput<TAccountFrom, TAccountTo, TAccountSystemProgram>,\n config?: { programAddress?: TProgramAddress }\n): TransferLamportsInstruction<\n TProgramAddress,\n TAccountFrom,\n TAccountTo,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? DROPPER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n from: { value: input.from ?? null, isWritable: true },\n to: { value: input.to ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.from),\n getAccountMeta(accounts.to),\n getAccountMeta(accounts.systemProgram),\n ],\n programAddress,\n data: getTransferLamportsInstructionDataEncoder().encode(\n args as TransferLamportsInstructionDataArgs\n ),\n } as TransferLamportsInstruction<\n TProgramAddress,\n TAccountFrom,\n TAccountTo,\n TAccountSystemProgram\n >;\n\n return instruction;\n}\n\nexport type ParsedTransferLamportsInstruction<\n TProgram extends string = typeof DROPPER_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n from: TAccountMetas[0];\n to: TAccountMetas[1];\n systemProgram: TAccountMetas[2];\n };\n data: TransferLamportsInstructionData;\n};\n\nexport function parseTransferLamportsInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>\n): ParsedTransferLamportsInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 3) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n from: getNextAccount(),\n to: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getTransferLamportsInstructionDataDecoder().decode(instruction.data),\n };\n}\n","import {\n addDecoderSizePrefix,\n addEncoderSizePrefix,\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport { HYRO_PROTOCOL_PROGRAM_ADDRESS } from '../../programs';\nimport {\n expectAddress,\n expectSome,\n getAccountMetaFactory,\n type ResolvedAccount,\n} from '../../shared';\nimport {\n getTransactionAccountDecoder,\n getTransactionAccountEncoder,\n type TransactionAccount,\n type TransactionAccountArgs,\n} from '../../types';\n\nexport const CREATE_TX_DISCRIMINATOR = new Uint8Array([\n 97, 223, 80, 153, 55, 13, 155, 12,\n]);\n\nexport function getCreateTxDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(CREATE_TX_DISCRIMINATOR);\n}\n\nexport type CreateTxInstruction<\n TProgram extends string = typeof HYRO_PROTOCOL_PROGRAM_ADDRESS,\n TAccountVault extends string | AccountMeta<string> = string,\n TAccountTransaction extends string | AccountMeta<string> = string,\n TAccountPolicyAccount extends string | AccountMeta<string> = string,\n TAccountPolicyProgram extends string | AccountMeta<string> = string,\n TAccountVaultSigner extends string | AccountMeta<string> = string,\n TAccountSigner extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends\n | string\n | AccountMeta<string> = '11111111111111111111111111111111',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountVault extends string\n ? ReadonlyAccount<TAccountVault>\n : TAccountVault,\n TAccountTransaction extends string\n ? WritableAccount<TAccountTransaction>\n : TAccountTransaction,\n TAccountPolicyAccount extends string\n ? WritableAccount<TAccountPolicyAccount>\n : TAccountPolicyAccount,\n TAccountPolicyProgram extends string\n ? ReadonlyAccount<TAccountPolicyProgram>\n : TAccountPolicyProgram,\n TAccountVaultSigner extends string\n ? ReadonlyAccount<TAccountVaultSigner>\n : TAccountVaultSigner,\n TAccountSigner extends string\n ? WritableSignerAccount<TAccountSigner> &\n AccountSignerMeta<TAccountSigner>\n : TAccountSigner,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreateTxInstructionData = {\n discriminator: ReadonlyUint8Array;\n nonce: bigint;\n pid: Address;\n accs: Array<TransactionAccount>;\n data: ReadonlyUint8Array;\n};\n\nexport type CreateTxInstructionDataArgs = {\n nonce: number | bigint;\n pid: Address;\n accs: Array<TransactionAccountArgs>;\n data: ReadonlyUint8Array;\n};\n\nexport function getCreateTxInstructionDataEncoder(): Encoder<CreateTxInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['nonce', getU64Encoder()],\n ['pid', getAddressEncoder()],\n ['accs', getArrayEncoder(getTransactionAccountEncoder())],\n ['data', addEncoderSizePrefix(getBytesEncoder(), getU32Encoder())],\n ]),\n (value) => ({ ...value, discriminator: CREATE_TX_DISCRIMINATOR })\n );\n}\n\nexport function getCreateTxInstructionDataDecoder(): Decoder<CreateTxInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['nonce', getU64Decoder()],\n ['pid', getAddressDecoder()],\n ['accs', getArrayDecoder(getTransactionAccountDecoder())],\n ['data', addDecoderSizePrefix(getBytesDecoder(), getU32Decoder())],\n ]);\n}\n\nexport function getCreateTxInstructionDataCodec(): Codec<\n CreateTxInstructionDataArgs,\n CreateTxInstructionData\n> {\n return combineCodec(\n getCreateTxInstructionDataEncoder(),\n getCreateTxInstructionDataDecoder()\n );\n}\n\nexport type CreateTxAsyncInput<\n TAccountVault extends string = string,\n TAccountTransaction extends string = string,\n TAccountPolicyAccount extends string = string,\n TAccountPolicyProgram extends string = string,\n TAccountVaultSigner extends string = string,\n TAccountSigner extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n vault: Address<TAccountVault>;\n transaction?: Address<TAccountTransaction>;\n policyAccount: Address<TAccountPolicyAccount>;\n policyProgram: Address<TAccountPolicyProgram>;\n vaultSigner?: Address<TAccountVaultSigner>;\n signer: TransactionSigner<TAccountSigner>;\n systemProgram?: Address<TAccountSystemProgram>;\n nonce: CreateTxInstructionDataArgs['nonce'];\n pid: CreateTxInstructionDataArgs['pid'];\n accs: CreateTxInstructionDataArgs['accs'];\n data: CreateTxInstructionDataArgs['data'];\n};\n\nexport async function getCreateTxInstructionAsync<\n TAccountVault extends string,\n TAccountTransaction extends string,\n TAccountPolicyAccount extends string,\n TAccountPolicyProgram extends string,\n TAccountVaultSigner extends string,\n TAccountSigner extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof HYRO_PROTOCOL_PROGRAM_ADDRESS,\n>(\n input: CreateTxAsyncInput<\n TAccountVault,\n TAccountTransaction,\n TAccountPolicyAccount,\n TAccountPolicyProgram,\n TAccountVaultSigner,\n TAccountSigner,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress }\n): Promise<\n CreateTxInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountTransaction,\n TAccountPolicyAccount,\n TAccountPolicyProgram,\n TAccountVaultSigner,\n TAccountSigner,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? HYRO_PROTOCOL_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n vault: { value: input.vault ?? null, isWritable: false },\n transaction: { value: input.transaction ?? null, isWritable: true },\n policyAccount: { value: input.policyAccount ?? null, isWritable: true },\n policyProgram: { value: input.policyProgram ?? null, isWritable: false },\n vaultSigner: { value: input.vaultSigner ?? null, isWritable: false },\n signer: { value: input.signer ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.transaction.value) {\n accounts.transaction.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getAddressEncoder().encode(expectAddress(accounts.vault.value)),\n getU64Encoder().encode(expectSome(args.nonce)),\n ],\n });\n }\n if (!accounts.vaultSigner.value) {\n accounts.vaultSigner.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getAddressEncoder().encode(expectAddress(accounts.vault.value))],\n });\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.vault),\n getAccountMeta(accounts.transaction),\n getAccountMeta(accounts.policyAccount),\n getAccountMeta(accounts.policyProgram),\n getAccountMeta(accounts.vaultSigner),\n getAccountMeta(accounts.signer),\n getAccountMeta(accounts.systemProgram),\n ],\n programAddress,\n data: getCreateTxInstructionDataEncoder().encode(\n args as CreateTxInstructionDataArgs\n ),\n } as CreateTxInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountTransaction,\n TAccountPolicyAccount,\n TAccountPolicyProgram,\n TAccountVaultSigner,\n TAccountSigner,\n TAccountSystemProgram\n >;\n\n return instruction;\n}\n\nexport type CreateTxInput<\n TAccountVault extends string = string,\n TAccountTransaction extends string = string,\n TAccountPolicyAccount extends string = string,\n TAccountPolicyProgram extends string = string,\n TAccountVaultSigner extends string = string,\n TAccountSigner extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n vault: Address<TAccountVault>;\n transaction: Address<TAccountTransaction>;\n policyAccount: Address<TAccountPolicyAccount>;\n policyProgram: Address<TAccountPolicyProgram>;\n vaultSigner: Address<TAccountVaultSigner>;\n signer: TransactionSigner<TAccountSigner>;\n systemProgram?: Address<TAccountSystemProgram>;\n nonce: CreateTxInstructionDataArgs['nonce'];\n pid: CreateTxInstructionDataArgs['pid'];\n accs: CreateTxInstructionDataArgs['accs'];\n data: CreateTxInstructionDataArgs['data'];\n};\n\nexport function getCreateTxInstruction<\n TAccountVault extends string,\n TAccountTransaction extends string,\n TAccountPolicyAccount extends string,\n TAccountPolicyProgram extends string,\n TAccountVaultSigner extends string,\n TAccountSigner extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof HYRO_PROTOCOL_PROGRAM_ADDRESS,\n>(\n input: CreateTxInput<\n TAccountVault,\n TAccountTransaction,\n TAccountPolicyAccount,\n TAccountPolicyProgram,\n TAccountVaultSigner,\n TAccountSigner,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress }\n): CreateTxInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountTransaction,\n TAccountPolicyAccount,\n TAccountPolicyProgram,\n TAccountVaultSigner,\n TAccountSigner,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? HYRO_PROTOCOL_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n vault: { value: input.vault ?? null, isWritable: false },\n transaction: { value: input.transaction ?? null, isWritable: true },\n policyAccount: { value: input.policyAccount ?? null, isWritable: true },\n policyProgram: { value: input.policyProgram ?? null, isWritable: false },\n vaultSigner: { value: input.vaultSigner ?? null, isWritable: false },\n signer: { value: input.signer ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.vault),\n getAccountMeta(accounts.transaction),\n getAccountMeta(accounts.policyAccount),\n getAccountMeta(accounts.policyProgram),\n getAccountMeta(accounts.vaultSigner),\n getAccountMeta(accounts.signer),\n getAccountMeta(accounts.systemProgram),\n ],\n programAddress,\n data: getCreateTxInstructionDataEncoder().encode(\n args as CreateTxInstructionDataArgs\n ),\n } as CreateTxInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountTransaction,\n TAccountPolicyAccount,\n TAccountPolicyProgram,\n TAccountVaultSigner,\n TAccountSigner,\n TAccountSystemProgram\n >;\n\n return instruction;\n}\n\nexport type ParsedCreateTxInstruction<\n TProgram extends string = typeof HYRO_PROTOCOL_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n vault: TAccountMetas[0];\n transaction: TAccountMetas[1];\n policyAccount: TAccountMetas[2];\n policyProgram: TAccountMetas[3];\n vaultSigner: TAccountMetas[4];\n signer: TAccountMetas[5];\n systemProgram: TAccountMetas[6];\n };\n data: CreateTxInstructionData;\n};\n\nexport function parseCreateTxInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>\n): ParsedCreateTxInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 7) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n vault: getNextAccount(),\n transaction: getNextAccount(),\n policyAccount: getNextAccount(),\n policyProgram: getNextAccount(),\n vaultSigner: getNextAccount(),\n signer: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getCreateTxInstructionDataDecoder().decode(instruction.data),\n };\n}\n","import {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport { HYRO_PROTOCOL_PROGRAM_ADDRESS } from '../../programs/hyroProtocol';\nimport {\n expectAddress,\n getAccountMetaFactory,\n type ResolvedAccount,\n} from '../../shared';\n\nexport const EXECUTE_TX_DISCRIMINATOR = new Uint8Array([\n 249, 17, 145, 23, 12, 252, 17, 41,\n]);\n\nexport function getExecuteTxDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(EXECUTE_TX_DISCRIMINATOR);\n}\n\nexport type ExecuteTxInstruction<\n TProgram extends string = typeof HYRO_PROTOCOL_PROGRAM_ADDRESS,\n TAccountVault extends string | AccountMeta<string> = string,\n TAccountTransaction extends string | AccountMeta<string> = string,\n TAccountVaultSigner extends string | AccountMeta<string> = string,\n TAccountPolicyAccount extends string | AccountMeta<string> = string,\n TAccountPolicyProgram extends string | AccountMeta<string> = string,\n TAccountSigner extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountVault extends string\n ? ReadonlyAccount<TAccountVault>\n : TAccountVault,\n TAccountTransaction extends string\n ? ReadonlyAccount<TAccountTransaction>\n : TAccountTransaction,\n TAccountVaultSigner extends string\n ? ReadonlyAccount<TAccountVaultSigner>\n : TAccountVaultSigner,\n TAccountPolicyAccount extends string\n ? WritableAccount<TAccountPolicyAccount>\n : TAccountPolicyAccount,\n TAccountPolicyProgram extends string\n ? ReadonlyAccount<TAccountPolicyProgram>\n : TAccountPolicyProgram,\n TAccountSigner extends string\n ? WritableSignerAccount<TAccountSigner> &\n AccountSignerMeta<TAccountSigner>\n : TAccountSigner,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ExecuteTxInstructionData = { discriminator: ReadonlyUint8Array };\n\nexport type ExecuteTxInstructionDataArgs = {};\n\nexport function getExecuteTxInstructionDataEncoder(): FixedSizeEncoder<ExecuteTxInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: EXECUTE_TX_DISCRIMINATOR })\n );\n}\n\nexport function getExecuteTxInstructionDataDecoder(): FixedSizeDecoder<ExecuteTxInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getExecuteTxInstructionDataCodec(): FixedSizeCodec<\n ExecuteTxInstructionDataArgs,\n ExecuteTxInstructionData\n> {\n return combineCodec(\n getExecuteTxInstructionDataEncoder(),\n getExecuteTxInstructionDataDecoder()\n );\n}\n\nexport type ExecuteTxAsyncInput<\n TAccountVault extends string = string,\n TAccountTransaction extends string = string,\n TAccountVaultSigner extends string = string,\n TAccountPolicyAccount extends string = string,\n TAccountPolicyProgram extends string = string,\n TAccountSigner extends string = string,\n> = {\n vault: Address<TAccountVault>;\n transaction: Address<TAccountTransaction>;\n vaultSigner?: Address<TAccountVaultSigner>;\n policyAccount: Address<TAccountPolicyAccount>;\n policyProgram: Address<TAccountPolicyProgram>;\n signer: TransactionSigner<TAccountSigner>;\n};\n\nexport async function getExecuteTxInstructionAsync<\n TAccountVault extends string,\n TAccountTransaction extends string,\n TAccountVaultSigner extends string,\n TAccountPolicyAccount extends string,\n TAccountPolicyProgram extends string,\n TAccountSigner extends string,\n TProgramAddress extends Address = typeof HYRO_PROTOCOL_PROGRAM_ADDRESS,\n>(\n input: ExecuteTxAsyncInput<\n TAccountVault,\n TAccountTransaction,\n TAccountVaultSigner,\n TAccountPolicyAccount,\n TAccountPolicyProgram,\n TAccountSigner\n >,\n config?: { programAddress?: TProgramAddress }\n): Promise<\n ExecuteTxInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountTransaction,\n TAccountVaultSigner,\n TAccountPolicyAccount,\n TAccountPolicyProgram,\n TAccountSigner\n >\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? HYRO_PROTOCOL_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n vault: { value: input.vault ?? null, isWritable: false },\n transaction: { value: input.transaction ?? null, isWritable: false },\n vaultSigner: { value: input.vaultSigner ?? null, isWritable: false },\n policyAccount: { value: input.policyAccount ?? null, isWritable: true },\n policyProgram: { value: input.policyProgram ?? null, isWritable: false },\n signer: { value: input.signer ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Resolve default values.\n if (!accounts.vaultSigner.value) {\n accounts.vaultSigner.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getAddressEncoder().encode(expectAddress(accounts.vault.value))],\n });\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.vault),\n getAccountMeta(accounts.transaction),\n getAccountMeta(accounts.vaultSigner),\n getAccountMeta(accounts.policyAccount),\n getAccountMeta(accounts.policyProgram),\n getAccountMeta(accounts.signer),\n ],\n programAddress,\n data: getExecuteTxInstructionDataEncoder().encode({}),\n } as ExecuteTxInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountTransaction,\n TAccountVaultSigner,\n TAccountPolicyAccount,\n TAccountPolicyProgram,\n TAccountSigner\n >;\n\n return instruction;\n}\n\nexport type ExecuteTxInput<\n TAccountVault extends string = string,\n TAccountTransaction extends string = string,\n TAccountVaultSigner extends string = string,\n TAccountPolicyAccount extends string = string,\n TAccountPolicyProgram extends string = string,\n TAccountSigner extends string = string,\n> = {\n vault: Address<TAccountVault>;\n transaction: Address<TAccountTransaction>;\n vaultSigner: Address<TAccountVaultSigner>;\n policyAccount: Address<TAccountPolicyAccount>;\n policyProgram: Address<TAccountPolicyProgram>;\n signer: TransactionSigner<TAccountSigner>;\n};\n\nexport function getExecuteTxInstruction<\n TAccountVault extends string,\n TAccountTransaction extends string,\n TAccountVaultSigner extends string,\n TAccountPolicyAccount extends string,\n TAccountPolicyProgram extends string,\n TAccountSigner extends string,\n TProgramAddress extends Address = typeof HYRO_PROTOCOL_PROGRAM_ADDRESS,\n>(\n input: ExecuteTxInput<\n TAccountVault,\n TAccountTransaction,\n TAccountVaultSigner,\n TAccountPolicyAccount,\n TAccountPolicyProgram,\n TAccountSigner\n >,\n config?: { programAddress?: TProgramAddress }\n): ExecuteTxInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountTransaction,\n TAccountVaultSigner,\n TAccountPolicyAccount,\n TAccountPolicyProgram,\n TAccountSigner\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? HYRO_PROTOCOL_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n vault: { value: input.vault ?? null, isWritable: false },\n transaction: { value: input.transaction ?? null, isWritable: false },\n vaultSigner: { value: input.vaultSigner ?? null, isWritable: false },\n policyAccount: { value: input.policyAccount ?? null, isWritable: true },\n policyProgram: { value: input.policyProgram ?? null, isWritable: false },\n signer: { value: input.signer ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.vault),\n getAccountMeta(accounts.transaction),\n getAccountMeta(accounts.vaultSigner),\n getAccountMeta(accounts.policyAccount),\n getAccountMeta(accounts.policyProgram),\n getAccountMeta(accounts.signer),\n ],\n programAddress,\n data: getExecuteTxInstructionDataEncoder().encode({}),\n } as ExecuteTxInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountTransaction,\n TAccountVaultSigner,\n TAccountPolicyAccount,\n TAccountPolicyProgram,\n TAccountSigner\n >;\n\n return instruction;\n}\n\nexport type ParsedExecuteTxInstruction<\n TProgram extends string = typeof HYRO_PROTOCOL_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n vault: TAccountMetas[0];\n transaction: TAccountMetas[1];\n vaultSigner: TAccountMetas[2];\n policyAccount: TAccountMetas[3];\n policyProgram: TAccountMetas[4];\n signer: TAccountMetas[5];\n };\n data: ExecuteTxInstructionData;\n};\n\nexport function parseExecuteTxInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>\n): ParsedExecuteTxInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 6) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n vault: getNextAccount(),\n transaction: getNextAccount(),\n vaultSigner: getNextAccount(),\n policyAccount: getNextAccount(),\n policyProgram: getNextAccount(),\n signer: getNextAccount(),\n },\n data: getExecuteTxInstructionDataDecoder().decode(instruction.data),\n };\n}\n","import {\n addDecoderSizePrefix,\n addEncoderSizePrefix,\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport { HYRO_PROTOCOL_PROGRAM_ADDRESS } from '../../programs/hyroProtocol';\nimport {\n expectAddress,\n expectSome,\n getAccountMetaFactory,\n type ResolvedAccount,\n} from '../../shared';\n\nexport const INITIALIZE_VAULT_DISCRIMINATOR = new Uint8Array([\n 48, 191, 163, 44, 71, 129, 63, 164,\n]);\n\nexport function getInitializeVaultDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n INITIALIZE_VAULT_DISCRIMINATOR\n );\n}\n\nexport type InitializeVaultInstruction<\n TProgram extends string = typeof HYRO_PROTOCOL_PROGRAM_ADDRESS,\n TAccountVault extends string | AccountMeta<string> = string,\n TAccountAuthority extends string | AccountMeta<string> = string,\n TAccountSigner extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends\n | string\n | AccountMeta<string> = '11111111111111111111111111111111',\n TAccountShareSignerPda extends string | AccountMeta<string> = string,\n TAccountShareMint extends string | AccountMeta<string> = string,\n TAccountVaultTokenAccount extends string | AccountMeta<string> = string,\n TAccountAuthorityTokenAccount extends string | AccountMeta<string> = string,\n TAccountUnderlyingMint extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends\n | string\n | AccountMeta<string> = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',\n TAccountRent extends\n | string\n | AccountMeta<string> = 'SysvarRent111111111111111111111111111111111',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountVault extends string\n ? WritableAccount<TAccountVault>\n : TAccountVault,\n TAccountAuthority extends string\n ? ReadonlyAccount<TAccountAuthority>\n : TAccountAuthority,\n TAccountSigner extends string\n ? WritableSignerAccount<TAccountSigner> &\n AccountSignerMeta<TAccountSigner>\n : TAccountSigner,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n TAccountShareSignerPda extends string\n ? ReadonlyAccount<TAccountShareSignerPda>\n : TAccountShareSignerPda,\n TAccountShareMint extends string\n ? WritableAccount<TAccountShareMint>\n : TAccountShareMint,\n TAccountVaultTokenAccount extends string\n ? WritableAccount<TAccountVaultTokenAccount>\n : TAccountVaultTokenAccount,\n TAccountAuthorityTokenAccount extends string\n ? WritableAccount<TAccountAuthorityTokenAccount>\n : TAccountAuthorityTokenAccount,\n TAccountUnderlyingMint extends string\n ? ReadonlyAccount<TAccountUnderlyingMint>\n : TAccountUnderlyingMint,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n TAccountRent extends string\n ? ReadonlyAccount<TAccountRent>\n : TAccountRent,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type InitializeVaultInstructionData = {\n discriminator: ReadonlyUint8Array;\n seed: string;\n policyProgram: Address;\n};\n\nexport type InitializeVaultInstructionDataArgs = {\n seed: string;\n policyProgram: Address;\n};\n\nexport function getInitializeVaultInstructionDataEncoder(): Encoder<InitializeVaultInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['seed', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ['policyProgram', getAddressEncoder()],\n ]),\n (value) => ({ ...value, discriminator: INITIALIZE_VAULT_DISCRIMINATOR })\n );\n}\n\nexport function getInitializeVaultInstructionDataDecoder(): Decoder<InitializeVaultInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['seed', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['policyProgram', getAddressDecoder()],\n ]);\n}\n\nexport function getInitializeVaultInstructionDataCodec(): Codec<\n InitializeVaultInstructionDataArgs,\n InitializeVaultInstructionData\n> {\n return combineCodec(\n getInitializeVaultInstructionDataEncoder(),\n getInitializeVaultInstructionDataDecoder()\n );\n}\n\nexport type InitializeVaultAsyncInput<\n TAccountVault extends string = string,\n TAccountAuthority extends string = string,\n TAccountSigner extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountShareSignerPda extends string = string,\n TAccountShareMint extends string = string,\n TAccountVaultTokenAccount extends string = string,\n TAccountAuthorityTokenAccount extends string = string,\n TAccountUnderlyingMint extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountRent extends string = string,\n> = {\n vault?: Address<TAccountVault>;\n authority?: Address<TAccountAuthority>;\n signer: TransactionSigner<TAccountSigner>;\n systemProgram?: Address<TAccountSystemProgram>;\n shareSignerPda?: Address<TAccountShareSignerPda>;\n shareMint?: Address<TAccountShareMint>;\n vaultTokenAccount?: Address<TAccountVaultTokenAccount>;\n authorityTokenAccount?: Address<TAccountAuthorityTokenAccount>;\n underlyingMint: Address<TAccountUnderlyingMint>;\n tokenProgram?: Address<TAccountTokenProgram>;\n rent?: Address<TAccountRent>;\n seed: InitializeVaultInstructionDataArgs['seed'];\n policyProgram: InitializeVaultInstructionDataArgs['policyProgram'];\n};\n\nexport async function getInitializeVaultInstructionAsync<\n TAccountVault extends string,\n TAccountAuthority extends string,\n TAccountSigner extends string,\n TAccountSystemProgram extends string,\n TAccountShareSignerPda extends string,\n TAccountShareMint extends string,\n TAccountVaultTokenAccount extends string,\n TAccountAuthorityTokenAccount extends string,\n TAccountUnderlyingMint extends string,\n TAccountTokenProgram extends string,\n TAccountRent extends string,\n TProgramAddress extends Address = typeof HYRO_PROTOCOL_PROGRAM_ADDRESS,\n>(\n input: InitializeVaultAsyncInput<\n TAccountVault,\n TAccountAuthority,\n TAccountSigner,\n TAccountSystemProgram,\n TAccountShareSignerPda,\n TAccountShareMint,\n TAccountVaultTokenAccount,\n TAccountAuthorityTokenAccount,\n TAccountUnderlyingMint,\n TAccountTokenProgram,\n TAccountRent\n >,\n config?: { programAddress?: TProgramAddress }\n): Promise<\n InitializeVaultInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountAuthority,\n TAccountSigner,\n TAccountSystemProgram,\n TAccountShareSignerPda,\n TAccountShareMint,\n TAccountVaultTokenAccount,\n TAccountAuthorityTokenAccount,\n TAccountUnderlyingMint,\n TAccountTokenProgram,\n TAccountRent\n >\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? HYRO_PROTOCOL_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n vault: { value: input.vault ?? null, isWritable: true },\n authority: { value: input.authority ?? null, isWritable: false },\n signer: { value: input.signer ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n shareSignerPda: { value: input.shareSignerPda ?? null, isWritable: false },\n shareMint: { value: input.shareMint ?? null, isWritable: true },\n vaultTokenAccount: {\n value: input.vaultTokenAccount ?? null,\n isWritable: true,\n },\n authorityTokenAccount: {\n value: input.authorityTokenAccount ?? null,\n isWritable: true,\n },\n underlyingMint: { value: input.underlyingMint ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n rent: { value: input.rent ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.vault.value) {\n accounts.vault.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()).encode(\n expectSome(args.seed)\n ),\n ],\n });\n }\n if (!accounts.authority.value) {\n accounts.authority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getAddressEncoder().encode(expectAddress(accounts.vault.value))],\n });\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.shareSignerPda.value) {\n accounts.shareSignerPda.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([\n 118, 97, 117, 108, 116, 95, 115, 104, 97, 114, 101, 95, 115, 105,\n 103, 110, 101, 114,\n ])\n ),\n getAddressEncoder().encode(expectAddress(accounts.vault.value)),\n ],\n });\n }\n if (!accounts.shareMint.value) {\n accounts.shareMint.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([\n 118, 97, 117, 108, 116, 95, 115, 104, 97, 114, 101, 95, 109, 105,\n 110, 116,\n ])\n ),\n getAddressEncoder().encode(expectAddress(accounts.vault.value)),\n ],\n });\n }\n if (!accounts.vaultTokenAccount.value) {\n accounts.vaultTokenAccount.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([\n 118, 97, 117, 108, 116, 95, 116, 111, 107, 101, 110, 95, 97, 99, 99,\n 111, 117, 110, 116,\n ])\n ),\n getAddressEncoder().encode(expectAddress(accounts.vault.value)),\n getAddressEncoder().encode(\n expectAddress(accounts.underlyingMint.value)\n ),\n ],\n });\n }\n if (!accounts.authorityTokenAccount.value) {\n accounts.authorityTokenAccount.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([\n 97, 117, 116, 104, 111, 114, 105, 116, 121, 95, 116, 111, 107, 101,\n 110, 95, 97, 99, 99, 111, 117, 110, 116,\n ])\n ),\n getAddressEncoder().encode(expectAddress(accounts.authority.value)),\n getAddressEncoder().encode(\n expectAddress(accounts.underlyingMint.value)\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;\n }\n if (!accounts.rent.value) {\n accounts.rent.value =\n 'SysvarRent111111111111111111111111111111111' as Address<'SysvarRent111111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.vault),\n getAccountMeta(accounts.authority),\n getAccountMeta(accounts.signer),\n getAccountMeta(accounts.systemProgram),\n getAccountMeta(accounts.shareSignerPda),\n getAccountMeta(accounts.shareMint),\n getAccountMeta(accounts.vaultTokenAccount),\n getAccountMeta(accounts.authorityTokenAccount),\n getAccountMeta(accounts.underlyingMint),\n getAccountMeta(accounts.tokenProgram),\n getAccountMeta(accounts.rent),\n ],\n programAddress,\n data: getInitializeVaultInstructionDataEncoder().encode(\n args as InitializeVaultInstructionDataArgs\n ),\n } as InitializeVaultInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountAuthority,\n TAccountSigner,\n TAccountSystemProgram,\n TAccountShareSignerPda,\n TAccountShareMint,\n TAccountVaultTokenAccount,\n TAccountAuthorityTokenAccount,\n TAccountUnderlyingMint,\n TAccountTokenProgram,\n TAccountRent\n >;\n\n return instruction;\n}\n\nexport type InitializeVaultInput<\n TAccountVault extends string = string,\n TAccountAuthority extends string = string,\n TAccountSigner extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountShareSignerPda extends string = string,\n TAccountShareMint extends string = string,\n TAccountVaultTokenAccount extends string = string,\n TAccountAuthorityTokenAccount extends string = string,\n TAccountUnderlyingMint extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountRent extends string = string,\n> = {\n vault: Address<TAccountVault>;\n authority: Address<TAccountAuthority>;\n signer: TransactionSigner<TAccountSigner>;\n systemProgram?: Address<TAccountSystemProgram>;\n shareSignerPda: Address<TAccountShareSignerPda>;\n shareMint: Address<TAccountShareMint>;\n vaultTokenAccount: Address<TAccountVaultTokenAccount>;\n authorityTokenAccount: Address<TAccountAuthorityTokenAccount>;\n underlyingMint: Address<TAccountUnderlyingMint>;\n tokenProgram?: Address<TAccountTokenProgram>;\n rent?: Address<TAccountRent>;\n seed: InitializeVaultInstructionDataArgs['seed'];\n policyProgram: InitializeVaultInstructionDataArgs['policyProgram'];\n};\n\nexport function getInitializeVaultInstruction<\n TAccountVault extends string,\n TAccountAuthority extends string,\n TAccountSigner extends string,\n TAccountSystemProgram extends string,\n TAccountShareSignerPda extends string,\n TAccountShareMint extends string,\n TAccountVaultTokenAccount extends string,\n TAccountAuthorityTokenAccount extends string,\n TAccountUnderlyingMint extends string,\n TAccountTokenProgram extends string,\n TAccountRent extends string,\n TProgramAddress extends Address = typeof HYRO_PROTOCOL_PROGRAM_ADDRESS,\n>(\n input: InitializeVaultInput<\n TAccountVault,\n TAccountAuthority,\n TAccountSigner,\n TAccountSystemProgram,\n TAccountShareSignerPda,\n TAccountShareMint,\n TAccountVaultTokenAccount,\n TAccountAuthorityTokenAccount,\n TAccountUnderlyingMint,\n TAccountTokenProgram,\n TAccountRent\n >,\n config?: { programAddress?: TProgramAddress }\n): InitializeVaultInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountAuthority,\n TAccountSigner,\n TAccountSystemProgram,\n TAccountShareSignerPda,\n TAccountShareMint,\n TAccountVaultTokenAccount,\n TAccountAuthorityTokenAccount,\n TAccountUnderlyingMint,\n TAccountTokenProgram,\n TAccountRent\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? HYRO_PROTOCOL_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n vault: { value: input.vault ?? null, isWritable: true },\n authority: { value: input.authority ?? null, isWritable: false },\n signer: { value: input.signer ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n shareSignerPda: { value: input.shareSignerPda ?? null, isWritable: false },\n shareMint: { value: input.shareMint ?? null, isWritable: true },\n vaultTokenAccount: {\n value: input.vaultTokenAccount ?? null,\n isWritable: true,\n },\n authorityTokenAccount: {\n value: input.authorityTokenAccount ?? null,\n isWritable: true,\n },\n underlyingMint: { value: input.underlyingMint ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n rent: { value: input.rent ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;\n }\n if (!accounts.rent.value) {\n accounts.rent.value =\n 'SysvarRent111111111111111111111111111111111' as Address<'SysvarRent111111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.vault),\n getAccountMeta(accounts.authority),\n getAccountMeta(accounts.signer),\n getAccountMeta(accounts.systemProgram),\n getAccountMeta(accounts.shareSignerPda),\n getAccountMeta(accounts.shareMint),\n getAccountMeta(accounts.vaultTokenAccount),\n getAccountMeta(accounts.authorityTokenAccount),\n getAccountMeta(accounts.underlyingMint),\n getAccountMeta(accounts.tokenProgram),\n getAccountMeta(accounts.rent),\n ],\n programAddress,\n data: getInitializeVaultInstructionDataEncoder().encode(\n args as InitializeVaultInstructionDataArgs\n ),\n } as InitializeVaultInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountAuthority,\n TAccountSigner,\n TAccountSystemProgram,\n TAccountShareSignerPda,\n TAccountShareMint,\n TAccountVaultTokenAccount,\n TAccountAuthorityTokenAccount,\n TAccountUnderlyingMint,\n TAccountTokenProgram,\n TAccountRent\n >;\n\n return instruction;\n}\n\nexport type ParsedInitializeVaultInstruction<\n TProgram extends string = typeof HYRO_PROTOCOL_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n vault: TAccountMetas[0];\n authority: TAccountMetas[1];\n signer: TAccountMetas[2];\n systemProgram: TAccountMetas[3];\n shareSignerPda: TAccountMetas[4];\n shareMint: TAccountMetas[5];\n vaultTokenAccount: TAccountMetas[6];\n authorityTokenAccount: TAccountMetas[7];\n underlyingMint: TAccountMetas[8];\n tokenProgram: TAccountMetas[9];\n rent: TAccountMetas[10];\n };\n data: InitializeVaultInstructionData;\n};\n\nexport function parseInitializeVaultInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>\n): ParsedInitializeVaultInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 11) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n vault: getNextAccount(),\n authority: getNextAccount(),\n signer: getNextAccount(),\n systemProgram: getNextAccount(),\n shareSignerPda: getNextAccount(),\n shareMint: getNextAccount(),\n vaultTokenAccount: getNextAccount(),\n authorityTokenAccount: getNextAccount(),\n underlyingMint: getNextAccount(),\n tokenProgram: getNextAccount(),\n rent: getNextAccount(),\n },\n data: getInitializeVaultInstructionDataDecoder().decode(instruction.data),\n };\n}\n","import {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport { POLICY_LIMIT_TRANSFER_PROGRAM_ADDRESS } from '../../programs';\nimport {\n expectAddress,\n getAccountMetaFactory,\n type ResolvedAccount,\n} from '../../shared';\n\nexport const INITIALIZE_LIMIT_TRANSFER_DISCRIMINATOR = new Uint8Array([\n 231, 140, 57, 76, 17, 243, 161, 149,\n]);\n\nexport function getInitializeLimitTransferDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n INITIALIZE_LIMIT_TRANSFER_DISCRIMINATOR\n );\n}\n\nexport type InitializeLimitTransferInstruction<\n TProgram extends string = typeof POLICY_LIMIT_TRANSFER_PROGRAM_ADDRESS,\n TAccountVault extends string | AccountMeta<string> = string,\n TAccountPolicyAccount extends string | AccountMeta<string> = string,\n TAccountSigner extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends\n | string\n | AccountMeta<string> = '11111111111111111111111111111111',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountVault extends string\n ? ReadonlyAccount<TAccountVault>\n : TAccountVault,\n TAccountPolicyAccount extends string\n ? WritableAccount<TAccountPolicyAccount>\n : TAccountPolicyAccount,\n TAccountSigner extends string\n ? WritableSignerAccount<TAccountSigner> &\n AccountSignerMeta<TAccountSigner>\n : TAccountSigner,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type InitializeLimitTransferInstructionData = {\n discriminator: ReadonlyUint8Array;\n min: bigint;\n max: bigint;\n};\n\nexport type InitializeLimitTransferInstructionDataArgs = {\n min: number | bigint;\n max: number | bigint;\n};\n\nexport function getInitializeLimitTransferInstructionDataEncoder(): FixedSizeEncoder<InitializeLimitTransferInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['min', getU64Encoder()],\n ['max', getU64Encoder()],\n ]),\n (value) => ({\n ...value,\n discriminator: INITIALIZE_LIMIT_TRANSFER_DISCRIMINATOR,\n })\n );\n}\n\nexport function getInitializeLimitTransferInstructionDataDecoder(): FixedSizeDecoder<InitializeLimitTransferInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['min', getU64Decoder()],\n ['max', getU64Decoder()],\n ]);\n}\n\nexport function getInitializeLimitTransferInstructionDataCodec(): FixedSizeCodec<\n InitializeLimitTransferInstructionDataArgs,\n InitializeLimitTransferInstructionData\n> {\n return combineCodec(\n getInitializeLimitTransferInstructionDataEncoder(),\n getInitializeLimitTransferInstructionDataDecoder()\n );\n}\n\nexport type InitializeLimitTransferAsyncInput<\n TAccountVault extends string = string,\n TAccountPolicyAccount extends string = string,\n TAccountSigner extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n vault: Address<TAccountVault>;\n policyAccount?: Address<TAccountPolicyAccount>;\n signer: TransactionSigner<TAccountSigner>;\n systemProgram?: Address<TAccountSystemProgram>;\n min: InitializeLimitTransferInstructionDataArgs['min'];\n max: InitializeLimitTransferInstructionDataArgs['max'];\n};\n\nexport async function getInitializeLimitTransferInstructionAsync<\n TAccountVault extends string,\n TAccountPolicyAccount extends string,\n TAccountSigner extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends\n Address = typeof POLICY_LIMIT_TRANSFER_PROGRAM_ADDRESS,\n>(\n input: InitializeLimitTransferAsyncInput<\n TAccountVault,\n TAccountPolicyAccount,\n TAccountSigner,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress }\n): Promise<\n InitializeLimitTransferInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountPolicyAccount,\n TAccountSigner,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? POLICY_LIMIT_TRANSFER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n vault: { value: input.vault ?? null, isWritable: false },\n policyAccount: { value: input.policyAccount ?? null, isWritable: true },\n signer: { value: input.signer ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.policyAccount.value) {\n accounts.policyAccount.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getAddressEncoder().encode(expectAddress(accounts.vault.value))],\n });\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.vault),\n getAccountMeta(accounts.policyAccount),\n getAccountMeta(accounts.signer),\n getAccountMeta(accounts.systemProgram),\n ],\n programAddress,\n data: getInitializeLimitTransferInstructionDataEncoder().encode(\n args as InitializeLimitTransferInstructionDataArgs\n ),\n } as InitializeLimitTransferInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountPolicyAccount,\n TAccountSigner,\n TAccountSystemProgram\n >;\n\n return instruction;\n}\n\nexport type InitializeLimitTransferInput<\n TAccountVault extends string = string,\n TAccountPolicyAccount extends string = string,\n TAccountSigner extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n vault: Address<TAccountVault>;\n policyAccount: Address<TAccountPolicyAccount>;\n signer: TransactionSigner<TAccountSigner>;\n systemProgram?: Address<TAccountSystemProgram>;\n min: InitializeLimitTransferInstructionDataArgs['min'];\n max: InitializeLimitTransferInstructionDataArgs['max'];\n};\n\nexport function getInitializeLimitTransferInstruction<\n TAccountVault extends string,\n TAccountPolicyAccount extends string,\n TAccountSigner extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends\n Address = typeof POLICY_LIMIT_TRANSFER_PROGRAM_ADDRESS,\n>(\n input: InitializeLimitTransferInput<\n TAccountVault,\n TAccountPolicyAccount,\n TAccountSigner,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress }\n): InitializeLimitTransferInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountPolicyAccount,\n TAccountSigner,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? POLICY_LIMIT_TRANSFER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n vault: { value: input.vault ?? null, isWritable: false },\n policyAccount: { value: input.policyAccount ?? null, isWritable: true },\n signer: { value: input.signer ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.vault),\n getAccountMeta(accounts.policyAccount),\n getAccountMeta(accounts.signer),\n getAccountMeta(accounts.systemProgram),\n ],\n programAddress,\n data: getInitializeLimitTransferInstructionDataEncoder().encode(\n args as InitializeLimitTransferInstructionDataArgs\n ),\n } as InitializeLimitTransferInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountPolicyAccount,\n TAccountSigner,\n TAccountSystemProgram\n >;\n\n return instruction;\n}\n\nexport type ParsedInitializeLimitTransferInstruction<\n TProgram extends string = typeof POLICY_LIMIT_TRANSFER_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n vault: TAccountMetas[0];\n policyAccount: TAccountMetas[1];\n signer: TAccountMetas[2];\n systemProgram: TAccountMetas[3];\n };\n data: InitializeLimitTransferInstructionData;\n};\n\nexport function parseInitializeLimitTransferInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>\n): ParsedInitializeLimitTransferInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 4) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n vault: getNextAccount(),\n policyAccount: getNextAccount(),\n signer: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getInitializeLimitTransferInstructionDataDecoder().decode(\n instruction.data\n ),\n };\n}\n","import {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n} from '@solana/kit';\nimport { POLICY_MULTISIG_PROGRAM_ADDRESS } from '../../programs';\nimport { getAccountMetaFactory, type ResolvedAccount } from '../../shared';\n\nexport const APPROVE_DISCRIMINATOR = new Uint8Array([\n 69, 74, 217, 36, 115, 117, 97, 76,\n]);\n\nexport function getApproveDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(APPROVE_DISCRIMINATOR);\n}\n\nexport type ApproveInstruction<\n TProgram extends string = typeof POLICY_MULTISIG_PROGRAM_ADDRESS,\n TAccountPolicyAccount extends string | AccountMeta<string> = string,\n TAccountOwner extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountPolicyAccount extends string\n ? WritableAccount<TAccountPolicyAccount>\n : TAccountPolicyAccount,\n TAccountOwner extends string\n ? ReadonlySignerAccount<TAccountOwner> &\n AccountSignerMeta<TAccountOwner>\n : TAccountOwner,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ApproveInstructionData = { discriminator: ReadonlyUint8Array };\n\nexport type ApproveInstructionDataArgs = {};\n\nexport function getApproveInstructionDataEncoder(): FixedSizeEncoder<ApproveInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: APPROVE_DISCRIMINATOR })\n );\n}\n\nexport function getApproveInstructionDataDecoder(): FixedSizeDecoder<ApproveInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getApproveInstructionDataCodec(): FixedSizeCodec<\n ApproveInstructionDataArgs,\n ApproveInstructionData\n> {\n return combineCodec(\n getApproveInstructionDataEncoder(),\n getApproveInstructionDataDecoder()\n );\n}\n\nexport type ApproveInput<\n TAccountPolicyAccount extends string = string,\n TAccountOwner extends string = string,\n> = {\n policyAccount: Address<TAccountPolicyAccount>;\n owner: TransactionSigner<TAccountOwner>;\n};\n\nexport function getApproveInstruction<\n TAccountPolicyAccount extends string,\n TAccountOwner extends string,\n TProgramAddress extends Address = typeof POLICY_MULTISIG_PROGRAM_ADDRESS,\n>(\n input: ApproveInput<TAccountPolicyAccount, TAccountOwner>,\n config?: { programAddress?: TProgramAddress }\n): ApproveInstruction<TProgramAddress, TAccountPolicyAccount, TAccountOwner> {\n // Program address.\n const programAddress =\n config?.programAddress ?? POLICY_MULTISIG_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n policyAccount: { value: input.policyAccount ?? null, isWritable: true },\n owner: { value: input.owner ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.policyAccount),\n getAccountMeta(accounts.owner),\n ],\n programAddress,\n data: getApproveInstructionDataEncoder().encode({}),\n } as ApproveInstruction<\n TProgramAddress,\n TAccountPolicyAccount,\n TAccountOwner\n >;\n\n return instruction;\n}\n\nexport type ParsedApproveInstruction<\n TProgram extends string = typeof POLICY_MULTISIG_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n policyAccount: TAccountMetas[0];\n owner: TAccountMetas[1];\n };\n data: ApproveInstructionData;\n};\n\nexport function parseApproveInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>\n): ParsedApproveInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 2) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n policyAccount: getNextAccount(),\n owner: getNextAccount(),\n },\n data: getApproveInstructionDataDecoder().decode(instruction.data),\n };\n}\n","import {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport { POLICY_MULTISIG_PROGRAM_ADDRESS } from '../../programs';\nimport {\n expectAddress,\n getAccountMetaFactory,\n type ResolvedAccount,\n} from '../../shared';\n\nexport const INITIALIZE_MULTISIG_DISCRIMINATOR = new Uint8Array([\n 220, 130, 117, 21, 27, 227, 78, 213,\n]);\n\nexport function getInitializeMultisigDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n INITIALIZE_MULTISIG_DISCRIMINATOR\n );\n}\n\nexport type InitializeMultisigInstruction<\n TProgram extends string = typeof POLICY_MULTISIG_PROGRAM_ADDRESS,\n TAccountVault extends string | AccountMeta<string> = string,\n TAccountPolicyAccount extends string | AccountMeta<string> = string,\n TAccountSigner extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends\n | string\n | AccountMeta<string> = '11111111111111111111111111111111',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountVault extends string\n ? ReadonlyAccount<TAccountVault>\n : TAccountVault,\n TAccountPolicyAccount extends string\n ? WritableAccount<TAccountPolicyAccount>\n : TAccountPolicyAccount,\n TAccountSigner extends string\n ? WritableSignerAccount<TAccountSigner> &\n AccountSignerMeta<TAccountSigner>\n : TAccountSigner,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type InitializeMultisigInstructionData = {\n discriminator: ReadonlyUint8Array;\n owners: Array<Address>;\n threshold: bigint;\n};\n\nexport type InitializeMultisigInstructionDataArgs = {\n owners: Array<Address>;\n threshold: number | bigint;\n};\n\nexport function getInitializeMultisigInstructionDataEncoder(): Encoder<InitializeMultisigInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['owners', getArrayEncoder(getAddressEncoder())],\n ['threshold', getU64Encoder()],\n ]),\n (value) => ({ ...value, discriminator: INITIALIZE_MULTISIG_DISCRIMINATOR })\n );\n}\n\nexport function getInitializeMultisigInstructionDataDecoder(): Decoder<InitializeMultisigInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['owners', getArrayDecoder(getAddressDecoder())],\n ['threshold', getU64Decoder()],\n ]);\n}\n\nexport function getInitializeMultisigInstructionDataCodec(): Codec<\n InitializeMultisigInstructionDataArgs,\n InitializeMultisigInstructionData\n> {\n return combineCodec(\n getInitializeMultisigInstructionDataEncoder(),\n getInitializeMultisigInstructionDataDecoder()\n );\n}\n\nexport type InitializeMultisigAsyncInput<\n TAccountVault extends string = string,\n TAccountPolicyAccount extends string = string,\n TAccountSigner extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n vault: Address<TAccountVault>;\n policyAccount?: Address<TAccountPolicyAccount>;\n signer: TransactionSigner<TAccountSigner>;\n systemProgram?: Address<TAccountSystemProgram>;\n owners: InitializeMultisigInstructionDataArgs['owners'];\n threshold: InitializeMultisigInstructionDataArgs['threshold'];\n};\n\nexport async function getInitializeMultisigInstructionAsync<\n TAccountVault extends string,\n TAccountPolicyAccount extends string,\n TAccountSigner extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof POLICY_MULTISIG_PROGRAM_ADDRESS,\n>(\n input: InitializeMultisigAsyncInput<\n TAccountVault,\n TAccountPolicyAccount,\n TAccountSigner,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress }\n): Promise<\n InitializeMultisigInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountPolicyAccount,\n TAccountSigner,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? POLICY_MULTISIG_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n vault: { value: input.vault ?? null, isWritable: false },\n policyAccount: { value: input.policyAccount ?? null, isWritable: true },\n signer: { value: input.signer ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.policyAccount.value) {\n accounts.policyAccount.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getAddressEncoder().encode(expectAddress(accounts.vault.value))],\n });\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.vault),\n getAccountMeta(accounts.policyAccount),\n getAccountMeta(accounts.signer),\n getAccountMeta(accounts.systemProgram),\n ],\n programAddress,\n data: getInitializeMultisigInstructionDataEncoder().encode(\n args as InitializeMultisigInstructionDataArgs\n ),\n } as InitializeMultisigInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountPolicyAccount,\n TAccountSigner,\n TAccountSystemProgram\n >;\n\n return instruction;\n}\n\nexport type InitializeMultisigInput<\n TAccountVault extends string = string,\n TAccountPolicyAccount extends string = string,\n TAccountSigner extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n vault: Address<TAccountVault>;\n policyAccount: Address<TAccountPolicyAccount>;\n signer: TransactionSigner<TAccountSigner>;\n systemProgram?: Address<TAccountSystemProgram>;\n owners: InitializeMultisigInstructionDataArgs['owners'];\n threshold: InitializeMultisigInstructionDataArgs['threshold'];\n};\n\nexport function getInitializeMultisigInstruction<\n TAccountVault extends string,\n TAccountPolicyAccount extends string,\n TAccountSigner extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof POLICY_MULTISIG_PROGRAM_ADDRESS,\n>(\n input: InitializeMultisigInput<\n TAccountVault,\n TAccountPolicyAccount,\n TAccountSigner,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress }\n): InitializeMultisigInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountPolicyAccount,\n TAccountSigner,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? POLICY_MULTISIG_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n vault: { value: input.vault ?? null, isWritable: false },\n policyAccount: { value: input.policyAccount ?? null, isWritable: true },\n signer: { value: input.signer ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.vault),\n getAccountMeta(accounts.policyAccount),\n getAccountMeta(accounts.signer),\n getAccountMeta(accounts.systemProgram),\n ],\n programAddress,\n data: getInitializeMultisigInstructionDataEncoder().encode(\n args as InitializeMultisigInstructionDataArgs\n ),\n } as InitializeMultisigInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountPolicyAccount,\n TAccountSigner,\n TAccountSystemProgram\n >;\n\n return instruction;\n}\n\nexport type ParsedInitializeMultisigInstruction<\n TProgram extends string = typeof POLICY_MULTISIG_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n vault: TAccountMetas[0];\n policyAccount: TAccountMetas[1];\n signer: TAccountMetas[2];\n systemProgram: TAccountMetas[3];\n };\n data: InitializeMultisigInstructionData;\n};\n\nexport function parseInitializeMultisigInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>\n): ParsedInitializeMultisigInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 4) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n vault: getNextAccount(),\n policyAccount: getNextAccount(),\n signer: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getInitializeMultisigInstructionDataDecoder().decode(\n instruction.data\n ),\n };\n}\n","import {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport { POLICY_OWNERS_PROGRAM_ADDRESS } from '../../programs';\nimport {\n expectAddress,\n getAccountMetaFactory,\n type ResolvedAccount,\n} from '../../shared';\n\nexport const INITIALIZE_OWNERS_DISCRIMINATOR = new Uint8Array([\n 145, 41, 103, 101, 229, 205, 135, 157,\n]);\n\nexport function getInitializeOwnersDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n INITIALIZE_OWNERS_DISCRIMINATOR\n );\n}\n\nexport type InitializeOwnersInstruction<\n TProgram extends string = typeof POLICY_OWNERS_PROGRAM_ADDRESS,\n TAccountVault extends string | AccountMeta<string> = string,\n TAccountPolicyAccount extends string | AccountMeta<string> = string,\n TAccountSigner extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends\n | string\n | AccountMeta<string> = '11111111111111111111111111111111',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountVault extends string\n ? ReadonlyAccount<TAccountVault>\n : TAccountVault,\n TAccountPolicyAccount extends string\n ? WritableAccount<TAccountPolicyAccount>\n : TAccountPolicyAccount,\n TAccountSigner extends string\n ? WritableSignerAccount<TAccountSigner> &\n AccountSignerMeta<TAccountSigner>\n : TAccountSigner,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type InitializeOwnersInstructionData = {\n discriminator: ReadonlyUint8Array;\n owners: Array<Address>;\n};\n\nexport type InitializeOwnersInstructionDataArgs = { owners: Array<Address> };\n\nexport function getInitializeOwnersInstructionDataEncoder(): Encoder<InitializeOwnersInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['owners', getArrayEncoder(getAddressEncoder())],\n ]),\n (value) => ({ ...value, discriminator: INITIALIZE_OWNERS_DISCRIMINATOR })\n );\n}\n\nexport function getInitializeOwnersInstructionDataDecoder(): Decoder<InitializeOwnersInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['owners', getArrayDecoder(getAddressDecoder())],\n ]);\n}\n\nexport function getInitializeOwnersInstructionDataCodec(): Codec<\n InitializeOwnersInstructionDataArgs,\n InitializeOwnersInstructionData\n> {\n return combineCodec(\n getInitializeOwnersInstructionDataEncoder(),\n getInitializeOwnersInstructionDataDecoder()\n );\n}\n\nexport type InitializeOwnersAsyncInput<\n TAccountVault extends string = string,\n TAccountPolicyAccount extends string = string,\n TAccountSigner extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n vault: Address<TAccountVault>;\n policyAccount?: Address<TAccountPolicyAccount>;\n signer: TransactionSigner<TAccountSigner>;\n systemProgram?: Address<TAccountSystemProgram>;\n owners: InitializeOwnersInstructionDataArgs['owners'];\n};\n\nexport async function getInitializeOwnersInstructionAsync<\n TAccountVault extends string,\n TAccountPolicyAccount extends string,\n TAccountSigner extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof POLICY_OWNERS_PROGRAM_ADDRESS,\n>(\n input: InitializeOwnersAsyncInput<\n TAccountVault,\n TAccountPolicyAccount,\n TAccountSigner,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress }\n): Promise<\n InitializeOwnersInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountPolicyAccount,\n TAccountSigner,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? POLICY_OWNERS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n vault: { value: input.vault ?? null, isWritable: false },\n policyAccount: { value: input.policyAccount ?? null, isWritable: true },\n signer: { value: input.signer ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.policyAccount.value) {\n accounts.policyAccount.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getAddressEncoder().encode(expectAddress(accounts.vault.value))],\n });\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.vault),\n getAccountMeta(accounts.policyAccount),\n getAccountMeta(accounts.signer),\n getAccountMeta(accounts.systemProgram),\n ],\n programAddress,\n data: getInitializeOwnersInstructionDataEncoder().encode(\n args as InitializeOwnersInstructionDataArgs\n ),\n } as InitializeOwnersInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountPolicyAccount,\n TAccountSigner,\n TAccountSystemProgram\n >;\n\n return instruction;\n}\n\nexport type InitializeOwnersInput<\n TAccountVault extends string = string,\n TAccountPolicyAccount extends string = string,\n TAccountSigner extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n vault: Address<TAccountVault>;\n policyAccount: Address<TAccountPolicyAccount>;\n signer: TransactionSigner<TAccountSigner>;\n systemProgram?: Address<TAccountSystemProgram>;\n owners: InitializeOwnersInstructionDataArgs['owners'];\n};\n\nexport function getInitializeOwnersInstruction<\n TAccountVault extends string,\n TAccountPolicyAccount extends string,\n TAccountSigner extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof POLICY_OWNERS_PROGRAM_ADDRESS,\n>(\n input: InitializeOwnersInput<\n TAccountVault,\n TAccountPolicyAccount,\n TAccountSigner,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress }\n): InitializeOwnersInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountPolicyAccount,\n TAccountSigner,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? POLICY_OWNERS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n vault: { value: input.vault ?? null, isWritable: false },\n policyAccount: { value: input.policyAccount ?? null, isWritable: true },\n signer: { value: input.signer ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.vault),\n getAccountMeta(accounts.policyAccount),\n getAccountMeta(accounts.signer),\n getAccountMeta(accounts.systemProgram),\n ],\n programAddress,\n data: getInitializeOwnersInstructionDataEncoder().encode(\n args as InitializeOwnersInstructionDataArgs\n ),\n } as InitializeOwnersInstruction<\n TProgramAddress,\n TAccountVault,\n TAccountPolicyAccount,\n TAccountSigner,\n TAccountSystemProgram\n >;\n\n return instruction;\n}\n\nexport type ParsedInitializeOwnersInstruction<\n TProgram extends string = typeof POLICY_OWNERS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n vault: TAccountMetas[0];\n policyAccount: TAccountMetas[1];\n signer: TAccountMetas[2];\n systemProgram: TAccountMetas[3];\n };\n data: InitializeOwnersInstructionData;\n};\n\nexport function parseInitializeOwnersInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>\n): ParsedInitializeOwnersInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 4) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n vault: getNextAccount(),\n policyAccount: getNextAccount(),\n signer: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getInitializeOwnersInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * PDA Helper Functions for Hyro Protocol\n */\n\nimport {\n getAddressEncoder,\n getProgramDerivedAddress,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/kit';\nimport { HYRO_PROTOCOL_PROGRAM_ADDRESS } from '../programs/hyroProtocol';\n\n/**\n * Convert a number or bigint to a seed buffer\n */\nfunction bigIntToSeed(value: bigint | number, byteLength: number = 8): Uint8Array {\n const buf = Buffer.alloc(byteLength);\n buf.writeBigUInt64LE(BigInt(value));\n return buf;\n}\n\n/**\n * Get PDA from seeds\n */\nasync function getPda(\n programAddress: Address,\n seeds: Array<string | Address | bigint | number>\n): Promise<ProgramDerivedAddress> {\n const addressEncoder = getAddressEncoder();\n const seedsUint8Array = seeds.map((seed) => {\n if (typeof seed === 'bigint' || typeof seed === 'number') {\n return bigIntToSeed(BigInt(seed), 8);\n }\n // Try to encode as Address, if it fails treat as string\n try {\n const encoded = addressEncoder.encode(seed as Address);\n return encoded;\n } catch {\n return new TextEncoder().encode(seed as string);\n }\n });\n return getProgramDerivedAddress({\n seeds: seedsUint8Array,\n programAddress,\n });\n}\n\n/**\n * Get Vault PDA and Authority PDA\n * @param seed - The seed string for the vault\n * @returns A tuple of [vaultPda, authorityPda]\n */\nexport async function getVaultPda(\n seed: string\n): Promise<[ProgramDerivedAddress, ProgramDerivedAddress]> {\n const vault = await getPda(HYRO_PROTOCOL_PROGRAM_ADDRESS, [seed]);\n const authority = await getPda(HYRO_PROTOCOL_PROGRAM_ADDRESS, [vault[0]]);\n return [vault, authority];\n}\n\n/**\n * Get Transaction PDA\n * @param vault - The vault PDA\n * @param nonce - The transaction nonce\n * @returns The transaction PDA\n */\nexport async function getTransactionPda(\n vault: ProgramDerivedAddress,\n nonce: number | bigint\n): Promise<ProgramDerivedAddress> {\n return getPda(HYRO_PROTOCOL_PROGRAM_ADDRESS, [vault[0], nonce]);\n}\n\n/**\n * Get Vault Signer PDA (for share operations)\n * @param vault - The vault PDA\n * @returns The vault signer PDA\n */\nexport async function getShareSignerPda(\n vault: ProgramDerivedAddress\n): Promise<ProgramDerivedAddress> {\n const addressEncoder = getAddressEncoder();\n return getProgramDerivedAddress({\n programAddress: HYRO_PROTOCOL_PROGRAM_ADDRESS,\n seeds: [\n new Uint8Array([\n 118, 97, 117, 108, 116, 95, 115, 104, 97, 114, 101, 95, 115, 105, 103,\n 110, 101, 114,\n ]),\n addressEncoder.encode(vault[0]),\n ],\n });\n}\n\n/**\n * Get Share Mint PDA\n * @param vault - The vault PDA\n * @returns The share mint PDA\n */\nexport async function getShareMintPda(\n vault: ProgramDerivedAddress\n): Promise<ProgramDerivedAddress> {\n const addressEncoder = getAddressEncoder();\n return getProgramDerivedAddress({\n programAddress: HYRO_PROTOCOL_PROGRAM_ADDRESS,\n seeds: [\n new Uint8Array([\n 118, 97, 117, 108, 116, 95, 115, 104, 97, 114, 101, 95, 109, 105, 110,\n 116,\n ]),\n addressEncoder.encode(vault[0]),\n ],\n });\n}\n\n/**\n * Get Vault Token Account PDA\n * @param vault - The vault PDA\n * @param underlyingMint - The underlying token mint address\n * @returns The vault token account PDA\n */\nexport async function getVaultTokenAccountPda(\n vault: ProgramDerivedAddress,\n underlyingMint: Address\n): Promise<ProgramDerivedAddress> {\n const addressEncoder = getAddressEncoder();\n return getProgramDerivedAddress({\n programAddress: HYRO_PROTOCOL_PROGRAM_ADDRESS,\n seeds: [\n new Uint8Array([\n 118, 97, 117, 108, 116, 95, 116, 111, 107, 101, 110, 95, 97, 99, 99,\n 111, 117, 110, 116,\n ]),\n addressEncoder.encode(vault[0]),\n addressEncoder.encode(underlyingMint),\n ],\n });\n}\n\n\nexport async function getPolicyAccountPda(vault: ProgramDerivedAddress, policyprogram: Address): Promise<Address> {\n const pda = await getPda(policyprogram, [vault[0]]);\n return pda[0];\n}","/**\n * High-level Vault class for easy vault operations\n */\n\nimport type {\n Address,\n ProgramDerivedAddress,\n TransactionSigner,\n ReadonlyUint8Array,\n AccountMeta,\n Instruction,\n} from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport Decimal from \"decimal.js\";\nimport { fetchVault, type Vault as VaultAccount } from '../accounts';\nimport { fetchTransaction, type Transaction } from '../accounts';\nimport { \n getInitializeVaultInstructionAsync, \n getInitializeLimitTransferInstructionAsync,\n getInitializeOwnersInstructionAsync,\n getInitializeMultisigInstructionAsync,\n} from '../instructions';\nimport { getCreateTxInstructionAsync } from '../instructions';\nimport { getExecuteTxInstructionAsync } from '../instructions';\nimport {\n getVaultPda as getVaultPdaUtil,\n getShareSignerPda,\n getShareMintPda,\n getVaultTokenAccountPda,\n getTransactionPda as getTransactionPdaUtil,\n getPolicyAccountPda,\n} from '../utils/pda';\nimport type { TransactionAccountArgs } from '../types';\nimport { Policy } from '../types';\nimport {\n DROPPER_PROGRAM_ADDRESS,\n POLICY_ALLOW_ANY_PROGRAM_ADDRESS,\n POLICY_DENY_ALL_PROGRAM_ADDRESS,\n POLICY_LIMIT_TRANSFER_PROGRAM_ADDRESS,\n POLICY_OWNERS_PROGRAM_ADDRESS,\n POLICY_MULTISIG_PROGRAM_ADDRESS,\n} from '../programs';\nexport class Vault {\n private _seed: string;\n private _signer: TransactionSigner;\n private _policy: Policy;\n private _vaultPda?: ProgramDerivedAddress;\n private _authorityPda?: ProgramDerivedAddress;\n private _policyProgram: Address;\n private _policyAccount?: Address;\n private _params?: any;\n\n /**\n * Create a new Vault instance\n * @param seed - The seed string for the vault\n * @param signer - The transaction signer\n * @param policy - The policy type to use for the vault\n */\n constructor(\n seed: string,\n signer: TransactionSigner,\n policy: Policy,\n params?: any,\n ) {\n this._seed = seed;\n this._signer = signer;\n this._policy = policy;\n this._policyProgram = this.getPolicyProgramAddress(policy);\n this._params = params;\n }\n\n private getPolicyProgramAddress(policy: Policy): Address {\n switch (policy) {\n case Policy.AllowAny:\n return POLICY_ALLOW_ANY_PROGRAM_ADDRESS;\n case Policy.DenyAll:\n return POLICY_DENY_ALL_PROGRAM_ADDRESS;\n case Policy.LimitTransfer:\n return POLICY_LIMIT_TRANSFER_PROGRAM_ADDRESS;\n case Policy.Owners:\n return POLICY_OWNERS_PROGRAM_ADDRESS;\n case Policy.Multisig:\n return POLICY_MULTISIG_PROGRAM_ADDRESS;\n }\n } \n\n /**\n * Initialize the vault (lazy loads PDAs)\n */\n private async initialize(): Promise<void> {\n if (!this._vaultPda || !this._authorityPda || !this._policyAccount) {\n [this._vaultPda, this._authorityPda] = await getVaultPdaUtil(\n this._seed\n );\n this._policyAccount = await this.getPolicyAccountAddress();\n }\n }\n\n /**\n * Get the vault PDA\n */\n async getVaultPda(): Promise<ProgramDerivedAddress> {\n await this.initialize();\n return this._vaultPda!;\n }\n\n /**\n * Get the authority PDA\n */\n async getAuthorityPda(): Promise<ProgramDerivedAddress> {\n await this.initialize();\n return this._authorityPda!;\n }\n\n /**\n * Get the vault address\n */\n async getAddress(): Promise<Address> {\n const pda = await this.getVaultPda();\n return pda[0];\n }\n\n /**\n * Get the authority address\n */\n async getAuthorityAddress(): Promise<Address> {\n const pda = await this.getAuthorityPda();\n return pda[0];\n }\n\n /**\n * Get share signer PDA\n */\n async getShareSignerPda(): Promise<ProgramDerivedAddress> {\n const vaultPda = await this.getVaultPda();\n return getShareSignerPda(vaultPda);\n }\n\n /**\n * Get share mint PDA\n */\n async getShareMintPda(): Promise<ProgramDerivedAddress> {\n const vaultPda = await this.getVaultPda();\n return getShareMintPda(vaultPda);\n }\n\n /**\n * Get vault token account PDA\n */\n async getVaultTokenAccountPda(underlyingMint: Address): Promise<ProgramDerivedAddress> {\n const vaultPda = await this.getVaultPda();\n return getVaultTokenAccountPda(vaultPda, underlyingMint);\n }\n\n /**\n * Get transaction PDA for a given nonce\n */\n async getTransactionPda(nonce: number | bigint): Promise<ProgramDerivedAddress> {\n const vaultPda = await this.getVaultPda();\n return getTransactionPdaUtil(vaultPda, nonce);\n }\n\n /**\n * Get policy account address\n */\n private async getPolicyAccountAddress(): Promise<Address> {\n switch (this._policy) {\n case Policy.AllowAny:\n return POLICY_ALLOW_ANY_PROGRAM_ADDRESS;\n case Policy.DenyAll:\n return POLICY_DENY_ALL_PROGRAM_ADDRESS;\n case Policy.LimitTransfer:\n return await getPolicyAccountPda(this._vaultPda!, POLICY_LIMIT_TRANSFER_PROGRAM_ADDRESS);\n case Policy.Owners:\n return await getPolicyAccountPda(this._vaultPda!, POLICY_OWNERS_PROGRAM_ADDRESS);\n case Policy.Multisig:\n return await getPolicyAccountPda(this._vaultPda!, POLICY_MULTISIG_PROGRAM_ADDRESS);\n default:\n return POLICY_ALLOW_ANY_PROGRAM_ADDRESS;\n }\n }\n\n /**\n * Build initialize vault instruction\n */\n async buildInitializeVaultInstruction(params: {\n underlyingMint: Address;\n vault?: Address;\n authority?: Address;\n shareSignerPda?: Address;\n shareMint?: Address;\n vaultTokenAccount?: Address;\n authorityTokenAccount?: Address;\n tokenProgram?: Address;\n systemProgram?: Address;\n rent?: Address;\n }): Promise<Instruction[]> {\n await this.initialize();\n const ixs: Instruction[] = [];\n const shareSignerPda = await this.getShareSignerPda();\n const shareMintPda = await this.getShareMintPda();\n const vaultTokenAccountPda = await this.getVaultTokenAccountPda(params.underlyingMint);\n\n if (this._policy === Policy.LimitTransfer) {\n ixs.push(await getInitializeLimitTransferInstructionAsync({\n signer: this._signer,\n vault: this._vaultPda![0],\n min: Decimal(this._params?.min)\n .mul(10 ** 9)\n .floor()\n .toNumber(),\n max: Decimal(this._params?.max)\n .mul(10 ** 9)\n .floor()\n .toNumber(),\n policyAccount: this._policyAccount!,\n }));\n }\n\n if (this._policy === Policy.Owners) {\n ixs.push(await getInitializeOwnersInstructionAsync({\n vault: this._vaultPda![0],\n owners: this._params?.owners,\n policyAccount: this._policyAccount!,\n signer: this._signer,\n }));\n }\n\n if (this._policy === Policy.Multisig) {\n ixs.push(await getInitializeMultisigInstructionAsync({\n vault: this._vaultPda![0],\n owners: this._params?.owners,\n threshold: this._params?.threshold,\n policyAccount: this._policyAccount!,\n signer: this._signer,\n }));\n }\n\n ixs.push(await getInitializeVaultInstructionAsync({\n seed: this._seed,\n policyProgram: this._policyProgram,\n underlyingMint: params.underlyingMint,\n signer: this._signer,\n vault: this._vaultPda![0],\n authority: this._authorityPda![0],\n shareSignerPda: shareSignerPda[0],\n shareMint: shareMintPda[0],\n vaultTokenAccount: vaultTokenAccountPda[0],\n }));\n return ixs;\n }\n\n /**\n * Create a transaction from an instruction (high-level method)\n * Automatically maps accounts and adds required program account\n */\n async createTx(\n instruction: Instruction,\n ): Promise<{ ix: Instruction; nonce: number; transferInstruction: Instruction }> {\n await this.initialize();\n \n // Generate a random nonce between 1 and 10000\n const nonce = Math.floor(Math.random() * 10000) + 1;\n\n const vaultPda = this._vaultPda!;\n const authorityPda = this._authorityPda!;\n const transactionPda = await this.getTransactionPda(nonce);\n\n // Map instruction accounts to TransactionAccountArgs format\n if (!instruction.accounts || !instruction.data) {\n throw new Error('Instruction must have accounts and data');\n }\n\n const accounts: TransactionAccountArgs[] = [\n ...instruction.accounts.map((account) => ({\n pubkey: account.address,\n // always false since it is meta tx\n isSigner: false,\n isWritable:\n account.role === AccountRole.WRITABLE ||\n account.role === AccountRole.WRITABLE_SIGNER,\n })),\n {\n pubkey: DROPPER_PROGRAM_ADDRESS,\n isSigner: false,\n isWritable: false,\n },\n ];\n\n const remainingAccounts: AccountMeta[] = [\n {\n address: transactionPda[0],\n role: AccountRole.READONLY,\n },\n {\n address: this._policyAccount!,\n role: AccountRole.READONLY,\n },\n {\n address: this._signer.address,\n role: AccountRole.READONLY,\n },\n {\n address: authorityPda[0],\n role: AccountRole.READONLY,\n },\n ];\n\n const createTxInstruction = await getCreateTxInstructionAsync({\n vault: vaultPda[0] as Address,\n nonce: nonce,\n pid: DROPPER_PROGRAM_ADDRESS,\n accs: accounts,\n data: instruction.data,\n policyAccount: (this._policyAccount || this._policyProgram) as Address,\n policyProgram: this._policyProgram as Address,\n signer: this._signer,\n transaction: transactionPda[0] as Address,\n vaultSigner: authorityPda[0] as Address,\n });\n\n (createTxInstruction.accounts as AccountMeta[]).push(...remainingAccounts);\n\n return {\n ix: createTxInstruction,\n nonce: typeof nonce === 'bigint' ? Number(nonce) : nonce,\n transferInstruction: instruction,\n };\n }\n\n /**\n * Execute a transaction (high-level method)\n * Automatically resolves all required accounts\n */\n async executeTx(createOp: { ix: Instruction; nonce: number; transferInstruction: Instruction }): Promise<{ ix: Instruction; nonce: number }> {\n await this.initialize();\n \n const vaultPda = this._vaultPda!;\n const authorityPda = this._authorityPda!;\n const transactionPda = await this.getTransactionPda(createOp.nonce);\n\n if (!createOp.transferInstruction.accounts) {\n throw new Error('Original instruction must have accounts');\n }\n\n const remainingAccounts: AccountMeta[] = [\n {\n address: transactionPda[0],\n role: AccountRole.READONLY,\n },\n {\n address: this._policyAccount!,\n role: AccountRole.READONLY,\n },\n {\n address: this._signer.address,\n role: AccountRole.READONLY,\n },\n {\n address: authorityPda[0],\n role: AccountRole.READONLY,\n },\n ...createOp.transferInstruction.accounts.map((account) => ({\n address: account.address,\n role: account.role === AccountRole.WRITABLE_SIGNER || account.role === AccountRole.READONLY_SIGNER\n ? AccountRole.READONLY // Remove signer flag for meta transaction\n : account.role,\n })),\n {\n address: DROPPER_PROGRAM_ADDRESS,\n role: AccountRole.READONLY,\n },\n ];\n\n const executeTxInstruction = await getExecuteTxInstructionAsync({\n vault: vaultPda[0] as Address,\n transaction: transactionPda[0] as Address,\n policyAccount: (this._policyAccount || this._policyProgram) as Address,\n policyProgram: this._policyProgram as Address,\n signer: this._signer,\n vaultSigner: authorityPda[0] as Address,\n });\n (executeTxInstruction.accounts as AccountMeta[]).push(...remainingAccounts);\n\n return {\n ix: executeTxInstruction,\n nonce: createOp.nonce,\n };\n }\n\n /**\n * Fetch vault account data\n */\n async fetch(rpc: Parameters<typeof fetchVault>[0]): Promise<{ address: Address; data: VaultAccount }> {\n const address = await this.getAddress();\n return fetchVault(rpc, address);\n }\n\n /**\n * Fetch transaction account data\n */\n async fetchTransaction(\n rpc: Parameters<typeof fetchTransaction>[0],\n nonce: number | bigint\n ): Promise<{ address: Address; data: Transaction }> {\n const transactionPda = await this.getTransactionPda(nonce);\n return fetchTransaction(rpc, transactionPda[0] as Address);\n }\n}\n\n"]}