@varla/sdk 2.13.0 → 2.13.1

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 (37) hide show
  1. package/AGENTS.md +1 -1
  2. package/CHANGELOG.md +6 -0
  3. package/dist/abi/full/VarlaOracle.d.ts +72 -0
  4. package/dist/abi/full/VarlaOracle.d.ts.map +1 -1
  5. package/dist/abi/full/VarlaOracle.js +93 -0
  6. package/dist/abi/full/VarlaOracle.js.map +1 -1
  7. package/dist/abi/subsets/VarlaOracle.registry.d.ts +42 -0
  8. package/dist/abi/subsets/VarlaOracle.registry.d.ts.map +1 -1
  9. package/dist/abi/subsets/VarlaOracle.registry.js +54 -0
  10. package/dist/abi/subsets/VarlaOracle.registry.js.map +1 -1
  11. package/dist/addresses/index.d.ts +1 -1
  12. package/dist/addresses/index.d.ts.map +1 -1
  13. package/dist/addresses/index.js +1 -1
  14. package/dist/addresses/index.js.map +1 -1
  15. package/dist/addresses/polygon.d.ts.map +1 -1
  16. package/dist/addresses/polygon.js +12 -10
  17. package/dist/addresses/polygon.js.map +1 -1
  18. package/dist/addresses/polygonProxy.d.ts +3 -0
  19. package/dist/addresses/polygonProxy.d.ts.map +1 -0
  20. package/dist/addresses/polygonProxy.js +15 -0
  21. package/dist/addresses/polygonProxy.js.map +1 -0
  22. package/dist/contracts.d.ts.map +1 -1
  23. package/dist/contracts.js +9 -15
  24. package/dist/contracts.js.map +1 -1
  25. package/dist/generated.d.ts +115 -1
  26. package/dist/generated.d.ts.map +1 -1
  27. package/dist/generated.js +1 -1
  28. package/dist/generated.js.map +1 -1
  29. package/package.json +1 -1
  30. package/src/abi/full/VarlaOracle.ts +93 -0
  31. package/src/abi/subsets/VarlaOracle.registry.ts +54 -0
  32. package/src/addresses/index.ts +1 -1
  33. package/src/addresses/polygon.json +10 -10
  34. package/src/addresses/polygon.ts +13 -11
  35. package/src/addresses/polygonProxy.ts +18 -0
  36. package/src/contracts.ts +11 -17
  37. package/src/generated.ts +1 -1
@@ -170,6 +170,22 @@ export const VARLAORACLE_ABI = [
170
170
  "name": "InvalidMaxStaleness",
171
171
  "type": "error"
172
172
  },
173
+ {
174
+ "inputs": [
175
+ {
176
+ "internalType": "uint256",
177
+ "name": "value",
178
+ "type": "uint256"
179
+ },
180
+ {
181
+ "internalType": "uint256",
182
+ "name": "floor",
183
+ "type": "uint256"
184
+ }
185
+ ],
186
+ "name": "InvalidMinLiquidity",
187
+ "type": "error"
188
+ },
173
189
  {
174
190
  "inputs": [
175
191
  {
@@ -396,6 +412,25 @@ export const VARLAORACLE_ABI = [
396
412
  "name": "LowLiquidityConfigUpdated",
397
413
  "type": "event"
398
414
  },
415
+ {
416
+ "anonymous": false,
417
+ "inputs": [
418
+ {
419
+ "indexed": false,
420
+ "internalType": "bool",
421
+ "name": "oldValue",
422
+ "type": "bool"
423
+ },
424
+ {
425
+ "indexed": false,
426
+ "internalType": "bool",
427
+ "name": "newValue",
428
+ "type": "bool"
429
+ }
430
+ ],
431
+ "name": "LowLiquidityGraceBlocksLiquidationUpdated",
432
+ "type": "event"
433
+ },
399
434
  {
400
435
  "anonymous": false,
401
436
  "inputs": [
@@ -440,6 +475,25 @@ export const VARLAORACLE_ABI = [
440
475
  "name": "MaxStalenessUpdated",
441
476
  "type": "event"
442
477
  },
478
+ {
479
+ "anonymous": false,
480
+ "inputs": [
481
+ {
482
+ "indexed": false,
483
+ "internalType": "uint256",
484
+ "name": "oldMinLiquidity",
485
+ "type": "uint256"
486
+ },
487
+ {
488
+ "indexed": false,
489
+ "internalType": "uint256",
490
+ "name": "newMinLiquidity",
491
+ "type": "uint256"
492
+ }
493
+ ],
494
+ "name": "MinLiquidityUpdated",
495
+ "type": "event"
496
+ },
443
497
  {
444
498
  "anonymous": false,
445
499
  "inputs": [
@@ -1800,6 +1854,19 @@ export const VARLAORACLE_ABI = [
1800
1854
  "stateMutability": "view",
1801
1855
  "type": "function"
1802
1856
  },
1857
+ {
1858
+ "inputs": [],
1859
+ "name": "lowLiquidityGraceBlocksLiquidation",
1860
+ "outputs": [
1861
+ {
1862
+ "internalType": "bool",
1863
+ "name": "",
1864
+ "type": "bool"
1865
+ }
1866
+ ],
1867
+ "stateMutability": "view",
1868
+ "type": "function"
1869
+ },
1803
1870
  {
1804
1871
  "inputs": [],
1805
1872
  "name": "maxStaleness",
@@ -1929,6 +1996,19 @@ export const VARLAORACLE_ABI = [
1929
1996
  "stateMutability": "nonpayable",
1930
1997
  "type": "function"
1931
1998
  },
1999
+ {
2000
+ "inputs": [
2001
+ {
2002
+ "internalType": "bool",
2003
+ "name": "shouldBlock",
2004
+ "type": "bool"
2005
+ }
2006
+ ],
2007
+ "name": "setLowLiquidityGraceBlocksLiquidation",
2008
+ "outputs": [],
2009
+ "stateMutability": "nonpayable",
2010
+ "type": "function"
2011
+ },
1932
2012
  {
1933
2013
  "inputs": [
1934
2014
  {
@@ -1942,6 +2022,19 @@ export const VARLAORACLE_ABI = [
1942
2022
  "stateMutability": "nonpayable",
1943
2023
  "type": "function"
1944
2024
  },
2025
+ {
2026
+ "inputs": [
2027
+ {
2028
+ "internalType": "uint256",
2029
+ "name": "newMinLiquidity",
2030
+ "type": "uint256"
2031
+ }
2032
+ ],
2033
+ "name": "setMinLiquidity",
2034
+ "outputs": [],
2035
+ "stateMutability": "nonpayable",
2036
+ "type": "function"
2037
+ },
1945
2038
  {
1946
2039
  "inputs": [
1947
2040
  {
@@ -170,6 +170,22 @@ export const VARLAORACLE_ABI_REGISTRY = [
170
170
  "name": "InvalidMaxStaleness",
171
171
  "type": "error"
172
172
  },
173
+ {
174
+ "inputs": [
175
+ {
176
+ "internalType": "uint256",
177
+ "name": "value",
178
+ "type": "uint256"
179
+ },
180
+ {
181
+ "internalType": "uint256",
182
+ "name": "floor",
183
+ "type": "uint256"
184
+ }
185
+ ],
186
+ "name": "InvalidMinLiquidity",
187
+ "type": "error"
188
+ },
173
189
  {
174
190
  "inputs": [
175
191
  {
@@ -396,6 +412,25 @@ export const VARLAORACLE_ABI_REGISTRY = [
396
412
  "name": "LowLiquidityConfigUpdated",
397
413
  "type": "event"
398
414
  },
415
+ {
416
+ "anonymous": false,
417
+ "inputs": [
418
+ {
419
+ "indexed": false,
420
+ "internalType": "bool",
421
+ "name": "oldValue",
422
+ "type": "bool"
423
+ },
424
+ {
425
+ "indexed": false,
426
+ "internalType": "bool",
427
+ "name": "newValue",
428
+ "type": "bool"
429
+ }
430
+ ],
431
+ "name": "LowLiquidityGraceBlocksLiquidationUpdated",
432
+ "type": "event"
433
+ },
399
434
  {
400
435
  "anonymous": false,
401
436
  "inputs": [
@@ -440,6 +475,25 @@ export const VARLAORACLE_ABI_REGISTRY = [
440
475
  "name": "MaxStalenessUpdated",
441
476
  "type": "event"
442
477
  },
478
+ {
479
+ "anonymous": false,
480
+ "inputs": [
481
+ {
482
+ "indexed": false,
483
+ "internalType": "uint256",
484
+ "name": "oldMinLiquidity",
485
+ "type": "uint256"
486
+ },
487
+ {
488
+ "indexed": false,
489
+ "internalType": "uint256",
490
+ "name": "newMinLiquidity",
491
+ "type": "uint256"
492
+ }
493
+ ],
494
+ "name": "MinLiquidityUpdated",
495
+ "type": "event"
496
+ },
443
497
  {
444
498
  "anonymous": false,
445
499
  "inputs": [
@@ -2,5 +2,5 @@
2
2
  // Do not edit manually.
3
3
 
4
4
  export * from "./polygon.js";
5
- export * from "./bsc.js";
5
+ export * from "./polygonProxy.js";
6
6
 
@@ -3,15 +3,15 @@
3
3
  "generatedAt": "",
4
4
  "deploymentsDir": "polygon",
5
5
  "contracts": {
6
- "VarlaAccessManager": "0x5CdDC155463929961Efa5d2F591E322eC747f10F",
7
- "VarlaOracle": "0xcd0FEd1962e8cE1579bC36F1Bd13174B32648770",
8
- "VarlaCore": "0x182796B1d17a75E8a65005371d3D529c1277e003",
9
- "VarlaPool": "0xBaF1f2cfe38373198c4f7c4db3C208Aab0DeF8B0",
10
- "OracleUpdaterRouter": "0x00Db61AfC2242b1fb7fcB91307f34bB1E3d3BfBe",
11
- "VarlaLiquidator": "0x033F0ede074330ceC7Ff513D3C02cB26A6F56F7b",
12
- "VarlaMergeLiquidator": "0xf07816374Fd0c626Db1F12642547a640C95E4CDC",
13
- "VarlaConvertLiquidator": "0xD3Ee3e685AeA47819B087df6277f66baaF9F0Ed5",
14
- "PolymarketCtfAdapter": "0x689968baC7A21Ca88867beb277CB29794C530259",
15
- "PolymarketNegRiskMergeAdapter": "0xaD595Fc654a14C0dd037427623ac3b4Ff80E5D12"
6
+ "VarlaAccessManager": "0xEAC5659248A4f4c8440961874FA7994c6B821ad0",
7
+ "VarlaOracle": "0x6D6d16860c9366a97AbC02402cFe7988F9c20a8d",
8
+ "VarlaCore": "0x79870b76C01900e53a909b1F77d2CF3f1935c5D8",
9
+ "VarlaPool": "0xf1d4be6c15b6F7Fb66CE2C85368d26a603eb3cC0",
10
+ "OracleUpdaterRouter": "0xd98799d440034CeC1CE41c8495cdeF0dA18951C1",
11
+ "VarlaLiquidator": "0xD570aeFD9C54f816a53786ed1888fE4A03be359A",
12
+ "VarlaMergeLiquidator": "0x71becFD9AC3aeE3F3BD24A8518022147Efc18b4d",
13
+ "VarlaConvertLiquidator": "0x842905cA77B50eCDf2D890516fCD7E9A324B44e9",
14
+ "PolymarketCtfAdapter": "0x3bd6570DB3f6D6965F78399817678950d6eC6e4C",
15
+ "PolymarketNegRiskMergeAdapter": "0x424886B053D1eED5FE98A94988CFC8CA28c7C0A7"
16
16
  }
17
17
  }
@@ -1,16 +1,18 @@
1
- // Auto-generated from varla-protocol deployments/polygon
1
+ // Auto-generated from varla-protocol deployments/polygon (immutable)
2
2
  import type { AddressBook } from "../types";
3
3
 
4
4
  export const polygon: AddressBook = {
5
- accessManager: "0x5CdDC155463929961Efa5d2F591E322eC747f10F",
6
- oracle: "0xcd0FEd1962e8cE1579bC36F1Bd13174B32648770",
7
- core: "0x182796B1d17a75E8a65005371d3D529c1277e003",
8
- pool: "0xBaF1f2cfe38373198c4f7c4db3C208Aab0DeF8B0",
9
- oracleUpdaterRouter: "0x00Db61AfC2242b1fb7fcB91307f34bB1E3d3BfBe",
10
- liquidator: "0x033F0ede074330ceC7Ff513D3C02cB26A6F56F7b",
11
- mergeLiquidator: "0xf07816374Fd0c626Db1F12642547a640C95E4CDC",
12
- convertLiquidator: "0xD3Ee3e685AeA47819B087df6277f66baaF9F0Ed5",
13
- polymarketCtfAdapter: "0x689968baC7A21Ca88867beb277CB29794C530259",
14
- negRiskMergeAdapter: "0xaD595Fc654a14C0dd037427623ac3b4Ff80E5D12",
5
+ accessManager: "0xEAC5659248A4f4c8440961874FA7994c6B821ad0",
6
+ oracle: "0x6D6d16860c9366a97AbC02402cFe7988F9c20a8d",
7
+ core: "0x79870b76C01900e53a909b1F77d2CF3f1935c5D8",
8
+ pool: "0xf1d4be6c15b6F7Fb66CE2C85368d26a603eb3cC0",
9
+ oracleUpdaterRouter: "0xd98799d440034CeC1CE41c8495cdeF0dA18951C1",
10
+ interestRateStrategy: "0x6eE2F00463632476614a01332aD490c87978fa1d",
11
+ proxyAdmin: "0xf42B3A7E9850DF4D6Ea0a58CF72C531b3B479aAB",
12
+ liquidator: "0xD570aeFD9C54f816a53786ed1888fE4A03be359A",
13
+ mergeLiquidator: "0x71becFD9AC3aeE3F3BD24A8518022147Efc18b4d",
14
+ convertLiquidator: "0x842905cA77B50eCDf2D890516fCD7E9A324B44e9",
15
+ polymarketCtfAdapter: "0x3bd6570DB3f6D6965F78399817678950d6eC6e4C",
16
+ negRiskMergeAdapter: "0x424886B053D1eED5FE98A94988CFC8CA28c7C0A7",
15
17
  };
16
18
 
@@ -0,0 +1,18 @@
1
+ // Auto-generated from varla-protocol deployments/polygon (proxy)
2
+ import type { AddressBook } from "../types";
3
+
4
+ export const polygonProxy: AddressBook = {
5
+ accessManager: "0xEAC5659248A4f4c8440961874FA7994c6B821ad0",
6
+ oracle: "0x1021A3B50F824873D96Ef126e4622cFFcD8d59bc",
7
+ core: "0x336A935210b39E01aC296f211274492caF013F77",
8
+ pool: "0x990DA16Fb01186C5Ffc3f185ff07c126C6705d76",
9
+ oracleUpdaterRouter: "0xd98799d440034CeC1CE41c8495cdeF0dA18951C1",
10
+ interestRateStrategy: "0x2C1D739947F1DD4F1E683f9e98F8c7B3d4a31464",
11
+ proxyAdmin: "0xf42B3A7E9850DF4D6Ea0a58CF72C531b3B479aAB",
12
+ liquidator: "0xDb94015Dd6304d86c637b218a867D15F49c3cC9b",
13
+ mergeLiquidator: "0xaCc7f056B0b9FEF713c5F317Bb65Fe660b3e1b2a",
14
+ convertLiquidator: "0x4d175bCCc5400Aca8b2d9E8c6c0aF179607fB935",
15
+ polymarketCtfAdapter: "0x3bd6570DB3f6D6965F78399817678950d6eC6e4C",
16
+ negRiskMergeAdapter: "0x424886B053D1eED5FE98A94988CFC8CA28c7C0A7",
17
+ };
18
+
package/src/contracts.ts CHANGED
@@ -66,24 +66,18 @@ export type GetVarlaContractsParams = {
66
66
  export function getAddressBook(chain: ChainKey, mode?: DeployMode): AddressBook {
67
67
  const m = mode ?? "immutable";
68
68
 
69
- if (m === "proxy") {
70
- const proxyKey = `${chain}Proxy` as keyof typeof addresses;
71
- const book = addresses[proxyKey];
72
- if (!book) {
73
- throw new Error(
74
- `No proxy deployment found for chain '${chain}'. ` +
75
- `Run the deploy with DEPLOY_MODE=proxy and regenerate SDK artifacts.`,
76
- );
77
- }
78
- return book;
69
+ const key = m === "proxy" ? `${chain}Proxy` : chain;
70
+ const book = (addresses as Record<string, AddressBook | undefined>)[key];
71
+ if (!book) {
72
+ throw new Error(
73
+ m === "proxy"
74
+ ? `No proxy deployment found for chain '${chain}'. ` +
75
+ `Run the deploy with DEPLOY_MODE=proxy and regenerate SDK artifacts.`
76
+ : `No deployment found for chain '${chain}'. ` +
77
+ `Deploy the chain and run \`bun run prepack\` to regenerate SDK artifacts.`,
78
+ );
79
79
  }
80
-
81
- if (chain === "polygon") return addresses.polygon;
82
- if (chain === "bsc") return addresses.bsc;
83
-
84
- // TypeScript should make this unreachable, but keep a runtime guard.
85
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
86
- throw new Error(`Unsupported chain key: ${chain as string}`);
80
+ return book;
87
81
  }
88
82
 
89
83
  function mustAddress(book: AddressBook, key: keyof AddressBook): Address {
package/src/generated.ts CHANGED
@@ -24,6 +24,6 @@ export const abis = {
24
24
 
25
25
  export const addresses = {
26
26
  polygon: addresses_.polygon,
27
- bsc: addresses_.bsc,
27
+ polygonProxy: addresses_.polygonProxy,
28
28
  } as const;
29
29