diff --git a/cspell.json b/cspell.json index 5a77b09c2..35c5bc405 100644 --- a/cspell.json +++ b/cspell.json @@ -30,6 +30,7 @@ "dotenv", "emittery", "etherchain", + "ethersproject", "ethgasstation", "Evaluable", "geomines", diff --git a/packages/payload/packages/crypto/packages/market/packages/uniswap/src/Schema.ts b/packages/payload/packages/crypto/packages/market/packages/uniswap/src/Schema.ts index 41fa80dce..6ad2319b3 100644 --- a/packages/payload/packages/crypto/packages/market/packages/uniswap/src/Schema.ts +++ b/packages/payload/packages/crypto/packages/market/packages/uniswap/src/Schema.ts @@ -1,5 +1,8 @@ export type UniswapCryptoMarketWitnessConfigSchema = 'network.xyo.crypto.market.uniswap.witness.config' export const UniswapCryptoMarketWitnessConfigSchema: UniswapCryptoMarketWitnessConfigSchema = 'network.xyo.crypto.market.uniswap.witness.config' +export type UniswapV4CryptoMarketWitnessConfigSchema = 'network.xyo.crypto.market.uniswap.v4.witness.config' +export const UniswapV4CryptoMarketWitnessConfigSchema: UniswapV4CryptoMarketWitnessConfigSchema = 'network.xyo.crypto.market.uniswap.v4.witness.config' + export type UniswapCryptoMarketSchema = 'network.xyo.crypto.market.uniswap' export const UniswapCryptoMarketSchema: UniswapCryptoMarketSchema = 'network.xyo.crypto.market.uniswap' diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/package.json b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/package.json index 172aa288b..f09e069c6 100644 --- a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/package.json +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/package.json @@ -29,30 +29,13 @@ "module": "dist/neutral/index.mjs", "types": "dist/types/index.d.ts", "dependencies": { - "@uniswap/sdk-core": "^7.7.2", - "@uniswap/v3-sdk": "^3.25.2", - "@xylabs/assert": "^4.8.7", - "@xylabs/delay": "^4.8.7", - "@xylabs/enum": "^4.8.7", - "@xylabs/promise": "^4.8.7", - "@xyo-network/abstract-witness": "^3.13.0", - "@xyo-network/module-model": "^3.13.0", - "@xyo-network/open-zeppelin-typechain": "^3.5.2", - "@xyo-network/payload-model": "^3.13.0", - "@xyo-network/payloadset-plugin": "^3.13.0", - "@xyo-network/uniswap-crypto-market-payload-plugin": "workspace:^", - "@xyo-network/uniswap-typechain": "^3.5.2", - "@xyo-network/witness-model": "^3.13.0", - "ethers": "^6.13.6" + "@xyo-network/uniswap-v3-crypto-market-plugin": "workspace:^", + "@xyo-network/uniswap-v4-crypto-market-plugin": "workspace:^" }, "devDependencies": { "@xylabs/ts-scripts-yarn3": "^6.3.1", "@xylabs/tsconfig": "^6.3.1", - "@xylabs/vitest-extended": "^4.8.7", - "@xyo-network/payload-wrapper": "^3.13.0", - "@xyo-network/witness-blockchain-abstract": "^3.13.0", - "typescript": "^5.8.3", - "vitest": "^3.1.1" + "typescript": "^5.8.3" }, "publishConfig": { "access": "public" diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/.depcheckrc b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/.depcheckrc new file mode 100644 index 000000000..06e527fad --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/.depcheckrc @@ -0,0 +1,4 @@ +ignores: + [ + "ethers" + ] diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/.npmignore b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/.npmignore new file mode 100644 index 000000000..a20bcd35c --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/.npmignore @@ -0,0 +1,20 @@ +.* +.env +.eslintcache +.example.env +tsconfig* +rollup.config.ts +yarn.lock +**/*.spec.ts +**/*.snap + +.github +docs +.pnp.* +.vscode +.yarn/* +coverage +cspell.json +node_modules +swagger.json +packages \ No newline at end of file diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/LICENSE b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/LICENSE new file mode 100644 index 000000000..0a041280b --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/README.md b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/README.md new file mode 100644 index 000000000..04d7c668c --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/README.md @@ -0,0 +1,13 @@ +[![logo][]](https://xyo.network) + +Part of [sdk-xyo-client-js](https://www.npmjs.com/package/@xyo-network/sdk-xyo-client-js) + +## License + +> See the [LICENSE](LICENSE) file for license details + +## Credits + +[Made with 🔥 and ❄️ by XYO](https://xyo.network) + +[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png \ No newline at end of file diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/package.json b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/package.json new file mode 100644 index 000000000..25c96491e --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/package.json @@ -0,0 +1,60 @@ +{ + "name": "@xyo-network/uniswap-v3-crypto-market-plugin", + "version": "3.5.1", + "description": "Typescript/Javascript Plugins for XYO Platform", + "homepage": "https://xyo.network", + "bugs": { + "url": "git+https://github.com/XYOracleNetwork/plugins/issues", + "email": "support@xyo.network" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/XYOracleNetwork/plugins.git" + }, + "license": "LGPL-3.0-only", + "author": { + "name": "XYO Development Team", + "email": "support@xyo.network", + "url": "https://xyo.network" + }, + "sideEffects": false, + "type": "module", + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "default": "./dist/neutral/index.mjs" + }, + "./package.json": "./package.json" + }, + "module": "dist/neutral/index.mjs", + "types": "dist/types/index.d.ts", + "dependencies": { + "@uniswap/sdk-core": "^7.7.2", + "@uniswap/v3-sdk": "^3.25.2", + "@xylabs/assert": "^4.8.7", + "@xylabs/delay": "^4.8.7", + "@xylabs/enum": "^4.8.7", + "@xylabs/promise": "^4.8.7", + "@xyo-network/abstract-witness": "^3.13.0", + "@xyo-network/module-model": "^3.13.0", + "@xyo-network/open-zeppelin-typechain": "^3.5.2", + "@xyo-network/payload-model": "^3.13.0", + "@xyo-network/payloadset-plugin": "^3.13.0", + "@xyo-network/uniswap-crypto-market-payload-plugin": "workspace:^", + "@xyo-network/uniswap-typechain": "^3.5.2", + "@xyo-network/witness-model": "^3.13.0", + "ethers": "^6.13.6" + }, + "devDependencies": { + "@xylabs/ts-scripts-yarn3": "^6.3.1", + "@xylabs/tsconfig": "^6.3.1", + "@xylabs/vitest-extended": "^4.8.7", + "@xyo-network/payload-wrapper": "^3.13.0", + "@xyo-network/witness-blockchain-abstract": "^3.13.0", + "typescript": "^5.8.3", + "vitest": "^3.1.1" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/Config.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/Config.ts similarity index 100% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/Config.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/Config.ts diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/Plugin.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/Plugin.ts similarity index 100% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/Plugin.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/Plugin.ts diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/Witness.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/Witness.ts similarity index 100% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/Witness.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/Witness.ts diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/index.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/index.ts new file mode 100644 index 000000000..25e04e79e --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/index.ts @@ -0,0 +1,4 @@ +export * from './Config.ts' +export * from './lib/index.ts' +export { UniswapCryptoMarketPlugin as default, UniswapCryptoMarketPlugin } from './Plugin.ts' +export * from './Witness.ts' diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/UniSwap3Pair.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/UniSwap3Pair.ts similarity index 98% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/UniSwap3Pair.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/UniSwap3Pair.ts index 5c4495e81..b846436f9 100644 --- a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/UniSwap3Pair.ts +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/UniSwap3Pair.ts @@ -10,7 +10,7 @@ import type { IUniswapV3Pool } from '@xyo-network/uniswap-typechain' import { IUniswapV3Pool__factory } from '@xyo-network/uniswap-typechain' import type { Provider } from 'ethers' -import { logErrors, logErrorsAsync } from '../logErrors.ts' +import { logErrors, logErrorsAsync } from './logErrors.ts' import { EthersUniswap3PoolSlot0Wrapper } from './Uniswap3PoolSlot0Wrapper.ts' export const ChainId = Enum({ diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/Uniswap3PoolSlot0Wrapper.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/Uniswap3PoolSlot0Wrapper.ts similarity index 100% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/Uniswap3PoolSlot0Wrapper.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/Uniswap3PoolSlot0Wrapper.ts diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/UniswapPoolContracts.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/UniswapPoolContracts.ts similarity index 100% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/UniswapPoolContracts.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/UniswapPoolContracts.ts diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/UniswapV3Slot0Fields.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/UniswapV3Slot0Fields.ts similarity index 100% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/UniswapV3Slot0Fields.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/UniswapV3Slot0Fields.ts diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/createUniswapPoolContracts.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/createUniswapPoolContracts.ts similarity index 87% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/createUniswapPoolContracts.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/createUniswapPoolContracts.ts index cd81b4e46..00736503e 100644 --- a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/createUniswapPoolContracts.ts +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/createUniswapPoolContracts.ts @@ -1,6 +1,6 @@ import type { Provider } from 'ethers' -import { logErrors } from '../logErrors.ts' +import { logErrors } from './logErrors.ts' import { EthersUniSwap3Pair } from './UniSwap3Pair.ts' export const createUniswapPoolContracts = (provider: Provider, contracts: string[]) => { diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/index.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/index.ts similarity index 83% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/index.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/index.ts index 1ebb0a978..88eb57b63 100644 --- a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/index.ts +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/index.ts @@ -3,4 +3,4 @@ export * from './pricesFromUniswap3.ts' export * from './UniSwap3Pair.ts' export * from './Uniswap3PoolSlot0Wrapper.ts' export * from './UniswapPoolContracts.ts' -export * from './UniswapV3Slot0Fields.ts' +export * from './UniswapV3Slot0Fields.ts' \ No newline at end of file diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/logErrors.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/logErrors.ts similarity index 100% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/logErrors.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/logErrors.ts diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/pricesFromUniswap3.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/pricesFromUniswap3.ts similarity index 92% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/pricesFromUniswap3.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/pricesFromUniswap3.ts index f6c02e332..ffe46094a 100644 --- a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/pricesFromUniswap3.ts +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/pricesFromUniswap3.ts @@ -2,7 +2,7 @@ import { fulfilled } from '@xylabs/promise' import type { UniswapCryptoPair } from '@xyo-network/uniswap-crypto-market-payload-plugin' import type { EthersUniSwap3Pair } from './index.ts' -import { logErrorsAsync } from '../logErrors.ts' +import { logErrorsAsync } from './logErrors.ts' export const pricesFromUniswap3 = async (pools: EthersUniSwap3Pair[]): Promise => { return await logErrorsAsync(async () => { diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/spec/pricesFromUniswap3.spec.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/spec/pricesFromUniswap3.spec.ts similarity index 100% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v3/spec/pricesFromUniswap3.spec.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/lib/spec/pricesFromUniswap3.spec.ts diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/spec/Plugin.spec.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/spec/Plugin.spec.ts similarity index 100% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/spec/Plugin.spec.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/spec/Plugin.spec.ts diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/spec/Witness.spec.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/spec/Witness.spec.ts similarity index 100% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/spec/Witness.spec.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/src/spec/Witness.spec.ts diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/tsconfig.json b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/tsconfig.json new file mode 100644 index 000000000..5225af9e1 --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/tsconfig.json @@ -0,0 +1,5 @@ +{ + "exclude": ["dist", "docs", "packages", "node_modules"], + "extends": "@xylabs/tsconfig" +} + diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/tsconfig.typedoc.json b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/tsconfig.typedoc.json new file mode 100644 index 000000000..0919ecb67 --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/tsconfig.typedoc.json @@ -0,0 +1,5 @@ +{ + "exclude": ["**/spec/*", "**/*.spec.*", "**/packages/*", "dist"], + "extends": "./tsconfig.json" +} + diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/typedoc.json b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/typedoc.json new file mode 100644 index 000000000..a1ff9f91c --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/typedoc.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://typedoc.org/schema.json", + "entryPoints": ["./src/index.ts"], + "tsconfig": "./tsconfig.typedoc.json" +} \ No newline at end of file diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/xy.config.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/xy.config.ts new file mode 100644 index 000000000..2952c5f9a --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3/xy.config.ts @@ -0,0 +1,10 @@ +import type { XyTsupConfig } from '@xylabs/ts-scripts-yarn3' +const config: XyTsupConfig = { + compile: { + browser: {}, + node: {}, + neutral: { src: true }, + }, +} + +export default config diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/.depcheckrc b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/.depcheckrc new file mode 100644 index 000000000..06e527fad --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/.depcheckrc @@ -0,0 +1,4 @@ +ignores: + [ + "ethers" + ] diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/.npmignore b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/.npmignore new file mode 100644 index 000000000..a20bcd35c --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/.npmignore @@ -0,0 +1,20 @@ +.* +.env +.eslintcache +.example.env +tsconfig* +rollup.config.ts +yarn.lock +**/*.spec.ts +**/*.snap + +.github +docs +.pnp.* +.vscode +.yarn/* +coverage +cspell.json +node_modules +swagger.json +packages \ No newline at end of file diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/LICENSE b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/LICENSE new file mode 100644 index 000000000..0a041280b --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/README.md b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/README.md new file mode 100644 index 000000000..04d7c668c --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/README.md @@ -0,0 +1,13 @@ +[![logo][]](https://xyo.network) + +Part of [sdk-xyo-client-js](https://www.npmjs.com/package/@xyo-network/sdk-xyo-client-js) + +## License + +> See the [LICENSE](LICENSE) file for license details + +## Credits + +[Made with 🔥 and ❄️ by XYO](https://xyo.network) + +[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png \ No newline at end of file diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/package.json b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/package.json new file mode 100644 index 000000000..5fb0c2ff0 --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/package.json @@ -0,0 +1,60 @@ +{ + "name": "@xyo-network/uniswap-v4-crypto-market-plugin", + "version": "3.5.1", + "description": "Typescript/Javascript Plugins for XYO Platform", + "homepage": "https://xyo.network", + "bugs": { + "url": "git+https://github.com/XYOracleNetwork/plugins/issues", + "email": "support@xyo.network" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/XYOracleNetwork/plugins.git" + }, + "license": "LGPL-3.0-only", + "author": { + "name": "XYO Development Team", + "email": "support@xyo.network", + "url": "https://xyo.network" + }, + "sideEffects": false, + "type": "module", + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "default": "./dist/neutral/index.mjs" + }, + "./package.json": "./package.json" + }, + "module": "dist/neutral/index.mjs", + "types": "dist/types/index.d.ts", + "dependencies": { + "@uniswap/sdk-core": "^7.7.2", + "@uniswap/v3-sdk": "^3.25.2", + "@xylabs/assert": "^4.8.7", + "@xylabs/delay": "^4.8.7", + "@xylabs/enum": "^4.8.7", + "@xylabs/promise": "^4.8.7", + "@xyo-network/abstract-witness": "^3.13.0", + "@xyo-network/module-model": "^3.13.0", + "@xyo-network/open-zeppelin-typechain": "^3.5.2", + "@xyo-network/payload-model": "^3.13.0", + "@xyo-network/payloadset-plugin": "^3.13.0", + "@xyo-network/uniswap-crypto-market-payload-plugin": "workspace:^", + "@xyo-network/uniswap-typechain": "^3.5.2", + "@xyo-network/witness-model": "^3.13.0", + "ethers": "^6.13.6" + }, + "devDependencies": { + "@xylabs/ts-scripts-yarn3": "^6.3.1", + "@xylabs/tsconfig": "^6.3.1", + "@xylabs/vitest-extended": "^4.8.7", + "@xyo-network/payload-wrapper": "^3.13.0", + "@xyo-network/witness-blockchain-abstract": "^3.13.0", + "typescript": "^5.8.3", + "vitest": "^3.1.1" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/Config.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/Config.ts new file mode 100644 index 000000000..92b883b9c --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/Config.ts @@ -0,0 +1,8 @@ +import type { UniswapV4CryptoMarketWitnessConfigSchema } from '@xyo-network/uniswap-crypto-market-payload-plugin' +import type { WitnessConfig } from '@xyo-network/witness-model' +import { TokenPairPoolKey } from './types/index.ts' + +export type UniswapV4CryptoMarketWitnessConfig = WitnessConfig<{ + poolKeys?: TokenPairPoolKey[] + schema: UniswapV4CryptoMarketWitnessConfigSchema +}> diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/Plugin.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/Plugin.ts new file mode 100644 index 000000000..b600f76f8 --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/Plugin.ts @@ -0,0 +1,16 @@ +import { PayloadSetSchema } from '@xyo-network/payload-model' +import { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin' +import { UniswapCryptoMarketSchema } from '@xyo-network/uniswap-crypto-market-payload-plugin' + +import { UniswapV4CryptoMarketWitness } from './Witness.ts' + +export const UniswapV4CryptoMarketPlugin = () => + createPayloadSetWitnessPlugin( + { required: { [UniswapCryptoMarketSchema]: 1 }, schema: PayloadSetSchema }, + { + witness: async (params) => { + const result = await UniswapV4CryptoMarketWitness.create(params) + return result + }, + }, + ) diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/Witness.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/Witness.ts new file mode 100644 index 000000000..d7751bd50 --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/Witness.ts @@ -0,0 +1,46 @@ +import { assertEx } from '@xylabs/assert' +import { AbstractWitness } from '@xyo-network/abstract-witness' +import type { AnyConfigSchema } from '@xyo-network/module-model' +import type { Payload, Schema } from '@xyo-network/payload-model' +import { UniswapCryptoMarketPayload, UniswapCryptoMarketSchema, UniswapV4CryptoMarketWitnessConfigSchema } from '@xyo-network/uniswap-crypto-market-payload-plugin' +import type { WitnessParams } from '@xyo-network/witness-model' +import type { Provider } from 'ethers' + +import type { UniswapV4CryptoMarketWitnessConfig } from './Config.ts' +import { pricesFromUniswapV4, UniswapV4DefaultPools } from './lib/index.ts' +import { TokenPairPoolKey } from './types/index.ts' + +export type UniswapV4CryptoMarketWitnessParams = WitnessParams< + AnyConfigSchema, + { + provider?: Provider + } +> + +export class UniswapV4CryptoMarketWitness< + TParams extends UniswapV4CryptoMarketWitnessParams = UniswapV4CryptoMarketWitnessParams, +> extends AbstractWitness { + static override readonly configSchemas: Schema[] = [...super.configSchemas, UniswapV4CryptoMarketWitnessConfigSchema] + static override readonly defaultConfigSchema: Schema = UniswapV4CryptoMarketWitnessConfigSchema + + protected get pools(): TokenPairPoolKey[] { + return this.config?.poolKeys ?? Object.values(UniswapV4DefaultPools) + } + + protected get provider() { + return assertEx(this.params.provider, () => 'Provider Required') + } + + protected override async observeHandler(): Promise { + await this.started('throw') + const pairs = await pricesFromUniswapV4(this.pools, this.provider) + const timestamp = Date.now() + const payload: UniswapCryptoMarketPayload = { pairs, schema: UniswapCryptoMarketSchema, timestamp } + return [payload] + } + + protected override async startHandler() { + await super.startHandler() + return true + } +} diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/index.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/index.ts new file mode 100644 index 000000000..729fb6de5 --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/index.ts @@ -0,0 +1,4 @@ +export * from './Config.ts' +export * from './lib/index.ts' +export { UniswapV4CryptoMarketPlugin as default, UniswapV4CryptoMarketPlugin } from './Plugin.ts' +export * from './Witness.ts' diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/UniswapV4ContractAddresses.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/UniswapV4ContractAddresses.ts similarity index 100% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/UniswapV4ContractAddresses.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/UniswapV4ContractAddresses.ts diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/UniswapV4DefaultPools.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/UniswapV4DefaultPools.ts new file mode 100644 index 000000000..874477353 --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/UniswapV4DefaultPools.ts @@ -0,0 +1,26 @@ +import { ZeroAddress } from "ethers" +import { TokenPairPoolKey, TokenParameters } from "../types/index.ts" + +export const TokenRegistry: Record = { + USDT: { + address: '0xdac17f958d2ee523a2206206994597c13d831ec7', + chainId: 1, + decimals: 6, + symbol: 'USDT', + }, + XYO: { + address: '0x55296f69f40ea6d20e478533c15a6b08b654e758', + chainId: 1, + decimals: 18, + symbol: 'XYO', + }, +} as const + +export const UniswapV4DefaultPools: Record = { + 'XYO:USDT': { + fee: 3000, + hookAddress: ZeroAddress, + tickSpacing: 60, + tokens: [TokenRegistry.XYO, TokenRegistry.USDT], + } +} as const \ No newline at end of file diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/UniswapV4TokenIdentifier.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/UniswapV4TokenIdentifier.ts similarity index 100% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/UniswapV4TokenIdentifier.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/UniswapV4TokenIdentifier.ts diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/getExchangeRate.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/getExchangeRate.ts similarity index 93% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/getExchangeRate.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/getExchangeRate.ts index 8c3a77632..5b69ede78 100644 --- a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/getExchangeRate.ts +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/getExchangeRate.ts @@ -5,6 +5,7 @@ import { getPoolId } from "./getPoolId.ts" import { getPriceFromSqrtX96 } from "./getPriceFromSqrtX96.ts" import { IStateView__factory } from "@xyo-network/uniswap-typechain/v4-periphery" import { UniswapV4ContractAddresses } from "./UniswapV4ContractAddresses.ts" +import { sortTokens } from "./sortTokens.ts" /** * Returns the price of the token pair in the Uniswap V4 pool. @@ -24,9 +25,7 @@ export const getExchangeRate = async ( ): Promise => { const hooks = hookAddress || ZeroAddress const stateView = IStateView__factory.connect(UniswapV4ContractAddresses.Ethereum.StateView, provider) - const [token0, token1] = tokenA.sortsBefore(tokenB) - ? [tokenA, tokenB] - : [tokenB, tokenA] + const [token0, token1] = sortTokens(tokenA, tokenB) const poolId: string = getPoolId(token0, token1, fee, 60, hooks) if (poolId === ZeroAddress) throw new Error("Invalid poolId") const response = await stateView.getSlot0(poolId) diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/getPoolId.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/getPoolId.ts similarity index 72% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/getPoolId.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/getPoolId.ts index 48eb7b615..82ed9c817 100644 --- a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/getPoolId.ts +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/getPoolId.ts @@ -2,19 +2,20 @@ import { Token } from "@uniswap/sdk-core" import { AbiCoder } from "ethers/abi" import { ZeroAddress } from "ethers/constants" import { keccak256 } from "ethers/crypto" +import { sortTokens } from "./sortTokens.ts" /** * Computes the pool address for a given pair of tokens, fee, tick spacing, and hooks which * is used to identify the pool on the Uniswap V4 protocol. - * @param currencyA - The first token in the pair. - * @param currencyB - The second token in the pair. + * @param tokenA - The first token in the pair. + * @param tokenB - The second token in the pair. * @param fee - The fee tier for the pool. * @param tickSpacing - The tick spacing for the pool. * @param hooks - The hooks associated with the pool. * @returns The computed pool address as a string. */ -export const getPoolId = (currencyA: Token, currencyB: Token, fee: number, tickSpacing: number, hooks: string): string => { - const [currency0, currency1] = currencyA.sortsBefore(currencyB) ? [currencyA, currencyB] : [currencyB, currencyA] +export const getPoolId = (tokenA: Token, tokenB: Token, fee: number, tickSpacing: number, hooks: string): string => { + const [currency0, currency1] = sortTokens(tokenA, tokenB) const currency0Addr = currency0.isNative ? ZeroAddress : currency0.wrapped.address const currency1Addr = currency1.isNative ? ZeroAddress : currency1.wrapped.address return keccak256( diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/getPriceFromSqrtX96.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/getPriceFromSqrtX96.ts similarity index 100% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/getPriceFromSqrtX96.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/getPriceFromSqrtX96.ts diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/index.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/index.ts new file mode 100644 index 000000000..31ab28a29 --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/index.ts @@ -0,0 +1,4 @@ +export * from './priceFromUniswapV4.ts' +export * from './pricesFromUniswapV4.ts' +export * from './tokenRegistryValueToToken.ts' +export * from './UniswapV4DefaultPools.ts' \ No newline at end of file diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/pricesFromUniswap4.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/priceFromUniswapV4.ts similarity index 62% rename from packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/pricesFromUniswap4.ts rename to packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/priceFromUniswapV4.ts index 68203efa7..1eb91091e 100644 --- a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/pricesFromUniswap4.ts +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/priceFromUniswapV4.ts @@ -1,12 +1,14 @@ import { Provider, ZeroAddress } from 'ethers' import { getExchangeRate } from './getExchangeRate.ts' -import { UniswapV4TokenContractIdentifier } from './UniswapV4TokenContractIdentifier.ts' import { UniswapCryptoPair, UniswapCryptoToken } from '@xyo-network/uniswap-crypto-market-payload-plugin' +import { tokenRegistryValueToToken } from './tokenRegistryValueToToken.ts' +import { TokenPairPoolKey } from '../types/index.ts' -export const pricesFromUniswap4 = async (contract: UniswapV4TokenContractIdentifier, provider: Provider): Promise => { - const { tokenA, tokenB, fee, hookAddress = ZeroAddress } = contract +export const priceFromUniswapV4 = async (poolId: TokenPairPoolKey, provider: Provider): Promise => { + const { tokens, fee, hookAddress = ZeroAddress } = poolId + const tokenA = tokenRegistryValueToToken(tokens[0]) + const tokenB = tokenRegistryValueToToken(tokens[1]) const rate = await getExchangeRate(tokenA, tokenB, fee, hookAddress, provider) - const token0: UniswapCryptoToken = { address: tokenA.address, symbol: tokenA.symbol || '', diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/pricesFromUniswapV4.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/pricesFromUniswapV4.ts new file mode 100644 index 000000000..b58b03c86 --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/pricesFromUniswapV4.ts @@ -0,0 +1,8 @@ +import { Provider } from 'ethers' +import { UniswapCryptoPair } from '@xyo-network/uniswap-crypto-market-payload-plugin' +import { priceFromUniswapV4 } from './priceFromUniswapV4.ts' +import { TokenPairPoolKey } from '../types/index.ts' + +export const pricesFromUniswapV4 = async (poolId: TokenPairPoolKey[], provider: Provider): Promise => { + return await Promise.all(poolId.map(async (pool) => priceFromUniswapV4(pool, provider))) +} diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/sortTokens.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/sortTokens.ts new file mode 100644 index 000000000..10ef6ce56 --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/sortTokens.ts @@ -0,0 +1,25 @@ +import { Token } from "@uniswap/sdk-core"; + +/** + * Sorts two tokens in ascending order by address to ensure consistent ordering. + * + * In Uniswap v2, v3, and v4, pool addresses are deterministically derived using + * `CREATE2` with a hash of the pool's initialization parameters. One critical + * part of this hash is the `token0` and `token1` addresses. To ensure uniqueness + * and prevent duplicate pools (e.g., USDC/WETH and WETH/USDC being treated as different), + * Uniswap requires that token pairs be ordered **lexicographically by address**. + * + * This method ensures that tokens are sorted according to that rule. + * + * This is required any time you: + * - Derive a pool address + * - Generate a pool ID + * - Call a function that expects a PoolKey or token pair in sorted order + * + * @param tokenA - The first token to compare + * @param tokenB - The second token to compare + * @returns A tuple `[token0, token1]` sorted by address in ascending order + */ +export const sortTokens = (tokenA: Token, tokenB: Token): [Token, Token] => { + return tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA] +} \ No newline at end of file diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/spec/priceFromUniswapV4.spec.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/spec/priceFromUniswapV4.spec.ts new file mode 100644 index 000000000..52c898196 --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/spec/priceFromUniswapV4.spec.ts @@ -0,0 +1,18 @@ +import '@xylabs/vitest-extended' + +import { getProviderFromEnv } from '@xyo-network/witness-blockchain-abstract' +import { + describe, expect, test, +} from 'vitest' +import { priceFromUniswapV4 } from '../priceFromUniswapV4.ts' +import { UniswapV4DefaultPools } from '../UniswapV4DefaultPools.ts' + +describe.skipIf(!(process.env.INFURA_PROJECT_ID && process.env.INFURA_PROJECT_SECRET))('priceFromUniswapV4', () => { + test('priceFromUniswapV4', async () => { + const provider = getProviderFromEnv() + const poolId = UniswapV4DefaultPools['XYO:USDT'] + const pairs = await priceFromUniswapV4(poolId, provider) + expect(pairs).toBeDefined() + console.dir(pairs, { depth: null }) + }) +}) diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/tokenRegistryValueToToken.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/tokenRegistryValueToToken.ts new file mode 100644 index 000000000..3350af66f --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/lib/tokenRegistryValueToToken.ts @@ -0,0 +1,9 @@ +import { Token } from "@uniswap/sdk-core" +import { getAddress } from "ethers/address" +import { TokenParameters } from "../types/index.ts" + +export const tokenRegistryValueToToken = (value: TokenParameters): Token => { + const { address, chainId, decimals, symbol, name } = value + const normalizedAddress = getAddress(address.toLowerCase()) + return new Token(chainId, normalizedAddress, decimals, symbol, name) +} \ No newline at end of file diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/spec/Plugin.spec.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/spec/Plugin.spec.ts new file mode 100644 index 000000000..cf5daefb5 --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/spec/Plugin.spec.ts @@ -0,0 +1,16 @@ +import '@xylabs/vitest-extended' + +import { PayloadSetPluginResolver } from '@xyo-network/payloadset-plugin' +import { + describe, expect, test, +} from 'vitest' + +import { UniswapV4CryptoMarketPlugin } from '../Plugin.ts' + +describe('UniswapV4CryptoMarketPlugin', () => { + test('Add to Resolver', async () => { + const plugin = UniswapV4CryptoMarketPlugin() + const resolver = await new PayloadSetPluginResolver().register(plugin) + expect(resolver.resolve(plugin.set)).toBeDefined() + }) +}) diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/spec/Witness.spec.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/spec/Witness.spec.ts new file mode 100644 index 000000000..eb5230f70 --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/spec/Witness.spec.ts @@ -0,0 +1,47 @@ +import '@xylabs/vitest-extended' + +import { PayloadWrapper } from '@xyo-network/payload-wrapper' +import type { UniswapCryptoMarketPayload } from '@xyo-network/uniswap-crypto-market-payload-plugin' +import { UniswapV4CryptoMarketWitnessConfigSchema } from '@xyo-network/uniswap-crypto-market-payload-plugin' +import { getProviderFromEnv } from '@xyo-network/witness-blockchain-abstract' +import { + describe, expect, + test, +} from 'vitest' + +import { UniswapV4DefaultPools } from '../lib/index.ts' +import { UniswapV4CryptoMarketWitness } from '../Witness.ts' + +describe('UniswapV4CryptoMarketWitness', () => { + test('observe', async () => { + const provider = getProviderFromEnv() + const witness = await UniswapV4CryptoMarketWitness.create({ + account: 'random', + config: { + poolKeys: Object.values(UniswapV4DefaultPools), + schema: UniswapV4CryptoMarketWitnessConfigSchema, + }, + provider, + }) + const [observation] = (await witness.observe()) as UniswapCryptoMarketPayload[] + expect(observation.pairs.length).toBeGreaterThan(0) + + const answerWrapper = PayloadWrapper.wrap(observation) + expect(await answerWrapper.getValid()).toBe(true) + }) + test('observe [no config]', async () => { + const provider = getProviderFromEnv() + const witness = await UniswapV4CryptoMarketWitness.create({ + account: 'random', + config: { + schema: UniswapV4CryptoMarketWitnessConfigSchema, + }, + provider, + }) + const [observation] = (await witness.observe()) as UniswapCryptoMarketPayload[] + expect(observation.pairs.length).toBeGreaterThan(0) + + const answerWrapper = PayloadWrapper.wrap(observation) + expect(await answerWrapper.getValid()).toBe(true) + }) +}) diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/types/TokenPairPoolKey.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/types/TokenPairPoolKey.ts new file mode 100644 index 000000000..8ca5deb5c --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/types/TokenPairPoolKey.ts @@ -0,0 +1,21 @@ +import { TokenParameters } from "./TokenParameters.ts"; + +// NOTE: We could import this type from @uniswap/v4-core, but +// they are currently hardcoded the ethers v5 which +// causes many issues since we are using ethers v6. Moreover, +// we would have to hit the ERC20 contract to get the decimals +// and name of the token, which is not ideal as it never changes. +// export type PoolKey = { +// currency0: string +// currency1: string +// fee: number +// tickSpacing: number +// hooks: string +// } + +export type TokenPairPoolKey = { + fee: number, + hookAddress: string, + tickSpacing: number, + tokens: [TokenParameters, TokenParameters], +} diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/types/TokenParameters.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/types/TokenParameters.ts new file mode 100644 index 000000000..fca1eb4de --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/types/TokenParameters.ts @@ -0,0 +1,39 @@ +/** + * Represents the minimal metadata required to define an ERC-20 token + * in the context of Uniswap pool interactions, token registries, or + * off-chain utilities. + * + * This structure is designed to be lightweight but expressive enough + * to support pool ID generation, token sorting, and on-chain lookups. + */ +export type TokenParameters = { + /** + * The Ethereum address of the token contract. + */ + address: string + + /** + * The chain ID where this token is deployed. + * This enables multi-chain compatibility and avoids collisions between + * tokens with the same address on different networks (e.g. mainnet vs testnet). + */ + chainId: number + + /** + * The number of decimals used by the token. + * This is required for correct price calculations and amount formatting. + */ + decimals: number + + /** + * A short uppercase identifier for the token (e.g. 'USDT', 'WETH'). + * Used for display, logging, and lookup convenience. + */ + symbol: string + + /** + * (Optional) The full human-readable name of the token (e.g. 'Tether USD'). + * Useful for UIs or token metadata enrichment. + */ + name?: string +} \ No newline at end of file diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/types/index.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/types/index.ts new file mode 100644 index 000000000..394199c71 --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/src/types/index.ts @@ -0,0 +1,2 @@ +export * from './TokenParameters.ts' +export * from './TokenPairPoolKey.ts' \ No newline at end of file diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/tsconfig.json b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/tsconfig.json new file mode 100644 index 000000000..5225af9e1 --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/tsconfig.json @@ -0,0 +1,5 @@ +{ + "exclude": ["dist", "docs", "packages", "node_modules"], + "extends": "@xylabs/tsconfig" +} + diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/tsconfig.typedoc.json b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/tsconfig.typedoc.json new file mode 100644 index 000000000..0919ecb67 --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/tsconfig.typedoc.json @@ -0,0 +1,5 @@ +{ + "exclude": ["**/spec/*", "**/*.spec.*", "**/packages/*", "dist"], + "extends": "./tsconfig.json" +} + diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/typedoc.json b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/typedoc.json new file mode 100644 index 000000000..a1ff9f91c --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/typedoc.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://typedoc.org/schema.json", + "entryPoints": ["./src/index.ts"], + "tsconfig": "./tsconfig.typedoc.json" +} \ No newline at end of file diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/xy.config.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/xy.config.ts new file mode 100644 index 000000000..2952c5f9a --- /dev/null +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4/xy.config.ts @@ -0,0 +1,10 @@ +import type { XyTsupConfig } from '@xylabs/ts-scripts-yarn3' +const config: XyTsupConfig = { + compile: { + browser: {}, + node: {}, + neutral: { src: true }, + }, +} + +export default config diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/index.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/index.ts index 25e04e79e..d9e8e55cc 100644 --- a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/index.ts +++ b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/index.ts @@ -1,4 +1,2 @@ -export * from './Config.ts' -export * from './lib/index.ts' -export { UniswapCryptoMarketPlugin as default, UniswapCryptoMarketPlugin } from './Plugin.ts' -export * from './Witness.ts' +export * from "@xyo-network/uniswap-v3-crypto-market-plugin" +export * from "@xyo-network/uniswap-v3-crypto-market-plugin" \ No newline at end of file diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/index.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/index.ts deleted file mode 100644 index 2eb019569..000000000 --- a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './v3/index.ts' -export * from './v4/index.ts' diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/UniswapV4TokenContractIdentifier.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/UniswapV4TokenContractIdentifier.ts deleted file mode 100644 index 72b14baf3..000000000 --- a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/UniswapV4TokenContractIdentifier.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Token } from "@uniswap/sdk-core"; - -export interface UniswapV4TokenContractIdentifier { - tokenA: Token, - tokenB: Token, - fee: number, - hookAddress?: string, -} diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/index.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/index.ts deleted file mode 100644 index ae00149b2..000000000 --- a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './pricesFromUniswap4.ts' \ No newline at end of file diff --git a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/spec/pricesFromUniswap4.spec.ts b/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/spec/pricesFromUniswap4.spec.ts deleted file mode 100644 index b8de0cade..000000000 --- a/packages/payloadset/packages/crypto/packages/market/packages/uniswap/src/lib/v4/spec/pricesFromUniswap4.spec.ts +++ /dev/null @@ -1,20 +0,0 @@ -import '@xylabs/vitest-extended' - -import { getProviderFromEnv } from '@xyo-network/witness-blockchain-abstract' -import { - describe, expect, test, -} from 'vitest' -import { pricesFromUniswap4 } from '../pricesFromUniswap4.ts' -import { Token } from '@uniswap/sdk-core' - -describe.skipIf(!(process.env.INFURA_PROJECT_ID && process.env.INFURA_PROJECT_SECRET))('pricesFromUniswap4', () => { - test('pricesFromUniswap4', async () => { - const provider = getProviderFromEnv() - const tokenA = new Token(1, "0x55296f69f40ea6d20e478533c15a6b08b654e758", 18, 'xyo') - const tokenB = new Token(1, "0xdac17f958d2ee523a2206206994597c13d831ec7", 6, 'usdt') - const tokenContractIdentifier = { tokenA, tokenB, fee: 3000 } - const pairs = await pricesFromUniswap4(tokenContractIdentifier, provider) - expect(pairs).toBeDefined() - // console.dir(pairs, { depth: null }) - }) -}) diff --git a/packages/payloadset/packages/crypto/packages/nft/packages/nft/packages/witness/package.json b/packages/payloadset/packages/crypto/packages/nft/packages/nft/packages/witness/package.json index 163f8833a..b5de9177c 100644 --- a/packages/payloadset/packages/crypto/packages/nft/packages/nft/packages/witness/package.json +++ b/packages/payloadset/packages/crypto/packages/nft/packages/nft/packages/witness/package.json @@ -33,6 +33,7 @@ "@xylabs/axios": "^4.8.7", "@xylabs/eth-address": "^4.8.7", "@xylabs/hex": "^4.8.7", + "@xyo-network/crypto-nft-collection-payload-plugin": "workspace:^", "@xyo-network/crypto-nft-payload-plugin": "workspace:^", "@xyo-network/erc1822-witness": "workspace:^", "@xyo-network/erc1967-witness": "workspace:^", diff --git a/yarn.lock b/yarn.lock index 03d0b395a..87563de56 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4563,6 +4563,7 @@ __metadata: "@xyo-network/archivist-model": "npm:^3.13.0" "@xyo-network/boundwitness-builder": "npm:^3.13.0" "@xyo-network/boundwitness-model": "npm:^3.13.0" + "@xyo-network/crypto-nft-collection-payload-plugin": "workspace:^" "@xyo-network/crypto-nft-payload-plugin": "workspace:^" "@xyo-network/diviner-boundwitness-memory": "npm:^3.13.0" "@xyo-network/diviner-model": "npm:^3.13.0" @@ -7045,6 +7046,27 @@ __metadata: "@xyo-network/uniswap-crypto-market-plugin@workspace:^, @xyo-network/uniswap-crypto-market-plugin@workspace:packages/payloadset/packages/crypto/packages/market/packages/uniswap": version: 0.0.0-use.local resolution: "@xyo-network/uniswap-crypto-market-plugin@workspace:packages/payloadset/packages/crypto/packages/market/packages/uniswap" + dependencies: + "@xylabs/ts-scripts-yarn3": "npm:^6.3.1" + "@xylabs/tsconfig": "npm:^6.3.1" + "@xyo-network/uniswap-v3-crypto-market-plugin": "workspace:^" + "@xyo-network/uniswap-v4-crypto-market-plugin": "workspace:^" + typescript: "npm:^5.8.3" + languageName: unknown + linkType: soft + +"@xyo-network/uniswap-typechain@npm:^3.5.2": + version: 3.5.2 + resolution: "@xyo-network/uniswap-typechain@npm:3.5.2" + dependencies: + ethers: "npm:^6.13.6" + checksum: 10/a42c1b9190af90481d0dee80e2652bcc3afe97250178dfc3ccbf35e5ba38831b97876a11bf9d775103232c147d14c3781585bc4f272495c12ad9bd1647fad80e + languageName: node + linkType: hard + +"@xyo-network/uniswap-v3-crypto-market-plugin@workspace:^, @xyo-network/uniswap-v3-crypto-market-plugin@workspace:packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3": + version: 0.0.0-use.local + resolution: "@xyo-network/uniswap-v3-crypto-market-plugin@workspace:packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v3" dependencies: "@uniswap/sdk-core": "npm:^7.7.2" "@uniswap/v3-sdk": "npm:^3.25.2" @@ -7071,14 +7093,34 @@ __metadata: languageName: unknown linkType: soft -"@xyo-network/uniswap-typechain@npm:^3.5.2": - version: 3.5.2 - resolution: "@xyo-network/uniswap-typechain@npm:3.5.2" +"@xyo-network/uniswap-v4-crypto-market-plugin@workspace:^, @xyo-network/uniswap-v4-crypto-market-plugin@workspace:packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4": + version: 0.0.0-use.local + resolution: "@xyo-network/uniswap-v4-crypto-market-plugin@workspace:packages/payloadset/packages/crypto/packages/market/packages/uniswap/packages/v4" dependencies: + "@uniswap/sdk-core": "npm:^7.7.2" + "@uniswap/v3-sdk": "npm:^3.25.2" + "@xylabs/assert": "npm:^4.8.7" + "@xylabs/delay": "npm:^4.8.7" + "@xylabs/enum": "npm:^4.8.7" + "@xylabs/promise": "npm:^4.8.7" + "@xylabs/ts-scripts-yarn3": "npm:^6.3.1" + "@xylabs/tsconfig": "npm:^6.3.1" + "@xylabs/vitest-extended": "npm:^4.8.7" + "@xyo-network/abstract-witness": "npm:^3.13.0" + "@xyo-network/module-model": "npm:^3.13.0" + "@xyo-network/open-zeppelin-typechain": "npm:^3.5.2" + "@xyo-network/payload-model": "npm:^3.13.0" + "@xyo-network/payload-wrapper": "npm:^3.13.0" + "@xyo-network/payloadset-plugin": "npm:^3.13.0" + "@xyo-network/uniswap-crypto-market-payload-plugin": "workspace:^" + "@xyo-network/uniswap-typechain": "npm:^3.5.2" + "@xyo-network/witness-blockchain-abstract": "npm:^3.13.0" + "@xyo-network/witness-model": "npm:^3.13.0" ethers: "npm:^6.13.6" - checksum: 10/a42c1b9190af90481d0dee80e2652bcc3afe97250178dfc3ccbf35e5ba38831b97876a11bf9d775103232c147d14c3781585bc4f272495c12ad9bd1647fad80e - languageName: node - linkType: hard + typescript: "npm:^5.8.3" + vitest: "npm:^3.1.1" + languageName: unknown + linkType: soft "@xyo-network/url-payload-plugin@workspace:^, @xyo-network/url-payload-plugin@workspace:packages/payload/packages/url": version: 0.0.0-use.local