@cowprotocol/cow-sdk 0.0.12 → 0.0.13

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.
@@ -25,5 +25,5 @@ import e from"loglevel";import t from"cross-fetch";import{IntChainIdTypedDataV4S
25
25
  volumeUsd
26
26
  }
27
27
  }
28
- `)),oe={[w.MAINNET]:"https://api.thegraph.com/subgraphs/name/cowprotocol/cow",[w.RINKEBY]:"https://api.thegraph.com/subgraphs/name/cowprotocol/cow-rinkeby",[w.GNOSIS_CHAIN]:"https://api.thegraph.com/subgraphs/name/cowprotocol/cow-gc"};class ne{constructor(e){this.context=void 0,this.clients=void 0,this.API_NAME="CoW Protocol Subgraph",this.context=e,this.clients=this.createClients()}createClients(){return{[w.MAINNET]:new l(oe[w.MAINNET],{fetch:t}),[w.RINKEBY]:new l(oe[w.RINKEBY],{fetch:t}),[w.GNOSIS_CHAIN]:new l(oe[w.GNOSIS_CHAIN],{fetch:t})}}async getBaseUrl(){const e=await this.context.chainId;return oe[e]}async getTotals(){const t=await this.context.chainId;return e.debug(`[subgraph:${this.API_NAME}] Get totals for:`,t),(await this.runQuery(ee)).totals[0]}async getLastDaysVolume(t){const r=await this.context.chainId;return e.debug(`[subgraph:${this.API_NAME}] Get last ${t} days volume for:`,r),this.runQuery(te,{days:t})}async getLastHoursVolume(t){const r=await this.context.chainId;return e.debug(`[subgraph:${this.API_NAME}] Get last ${t} hours volume for:`,r),this.runQuery(re,{hours:t})}async runQuery(t,r){try{const e=await this.context.chainId,o=this.clients[e];return await o.request(t,r)}catch(o){e.error(o);const n=await this.getBaseUrl();throw new T(`Error running query: ${t}. Variables: ${JSON.stringify(r)}. API: ${n}. Inner Error: ${o}`)}}}let ie,ae;async function se(){if(ae||(ae=new h),!ie){const e=await import("./appData.schema-0c8db23b.js");ie=ae.compile(e)}return{ajv:ae,validate:ie}}async function ce(e){const t=function(e){const t=e.match(/.{1,2}/g);if(t)return new Uint8Array(t.map(e=>parseInt(e,16)))}(e.replace(/(^0x)/,""));if(!t)return;const r=Uint8Array.from([1,112,18,32,...t]),{CID:o}=await import("multiformats/cid");return o.decode(r).toV0().toString()}async function de(e){const{ajv:t,validate:r}=await se();return{result:!!r(e),errors:t.errors?t.errorsText(t.errors):void 0}}class ue{constructor(e){this.context=void 0,this.context=e}generateAppDataDoc(e={},t="CowSwap"){return{version:"0.2.0",appCode:t,metadata:p({},e)}}async decodeAppData(t){try{const e=await ce(t);if(!e)throw new T("Error getting serialized CID");return async function(e,t="https://gnosis.mypinata.cloud/ipfs"){const{default:r}=await import("cross-fetch"),o=await r(`${t}/${e}`);return await o.json()}(e)}catch(t){const r=t;throw e.error("Error decoding AppData:",r),new T("Error decoding AppData: "+r.message)}}async cidToAppDataHex(e){const{CID:t}=await import("multiformats/cid"),{digest:r}=t.parse(e).multihash;return`0x${Buffer.from(r).toString("hex")}`}async appDataHexToCid(e){const t=await ce(e);if(!t)throw new T("Error getting serialized CID");return t}async calculateAppDataHash(e){const t=await de(e);if(null==t||!t.result)throw new T("Invalid appData provided",null==t?void 0:t.errors);try{const t=await async function(e){const t=JSON.stringify(e),{of:r}=await import("ipfs-only-hash");return r(t,{cidVersion:0})}(e),r=await this.cidToAppDataHex(t);if(!r)throw new T(`Could not extract appDataHash from calculated cidV0 ${t}`);return{cidV0:t,appDataHash:r}}catch(e){throw new T("Failed to calculate appDataHash",e.message)}}async uploadMetadataDocToIpfs(e){const{IpfsHash:t}=await async function(e,{uri:t,pinataApiKey:r="",pinataApiSecret:o=""}){const{default:n}=await import("cross-fetch");if(!r||!o)throw new T("You need to pass IPFS api credentials.");const i=JSON.stringify({pinataContent:e,pinataMetadata:{name:"appData-affiliate"}}),a=`${t}/pinning/pinJSONToIPFS`,s=await n(a,{method:"POST",body:i,headers:{"Content-Type":"application/json",pinata_api_key:r,pinata_secret_api_key:o}}),c=await s.json();if(200!==s.status)throw new Error(c.error.details||c.error);return c}(e,this.context.ipfs);return this.cidToAppDataHex(t)}}const le={appDataHash:"0x0000000000000000000000000000000000000000000000000000000000000000",isDevEnvironment:!1,ipfs:{uri:"https://gnosis.mypinata.cloud/ipfs",apiKey:void 0,apiSecret:void 0}};var he,pe,me,fe,ge,Te,Ee,ye,we,Ae,Ie,Ne,ve,ke,De,Oe,_e,Pe,Se=/*#__PURE__*/f("context"),Ue=/*#__PURE__*/f("chainId");class be{constructor(e,t){Object.defineProperty(this,Se,{writable:!0,value:void 0}),Object.defineProperty(this,Ue,{writable:!0,value:void 0}),g(this,Ue)[Ue]=this.updateChainId(e),g(this,Se)[Se]=p({},le,t)}updateChainId(t){if(!w[t])throw new T(`Invalid chainId: ${t}`);return e.debug(y,`Updating chainId to: ${t}`),g(this,Ue)[Ue]=t,t}get chainId(){var t,r=this;const o=null==(t=g(this,Se)[Se].signer)?void 0:t.provider;return o?(e.debug(y,"Getting chainId from provider"),async function(){const t=(await o.getNetwork()).chainId;return t!==g(r,Ue)[Ue]&&(e.debug(y,`ChainId mismatch: Provider's chainId: ${t} vs Context's chainId: ${g(r,Ue)[Ue]}. Updating Context's chainId`),r.updateChainId(t)),t}()):Promise.resolve(g(this,Ue)[Ue])}get appDataHash(){var e;return null!==(e=g(this,Se)[Se].appDataHash)&&void 0!==e?e:le.appDataHash}get isDevEnvironment(){var e;return null!==(e=g(this,Se)[Se].isDevEnvironment)&&void 0!==e?e:le.isDevEnvironment}get signer(){return g(this,Se)[Se].signer}get ipfs(){var e;return null!==(e=g(this,Se)[Se].ipfs)&&void 0!==e?e:le.ipfs}}class Re{constructor(t,r={},o={}){this.context=void 0,this.cowApi=void 0,this.metadataApi=void 0,this.cowSubgraphApi=void 0,this.updateChainId=e=>{this.context.updateChainId(e)},this.validateAppDataDocument=de,this.context=new be(t,p({},r)),this.cowApi=new W(this.context),this.cowSubgraphApi=new ne(this.context),this.metadataApi=new ue(this.context),e.setLevel(o.loglevel||"error")}async signOrder(e){const t=this._checkSigner(),r=await this.context.chainId;return async function(e,t,r){return C({order:e,chainId:t},R,r)}(p({},e,{appData:this.context.appDataHash}),r,t)}async signOrderCancellation(e){const t=this._checkSigner();return async function(e,t,r){return C({orderId:e,chainId:t},x,r)}(e,await this.context.chainId,t)}_checkSigner(e=this.context.signer){if(!e)throw new T("No signer available");return e}}!function(e){e.EthPriceUsd="ethPriceUSD",e.Id="id"}(he||(he={})),function(e){e.FeesEth="feesEth",e.FeesUsd="feesUsd",e.Id="id",e.NumberOfTrades="numberOfTrades",e.Orders="orders",e.Settlements="settlements",e.Timestamp="timestamp",e.Tokens="tokens",e.TotalTokens="totalTokens",e.VolumeEth="volumeEth",e.VolumeUsd="volumeUsd"}(pe||(pe={})),function(e){e.FeesEth="feesEth",e.FeesUsd="feesUsd",e.Id="id",e.NumberOfTrades="numberOfTrades",e.Orders="orders",e.Settlements="settlements",e.Timestamp="timestamp",e.Tokens="tokens",e.TotalTokens="totalTokens",e.VolumeEth="volumeEth",e.VolumeUsd="volumeUsd"}(me||(me={})),function(e){e.Asc="asc",e.Desc="desc"}(fe||(fe={})),function(e){e.Id="id",e.InvalidateTimestamp="invalidateTimestamp",e.IsSigned="isSigned",e.IsValid="isValid",e.Owner="owner",e.PresignTimestamp="presignTimestamp",e.Trades="trades",e.TradesTimestamp="tradesTimestamp"}(ge||(ge={})),function(e){e.Id="id",e.Timestamp="timestamp",e.Token0="token0",e.Token1="token1",e.VolumeToken0="volumeToken0",e.VolumeToken1="volumeToken1",e.VolumeTradedEth="volumeTradedEth",e.VolumeTradedUsd="volumeTradedUsd"}(Te||(Te={})),function(e){e.Id="id",e.Timestamp="timestamp",e.Token0="token0",e.Token1="token1",e.VolumeToken0="volumeToken0",e.VolumeToken1="volumeToken1",e.VolumeTradedEth="volumeTradedEth",e.VolumeTradedUsd="volumeTradedUsd"}(Ee||(Ee={})),function(e){e.Id="id",e.Token0="token0",e.Token1="token1",e.VolumeToken0="volumeToken0",e.VolumeToken1="volumeToken1",e.VolumeTradedEth="volumeTradedEth",e.VolumeTradedUsd="volumeTradedUsd"}(ye||(ye={})),function(e){e.FirstTradeTimestamp="firstTradeTimestamp",e.Id="id",e.Solver="solver",e.Trades="trades",e.TxHash="txHash"}(we||(we={})),function(e){e.AveragePrice="averagePrice",e.ClosePrice="closePrice",e.HigherPrice="higherPrice",e.Id="id",e.LowerPrice="lowerPrice",e.OpenPrice="openPrice",e.Timestamp="timestamp",e.Token="token",e.TotalTrades="totalTrades",e.TotalVolume="totalVolume",e.TotalVolumeEth="totalVolumeEth",e.TotalVolumeUsd="totalVolumeUsd"}(Ae||(Ae={})),function(e){e.AveragePrice="averagePrice",e.ClosePrice="closePrice",e.HigherPrice="higherPrice",e.Id="id",e.LowerPrice="lowerPrice",e.OpenPrice="openPrice",e.Timestamp="timestamp",e.Token="token",e.TotalTrades="totalTrades",e.TotalVolume="totalVolume",e.TotalVolumeEth="totalVolumeEth",e.TotalVolumeUsd="totalVolumeUsd"}(Ie||(Ie={})),function(e){e.AmountEth="amountEth",e.AmountUsd="amountUsd",e.Id="id",e.Timestamp="timestamp",e.Token="token",e.Trade="trade"}(Ne||(Ne={})),function(e){e.Address="address",e.AllowedPools="allowedPools",e.Decimals="decimals",e.FirstTradeTimestamp="firstTradeTimestamp",e.History="history",e.Id="id",e.Name="name",e.NumberOfTrades="numberOfTrades",e.PriceEth="priceEth",e.PriceUsd="priceUsd",e.Symbol="symbol",e.TotalVolume="totalVolume",e.TotalVolumeEth="totalVolumeEth",e.TotalVolumeUsd="totalVolumeUsd"}(ve||(ve={})),function(e){e.FeesEth="feesEth",e.FeesUsd="feesUsd",e.Id="id",e.NumberOfTrades="numberOfTrades",e.Orders="orders",e.Settlements="settlements",e.Tokens="tokens",e.Traders="traders",e.VolumeEth="volumeEth",e.VolumeUsd="volumeUsd"}(ke||(ke={})),function(e){e.BuyAmount="buyAmount",e.BuyAmountEth="buyAmountEth",e.BuyAmountUsd="buyAmountUsd",e.BuyToken="buyToken",e.FeeAmount="feeAmount",e.GasPrice="gasPrice",e.Id="id",e.Order="order",e.SellAmount="sellAmount",e.SellAmountEth="sellAmountEth",e.SellAmountUsd="sellAmountUsd",e.SellToken="sellToken",e.Settlement="settlement",e.Timestamp="timestamp",e.TxHash="txHash"}(De||(De={})),function(e){e.Id="id",e.Liquidity="liquidity",e.Tick="tick",e.Token0="token0",e.Token0Price="token0Price",e.Token1="token1",e.Token1Price="token1Price",e.TotalValueLockedToken0="totalValueLockedToken0",e.TotalValueLockedToken1="totalValueLockedToken1"}(Oe||(Oe={})),function(e){e.Address="address",e.FirstTradeTimestamp="firstTradeTimestamp",e.Id="id",e.IsSolver="isSolver",e.NumberOfTrades="numberOfTrades",e.OrdersPlaced="ordersPlaced",e.SolvedAmountEth="solvedAmountEth",e.SolvedAmountUsd="solvedAmountUsd",e.TradedAmountEth="tradedAmountEth",e.TradedAmountUsd="tradedAmountUsd"}(_e||(_e={})),function(e){e.Allow="allow",e.Deny="deny"}(Pe||(Pe={}));var xe={__proto__:null,get Bundle_OrderBy(){return he},get DailyTotal_OrderBy(){return pe},get HourlyTotal_OrderBy(){return me},get OrderDirection(){return fe},get Order_OrderBy(){return ge},get PairDaily_OrderBy(){return Te},get PairHourly_OrderBy(){return Ee},get Pair_OrderBy(){return ye},get Settlement_OrderBy(){return we},get TokenDailyTotal_OrderBy(){return Ae},get TokenHourlyTotal_OrderBy(){return Ie},get TokenTradingEvent_OrderBy(){return Ne},get Token_OrderBy(){return ve},get Total_OrderBy(){return ke},get Trade_OrderBy(){return De},get UniswapPool_OrderBy(){return Oe},get User_OrderBy(){return _e},get _SubgraphErrorPolicy_(){return Pe}};export{A as ALL_SUPPORTED_CHAIN_IDS,T as CowError,Re as CowSdk,xe as GraphQL,w as SupportedChainId,M as Token};
28
+ `)),oe={[w.MAINNET]:"https://api.thegraph.com/subgraphs/name/cowprotocol/cow",[w.RINKEBY]:"https://api.thegraph.com/subgraphs/name/cowprotocol/cow-rinkeby",[w.GNOSIS_CHAIN]:"https://api.thegraph.com/subgraphs/name/cowprotocol/cow-gc"};class ne{constructor(e){this.context=void 0,this.clients=void 0,this.API_NAME="CoW Protocol Subgraph",this.context=e,this.clients=this.createClients()}createClients(){return{[w.MAINNET]:new l(oe[w.MAINNET],{fetch:t}),[w.RINKEBY]:new l(oe[w.RINKEBY],{fetch:t}),[w.GNOSIS_CHAIN]:new l(oe[w.GNOSIS_CHAIN],{fetch:t})}}async getBaseUrl(){const e=await this.context.chainId;return oe[e]}async getTotals(){const t=await this.context.chainId;return e.debug(`[subgraph:${this.API_NAME}] Get totals for:`,t),(await this.runQuery(ee)).totals[0]}async getLastDaysVolume(t){const r=await this.context.chainId;return e.debug(`[subgraph:${this.API_NAME}] Get last ${t} days volume for:`,r),this.runQuery(te,{days:t})}async getLastHoursVolume(t){const r=await this.context.chainId;return e.debug(`[subgraph:${this.API_NAME}] Get last ${t} hours volume for:`,r),this.runQuery(re,{hours:t})}async runQuery(t,r){try{const e=await this.context.chainId,o=this.clients[e];return await o.request(t,r)}catch(o){e.error(o);const n=await this.getBaseUrl();throw new T(`Error running query: ${t}. Variables: ${JSON.stringify(r)}. API: ${n}. Inner Error: ${o}`)}}}let ie,ae;async function se(){if(ae||(ae=new h),!ie){const e=await import("./appData.schema-adfc1c6f.js");ie=ae.compile(e)}return{ajv:ae,validate:ie}}async function ce(e){const t=function(e){const t=e.match(/.{1,2}/g);if(t)return new Uint8Array(t.map(e=>parseInt(e,16)))}(e.replace(/(^0x)/,""));if(!t)return;const r=Uint8Array.from([1,112,18,32,...t]),{CID:o}=await import("multiformats/cid");return o.decode(r).toV0().toString()}async function de(e){const{ajv:t,validate:r}=await se();return{result:!!r(e),errors:t.errors?t.errorsText(t.errors):void 0}}const ue="CowSwap";class le{constructor(e){this.context=void 0,this.context=e}generateAppDataDoc(e={},t){const{appCode:r=ue,environment:o}=t||{};return{version:"0.3.0",appCode:r,environment:o,metadata:p({},e)}}async decodeAppData(t){try{const e=await ce(t);if(!e)throw new T("Error getting serialized CID");return async function(e,t="https://gnosis.mypinata.cloud/ipfs"){const{default:r}=await import("cross-fetch"),o=await r(`${t}/${e}`);return await o.json()}(e)}catch(t){const r=t;throw e.error("Error decoding AppData:",r),new T("Error decoding AppData: "+r.message)}}async cidToAppDataHex(e){const{CID:t}=await import("multiformats/cid"),{digest:r}=t.parse(e).multihash;return`0x${Buffer.from(r).toString("hex")}`}async appDataHexToCid(e){const t=await ce(e);if(!t)throw new T("Error getting serialized CID");return t}async calculateAppDataHash(e){const t=await de(e);if(null==t||!t.result)throw new T("Invalid appData provided",null==t?void 0:t.errors);try{const t=await async function(e){const t=JSON.stringify(e),{of:r}=await import("ipfs-only-hash");return r(t,{cidVersion:0})}(e),r=await this.cidToAppDataHex(t);if(!r)throw new T(`Could not extract appDataHash from calculated cidV0 ${t}`);return{cidV0:t,appDataHash:r}}catch(e){throw new T("Failed to calculate appDataHash",e.message)}}async uploadMetadataDocToIpfs(e){const{IpfsHash:t}=await async function(e,{writeUri:t="https://api.pinata.cloud",pinataApiKey:r="",pinataApiSecret:o=""}){const{default:n}=await import("cross-fetch");if(!r||!o)throw new T("You need to pass IPFS api credentials.");const i=JSON.stringify({pinataContent:e,pinataMetadata:{name:"appData"}}),a=`${t}/pinning/pinJSONToIPFS`,s=await n(a,{method:"POST",body:i,headers:{"Content-Type":"application/json",pinata_api_key:r,pinata_secret_api_key:o}}),c=await s.json();if(200!==s.status)throw new Error(c.error.details||c.error);return c}(e,this.context.ipfs);return this.cidToAppDataHex(t)}}const he={appDataHash:"0x0000000000000000000000000000000000000000000000000000000000000000",isDevEnvironment:!1,ipfs:{readUri:"https://gnosis.mypinata.cloud/ipfs",writeUri:"https://api.pinata.cloud",apiKey:void 0,apiSecret:void 0}};var pe,me,fe,ge,Te,Ee,ye,we,Ae,Ie,Ne,ve,ke,De,Oe,_e,Pe,Se,Ue,be=/*#__PURE__*/f("context"),Re=/*#__PURE__*/f("chainId");class xe{constructor(e,t){Object.defineProperty(this,be,{writable:!0,value:void 0}),Object.defineProperty(this,Re,{writable:!0,value:void 0}),g(this,Re)[Re]=this.updateChainId(e),g(this,be)[be]=p({},he,t,{ipfs:p({},he.ipfs,t.ipfs)})}updateChainId(t){if(!w[t])throw new T(`Invalid chainId: ${t}`);return e.debug(y,`Updating chainId to: ${t}`),g(this,Re)[Re]=t,t}get chainId(){var t,r=this;const o=null==(t=g(this,be)[be].signer)?void 0:t.provider;return o?(e.debug(y,"Getting chainId from provider"),async function(){const t=(await o.getNetwork()).chainId;return t!==g(r,Re)[Re]&&(e.debug(y,`ChainId mismatch: Provider's chainId: ${t} vs Context's chainId: ${g(r,Re)[Re]}. Updating Context's chainId`),r.updateChainId(t)),t}()):Promise.resolve(g(this,Re)[Re])}get appDataHash(){var e;return null!==(e=g(this,be)[be].appDataHash)&&void 0!==e?e:he.appDataHash}get isDevEnvironment(){var e;return null!==(e=g(this,be)[be].isDevEnvironment)&&void 0!==e?e:he.isDevEnvironment}get signer(){return g(this,be)[be].signer}get ipfs(){var e;return null!==(e=g(this,be)[be].ipfs)&&void 0!==e?e:he.ipfs}}class Ce{constructor(t,r={},o={}){this.context=void 0,this.cowApi=void 0,this.metadataApi=void 0,this.cowSubgraphApi=void 0,this.updateChainId=e=>{this.context.updateChainId(e)},this.validateAppDataDocument=de,this.context=new xe(t,p({},r)),this.cowApi=new W(this.context),this.cowSubgraphApi=new ne(this.context),this.metadataApi=new le(this.context),e.setLevel(o.loglevel||"error")}async signOrder(e){const t=this._checkSigner(),r=await this.context.chainId;return async function(e,t,r){return C({order:e,chainId:t},R,r)}(p({},e,{appData:this.context.appDataHash}),r,t)}async signOrderCancellation(e){const t=this._checkSigner();return async function(e,t,r){return C({orderId:e,chainId:t},x,r)}(e,await this.context.chainId,t)}_checkSigner(e=this.context.signer){if(!e)throw new T("No signer available");return e}}!function(e){e.EthPriceUsd="ethPriceUSD",e.Id="id"}(pe||(pe={})),function(e){e.FeesEth="feesEth",e.FeesUsd="feesUsd",e.Id="id",e.NumberOfTrades="numberOfTrades",e.Orders="orders",e.Settlements="settlements",e.Timestamp="timestamp",e.Tokens="tokens",e.TotalTokens="totalTokens",e.VolumeEth="volumeEth",e.VolumeUsd="volumeUsd"}(me||(me={})),function(e){e.FeesEth="feesEth",e.FeesUsd="feesUsd",e.Id="id",e.NumberOfTrades="numberOfTrades",e.Orders="orders",e.Settlements="settlements",e.Timestamp="timestamp",e.Tokens="tokens",e.TotalTokens="totalTokens",e.VolumeEth="volumeEth",e.VolumeUsd="volumeUsd"}(fe||(fe={})),function(e){e.Asc="asc",e.Desc="desc"}(ge||(ge={})),function(e){e.Id="id",e.InvalidateTimestamp="invalidateTimestamp",e.IsSigned="isSigned",e.IsValid="isValid",e.Owner="owner",e.PresignTimestamp="presignTimestamp",e.Trades="trades",e.TradesTimestamp="tradesTimestamp"}(Te||(Te={})),function(e){e.Id="id",e.Timestamp="timestamp",e.Token0="token0",e.Token1="token1",e.VolumeToken0="volumeToken0",e.VolumeToken1="volumeToken1",e.VolumeTradedEth="volumeTradedEth",e.VolumeTradedUsd="volumeTradedUsd"}(Ee||(Ee={})),function(e){e.Id="id",e.Timestamp="timestamp",e.Token0="token0",e.Token1="token1",e.VolumeToken0="volumeToken0",e.VolumeToken1="volumeToken1",e.VolumeTradedEth="volumeTradedEth",e.VolumeTradedUsd="volumeTradedUsd"}(ye||(ye={})),function(e){e.Id="id",e.Token0="token0",e.Token1="token1",e.VolumeToken0="volumeToken0",e.VolumeToken1="volumeToken1",e.VolumeTradedEth="volumeTradedEth",e.VolumeTradedUsd="volumeTradedUsd"}(we||(we={})),function(e){e.FirstTradeTimestamp="firstTradeTimestamp",e.Id="id",e.Solver="solver",e.Trades="trades",e.TxHash="txHash"}(Ae||(Ae={})),function(e){e.AveragePrice="averagePrice",e.ClosePrice="closePrice",e.HigherPrice="higherPrice",e.Id="id",e.LowerPrice="lowerPrice",e.OpenPrice="openPrice",e.Timestamp="timestamp",e.Token="token",e.TotalTrades="totalTrades",e.TotalVolume="totalVolume",e.TotalVolumeEth="totalVolumeEth",e.TotalVolumeUsd="totalVolumeUsd"}(Ie||(Ie={})),function(e){e.AveragePrice="averagePrice",e.ClosePrice="closePrice",e.HigherPrice="higherPrice",e.Id="id",e.LowerPrice="lowerPrice",e.OpenPrice="openPrice",e.Timestamp="timestamp",e.Token="token",e.TotalTrades="totalTrades",e.TotalVolume="totalVolume",e.TotalVolumeEth="totalVolumeEth",e.TotalVolumeUsd="totalVolumeUsd"}(Ne||(Ne={})),function(e){e.AmountEth="amountEth",e.AmountUsd="amountUsd",e.Id="id",e.Timestamp="timestamp",e.Token="token",e.Trade="trade"}(ve||(ve={})),function(e){e.Address="address",e.Decimals="decimals",e.FirstTradeTimestamp="firstTradeTimestamp",e.History="history",e.Id="id",e.Name="name",e.NumberOfTrades="numberOfTrades",e.PriceEth="priceEth",e.PriceUsd="priceUsd",e.Symbol="symbol",e.TotalVolume="totalVolume",e.TotalVolumeEth="totalVolumeEth",e.TotalVolumeUsd="totalVolumeUsd"}(ke||(ke={})),function(e){e.FeesEth="feesEth",e.FeesUsd="feesUsd",e.Id="id",e.NumberOfTrades="numberOfTrades",e.Orders="orders",e.Settlements="settlements",e.Tokens="tokens",e.Traders="traders",e.VolumeEth="volumeEth",e.VolumeUsd="volumeUsd"}(De||(De={})),function(e){e.BuyAmount="buyAmount",e.BuyAmountEth="buyAmountEth",e.BuyAmountUsd="buyAmountUsd",e.BuyToken="buyToken",e.FeeAmount="feeAmount",e.GasPrice="gasPrice",e.Id="id",e.Order="order",e.SellAmount="sellAmount",e.SellAmountEth="sellAmountEth",e.SellAmountUsd="sellAmountUsd",e.SellToken="sellToken",e.Settlement="settlement",e.Timestamp="timestamp",e.TxHash="txHash"}(Oe||(Oe={})),function(e){e.Id="id",e.Liquidity="liquidity",e.Tick="tick",e.Token0="token0",e.Token0Price="token0Price",e.Token1="token1",e.Token1Price="token1Price",e.TotalValueLockedToken0="totalValueLockedToken0",e.TotalValueLockedToken1="totalValueLockedToken1"}(_e||(_e={})),function(e){e.Address="address",e.AllowedPools="allowedPools",e.Decimals="decimals",e.Id="id",e.Name="name",e.PriceEth="priceEth",e.PriceUsd="priceUsd",e.Symbol="symbol"}(Pe||(Pe={})),function(e){e.Address="address",e.FirstTradeTimestamp="firstTradeTimestamp",e.Id="id",e.IsSolver="isSolver",e.NumberOfTrades="numberOfTrades",e.OrdersPlaced="ordersPlaced",e.SolvedAmountEth="solvedAmountEth",e.SolvedAmountUsd="solvedAmountUsd",e.TradedAmountEth="tradedAmountEth",e.TradedAmountUsd="tradedAmountUsd"}(Se||(Se={})),function(e){e.Allow="allow",e.Deny="deny"}(Ue||(Ue={}));var He={__proto__:null,get Bundle_OrderBy(){return pe},get DailyTotal_OrderBy(){return me},get HourlyTotal_OrderBy(){return fe},get OrderDirection(){return ge},get Order_OrderBy(){return Te},get PairDaily_OrderBy(){return Ee},get PairHourly_OrderBy(){return ye},get Pair_OrderBy(){return we},get Settlement_OrderBy(){return Ae},get TokenDailyTotal_OrderBy(){return Ie},get TokenHourlyTotal_OrderBy(){return Ne},get TokenTradingEvent_OrderBy(){return ve},get Token_OrderBy(){return ke},get Total_OrderBy(){return De},get Trade_OrderBy(){return Oe},get UniswapPool_OrderBy(){return _e},get UniswapToken_OrderBy(){return Pe},get User_OrderBy(){return Se},get _SubgraphErrorPolicy_(){return Ue}};export{A as ALL_SUPPORTED_CHAIN_IDS,T as CowError,Ce as CowSdk,He as GraphQL,w as SupportedChainId,M as Token};
29
29
  //# sourceMappingURL=index.modern.js.map