@xyo-network/uniswap-v4-crypto-market-plugin 4.0.0 → 4.1.0

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.
Files changed (44) hide show
  1. package/dist/neutral/index.d.ts +82 -0
  2. package/dist/neutral/lib/spec/priceFromUniswapV4.spec.d.ts +2 -0
  3. package/dist/neutral/lib/spec/priceFromUniswapV4.spec.d.ts.map +1 -0
  4. package/dist/neutral/spec/Plugin.spec.d.ts +2 -0
  5. package/dist/neutral/spec/Plugin.spec.d.ts.map +1 -0
  6. package/dist/neutral/spec/Witness.spec.d.ts +2 -0
  7. package/dist/neutral/spec/Witness.spec.d.ts.map +1 -0
  8. package/package.json +15 -15
  9. package/dist/types/index.d.ts +0 -5
  10. /package/dist/{types → neutral}/Config.d.ts +0 -0
  11. /package/dist/{types → neutral}/Config.d.ts.map +0 -0
  12. /package/dist/{types → neutral}/Plugin.d.ts +0 -0
  13. /package/dist/{types → neutral}/Plugin.d.ts.map +0 -0
  14. /package/dist/{types → neutral}/Witness.d.ts +0 -0
  15. /package/dist/{types → neutral}/Witness.d.ts.map +0 -0
  16. /package/dist/{types → neutral}/index.d.ts.map +0 -0
  17. /package/dist/{types → neutral}/lib/UniswapV4ContractAddresses.d.ts +0 -0
  18. /package/dist/{types → neutral}/lib/UniswapV4ContractAddresses.d.ts.map +0 -0
  19. /package/dist/{types → neutral}/lib/UniswapV4DefaultPools.d.ts +0 -0
  20. /package/dist/{types → neutral}/lib/UniswapV4DefaultPools.d.ts.map +0 -0
  21. /package/dist/{types → neutral}/lib/UniswapV4TokenIdentifier.d.ts +0 -0
  22. /package/dist/{types → neutral}/lib/UniswapV4TokenIdentifier.d.ts.map +0 -0
  23. /package/dist/{types → neutral}/lib/getExchangeRate.d.ts +0 -0
  24. /package/dist/{types → neutral}/lib/getExchangeRate.d.ts.map +0 -0
  25. /package/dist/{types → neutral}/lib/getPoolId.d.ts +0 -0
  26. /package/dist/{types → neutral}/lib/getPoolId.d.ts.map +0 -0
  27. /package/dist/{types → neutral}/lib/getPriceFromSqrtX96.d.ts +0 -0
  28. /package/dist/{types → neutral}/lib/getPriceFromSqrtX96.d.ts.map +0 -0
  29. /package/dist/{types → neutral}/lib/index.d.ts +0 -0
  30. /package/dist/{types → neutral}/lib/index.d.ts.map +0 -0
  31. /package/dist/{types → neutral}/lib/priceFromUniswapV4.d.ts +0 -0
  32. /package/dist/{types → neutral}/lib/priceFromUniswapV4.d.ts.map +0 -0
  33. /package/dist/{types → neutral}/lib/pricesFromUniswapV4.d.ts +0 -0
  34. /package/dist/{types → neutral}/lib/pricesFromUniswapV4.d.ts.map +0 -0
  35. /package/dist/{types → neutral}/lib/sortTokens.d.ts +0 -0
  36. /package/dist/{types → neutral}/lib/sortTokens.d.ts.map +0 -0
  37. /package/dist/{types → neutral}/lib/tokenRegistryValueToToken.d.ts +0 -0
  38. /package/dist/{types → neutral}/lib/tokenRegistryValueToToken.d.ts.map +0 -0
  39. /package/dist/{types → neutral}/types/TokenPairPoolKey.d.ts +0 -0
  40. /package/dist/{types → neutral}/types/TokenPairPoolKey.d.ts.map +0 -0
  41. /package/dist/{types → neutral}/types/TokenParameters.d.ts +0 -0
  42. /package/dist/{types → neutral}/types/TokenParameters.d.ts.map +0 -0
  43. /package/dist/{types → neutral}/types/index.d.ts +0 -0
  44. /package/dist/{types → neutral}/types/index.d.ts.map +0 -0
@@ -0,0 +1,82 @@
1
+ import { UniswapV4CryptoMarketWitnessConfigSchema, UniswapCryptoPair } from '@xyo-network/uniswap-crypto-market-payload-plugin';
2
+ import { WitnessConfig, WitnessParams } from '@xyo-network/witness-model';
3
+ import { Provider } from 'ethers';
4
+ import { Token } from '@uniswap/sdk-core';
5
+ import * as _xyo_network_payloadset_plugin from '@xyo-network/payloadset-plugin';
6
+ import { AbstractWitness } from '@xyo-network/abstract-witness';
7
+ import { AnyConfigSchema } from '@xyo-network/module-model';
8
+ import { Schema, Payload } from '@xyo-network/payload-model';
9
+
10
+ /**
11
+ * Represents the minimal metadata required to define an ERC-20 token
12
+ * in the context of Uniswap pool interactions, token registries, or
13
+ * off-chain utilities.
14
+ *
15
+ * This structure is designed to be lightweight but expressive enough
16
+ * to support pool ID generation, token sorting, and on-chain lookups.
17
+ */
18
+ type TokenParameters = {
19
+ /**
20
+ * The Ethereum address of the token contract.
21
+ */
22
+ address: string;
23
+ /**
24
+ * The chain ID where this token is deployed.
25
+ * This enables multi-chain compatibility and avoids collisions between
26
+ * tokens with the same address on different networks (e.g. mainnet vs testnet).
27
+ */
28
+ chainId: number;
29
+ /**
30
+ * The number of decimals used by the token.
31
+ * This is required for correct price calculations and amount formatting.
32
+ */
33
+ decimals: number;
34
+ /**
35
+ * A short uppercase identifier for the token (e.g. 'USDT', 'WETH').
36
+ * Used for display, logging, and lookup convenience.
37
+ */
38
+ symbol: string;
39
+ /**
40
+ * (Optional) The full human-readable name of the token (e.g. 'Tether USD').
41
+ * Useful for UIs or token metadata enrichment.
42
+ */
43
+ name?: string;
44
+ };
45
+
46
+ type TokenPairPoolKey = {
47
+ fee: number;
48
+ hookAddress: string;
49
+ tickSpacing: number;
50
+ tokens: [TokenParameters, TokenParameters];
51
+ };
52
+
53
+ type UniswapV4CryptoMarketWitnessConfig = WitnessConfig<{
54
+ poolKeys?: TokenPairPoolKey[];
55
+ schema: UniswapV4CryptoMarketWitnessConfigSchema;
56
+ }>;
57
+
58
+ declare const priceFromUniswapV4: (poolId: TokenPairPoolKey, provider: Provider) => Promise<UniswapCryptoPair>;
59
+
60
+ declare const pricesFromUniswapV4: (poolId: TokenPairPoolKey[], provider: Provider) => Promise<UniswapCryptoPair[]>;
61
+
62
+ declare const tokenRegistryValueToToken: (value: TokenParameters) => Token;
63
+
64
+ declare const TokenRegistry: Record<string, TokenParameters>;
65
+ declare const UniswapV4DefaultPools: Record<string, TokenPairPoolKey>;
66
+
67
+ interface UniswapV4CryptoMarketWitnessParams extends WitnessParams<AnyConfigSchema<UniswapV4CryptoMarketWitnessConfig>> {
68
+ provider?: Provider;
69
+ }
70
+ declare class UniswapV4CryptoMarketWitness<TParams extends UniswapV4CryptoMarketWitnessParams = UniswapV4CryptoMarketWitnessParams> extends AbstractWitness<TParams> {
71
+ static readonly configSchemas: Schema[];
72
+ static readonly defaultConfigSchema: Schema;
73
+ protected get pools(): TokenPairPoolKey[];
74
+ protected get provider(): Provider;
75
+ protected observeHandler(): Promise<Payload[]>;
76
+ protected startHandler(): Promise<void>;
77
+ }
78
+
79
+ declare const UniswapV4CryptoMarketPlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<UniswapV4CryptoMarketWitness<UniswapV4CryptoMarketWitnessParams>>;
80
+
81
+ export { TokenRegistry, UniswapV4CryptoMarketPlugin, UniswapV4CryptoMarketWitness, UniswapV4DefaultPools, UniswapV4CryptoMarketPlugin as default, priceFromUniswapV4, pricesFromUniswapV4, tokenRegistryValueToToken };
82
+ export type { UniswapV4CryptoMarketWitnessConfig, UniswapV4CryptoMarketWitnessParams };
@@ -0,0 +1,2 @@
1
+ import '@xylabs/vitest-extended';
2
+ //# sourceMappingURL=priceFromUniswapV4.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"priceFromUniswapV4.spec.d.ts","sourceRoot":"","sources":["../../../../src/lib/spec/priceFromUniswapV4.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
@@ -0,0 +1,2 @@
1
+ import '@xylabs/vitest-extended';
2
+ //# sourceMappingURL=Plugin.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Plugin.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Plugin.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
@@ -0,0 +1,2 @@
1
+ import '@xylabs/vitest-extended';
2
+ //# sourceMappingURL=Witness.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Witness.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/Witness.spec.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/uniswap-v4-crypto-market-plugin",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -21,31 +21,31 @@
21
21
  "type": "module",
22
22
  "exports": {
23
23
  ".": {
24
- "types": "./dist/types/index.d.ts",
24
+ "types": "./dist/neutral/index.d.ts",
25
25
  "default": "./dist/neutral/index.mjs"
26
26
  },
27
27
  "./package.json": "./package.json"
28
28
  },
29
29
  "module": "dist/neutral/index.mjs",
30
- "types": "dist/types/index.d.ts",
30
+ "types": "dist/neutral/index.d.ts",
31
31
  "dependencies": {
32
32
  "@uniswap/sdk-core": "^7.7.2",
33
- "@xylabs/assert": "^4.12.31",
34
- "@xyo-network/abstract-witness": "^4.0.1",
35
- "@xyo-network/module-model": "^4.0.1",
36
- "@xyo-network/payload-model": "^4.0.1",
37
- "@xyo-network/payloadset-plugin": "^4.0.1",
38
- "@xyo-network/uniswap-crypto-market-payload-plugin": "^4.0.0",
33
+ "@xylabs/assert": "^4.13.15",
34
+ "@xyo-network/abstract-witness": "^4.1.1",
35
+ "@xyo-network/module-model": "^4.1.1",
36
+ "@xyo-network/payload-model": "^4.1.1",
37
+ "@xyo-network/payloadset-plugin": "^4.1.1",
38
+ "@xyo-network/uniswap-crypto-market-payload-plugin": "^4.1.0",
39
39
  "@xyo-network/uniswap-typechain": "^3.5.4",
40
- "@xyo-network/witness-model": "^4.0.1",
40
+ "@xyo-network/witness-model": "^4.1.1",
41
41
  "ethers": "^6.15.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@xylabs/ts-scripts-yarn3": "^6.5.12",
45
- "@xylabs/tsconfig": "^6.5.12",
46
- "@xylabs/vitest-extended": "^4.12.31",
47
- "@xyo-network/payload-wrapper": "^4.0.1",
48
- "@xyo-network/witness-blockchain-abstract": "^4.0.1",
44
+ "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.24",
45
+ "@xylabs/tsconfig": "^7.0.0-rc.24",
46
+ "@xylabs/vitest-extended": "^4.13.15",
47
+ "@xyo-network/payload-wrapper": "^4.1.1",
48
+ "@xyo-network/witness-blockchain-abstract": "^4.1.1",
49
49
  "knip": "^5.61.3",
50
50
  "typescript": "^5.8.3",
51
51
  "vitest": "^3.2.4"
@@ -1,5 +0,0 @@
1
- export * from './Config.ts';
2
- export * from './lib/index.ts';
3
- export { UniswapV4CryptoMarketPlugin as default, UniswapV4CryptoMarketPlugin } from './Plugin.ts';
4
- export * from './Witness.ts';
5
- //# sourceMappingURL=index.d.ts.map
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes