@chainrails/sdk 0.2.7 → 0.2.9
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.
- package/dist/chainrails-sdk.es.js +853 -531
- package/dist/chainrails-sdk.es.mjs +853 -531
- package/dist/chainrails-sdk.umd.js +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/src/Auth/index.d.ts.map +1 -1
- package/dist/src/Auth/types.d.ts +3 -3
- package/dist/src/Auth/types.d.ts.map +1 -1
- package/dist/src/Chains/index.d.ts +3 -2
- package/dist/src/Chains/index.d.ts.map +1 -1
- package/dist/src/Chains/types.d.ts +8 -0
- package/dist/src/Chains/types.d.ts.map +1 -1
- package/dist/src/Intents/types.d.ts +2 -0
- package/dist/src/Intents/types.d.ts.map +1 -1
- package/dist/src/Quotes/index.d.ts +2 -2
- package/dist/src/Quotes/index.d.ts.map +1 -1
- package/dist/src/Quotes/types.d.ts +37 -16
- package/dist/src/Quotes/types.d.ts.map +1 -1
- package/dist/src/Router/types.d.ts +7 -4
- package/dist/src/Router/types.d.ts.map +1 -1
- package/dist/src/types.d.ts +32 -20
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
`);super(o,s.cause?{cause:s.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=i,this.metaMessages=s.metaMessages,this.name=s.name??this.name,this.shortMessage=e,this.version=te}walk(e){return se(this,e)}}function se(t,e){return e?.(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?se(t.cause,e):e?null:t}class ne extends f{constructor({size:e,targetSize:s,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${s}).`,{name:"SizeExceedsPaddingSizeError"})}}function w(t,{dir:e,size:s=32}={}){return typeof t=="string"?Ee(t,{dir:e,size:s}):Se(t,{dir:e,size:s})}function Ee(t,{dir:e,size:s=32}={}){if(s===null)return t;const n=t.replace("0x","");if(n.length>s*2)throw new ne({size:Math.ceil(n.length/2),targetSize:s,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](s*2,"0")}`}function Se(t,{dir:e,size:s=32}={}){if(s===null)return t;if(t.length>s)throw new ne({size:t.length,targetSize:s,type:"bytes"});const n=new Uint8Array(s);for(let i=0;i<s;i++){const r=e==="right";n[r?i:s-i-1]=t[r?i:t.length-i-1]}return n}class Ae extends f{constructor({max:e,min:s,signed:n,size:i,value:r}){super(`Number "${r}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${s} to ${e})`:`(above ${s})`}`,{name:"IntegerOutOfRangeError"})}}class Ue extends f{constructor({givenSize:e,maxSize:s}){super(`Size cannot exceed ${s} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function T(t,{size:e}){if(ee(t)>e)throw new Ue({givenSize:ee(t),maxSize:e})}function ve(t,e={}){const{signed:s,size:n}=e,i=BigInt(t);let r;n?s?r=(1n<<BigInt(n)*8n-1n)-1n:r=2n**(BigInt(n)*8n)-1n:typeof t=="number"&&(r=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof r=="bigint"&&s?-r-1n:0;if(r&&i>r||i<o){const d=typeof t=="bigint"?"n":"";throw new Ae({max:r?`${r}${d}`:void 0,min:`${o}${d}`,signed:s,size:n,value:`${t}${d}`})}const a=`0x${(s&&i<0?(1n<<BigInt(n*8))+BigInt(i):i).toString(16)}`;return n?w(a,{size:n}):a}const Ce=new TextEncoder;function Te(t,e={}){return typeof t=="number"||typeof t=="bigint"?De(t,e):typeof t=="boolean"?Ne(t,e):v(t)?oe(t,e):re(t,e)}function Ne(t,e={}){const s=new Uint8Array(1);return s[0]=Number(t),typeof e.size=="number"?(T(s,{size:e.size}),w(s,{size:e.size})):s}const p={zero:48,nine:57,A:65,F:70,a:97,f:102};function ie(t){if(t>=p.zero&&t<=p.nine)return t-p.zero;if(t>=p.A&&t<=p.F)return t-(p.A-10);if(t>=p.a&&t<=p.f)return t-(p.a-10)}function oe(t,e={}){let s=t;e.size&&(T(s,{size:e.size}),s=w(s,{dir:"right",size:e.size}));let n=s.slice(2);n.length%2&&(n=`0${n}`);const i=n.length/2,r=new Uint8Array(i);for(let o=0,a=0;o<i;o++){const d=ie(n.charCodeAt(a++)),m=ie(n.charCodeAt(a++));if(d===void 0||m===void 0)throw new f(`Invalid byte sequence ("${n[a-2]}${n[a-1]}" in "${n}").`);r[o]=d*16+m}return r}function De(t,e){const s=ve(t,e);return oe(s)}function re(t,e={}){const s=Ce.encode(t);return typeof e.size=="number"?(T(s,{size:e.size}),w(s,{dir:"right",size:e.size})):s}const E=BigInt(2**32-1),ae=BigInt(32);function xe(t,e=!1){return e?{h:Number(t&E),l:Number(t>>ae&E)}:{h:Number(t>>ae&E)|0,l:Number(t&E)|0}}function ke(t,e=!1){const s=t.length;let n=new Uint32Array(s),i=new Uint32Array(s);for(let r=0;r<s;r++){const{h:o,l:a}=xe(t[r],e);[n[r],i[r]]=[o,a]}return[n,i]}const Re=(t,e,s)=>t<<s|e>>>32-s,Be=(t,e,s)=>e<<s|t>>>32-s,ze=(t,e,s)=>e<<s-32|t>>>64-s,$e=(t,e,s)=>t<<s-32|e>>>64-s;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Me(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function ce(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function S(t,...e){if(!Me(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function ue(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function je(t,e){S(t);const s=e.outputLen;if(t.length<s)throw new Error("digestInto() expects output buffer of length at least "+s)}function Oe(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function le(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}const Pe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Fe(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function Le(t){for(let e=0;e<t.length;e++)t[e]=Fe(t[e]);return t}const he=Pe?t=>t:Le;function _e(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function de(t){return typeof t=="string"&&(t=_e(t)),S(t),t}class He{}function Ke(t){const e=n=>t().update(de(n)).digest(),s=t();return e.outputLen=s.outputLen,e.blockLen=s.blockLen,e.create=()=>t(),e}const qe=BigInt(0),b=BigInt(1),Ve=BigInt(2),Xe=BigInt(7),Ge=BigInt(256),Qe=BigInt(113),pe=[],ge=[],fe=[];for(let t=0,e=b,s=1,n=0;t<24;t++){[s,n]=[n,(2*s+3*n)%5],pe.push(2*(5*n+s)),ge.push((t+1)*(t+2)/2%64);let i=qe;for(let r=0;r<7;r++)e=(e<<b^(e>>Xe)*Qe)%Ge,e&Ve&&(i^=b<<(b<<BigInt(r))-b);fe.push(i)}const me=ke(fe,!0),We=me[0],Je=me[1],ye=(t,e,s)=>s>32?ze(t,e,s):Re(t,e,s),Ie=(t,e,s)=>s>32?$e(t,e,s):Be(t,e,s);function Ye(t,e=24){const s=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)s[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,d=(o+2)%10,m=s[d],y=s[d+1],It=ye(m,y,1)^s[a],bt=Ie(m,y,1)^s[a+1];for(let U=0;U<50;U+=10)t[o+U]^=It,t[o+U+1]^=bt}let i=t[2],r=t[3];for(let o=0;o<24;o++){const a=ge[o],d=ye(i,r,a),m=Ie(i,r,a),y=pe[o];i=t[y],r=t[y+1],t[y]=d,t[y+1]=m}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)s[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~s[(a+2)%10]&s[(a+4)%10]}t[0]^=We[n],t[1]^=Je[n]}le(s)}class N extends He{constructor(e,s,n,i=!1,r=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=s,this.outputLen=n,this.enableXOF=i,this.rounds=r,ce(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Oe(this.state)}clone(){return this._cloneInto()}keccak(){he(this.state32),Ye(this.state32,this.rounds),he(this.state32),this.posOut=0,this.pos=0}update(e){ue(this),e=de(e),S(e);const{blockLen:s,state:n}=this,i=e.length;for(let r=0;r<i;){const o=Math.min(s-this.pos,i-r);for(let a=0;a<o;a++)n[this.pos++]^=e[r++];this.pos===s&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:s,pos:n,blockLen:i}=this;e[n]^=s,(s&128)!==0&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){ue(this,!1),S(e),this.finish();const s=this.state,{blockLen:n}=this;for(let i=0,r=e.length;i<r;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,r-i);e.set(s.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ce(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(je(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,le(this.state)}_cloneInto(e){const{blockLen:s,suffix:n,outputLen:i,rounds:r,enableXOF:o}=this;return e||(e=new N(s,n,i,o,r)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=r,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const Ze=(t,e,s)=>Ke(()=>new N(e,t,s)),et=Ze(1,136,256/8);function tt(t,e){return et(v(t,{strict:!1})?Te(t):t)}class st extends f{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class be extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const s=super.get(e);return super.has(e)&&s!==void 0&&(this.delete(e),super.set(e,s)),s}set(e,s){if(super.set(e,s),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}const D=new be(8192);function we(t,e){if(D.has(`${t}.${e}`))return D.get(`${t}.${e}`);const s=t.substring(2).toLowerCase(),n=tt(re(s)),i=s.split("");for(let o=0;o<40;o+=2)n[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(n[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());const r=`0x${i.join("")}`;return D.set(`${t}.${e}`,r),r}function g(t,e){if(!it(t,{strict:!1}))throw new st({address:t});return we(t,e)}const nt=/^0x[a-fA-F0-9]{40}$/,x=new be(8192);function it(t,e){const{strict:s=!0}=e??{},n=`${t}.${s}`;if(x.has(n))return x.get(n);const i=nt.test(t)?t.toLowerCase()===t?!0:s?we(t)===t:!0:!1;return x.set(n,i),i}const k={chainId:q.chainId,address:g("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),symbol:"USDC",fiatISO:"USD",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},R={chainId:K.chainId,address:g("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),symbol:"USDC",name:"USD Coin",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png"},B={chainId:Y.chainId,address:g("0x5425890298aed601595a70ab815c96711a31bc65"),symbol:"USDC",fiatISO:"USD",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},z={chainId:J.chainId,address:g("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),symbol:"USDC",fiatISO:"USD",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},$={chainId:X.chainId,address:g("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),symbol:"USDC",fiatISO:"USD",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},M={chainId:V.chainId,address:g("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),symbol:"USDC",fiatISO:"USD",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},j={chainId:G.chainId,address:g("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),symbol:"USDC",decimals:18,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},O={chainId:W.chainId,address:g("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),symbol:"USDC",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},P={chainId:Q.chainId,address:g("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),symbol:"USDC",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},ot={chainId:Z.chainId,address:"0x053C91253BC9682c04929cA02ED00b3E423f6710D2ee7e0D5EBB06F3eCF368A8",symbol:"USDC",decimals:6,logoURI:"https://pay.daimo.com/coin-logos/usdc.png",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},rt={[k.chainId]:k,[R.chainId]:R,[B.chainId]:B,[z.chainId]:z,[$.chainId]:$,[M.chainId]:M,[O.chainId]:O,[P.chainId]:P,[j.chainId]:j},F={ARBITRUM_MAINNET:{...K,tokens:{[h.USDC]:R},explorer:"https://arbiscan.io"},ARBITRUM_TESTNET:{...q,explorer:"https://sepolia.arbiscan.io",tokens:{[h.USDC]:k}},AVALANCHE_MAINNET:{...J,tokens:{[h.USDC]:z},explorer:"https://snowtrace.io"},AVALANCHE_TESTNET:{...Y,tokens:{[h.USDC]:B},explorer:"https://testnet.snowtrace.io"},BASE_MAINNET:{...V,tokens:{[h.USDC]:M},explorer:"https://basescan.org"},BASE_TESTNET:{...X,tokens:{[h.USDC]:$},explorer:"https://sepolia.basescan.org"},BSC_MAINNET:{...G,tokens:{[h.USDC]:j},explorer:"https://bscscan.com"},ETHEREUM_MAINNET:{...Q,tokens:{[h.USDC]:P},explorer:"https://etherscan.io"},ETHEREUM_TESTNET:{...W,tokens:{[h.USDC]:O},explorer:"https://sepolia.etherscan.io"},STARKNET_MAINNET:{...Z,tokens:{[h.USDC]:ot},explorer:""}};var A=(t=>(t.ARBITRUM="ARBITRUM_MAINNET",t.ARBITRUM_TESTNET="ARBITRUM_TESTNET",t.AVALANCHE="AVALANCHE_MAINNET",t.AVALANCHE_TESTNET="AVALANCHE_TESTNET",t.BASE="BASE_MAINNET",t.BASE_TESTNET="BASE_TESTNET",t.BSC="BSC_MAINNET",t.ETHEREUM="ETHEREUM_MAINNET",t.ETHEREUM_TESTNET="ETHEREUM_TESTNET",t.STARKNET="STARKNET_MAINNET",t))(A||{}),L=(t=>(t.USDC="USDC",t))(L||{});function at(t){return rt[F[t||""].chainId]?.decimals||6}const ct=t=>{const e=t?.trim().toUpperCase();if(F[e])return F[e]};function ut(t,e){return ct(t)?.tokens[e]?.address}var _=(t=>(t.PRODUCTION="production",t.STAGING="staging",t))(_||{});class c{constructor({api_key:e,env:s,seesion_token:n,props:i}){this.api_key=e||"",this.sessionToken=n||"",this.env=s??_.PRODUCTION,this.props=i}static async config(e){if(!c.app){if(!e)throw new Error("Please provide an api_key");c.app=new c(e)}return e&&(e.api_key!==void 0&&(c.app.api_key=e.api_key),e.seesion_token!==void 0&&(c.app.sessionToken=e.seesion_token),e.env!==void 0&&(c.app.env=e.env),e.props!==void 0&&(c.app.props=e.props)),c.app}static getApiKey(){if(!c.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return c.app.api_key}static getSessionToken(){if(!c.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return c.app.sessionToken}static getProps(){if(!c.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return c.app.props}static getEnv(){if(!c.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return c.app.env==="internal"?"staging":c.app.env}static getBaseUrl(){if(!c.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");switch(c.app.env){case"production":return"https://api.chainrails.io/api/v1";case"staging":return"https://dev.chainrails.io/api/v1";case"internal":return"https://dev.chainrails.io/api/v1";default:return"https://api.chainrails.io/api/v1"}}static getPayModalUrl(e){if(!c.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");const s=c.app.env==="internal"?"https://chainrails-frontend-git-staging-horus-labs.vercel.app":"https://app.chainrails.io",n=Number(e),i=e&&!isNaN(Number(e))&&n>0?"/pay/":"/deposit/",r=`${e&&!isNaN(Number(e))&&n>0?n*100:""}`;return s+i+r}}let H=null;function lt(){H=I.create({prefixUrl:c.getBaseUrl(),headers:{"Content-Type":"application/json"},hooks:{beforeRequest:[t=>{const e=c.getSessionToken()||c.getApiKey();t.headers.set("Authorization",`Bearer ${e}`)}],afterResponse:[(t,e,s)=>s]},retry:{limit:2}})}function u(){return H||lt(),H}class ht{async getById(e){return await u().get("intents/"+e).json()}async getForSender(e){return await u().get("intents/user/"+e).json()}async getForAddress(e){return await u().get("intents/address/"+e).json()}async getForSession(e){return await u().get("modal/sessions/intents/"+e).json()}async getAll(e){return await u().get("intents",{searchParams:e}).json()}async create(e){return await u().post("intents",{json:e}).json()}async createForSession(e){return await u().post("modal/sessions/intents",{json:e}).json()}async update(e,s){return await u().post("intents",{json:s}).json()}async triggerProcessing(e){return await u().post(`intents/${e}/trigger-processing`).json()}async triggerProcessingForSession(e){return await u().post(`modal/sessions/intents/${e}/process`).json()}}class dt{async getFromSpecificBridge(e){return await u().get("quotes/single",{searchParams:e}).json()}async getFromAllBridges(e){return await u().get("quotes/multiple",{searchParams:e}).json()}async getBestAcrossBridges(e){return await u().get("quotes/best",{searchParams:e}).json()}async getAll(e){return await u().get("quotes/multi-source",{searchParams:e}).json()}async getAllForSession(e){return await u().get("modal/sessions/quotes",{searchParams:e}).json()}}class pt{async getOptimalRoutes(e){return await u().get("router/optimal-route",{searchParams:e}).json()}async getAllSupportedBridges(){return await u().get("router/supported-bridges/all").json()}async getSupportedBridges(e){return await u().get("router/supported-bridges/route",{searchParams:e}).json()}async getSupportedRoutes(e,s){return await u().get("router/supported-bridges/bridge/"+e,{searchParams:s}).json()}}class gt{async getSupported(e){return await u().get("chains",{searchParams:e}).json()}}class ft{async getClientInfo(){return await u().get("client/auth/client-info").json()}async getClientInfoForSession(){return await u().get("modal/sessions/client").json()}}class mt{getSessionToken(e){const s={recipient:e.recipient,tokenOut:ut(A[e.destinationChain?.replace("_MAINNET","")],L[e.token]),destinationChain:A[e.destinationChain?.replace("_MAINNET","")],amount:e.amount};return u().post("modal/sessions",{json:s}).json().then(n=>({...n,amount:s.amount}))}}const yt={router:new pt,quotes:new dt,intents:new ht,chains:new gt,client:new ft,auth:new mt};l.Chainrails=c,l.chains=A,l.crapi=yt,l.environment=_,l.getTokenDecimals=at,l.tokens=L,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(m,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("ky")):typeof define=="function"&&define.amd?define(["exports","ky"],b):(m=typeof globalThis<"u"?globalThis:m||self,b(m.Chainrails={},m.Ky))})(this,(function(m,b){"use strict";const c={ARBITRUM:"ARBITRUM_MAINNET",ARBITRUM_TESTNET:"ARBITRUM_TESTNET",AVALANCHE:"AVALANCHE_MAINNET",AVALANCHE_TESTNET:"AVALANCHE_TESTNET",BASE:"BASE_MAINNET",BASE_TESTNET:"BASE_TESTNET",BSC:"BSC_MAINNET",ETHEREUM:"ETHEREUM_MAINNET",ETHEREUM_TESTNET:"ETHEREUM_TESTNET",HYPEREVM:"HYPEREVM_MAINNET",LISK:"LISK_MAINNET",MONAD:"MONAD_MAINNET",MONAD_TESTNET:"MONAD_TESTNET",OPTIMISM:"OPTIMISM_MAINNET",OPTIMISM_TESTNET:"OPTIMISM_TESTNET",POLYGON:"POLYGON_MAINNET",STARKNET:"STARKNET_MAINNET",STARKNET_TESTNET:"STARKNET_TESTNET"};function y(s,{strict:e=!0}={}){return!s||typeof s!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(s):s.startsWith("0x")}function O(s){return y(s,{strict:!1})?Math.ceil((s.length-2)/2):s.length}const F="2.43.4";let N={getDocsUrl:({docsBaseUrl:s,docsPath:e="",docsSlug:t})=>e?`${s??"https://viem.sh"}${e}${t?`#${t}`:""}`:void 0,version:`viem@${F}`};class T extends Error{constructor(e,t={}){const o=t.cause instanceof T?t.cause.details:t.cause?.message?t.cause.message:t.details,a=t.cause instanceof T&&t.cause.docsPath||t.docsPath,r=N.getDocsUrl?.({...t,docsPath:a}),i=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...r?[`Docs: ${r}`]:[],...o?[`Details: ${o}`]:[],...N.version?[`Version: ${N.version}`]:[]].join(`
|
|
2
|
+
`);super(i,t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=o,this.docsPath=a,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=F}walk(e){return H(this,e)}}function H(s,e){return e?.(s)?s:s&&typeof s=="object"&&"cause"in s&&s.cause!==void 0?H(s.cause,e):e?null:s}class P extends T{constructor({size:e,targetSize:t,type:o}){super(`${o.charAt(0).toUpperCase()}${o.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}function U(s,{dir:e,size:t=32}={}){return typeof s=="string"?te(s,{dir:e,size:t}):ne(s,{dir:e,size:t})}function te(s,{dir:e,size:t=32}={}){if(t===null)return s;const o=s.replace("0x","");if(o.length>t*2)throw new P({size:Math.ceil(o.length/2),targetSize:t,type:"hex"});return`0x${o[e==="right"?"padEnd":"padStart"](t*2,"0")}`}function ne(s,{dir:e,size:t=32}={}){if(t===null)return s;if(s.length>t)throw new P({size:s.length,targetSize:t,type:"bytes"});const o=new Uint8Array(t);for(let a=0;a<t;a++){const r=e==="right";o[r?a:t-a-1]=s[r?a:s.length-a-1]}return o}class oe extends T{constructor({max:e,min:t,signed:o,size:a,value:r}){super(`Number "${r}" is not in safe ${a?`${a*8}-bit ${o?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class ae extends T{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function R(s,{size:e}){if(O(s)>e)throw new ae({givenSize:O(s),maxSize:e})}function ie(s,e={}){const{signed:t,size:o}=e,a=BigInt(s);let r;o?t?r=(1n<<BigInt(o)*8n-1n)-1n:r=2n**(BigInt(o)*8n)-1n:typeof s=="number"&&(r=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof r=="bigint"&&t?-r-1n:0;if(r&&a>r||a<i){const h=typeof s=="bigint"?"n":"";throw new oe({max:r?`${r}${h}`:void 0,min:`${i}${h}`,signed:t,size:o,value:`${s}${h}`})}const l=`0x${(t&&a<0?(1n<<BigInt(o*8))+BigInt(a):a).toString(16)}`;return o?U(l,{size:o}):l}const re=new TextEncoder;function ce(s,e={}){return typeof s=="number"||typeof s=="bigint"?le(s,e):typeof s=="boolean"?de(s,e):y(s)?$(s,e):z(s,e)}function de(s,e={}){const t=new Uint8Array(1);return t[0]=Number(s),typeof e.size=="number"?(R(t,{size:e.size}),U(t,{size:e.size})):t}const f={zero:48,nine:57,A:65,F:70,a:97,f:102};function _(s){if(s>=f.zero&&s<=f.nine)return s-f.zero;if(s>=f.A&&s<=f.F)return s-(f.A-10);if(s>=f.a&&s<=f.f)return s-(f.a-10)}function $(s,e={}){let t=s;e.size&&(R(t,{size:e.size}),t=U(t,{dir:"right",size:e.size}));let o=t.slice(2);o.length%2&&(o=`0${o}`);const a=o.length/2,r=new Uint8Array(a);for(let i=0,l=0;i<a;i++){const h=_(o.charCodeAt(l++)),S=_(o.charCodeAt(l++));if(h===void 0||S===void 0)throw new T(`Invalid byte sequence ("${o[l-2]}${o[l-1]}" in "${o}").`);r[i]=h*16+S}return r}function le(s,e){const t=ie(s,e);return $(t)}function z(s,e={}){const t=re.encode(s);return typeof e.size=="number"?(R(t,{size:e.size}),U(t,{dir:"right",size:e.size})):t}const D=BigInt(2**32-1),L=BigInt(32);function ue(s,e=!1){return e?{h:Number(s&D),l:Number(s>>L&D)}:{h:Number(s>>L&D)|0,l:Number(s&D)|0}}function ge(s,e=!1){const t=s.length;let o=new Uint32Array(t),a=new Uint32Array(t);for(let r=0;r<t;r++){const{h:i,l}=ue(s[r],e);[o[r],a[r]]=[i,l]}return[o,a]}const Ee=(s,e,t)=>s<<t|e>>>32-t,me=(s,e,t)=>e<<t|s>>>32-t,he=(s,e,t)=>e<<t-32|s>>>64-t,fe=(s,e,t)=>s<<t-32|e>>>64-t;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Te(s){return s instanceof Uint8Array||ArrayBuffer.isView(s)&&s.constructor.name==="Uint8Array"}function j(s){if(!Number.isSafeInteger(s)||s<0)throw new Error("positive integer expected, got "+s)}function C(s,...e){if(!Te(s))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(s.length))throw new Error("Uint8Array expected of length "+e+", got length="+s.length)}function K(s,e=!0){if(s.destroyed)throw new Error("Hash instance has been destroyed");if(e&&s.finished)throw new Error("Hash#digest() has already been called")}function Se(s,e){C(s);const t=e.outputLen;if(s.length<t)throw new Error("digestInto() expects output buffer of length at least "+t)}function pe(s){return new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4))}function W(...s){for(let e=0;e<s.length;e++)s[e].fill(0)}const be=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Ae(s){return s<<24&4278190080|s<<8&16711680|s>>>8&65280|s>>>24&255}function Ue(s){for(let e=0;e<s.length;e++)s[e]=Ae(s[e]);return s}const V=be?s=>s:Ue;function De(s){if(typeof s!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(s))}function Y(s){return typeof s=="string"&&(s=De(s)),C(s),s}class Ce{}function Ie(s){const e=o=>s().update(Y(o)).digest(),t=s();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>s(),e}const ye=BigInt(0),A=BigInt(1),Ne=BigInt(2),Re=BigInt(7),Be=BigInt(256),we=BigInt(113),q=[],G=[],X=[];for(let s=0,e=A,t=1,o=0;s<24;s++){[t,o]=[o,(2*t+3*o)%5],q.push(2*(5*o+t)),G.push((s+1)*(s+2)/2%64);let a=ye;for(let r=0;r<7;r++)e=(e<<A^(e>>Re)*we)%Be,e&Ne&&(a^=A<<(A<<BigInt(r))-A);X.push(a)}const Q=ge(X,!0),ke=Q[0],Me=Q[1],J=(s,e,t)=>t>32?he(s,e,t):Ee(s,e,t),Z=(s,e,t)=>t>32?fe(s,e,t):me(s,e,t);function ve(s,e=24){const t=new Uint32Array(10);for(let o=24-e;o<24;o++){for(let i=0;i<10;i++)t[i]=s[i]^s[i+10]^s[i+20]^s[i+30]^s[i+40];for(let i=0;i<10;i+=2){const l=(i+8)%10,h=(i+2)%10,S=t[h],p=t[h+1],Ze=J(S,p,1)^t[l],es=Z(S,p,1)^t[l+1];for(let I=0;I<50;I+=10)s[i+I]^=Ze,s[i+I+1]^=es}let a=s[2],r=s[3];for(let i=0;i<24;i++){const l=G[i],h=J(a,r,l),S=Z(a,r,l),p=q[i];a=s[p],r=s[p+1],s[p]=h,s[p+1]=S}for(let i=0;i<50;i+=10){for(let l=0;l<10;l++)t[l]=s[i+l];for(let l=0;l<10;l++)s[i+l]^=~t[(l+2)%10]&t[(l+4)%10]}s[0]^=ke[o],s[1]^=Me[o]}W(t)}class B extends Ce{constructor(e,t,o,a=!1,r=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=o,this.enableXOF=a,this.rounds=r,j(o),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=pe(this.state)}clone(){return this._cloneInto()}keccak(){V(this.state32),ve(this.state32,this.rounds),V(this.state32),this.posOut=0,this.pos=0}update(e){K(this),e=Y(e),C(e);const{blockLen:t,state:o}=this,a=e.length;for(let r=0;r<a;){const i=Math.min(t-this.pos,a-r);for(let l=0;l<i;l++)o[this.pos++]^=e[r++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:o,blockLen:a}=this;e[o]^=t,(t&128)!==0&&o===a-1&&this.keccak(),e[a-1]^=128,this.keccak()}writeInto(e){K(this,!1),C(e),this.finish();const t=this.state,{blockLen:o}=this;for(let a=0,r=e.length;a<r;){this.posOut>=o&&this.keccak();const i=Math.min(o-this.posOut,r-a);e.set(t.subarray(this.posOut,this.posOut+i),a),this.posOut+=i,a+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return j(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Se(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,W(this.state)}_cloneInto(e){const{blockLen:t,suffix:o,outputLen:a,rounds:r,enableXOF:i}=this;return e||(e=new B(t,o,a,i,r)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=r,e.suffix=o,e.outputLen=a,e.enableXOF=i,e.destroyed=this.destroyed,e}}const xe=(s,e,t)=>Ie(()=>new B(e,s,t)),Oe=xe(1,136,256/8);function Fe(s,e){return Oe(y(s,{strict:!1})?ce(s):s)}class He extends T{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class ee extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&t!==void 0&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const o=this.keys().next().value;o&&this.delete(o)}return this}}const w=new ee(8192);function se(s,e){if(w.has(`${s}.${e}`))return w.get(`${s}.${e}`);const t=s.substring(2).toLowerCase(),o=Fe(z(t)),a=t.split("");for(let i=0;i<40;i+=2)o[i>>1]>>4>=8&&a[i]&&(a[i]=a[i].toUpperCase()),(o[i>>1]&15)>=8&&a[i+1]&&(a[i+1]=a[i+1].toUpperCase());const r=`0x${a.join("")}`;return w.set(`${s}.${e}`,r),r}function E(s,e){if(!_e(s,{strict:!1}))throw new He({address:s});return se(s,e)}const Pe=/^0x[a-fA-F0-9]{40}$/,k=new ee(8192);function _e(s,e){const{strict:t=!0}=e??{},o=`${s}.${t}`;if(k.has(o))return k.get(o);const a=Pe.test(s)?s.toLowerCase()===s?!0:t?se(s)===s:!0:!1;return k.set(o,a),a}const n={USDC:"USDC",USDT:"USDT",DAI:"DAI",BUSD:"BUSD",EURC:"EURC",ETH:"ETH",WETH:"WETH",STRK:"STRK",BNB:"BNB",LORDS:"LORDS"};n.USDC;const d={[c.ARBITRUM]:{[n.DAI]:{address:E("0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1"),symbol:n.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[n.ETH]:{address:"0x0000000000000000000000000000000000000000",symbol:n.ETH,name:"Ethereum",decimals:18,logoURI:"/images/chains/ethereum.svg"},[n.USDC]:{address:E("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),symbol:n.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"},[n.USDT]:{address:E("0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"),symbol:n.USDT,name:"Tether USD",decimals:6,logoURI:"/images/tokens/usdt.png"},[n.WETH]:{address:E("0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"),symbol:n.WETH,name:"Wrapped Ether",decimals:18,logoURI:"/images/tokens/weth.png"}},[c.ARBITRUM_TESTNET]:{[n.USDC]:{address:E("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),symbol:n.USDC,name:"USD Coin",fiatISO:"USD",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"}},[c.AVALANCHE]:{[n.DAI]:{address:"0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",symbol:n.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[n.USDC]:{address:E("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),symbol:n.USDC,name:"USD Coin",fiatISO:"USD",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},[n.USDT]:{address:"0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",symbol:n.USDT,name:"Tether USD",decimals:6,logoURI:"/images/tokens/usdt.png"},[n.WETH]:{address:"0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB",symbol:n.WETH,name:"Wrapped Ether",decimals:18,logoURI:"/images/tokens/weth.png"}},[c.AVALANCHE_TESTNET]:{[n.USDC]:{address:E("0x5425890298aed601595a70AB815c96711a31Bc65"),symbol:n.USDC,name:"USD Coin",fiatISO:"USD",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"}},[c.BASE]:{[n.DAI]:{address:"0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",symbol:n.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[n.ETH]:{address:"0x0000000000000000000000000000000000000000",symbol:n.ETH,name:"Ethereum",decimals:18,logoURI:"/images/chains/ethereum.svg"},[n.EURC]:{address:"0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42",symbol:n.EURC,name:"Euro Coin",decimals:6,logoURI:"/images/tokens/eurc.png"},[n.USDC]:{address:E("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),symbol:n.USDC,name:"USD Coin",fiatISO:"USD",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},[n.WETH]:{address:E("0x4200000000000000000000000000000000000006"),symbol:n.WETH,name:"Wrapped Ether",decimals:18,logoURI:"/images/tokens/weth.png"}},[c.BASE_TESTNET]:{[n.USDC]:{address:E("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),symbol:n.USDC,name:"USD Coin",fiatISO:"USD",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"}},[c.BSC]:{[n.BNB]:{address:"0x0000000000000000000000000000000000000000",symbol:n.BNB,name:"BNB",decimals:18,logoURI:"/images/chains/bsc.webp"},[n.BUSD]:{address:"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",symbol:n.BUSD,name:"Binance USD",decimals:18,logoURI:"/images/tokens/busd.png"},[n.DAI]:{address:"0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3",symbol:n.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[n.ETH]:{address:"0x2170Ed0880ac9A755fd29B2688956BD959F933F8",symbol:n.ETH,name:"Ethereum",decimals:18,logoURI:"/images/chains/ethereum.svg"},[n.USDC]:{address:E("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),symbol:n.USDC,decimals:18,name:"USD Coin",logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},[n.USDT]:{address:"0x55d398326f99059fF775485246999027B3197955",symbol:n.USDT,name:"Tether USD",decimals:18,logoURI:"/images/tokens/usdt.png"}},[c.ETHEREUM]:{[n.BUSD]:{address:"0x4Fabb145d64652a948d72533023f6E7A623C7C53",symbol:n.BUSD,name:"Binance USD",decimals:18,logoURI:"/images/tokens/busd.png"},[n.DAI]:{address:E("0x6B175474E89094C44Da98b954EedeAC495271d0F"),symbol:n.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[n.ETH]:{address:"0x0000000000000000000000000000000000000000",symbol:n.ETH,name:"Ethereum",decimals:18,logoURI:"/images/chains/ethereum.svg"},[n.EURC]:{address:"0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",symbol:n.EURC,name:"Euro Coin",decimals:6,logoURI:"/images/tokens/eurc.png"},[n.STRK]:{address:"0xCa14007Eff0dB1f8135f4C25B34De49AB0d42766",symbol:n.STRK,name:"Starknet Token",decimals:18,logoURI:"/images/chains/starknet.svg"},[n.USDC]:{address:E("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),symbol:n.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},[n.USDT]:{address:E("0xdAC17F958D2ee523a2206206994597C13D831ec7"),symbol:n.USDT,name:"Tether USD",decimals:6,logoURI:"/images/tokens/usdt.png"},[n.WETH]:{address:E("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"),symbol:n.WETH,name:"Wrapped Ether",decimals:18,logoURI:"/images/tokens/weth.png"}},[c.ETHEREUM_TESTNET]:{[n.USDC]:{address:E("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),symbol:n.USDC,decimals:6,name:"USD Coin",logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"}},[c.HYPEREVM]:{[n.USDC]:{address:"0xb88339CB7199b77E23DB6E890353E22632Ba630f",symbol:n.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"}},[c.LISK]:{[n.USDC]:{address:"0xF242275d3a6527d877f2c927a82D9b057609cc71",symbol:n.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"}},[c.MONAD]:{[n.USDC]:{address:"0x754704Bc059F8C67012fEd69BC8A327a5aafb603",symbol:n.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"}},[c.MONAD_TESTNET]:{[n.USDC]:{address:"0x534b2f3A21130d7a60830c2Df862319e593943A3",symbol:n.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"}},[c.OPTIMISM]:{[n.DAI]:{address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",symbol:n.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[n.ETH]:{address:"0x0000000000000000000000000000000000000000",symbol:n.ETH,name:"Ethereum",decimals:18,logoURI:"/images/chains/ethereum.svg"},[n.USDC]:{address:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",symbol:n.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"},[n.USDT]:{address:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",symbol:n.USDT,name:"Tether USD",decimals:6,logoURI:"/images/tokens/usdt.png"},[n.WETH]:{address:"0x4200000000000000000000000000000000000006",symbol:n.WETH,name:"Wrapped Ether",decimals:18,logoURI:"/images/tokens/weth.png"}},[c.OPTIMISM_TESTNET]:{[n.USDC]:{address:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",symbol:n.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"}},[c.POLYGON]:{[n.DAI]:{address:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",symbol:n.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[n.USDC]:{address:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",symbol:n.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"},[n.USDT]:{address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",symbol:n.USDT,name:"Tether USD",decimals:6,logoURI:"/images/tokens/usdt.png"},[n.WETH]:{address:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",symbol:n.WETH,name:"Wrapped Ether",decimals:18,logoURI:"/images/tokens/weth.png"}},[c.STARKNET]:{[n.DAI]:{address:"0x05574eb6b8789a91466f902c380d978e472db68170ff82a5b650b95a58ddf4ad",symbol:n.DAI,name:"Dai Stablecoin",decimals:18,logoURI:"/images/tokens/dai.png"},[n.ETH]:{address:"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",symbol:n.ETH,name:"Ethereum",decimals:18,logoURI:"/images/chains/ethereum.svg"},[n.LORDS]:{address:"0x0124aeb495b947201f5faC96fD1138E326AD86195B98df6DEc9009158A533B49",symbol:n.LORDS,name:"LORDS Token",decimals:18,logoURI:"/images/tokens/lords.png"},[n.STRK]:{address:"0x04718f5a0Fc34cC1AF16A1cdee98fFB20C31f5cD61D6Ab07201858f4287c938D",symbol:n.STRK,name:"Starknet Token",decimals:18,logoURI:"/images/chains/starknet.svg"},[n.USDC]:{address:"0x033068F6539f8e6e6b131e6B2B814e6c34A5224bC66947c47DaB9dFeE93b35fb",symbol:n.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg",logoSourceURI:"https://pay.daimo.com/coin-logos/usdc.png"},[n.USDT]:{address:"0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8",symbol:n.USDT,name:"Tether USD",decimals:6,logoURI:"/images/tokens/usdt.png"}},[c.STARKNET_TESTNET]:{[n.USDC]:{address:"0x0512feAc6339Ff7889822cb5aA2a86C848e9D392bB0E3E237C008674feeD8343",symbol:n.USDC,name:"USD Coin",decimals:6,logoURI:"/images/tokens/usdc.svg"}}},$e={ARBITRUM:d[c.ARBITRUM],ARBITRUM_TESTNET:d[c.ARBITRUM_TESTNET],AVALANCHE:d[c.AVALANCHE],AVALANCHE_TESTNET:d[c.AVALANCHE_TESTNET],BASE:d[c.BASE],BASE_TESTNET:d[c.BASE_TESTNET],BSC:d[c.BSC],ETHEREUM:d[c.ETHEREUM],ETHEREUM_TESTNET:d[c.ETHEREUM_TESTNET],STARKNET:d[c.STARKNET]};d[c.ARBITRUM],d[c.ARBITRUM_TESTNET],d[c.AVALANCHE],d[c.AVALANCHE_TESTNET],d[c.BASE],d[c.BASE_TESTNET],d[c.BSC],d[c.ETHEREUM],d[c.ETHEREUM_TESTNET],d[c.HYPEREVM],d[c.LISK],d[c.MONAD],d[c.MONAD_TESTNET],d[c.OPTIMISM],d[c.OPTIMISM_TESTNET],d[c.POLYGON],d[c.STARKNET],d[c.STARKNET_TESTNET];function ze(s,e){const t=e.toLowerCase().trim(),o=d[s];if(!o)throw new Error(`Chain not found: ${s}. The chain key must be a valid chain identifier.`);let a;for(const r in o){const i=o[r];if(i&&i.address.toLowerCase()===t.toLowerCase()){a=i;break}}if(!a)throw new Error(`Token address mismatch: address ${e} does not exist on chain ${s}. The token address must be a valid token address on the specified chain.`);return a}function M(s,e,t){const o=ze(s,e);if(o.symbol!==t)throw new Error(`Token address and symbol mismatch: address ${e} on chain ${s} corresponds to token "${o.symbol}", but expected "${t}". The token address must correspond to a token with the expected symbol on the specified chain.`);return o}function Le(s,e){return d[s]?.[e]}function je(s,e){return Le(s,e)?.address}var v=(s=>(s.PRODUCTION="production",s.STAGING="staging",s))(v||{});class u{constructor({api_key:e,env:t,seesion_token:o,props:a}){this.api_key=e||"",this.sessionToken=o||"",this.env=t??v.PRODUCTION,this.props=a}static async config(e){if(!u.app){if(!e)throw new Error("Please provide an api_key");u.app=new u(e)}return e&&(e.api_key!==void 0&&(u.app.api_key=e.api_key),e.seesion_token!==void 0&&(u.app.sessionToken=e.seesion_token),e.env!==void 0&&(u.app.env=e.env),e.props!==void 0&&(u.app.props=e.props)),u.app}static getApiKey(){if(!u.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return u.app.api_key}static getSessionToken(){if(!u.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return u.app.sessionToken}static getProps(){if(!u.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return u.app.props}static getEnv(){if(!u.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");return u.app.env==="internal"?"staging":u.app.env}static getBaseUrl(){if(!u.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");switch(u.app.env){case"production":return"https://api.chainrails.io/api/v1";case"staging":return"https://dev.chainrails.io/api/v1";case"internal":return"https://dev.chainrails.io/api/v1";default:return"https://api.chainrails.io/api/v1"}}static getPayModalUrl(e){if(!u.app)throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");const t=u.app.env==="internal"?"https://chainrails-frontend-git-staging-horus-labs.vercel.app":"https://app.chainrails.io",o=Number(e),a=e&&!isNaN(Number(e))&&o>0?"/pay/":"/deposit/",r=`${e&&!isNaN(Number(e))&&o>0?o*100:""}`;return t+a+r}}let x=null;function Ke(){x=b.create({prefixUrl:u.getBaseUrl(),headers:{"Content-Type":"application/json"},hooks:{beforeRequest:[s=>{const e=u.getSessionToken()||u.getApiKey();s.headers.set("Authorization",`Bearer ${e}`)}],afterResponse:[(s,e,t)=>t]},retry:{limit:2}})}function g(){return x||Ke(),x}class We{async getById(e){return await g().get("intents/"+e).json()}async getForSender(e){return await g().get("intents/user/"+e).json()}async getForAddress(e){return await g().get("intents/address/"+e).json()}async getForSession(e){return await g().get("modal/sessions/intents/"+e).json()}async getAll(e){return await g().get("intents",{searchParams:e}).json()}async create(e){return await g().post("intents",{json:e}).json()}async createForSession(e){return await g().post("modal/sessions/intents",{json:e}).json()}async update(e,t){return await g().post("intents",{json:t}).json()}async triggerProcessing(e){return await g().post(`intents/${e}/trigger-processing`).json()}async triggerProcessingForSession(e){return await g().post(`modal/sessions/intents/${e}/process`).json()}}class Ve{async getFromSpecificBridge(e){return M(e.sourceChain,e.tokenIn,e.amountSymbol),await g().get("quotes/single",{searchParams:e}).json()}async getFromAllBridges(e){return M(e.sourceChain,e.tokenIn,e.amountSymbol),await g().get("quotes/multiple",{searchParams:e}).json()}async getBestAcrossBridges(e){return M(e.sourceChain,e.tokenIn,e.amountSymbol),await g().get("quotes/best",{searchParams:e}).json()}async getAll(e){return await g().get("quotes/multi-source",{searchParams:e}).json()}async getAllForSession(e){return await g().get("modal/sessions/quotes",{searchParams:e}).json()}}class Ye{async getOptimalRoutes(e){return await g().get("router/optimal-route",{searchParams:e}).json()}async getAllSupportedBridges(){return await g().get("router/supported-bridges/all").json()}async getSupportedBridges(e){return await g().get("router/supported-bridges/route",{searchParams:e}).json()}async getSupportedRoutes(e,t){return await g().get("router/supported-bridges/bridge/"+e,{searchParams:t}).json()}}class qe{async getSupported(e){return await g().get("chains",{searchParams:e}).json()}async getBalance(e){return await g().get(`chains/balances/${e.address}`,{searchParams:e}).json()}}class Ge{async getClientInfo(){return await g().get("client/auth/client-info").json()}async getClientInfoForSession(){return await g().get("modal/sessions/client").json()}}class Xe{async getSessionToken(e){const t=typeof e.destinationChain=="string"?e.destinationChain.replace("_MAINNET",""):void 0,o=t?c[t]:void 0,a={recipient:e.recipient,tokenOut:je(o,e.token),destinationChain:o,amount:e.amount};return g().post("modal/sessions",{json:a}).json().then(r=>({...r,amount:a.amount}))}}const Qe={ACROSS:"ACROSS",CCTP:"CCTP",GATEWAY:"GATEWAY",RHINOFI:"RHINOFI"},Je={router:new Ye,quotes:new Ve,intents:new We,chains:new qe,client:new Ge,auth:new Xe};m.AmountSymbols=n,m.Bridges=Qe,m.Chainrails=u,m.Chains=c,m.Tokens=$e,m.crapi=Je,m.environment=v,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import Intents from "./src/Intents";
|
|
2
2
|
import Quotes from "./src/Quotes";
|
|
3
3
|
import Router from "./src/Router";
|
|
4
|
-
import
|
|
4
|
+
import ChainsService from "./src/Chains";
|
|
5
5
|
import Client from "./src/Client";
|
|
6
6
|
import Auth from "./src/Auth";
|
|
7
7
|
import { Chainrails } from "./src/req";
|
|
8
|
-
import {
|
|
8
|
+
import { Chains, Tokens, environment, AmountSymbols } from "@chainrails/common";
|
|
9
9
|
declare const crapi: {
|
|
10
10
|
router: Router;
|
|
11
11
|
quotes: Quotes;
|
|
12
12
|
intents: Intents;
|
|
13
|
-
chains:
|
|
13
|
+
chains: ChainsService;
|
|
14
14
|
client: Client;
|
|
15
15
|
auth: Auth;
|
|
16
16
|
};
|
|
17
17
|
export * from "./src/types";
|
|
18
|
-
export { crapi,
|
|
18
|
+
export { crapi, Chains, Tokens, Chainrails, environment, AmountSymbols };
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,aAAa,MAAM,cAAc,CAAC;AACzC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEhF,QAAA,MAAM,KAAK;;;;;;;CAOV,CAAC;AAEF,cAAc,aAAa,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Auth/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAyB,MAAM,SAAS,CAAC;AAEtE,MAAM,CAAC,OAAO,OAAO,IAAI;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Auth/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAyB,MAAM,SAAS,CAAC;AAEtE,MAAM,CAAC,OAAO,OAAO,IAAI;IACjB,eAAe,CAAC,KAAK,EAAE,oBAAoB;;;;CAoBlD;AAED,cAAc,SAAS,CAAC"}
|
package/dist/src/Auth/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AmountSymbol, Chain } from "@chainrails/common";
|
|
2
2
|
export interface getSessionTokenInput {
|
|
3
3
|
recipient: string;
|
|
4
|
-
token:
|
|
5
|
-
destinationChain:
|
|
4
|
+
token: AmountSymbol;
|
|
5
|
+
destinationChain: Chain;
|
|
6
6
|
amount: string;
|
|
7
7
|
}
|
|
8
8
|
export interface getSessionTokenOutput {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/Auth/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/Auth/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,YAAY,CAAC;IACpB,gBAAgB,EAAE,KAAK,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { getSupportedInput } from "./types";
|
|
2
|
-
export default class
|
|
1
|
+
import { getSupportedInput, getBalanceInput } from "./types";
|
|
2
|
+
export default class ChainsService {
|
|
3
3
|
getSupported(input?: getSupportedInput): Promise<string[]>;
|
|
4
|
+
getBalance(input: getBalanceInput): Promise<string>;
|
|
4
5
|
}
|
|
5
6
|
export * from "./types";
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Chains/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Chains/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE7D,MAAM,CAAC,OAAO,OAAO,aAAa;IAC1B,YAAY,CAAC,KAAK,CAAC,EAAE,iBAAiB;IAMtC,UAAU,CAAC,KAAK,EAAE,eAAe;CAKxC;AAED,cAAc,SAAS,CAAC"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import { ChainType } from "@chainrails/common";
|
|
1
2
|
import { Network } from "src/types";
|
|
2
3
|
export interface getSupportedInput {
|
|
3
4
|
network?: Network;
|
|
4
5
|
[key: string]: string | number | boolean | undefined;
|
|
5
6
|
}
|
|
7
|
+
export interface getBalanceInput {
|
|
8
|
+
address: `0x${string}`;
|
|
9
|
+
includeZeroBalances?: boolean;
|
|
10
|
+
network?: Network;
|
|
11
|
+
chainType?: ChainType;
|
|
12
|
+
[key: string]: string | number | boolean | undefined;
|
|
13
|
+
}
|
|
6
14
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/Chains/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;CACrD"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/Chains/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;CACrD;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACtD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AmountSymbol } from "@chainrails/common";
|
|
1
2
|
import { Intent } from "src/types";
|
|
2
3
|
export type getAllIntentsInput = {
|
|
3
4
|
limit?: number;
|
|
@@ -14,6 +15,7 @@ export interface createIntentInput {
|
|
|
14
15
|
sender: `0x${string}`;
|
|
15
16
|
amount: string;
|
|
16
17
|
tokenIn: `0x${string}`;
|
|
18
|
+
amountSymbol: AmountSymbol;
|
|
17
19
|
source_chain: string;
|
|
18
20
|
destination_chain: string;
|
|
19
21
|
recipient: `0x${string}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/Intents/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,WAAW,CAAC;AAE3C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,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estAcrossBridgesOutput, getFromAllBridgesInput, getFromAllBridgesOutput, getFromSpecificBridgeInput, getFromSpecificBridgeOutput } from "./types";
|
|
1
|
+
import { getAllForSessionInput, getAllForSessionOutput, getAllInput, getAllOutput, getBestAcrossBridgesInput, getBestAcrossBridgesOutput, getFromAllBridgesInput, getFromAllBridgesOutput, getFromSpecificBridgeInput, getFromSpecificBridgeOutput } from "./types";
|
|
2
2
|
export default class Quotes {
|
|
3
3
|
getFromSpecificBridge(input: getFromSpecificBridgeInput): Promise<getFromSpecificBridgeOutput>;
|
|
4
4
|
getFromAllBridges(input: getFromAllBridgesInput): Promise<getFromAllBridgesOutput>;
|
|
5
5
|
getBestAcrossBridges(input: getBestAcrossBridgesInput): Promise<getBestAcrossBridgesOutput>;
|
|
6
6
|
getAll(input: getAllInput): Promise<getAllOutput>;
|
|
7
|
-
getAllForSession(input: getAllForSessionInput): Promise<
|
|
7
|
+
getAllForSession(input: getAllForSessionInput): Promise<getAllForSessionOutput>;
|
|
8
8
|
}
|
|
9
9
|
export * from "./types";
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Quotes/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Quotes/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,OAAO,OAAO,MAAM;IACnB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B;IAKvD,iBAAiB,CAAC,KAAK,EAAE,sBAAsB;IAK/C,oBAAoB,CAAC,KAAK,EAAE,yBAAyB;IAKrD,MAAM,CAAC,KAAK,EAAE,WAAW;IAIzB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB;CAGpD;AAED,cAAc,SAAS,CAAC"}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Chain, AmountSymbol } from "@chainrails/common";
|
|
2
2
|
import { Bridge, Quote } from "src/types";
|
|
3
3
|
export interface getFromSpecificBridgeInput {
|
|
4
|
-
destinationChain:
|
|
5
|
-
sourceChain:
|
|
4
|
+
destinationChain: Chain;
|
|
5
|
+
sourceChain: Chain;
|
|
6
6
|
tokenIn: `0x${string}`;
|
|
7
7
|
tokenOut: `0x${string}`;
|
|
8
8
|
amount: string;
|
|
9
9
|
bridge: Bridge;
|
|
10
10
|
recipient: `0x${string}`;
|
|
11
|
+
amountSymbol?: AmountSymbol;
|
|
11
12
|
[key: string]: string | number | boolean | undefined;
|
|
12
13
|
}
|
|
13
14
|
export interface getFromSpecificBridgeOutput {
|
|
14
|
-
destinationChain:
|
|
15
|
+
destinationChain: Chain;
|
|
15
16
|
quotes: Quote[];
|
|
16
17
|
cheapestOption: Quote;
|
|
17
18
|
}
|
|
18
19
|
export interface getFromAllBridgesInput {
|
|
19
|
-
destinationChain:
|
|
20
|
-
sourceChain:
|
|
20
|
+
destinationChain: Chain;
|
|
21
|
+
sourceChain: Chain;
|
|
21
22
|
tokenIn: `0x${string}`;
|
|
22
23
|
tokenOut: `0x${string}`;
|
|
23
24
|
amount: string;
|
|
@@ -25,30 +26,49 @@ export interface getFromAllBridgesInput {
|
|
|
25
26
|
/** Comma-separated chains to exclude from results, example: 'BASE_TESTNET,STARKNET_TESTNET' */
|
|
26
27
|
excludeChains?: string;
|
|
27
28
|
recipient: `0x${string}`;
|
|
29
|
+
amountSymbol?: AmountSymbol;
|
|
28
30
|
[key: string]: string | number | boolean | undefined;
|
|
29
31
|
}
|
|
30
32
|
export interface getFromAllBridgesOutput {
|
|
31
|
-
destinationChain:
|
|
33
|
+
destinationChain: Chain;
|
|
32
34
|
quotes: Quote[];
|
|
33
35
|
cheapestOption: Quote;
|
|
34
36
|
}
|
|
35
37
|
export interface getBestAcrossBridgesInput {
|
|
36
|
-
destinationChain:
|
|
37
|
-
sourceChain:
|
|
38
|
+
destinationChain: Chain;
|
|
39
|
+
sourceChain: Chain;
|
|
38
40
|
tokenIn: `0x${string}`;
|
|
39
41
|
tokenOut: `0x${string}`;
|
|
40
42
|
amount: string;
|
|
41
|
-
excludeBridges
|
|
43
|
+
excludeBridges?: string;
|
|
42
44
|
recipient: `0x${string}`;
|
|
45
|
+
amountSymbol?: AmountSymbol;
|
|
43
46
|
[key: string]: string | number | boolean | undefined;
|
|
44
47
|
}
|
|
45
48
|
export interface getBestAcrossBridgesOutput {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
bridgeFeeDetails: {
|
|
50
|
+
maxFee: string;
|
|
51
|
+
};
|
|
52
|
+
totalFee: string;
|
|
53
|
+
totalFeeFormatted: string;
|
|
54
|
+
assetToken: AmountSymbol;
|
|
55
|
+
feeInAssetToken: string;
|
|
56
|
+
feeInAssetTokenFormatted: string;
|
|
57
|
+
depositAmount: string;
|
|
58
|
+
depositAmountFormatted: string;
|
|
59
|
+
route: {
|
|
60
|
+
tokenIn: `0x${string}`;
|
|
61
|
+
tokenOut: `0x${string}`;
|
|
62
|
+
sourceChain: Chain;
|
|
63
|
+
destinationChain: Chain;
|
|
64
|
+
amount: string;
|
|
65
|
+
recipient: `0x${string}`;
|
|
66
|
+
amountSymbol: AmountSymbol;
|
|
67
|
+
bridge: Bridge;
|
|
68
|
+
};
|
|
49
69
|
}
|
|
50
70
|
export interface getAllInput {
|
|
51
|
-
destinationChain:
|
|
71
|
+
destinationChain: Chain;
|
|
52
72
|
tokenOut: `0x${string}`;
|
|
53
73
|
amount: string;
|
|
54
74
|
recipient: `0x${string}`;
|
|
@@ -57,7 +77,7 @@ export interface getAllInput {
|
|
|
57
77
|
[key: string]: string | number | boolean | undefined;
|
|
58
78
|
}
|
|
59
79
|
export interface getAllOutput {
|
|
60
|
-
destinationChain:
|
|
80
|
+
destinationChain: Chain;
|
|
61
81
|
quotes: Quote[];
|
|
62
82
|
cheapestOption: Quote;
|
|
63
83
|
}
|
|
@@ -68,8 +88,9 @@ export interface getAllForSessionInput {
|
|
|
68
88
|
[key: string]: string | number | boolean | undefined;
|
|
69
89
|
}
|
|
70
90
|
export interface getAllForSessionOutput {
|
|
71
|
-
destinationChain:
|
|
91
|
+
destinationChain: Chain;
|
|
72
92
|
quotes: Quote[];
|
|
73
93
|
cheapestOption: Quote;
|
|
94
|
+
network: 'mainnet' | 'testnet';
|
|
74
95
|
}
|
|
75
96
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/Quotes/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/Quotes/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,WAAW,0BAA0B;IACzC,gBAAgB,EAAE,KAAK,CAAC;IACxB,WAAW,EAAE,KAAK,CAAC;IACnB,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,KAAK,MAAM,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACtD;AAED,MAAM,WAAW,2BAA2B;IAC1C,gBAAgB,EAAE,KAAK,CAAC;IACxB,MAAM,EA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AAS,CAAC;CAChC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { AmountSymbol, Chain } from "@chainrails/common";
|
|
1
2
|
import { Bridge } from "src/types";
|
|
2
3
|
export interface getOptimalRoutesInput {
|
|
3
|
-
sourceChain:
|
|
4
|
-
destinationChain:
|
|
5
|
-
tokenIn: `0x${string}
|
|
6
|
-
tokenOut: `0x${string}
|
|
4
|
+
sourceChain: Chain;
|
|
5
|
+
destinationChain: Chain;
|
|
6
|
+
tokenIn: `0x${string}` | string;
|
|
7
|
+
tokenOut: `0x${string}` | string;
|
|
7
8
|
amount: string;
|
|
9
|
+
recipient?: `0x${string}` | string;
|
|
10
|
+
amountSymbol: AmountSymbol;
|
|
8
11
|
[key: string]: string | number | boolean | undefined;
|
|
9
12
|
}
|
|
10
13
|
export interface getOptimalRoutesOutput {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/Router/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/Router/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,KAAK,CAAA;IAClB,gBAAgB,EAAE,KAAK,CAAA;IACvB,OAAO,EAAE,KAAK,MAAM,EAAE,GAAG,MAAM,CAAA;IAC/B,QAAQ,EAAE,KAAK,MAAM,EAAE,GAAG,MAAM,CAAA;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAC,KAAK,MAAM,EAAE,GAAG,MAAM,CAAA;IACjC,YAAY,EAAE,YAAY,CAAA;IAC1B,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
1
|
-
import {
|
|
1
|
+
import { Chain, AmountSymbol } from "@chainrails/common";
|
|
2
2
|
export type Status = "PENDING" | "FUNDED" | "INITIATED" | "COMPLETED" | "EXPIRED";
|
|
3
|
-
export type Bridge = "ACROSS" | "CCTP" | "GATEWAY" | "RHINOFI";
|
|
4
3
|
export type Network = "mainnet" | "testnet";
|
|
4
|
+
export declare const Bridges: {
|
|
5
|
+
readonly ACROSS: "ACROSS";
|
|
6
|
+
readonly CCTP: "CCTP";
|
|
7
|
+
readonly GATEWAY: "GATEWAY";
|
|
8
|
+
readonly RHINOFI: "RHINOFI";
|
|
9
|
+
};
|
|
10
|
+
export type Bridge = (typeof Bridges)[keyof typeof Bridges];
|
|
11
|
+
export interface PaymentOption {
|
|
12
|
+
token: AmountSymbol;
|
|
13
|
+
depositAmount: string;
|
|
14
|
+
depositAmountFormatted: string;
|
|
15
|
+
fee: string;
|
|
16
|
+
feeFormatted: string;
|
|
17
|
+
slippage: number;
|
|
18
|
+
}
|
|
5
19
|
export interface Quote {
|
|
6
|
-
sourceChain:
|
|
7
|
-
destinationChain:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
totalFee: string;
|
|
13
|
-
totalFeeFormatted: string;
|
|
14
|
-
route: {
|
|
15
|
-
tokenIn: `0x${string}`;
|
|
16
|
-
tokenOut: `0x${string}`;
|
|
17
|
-
sourceChain: chains;
|
|
18
|
-
destinationChain: chains;
|
|
19
|
-
amount: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
20
|
+
sourceChain: Chain;
|
|
21
|
+
destinationChain: Chain;
|
|
22
|
+
totalFee: string;
|
|
23
|
+
totalFeeFormatted: string;
|
|
24
|
+
bridge?: Bridge;
|
|
25
|
+
paymentOptions: PaymentOption[];
|
|
22
26
|
}
|
|
23
27
|
export interface Intent {
|
|
24
28
|
id: number;
|
|
@@ -29,10 +33,17 @@ export interface Intent {
|
|
|
29
33
|
initialAmount: string;
|
|
30
34
|
totalAmount: string;
|
|
31
35
|
fees: string;
|
|
36
|
+
app_fee: string;
|
|
37
|
+
total_amount_in_asset_token: string;
|
|
38
|
+
fees_in_asset_token: string;
|
|
39
|
+
app_fee_in_asset_token: string;
|
|
40
|
+
asset_token_symbol: string;
|
|
41
|
+
asset_token_decimals: number;
|
|
42
|
+
slippage: string;
|
|
32
43
|
tokenIn: `0x${string}`;
|
|
33
44
|
tokenOut: `0x${string}`;
|
|
34
|
-
source_chain:
|
|
35
|
-
destination_chain:
|
|
45
|
+
source_chain: Chain;
|
|
46
|
+
destination_chain: Chain;
|
|
36
47
|
intent_address: `0x${string}`;
|
|
37
48
|
destination_intent_address: `0x${string}`;
|
|
38
49
|
intent_nonce: number;
|
|
@@ -44,6 +55,7 @@ export interface Intent {
|
|
|
44
55
|
relayer_claimed: boolean;
|
|
45
56
|
needs_relay: boolean;
|
|
46
57
|
paymaster_used: boolean;
|
|
58
|
+
mode: string;
|
|
47
59
|
tx_hash: string | null;
|
|
48
60
|
expires_at: string;
|
|
49
61
|
created_at: string;
|
package/dist/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,CAAC;AAIlF,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAE5C,eAAO,MAAM,OAAO;;;;;CAKV,CAAC;AAEX,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAAC;AAE5D,MAAM,WAAW,aAAa;IAC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AM,CAAC;IACtB,WAAW,EAAE,KAAK,MAAM,EAAE,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE;QACR,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainrails/sdk",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.9",
|
|
5
5
|
"main": "./dist/chainrails-sdk.umd.js",
|
|
6
6
|
"module": "./dist/chainrails-sdk.es.mjs",
|
|
7
7
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@chainrails/common": "^0.2.
|
|
38
|
+
"@chainrails/common": "^0.2.5",
|
|
39
39
|
"ky": "^1.14.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|