@bancor/carbon-sdk
Advanced tools
Comparing version 0.0.95-DEV to 0.0.96-TEST
@@ -1,1 +0,1 @@ | ||
import{ONE as r,BigNumberMax as t}from"../../utils/numerics/index.js";import{decodeFloat as e}from"../../utils/encoders/index.js";import{BigNumber as n}from"../../node_modules/@ethersproject/bignumber/lib.esm/bignumber/index.js";const o=n.from(r),u=n.from(2).pow(128).sub(1),s=n.from(2).pow(256).sub(1);function i(r,t){if(r.gte(0)&&r.lte(t))return r;throw null}const m=r=>i(r,u),c=(r,t)=>i(r.add(t),s),d=(r,t)=>i(r.mul(t),s),f=(r,t,e)=>i(r.mul(t).div(e),s),l=(r,t,e)=>i(r.mul(t).add(e).sub(1).div(e),s),b=(r,e,n,u,m)=>{if(u.eq(0))return l(r,d(o,o),d(m,m));const b=d(n,o),p=c(d(e,u),d(n,m)),a=(h=p,j=d(r,u),i(h.sub(j),s));var h,j;const v=l(b,b,s),x=l(p,a,s),y=t(v,x),g=l(b,b,y),w=f(p,a,y);return l(r,g,w)},p=(r,u)=>{const i=r,b=u.y,p=u.z,a=e(u.A),h=e(u.B);try{return m(((r,e,n,u,i)=>{if(u.eq(0))return f(r,d(i,i),d(o,o));const m=d(n,o),b=c(d(e,u),d(n,i)),p=d(b,r),a=l(m,m,s),h=l(p,u,s),j=t(a,h),v=l(m,m,j),x=l(p,u,j);return f(b,p.div(j),c(v,x))})(i,b,p,a,h))}catch(r){return n.from(0)}},a=(r,t)=>{const n=r,o=t.y,s=t.z,i=e(t.A),c=e(t.B);try{return m(b(n,o,s,i,c))}catch(r){return u}};export{a as getEncodedTradeSourceAmount,p as getEncodedTradeTargetAmount}; | ||
import{ONE as r,BigNumberMax as t}from"../../utils/numerics/index.js";import{decodeFloat as e}from"../../utils/encoders/index.js";import{BigNumber as n}from"../../node_modules/@ethersproject/bignumber/lib.esm/bignumber/index.js";const o=n.from(r),u=n.from(2).pow(128).sub(1),s=n.from(2).pow(256).sub(1);function i(r,t){if(r.gte(0)&&r.lte(t))return r;throw null}const d=r=>i(r,u),m=(r,t)=>i(r.add(t),s),c=(r,t)=>i(r.mul(t),s),f=(r,t,e)=>i(r.mul(t).div(e),s),l=(r,t,e)=>i(r.mul(t).add(e).sub(1).div(e),s),b=(r,e,n,u,d)=>{if(u.eq(0))return l(r,c(o,o),c(d,d));const b=c(n,o),a=m(c(e,u),c(n,d)),p=(v=a,h=c(r,u),i(v.sub(h),s));var v,h;const j=l(b,b,s),x=l(a,p,s),y=t(j,x),g=l(b,b,y),w=f(a,p,y);return l(r,g,w)},a=(r,u)=>{const i=r,b=u.y,a=u.z,p=e(u.A),v=e(u.B);try{return d(((r,e,n,u,i)=>{if(u.eq(0))return f(r,c(i,i),c(o,o));const d=c(n,o),b=m(c(e,u),c(n,i)),a=c(b,r),p=l(d,d,s),v=l(a,u,s),h=t(p,v),j=l(d,d,h),x=l(a,u,h);return j.add(x).lte(s)?f(b,a.div(h),j.add(x)):b.div(m(u,l(d,d,a)))})(i,b,a,p,v))}catch(r){return n.from(0)}},p=(r,t)=>{const n=r,o=t.y,s=t.z,i=e(t.A),m=e(t.B);try{return d(b(n,o,s,i,m))}catch(r){return u}};export{p as getEncodedTradeSourceAmount,a as getEncodedTradeTargetAmount}; |
@@ -5,3 +5,3 @@ { | ||
"source": "src/index.ts", | ||
"version": "0.0.95-DEV", | ||
"version": "0.0.96-TEST", | ||
"description": "The SDK is a READ-ONLY tool, intended to facilitate working with Carbon contracts. It's a convenient wrapper around our matching algorithm, allowing programs and users get a ready to use transaction data that will allow them to manage strategies and fulfill trades", | ||
@@ -8,0 +8,0 @@ "main": "dist/index.cjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
918387