@raydium-io/raydium-sdk-v2
Version:
An SDK for building applications on top of Raydium.
2 lines • 1.48 kB
JavaScript
var u=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var c=(r,e)=>{for(var n in e)u(r,n,{get:e[n],enumerable:!0})},y=(r,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of l(e))!w.call(r,i)&&i!==n&&u(r,i,{get:()=>e[i],enumerable:!(t=s(e,i))||t.enumerable});return r};var B=r=>y(u({},"__esModule",{value:!0}),r);var v={};c(v,{i16ToBytes:()=>m,i32ToBytes:()=>p,isZero:()=>o,leadingZeros:()=>a,leastSignificantBit:()=>x,mostSignificantBit:()=>U,trailingZeros:()=>f,u16ToBytes:()=>b,u32ToBytes:()=>A});module.exports=B(v);function b(r){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,r,!1),new Uint8Array(e)}function m(r){let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,r,!1),new Uint8Array(e)}function A(r){let e=new ArrayBuffer(4);return new DataView(e).setUint32(0,r,!1),new Uint8Array(e)}function p(r){let e=new ArrayBuffer(4);return new DataView(e).setInt32(0,r,!1),new Uint8Array(e)}function a(r,e){let n=0;for(let t=r-1;t>=0&&!e.testn(t);t--)n++;return n}function f(r,e){let n=0;for(let t=0;t<r&&!e.testn(t);t++)n++;return n}function o(r,e){for(let n=0;n<r;n++)if(e.testn(n))return!1;return!0}function U(r,e){return o(r,e)?null:a(r,e)}function x(r,e){return o(r,e)?null:f(r,e)}0&&(module.exports={i16ToBytes,i32ToBytes,isZero,leadingZeros,leastSignificantBit,mostSignificantBit,trailingZeros,u16ToBytes,u32ToBytes});
//# sourceMappingURL=util.js.map