zo-sdk 0.1.26 → 0.1.28

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 (36) hide show
  1. package/dist/consts/deployments-slp-mainnet.json +1 -1
  2. package/dist/consts/deployments-usdz-mainnet.json +11 -31
  3. package/dist/consts/deployments-zlp-mainnet.json +1 -1
  4. package/dist/implementations/SLPDataAPI.cjs +4 -2
  5. package/dist/implementations/SLPDataAPI.cjs.map +1 -1
  6. package/dist/implementations/SLPDataAPI.d.cts.map +1 -1
  7. package/dist/implementations/SLPDataAPI.d.mts.map +1 -1
  8. package/dist/implementations/SLPDataAPI.mjs +4 -2
  9. package/dist/implementations/SLPDataAPI.mjs.map +1 -1
  10. package/dist/implementations/USDZDataAPI.cjs +3 -1
  11. package/dist/implementations/USDZDataAPI.cjs.map +1 -1
  12. package/dist/implementations/USDZDataAPI.d.cts.map +1 -1
  13. package/dist/implementations/USDZDataAPI.d.mts.map +1 -1
  14. package/dist/implementations/USDZDataAPI.mjs +3 -1
  15. package/dist/implementations/USDZDataAPI.mjs.map +1 -1
  16. package/dist/implementations/ZBTCVCDataAPI.cjs +4 -1
  17. package/dist/implementations/ZBTCVCDataAPI.cjs.map +1 -1
  18. package/dist/implementations/ZBTCVCDataAPI.d.cts.map +1 -1
  19. package/dist/implementations/ZBTCVCDataAPI.d.mts.map +1 -1
  20. package/dist/implementations/ZBTCVCDataAPI.mjs +4 -1
  21. package/dist/implementations/ZBTCVCDataAPI.mjs.map +1 -1
  22. package/dist/implementations/ZLPDataAPI.cjs +4 -1
  23. package/dist/implementations/ZLPDataAPI.cjs.map +1 -1
  24. package/dist/implementations/ZLPDataAPI.d.cts.map +1 -1
  25. package/dist/implementations/ZLPDataAPI.d.mts.map +1 -1
  26. package/dist/implementations/ZLPDataAPI.mjs +4 -1
  27. package/dist/implementations/ZLPDataAPI.mjs.map +1 -1
  28. package/package.json +9 -9
  29. package/src/consts/deployments-shared-mainnet.json +1 -1
  30. package/src/consts/deployments-slp-testnet.json +1 -1
  31. package/src/consts/deployments-usdz-mainnet.json +12 -32
  32. package/src/consts/deployments-zlp-mainnet.json +2 -2
  33. package/src/implementations/SLPDataAPI.ts +9 -4
  34. package/src/implementations/USDZDataAPI.ts +8 -3
  35. package/src/implementations/ZBTCVCDataAPI.ts +9 -3
  36. package/src/implementations/ZLPDataAPI.ts +9 -3
@@ -106,4 +106,4 @@
106
106
  "admin_cap": "0x6bf5c1431421fabc3ba05bba3b33e3b237034bd65b9e21885337c55ddc4c3f42",
107
107
  "pool": "0x08be6e8ec6c6b1d60ea31a157b5611eb0818d189e83f247fd117af0491e2c2ec"
108
108
  }
109
- }
109
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "zo_core": {
3
3
  "package": "0x7fd8aba1652c58b6397c799fd375e748e5053145cb7e126d303e0a1545fd1fec",
4
- "upgraded_package": "0x93f66649a5c82835a8d8628ad88a85a2d67fd49d044ef6144bf7d8621da77dfd",
4
+ "upgraded_package": "0x2efc671e41a1bc2d251de78800691537b0526f829045e874eac1d6e9a7e84db6",
5
5
  "upgrade_cap": "0x2f67d379d3b9e256a9c4079de50f4bd336dcbda1bd90d1fcd61a9cc1dc369d69",
6
6
  "admin_cap": "0x63af8e78701327be98e0c44967389148c374f4ea7c7cf8acf64957b705ffd02d",
7
7
  "market": "0x3310c794d0bbc4b0421d2fedc74fbd5a028b09fe4d396cd5458786f4c52fa636",
@@ -20,72 +20,52 @@
20
20
  },
21
21
  "symbols": {
22
22
  "long_sui": {
23
- "supported_collaterals": [
24
- "nusdc"
25
- ],
23
+ "supported_collaterals": ["nusdc"],
26
24
  "funding_fee_model": "0x23267c3d23e60eb1a574e979cc3b24f0c1aa88079a37598e81925d1f8f14d648",
27
25
  "position_config": "0xd6db43851591a5b6113204805dfeb10d77bb2f44bb25aa2cfc093ce096e0f070"
28
26
  },
29
27
  "short_sui": {
30
- "supported_collaterals": [
31
- "nusdc"
32
- ],
28
+ "supported_collaterals": ["nusdc"],
33
29
  "funding_fee_model": "0x67edfd197121f4b07aeeaa38b78806ba6567c1affb7af6c28ebc2cb4e8f43d47",
34
30
  "position_config": "0x2a991952d39a4e82d8f0435f5b7125feea87dc8348125f221774fa21e1818088"
35
31
  },
36
32
  "long_btc": {
37
- "supported_collaterals": [
38
- "nusdc"
39
- ],
33
+ "supported_collaterals": ["nusdc"],
40
34
  "funding_fee_model": "0x4e85e90f9f32d0c5ba932fd64db8c4a8c379ab973310961ccab94f449eee7e40",
41
35
  "position_config": "0xdd865bfc98ce4d6f55e8407f67cb23582e8c033d8b4b7bf8acc897f23dc8c50f"
42
36
  },
43
37
  "short_btc": {
44
- "supported_collaterals": [
45
- "nusdc"
46
- ],
38
+ "supported_collaterals": ["nusdc"],
47
39
  "funding_fee_model": "0xb5f85180baedc61fe9cbc9cb2318f03615941ba8a0b487b15382d8bb2bc12f09",
48
40
  "position_config": "0xf927e26f9c1205252f0a267e63a344adb2af4218bde52d7866a2b0540618fb70"
49
41
  },
50
42
  "long_xrp": {
51
- "supported_collaterals": [
52
- "nusdc"
53
- ],
43
+ "supported_collaterals": ["nusdc"],
54
44
  "funding_fee_model": "0xa41f73c98046707dd7c2a9d5dff5d6ce31eb7daa65accc0c67ae0cb1e7a3bf30",
55
45
  "position_config": "0xd157fd40d016c50d9494744937e35aa34be805f3dd3cd89aeba1c0d772fcf762"
56
46
  },
57
47
  "short_xrp": {
58
- "supported_collaterals": [
59
- "nusdc"
60
- ],
48
+ "supported_collaterals": ["nusdc"],
61
49
  "funding_fee_model": "0xc2be41515db4ef64c317a105d701f254e9f289ce9c1af0c8ccfa30397c319283",
62
50
  "position_config": "0x1337dda7dc5cf86fec6e89749c01f736c3d032317620f7f49746062c56a2d410"
63
51
  },
64
52
  "long_eth": {
65
- "supported_collaterals": [
66
- "nusdc"
67
- ],
53
+ "supported_collaterals": ["nusdc"],
68
54
  "funding_fee_model": "0x9710b35f31f6cf6c4a4393d6f7bdff7583cd685e27c30ef7e635b7077e422b85",
69
55
  "position_config": "0x8f0dd8f9f1831c72962652feeba61d28c4dfb0e68d62d74731787e33c606ff44"
70
56
  },
71
57
  "short_eth": {
72
- "supported_collaterals": [
73
- "nusdc"
74
- ],
58
+ "supported_collaterals": ["nusdc"],
75
59
  "funding_fee_model": "0x79d8ba118acf62db188dfdd5960dff262ed2b1ea1f1cfd38b6a41e10064779fd",
76
60
  "position_config": "0x235a35cccc4eb265b53296883d50ad5bff62d93b36092207bb2abb20aad8605a"
77
61
  },
78
62
  "long_sol": {
79
- "supported_collaterals": [
80
- "nusdc"
81
- ],
63
+ "supported_collaterals": ["nusdc"],
82
64
  "funding_fee_model": "0x980f2f29c144ed4dd0fae2ce2c4755c9b9ff8b642b594bfae331686c56b2dc2a",
83
65
  "position_config": "0x3465448bedeeccaf128e80fa26dc8954dcc6df5be91db8b848aa4d2c1c8dde10"
84
66
  },
85
67
  "short_sol": {
86
- "supported_collaterals": [
87
- "nusdc"
88
- ],
68
+ "supported_collaterals": ["nusdc"],
89
69
  "funding_fee_model": "0x7ee95a8538e7d840da05ef29e346fd20f2b2899ec6f9c5003e13d40813d7544a",
90
70
  "position_config": "0xeeade97837afe6af686d1710df71a301c2527e2498aecf843a9535ffb312e650"
91
71
  }
@@ -281,4 +261,4 @@
281
261
  "admin_cap": "0xe339faca7f7558bdf8256e7174d0543e5db99befcd0e5b9bef9c421cecabc195",
282
262
  "acl_control": "0x2de40211db8cc6aac0fe01acd8ea53943a577fa9ce13e0419ef1b821b75c8b9b"
283
263
  }
284
- }
264
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "zo_core": {
3
3
  "package": "0xf7fade57462e56e2eff1d7adef32e4fd285b21fd81f983f407bb7110ca766cda",
4
- "upgraded_package": "0x25a1d518373e465f1bff4c4ab069e160f9c30da9d9a2cb5a17f5bd645ab62ea4",
4
+ "upgraded_package": "0x3b3ecf771bf0c194d93e3812566769f24376b07fe8130f0b5c193705271ef5e8",
5
5
  "upgrade_cap": "0xcc96f78abe0b868afaab05954ccc6357afb5d379a21389d6eb88dda8b1f60052",
6
6
  "admin_cap": "0xbc10f6481f2b5d6185c73ee680aa90a60fe3854d9f638e00f7e00d3b6a88e2b8",
7
7
  "market": "0x35c667bd8c401036103992791a924f31df0d104256a9e2313acee5b1bcf05b7e",
@@ -766,4 +766,4 @@
766
766
  }
767
767
  }
768
768
  }
769
- }
769
+ }
@@ -517,9 +517,14 @@ export class SLPDataAPI extends BaseDataAPI implements ISLPDataAPI {
517
517
 
518
518
  const pool = await this.getStakePoolV2()
519
519
 
520
- const credentials = rawCredentialsData.map((item: any) =>
521
- SLPDataAPI.parseCredential(item, pool),
522
- )
520
+ const credentials = rawCredentialsData
521
+ .filter(
522
+ (item: any) =>
523
+ item.data.type ===
524
+ `${this.sharedConfig.zoStaking.package}::pool::Credential<${this.consts.sudoCore.package}::slp::SLP, ${this.consts.sudoCore.package}::slp::SLP>`
525
+ ).map((item: any) =>
526
+ SLPDataAPI.parseCredential(item, pool),
527
+ )
523
528
  return {
524
529
  credentials,
525
530
  amount: credentials.reduce(
@@ -1274,7 +1279,7 @@ export class SLPDataAPI extends BaseDataAPI implements ISLPDataAPI {
1274
1279
  }
1275
1280
 
1276
1281
  // Use appropriate refresh method based on version
1277
- if (isNewVersion && pool.rewardRate) {
1282
+ if (isNewVersion) {
1278
1283
  SLPDataAPI.refreshPoolV2(pool, Math.floor(Date.now() / 1000))
1279
1284
  } else {
1280
1285
  SLPDataAPI.refreshPool(pool, Math.floor(Date.now() / 1000))
@@ -76,9 +76,14 @@ export class USDZDataAPI extends BaseDataAPI implements IUSDZDataAPI {
76
76
 
77
77
  const pool = await this.getStakePool()
78
78
 
79
- const credentials = rawCredentialsData.map((item: any) =>
80
- USDZDataAPI.parseCredential(item, pool),
81
- )
79
+ const credentials = rawCredentialsData
80
+ .filter(
81
+ (item: any) =>
82
+ item.data.type ===
83
+ `${this.sharedConfig.zoStaking.package}::pool::Credential<${this.consts.zoCore.package}::usdz::USDZ, 0x2::sui::SUI>`
84
+ ).map((item: any) =>
85
+ USDZDataAPI.parseCredential(item, pool),
86
+ )
82
87
  return {
83
88
  credentials,
84
89
  amount: credentials.reduce(
@@ -76,9 +76,15 @@ export class ZBTCVCDataAPI extends BaseDataAPI implements IZBTCVCDataAPI {
76
76
 
77
77
  const pool = await this.getStakePool()
78
78
 
79
- const credentials = rawCredentialsData.map((item: any) =>
80
- ZBTCVCDataAPI.parseCredential(item, pool),
81
- )
79
+ // TODO: Update reward coin type once available
80
+ const credentials = rawCredentialsData
81
+ .filter(
82
+ (item: any) =>
83
+ item.data.type ===
84
+ `${this.sharedConfig.zoStaking.package}::pool::Credential<${this.consts.zoCore.package}::zbtcvc::ZBTCVC, 0x2::sui::SUI>`
85
+ ).map((item: any) =>
86
+ ZBTCVCDataAPI.parseCredential(item, pool),
87
+ )
82
88
  return {
83
89
  credentials,
84
90
  amount: credentials.reduce(
@@ -77,9 +77,15 @@ export class ZLPDataAPI extends BaseDataAPI implements IZLPDataAPI {
77
77
 
78
78
  const pool = await this.getStakePool()
79
79
 
80
- const credentials = rawCredentialsData.map((item: any) =>
81
- ZLPDataAPI.parseCredential(item, pool),
82
- )
80
+ // TODO: Update reward coin type once available
81
+ const credentials = rawCredentialsData
82
+ .filter(
83
+ (item: any) =>
84
+ item.data.type ===
85
+ `${this.sharedConfig.zoStaking.package}::pool::Credential<${this.consts.zoCore.package}::zlp::ZLP, 0x2::sui::SUI>`
86
+ ).map((item: any) =>
87
+ ZLPDataAPI.parseCredential(item, pool),
88
+ )
83
89
  return {
84
90
  credentials,
85
91
  amount: credentials.reduce(