@cetusprotocol/dlmm-sdk 0.0.1 → 0.0.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cetusprotocol/dlmm-sdk",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "SDK for cetus dlmm",
5
5
  "typings": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
@@ -5,21 +5,21 @@ export const dlmmTestnet: SdkOptions = {
5
5
  env: 'testnet',
6
6
  full_rpc_url: FullRpcUrlTestnet,
7
7
  dlmm_pool: {
8
- package_id: '0x05a79a247dc4c0daf0c03912cc2f14ebb3d0ca925482c3c09f516b16825bfc45',
9
- published_at: '0x534b3ca6b921257b33db4d0d0ac5b4f37c1eb15c22c5a55b38faba8d9f91b1c3',
8
+ package_id: '0x17a1f5a8779461ff44e942adf33325cce112c693d6a177ed77f035ca86d1fdb6',
9
+ published_at: '0x17a1f5a8779461ff44e942adf33325cce112c693d6a177ed77f035ca86d1fdb6',
10
10
  version: 1,
11
11
  config: {
12
- registry_id: '0xcb49fbeebeb778fcae261c3a9fad8abe7e329ac0f86ef458e0bd5b587b0ad858',
13
- pools_id: '0x7fc11580586ea9f0941be9973345ebf82cf5c479353b865a22e59cd720b8bf04',
14
- global_config_id: '0xac39b660d54aadaaef08b17605d0c91c102797be18b00b590647321f11948c35',
15
- versioned_id: '0xc1d8eae3c5e6b5322136bbe71c3d348b1061695cf199e9c4d5efd1139b294edb',
16
- admin_cap_id: '0x570ce0b84182892b8af58fd74307a144aa36b330141bfa01d0f0c1978d2325a8',
17
- partners_id: '0xd7833b08e9637f4431f6a69dad8f6d0f9f3b09c16387b33ac527411df0f99d12',
12
+ registry_id: '0x319070e26a6809f439d3c4a45e63bf74939c5fe3165de7b65968ee8547f71bd0',
13
+ pools_id: '0x505fcde74ab557d553832a87f169a0408ad3507ca4e84b25f7d32c2c1535765c',
14
+ global_config_id: '0x88bb33e9eff2fccab980a0e4b43fc4572abd08f08304d47a20d3e4e99d94d159',
15
+ versioned_id: '0xa710caae87b2129acc97fbb98ea7011e3137c3291b02c0fcce866d67d5d9e8d0',
16
+ admin_cap_id: '0x6fc908894ad7c2ff16cca07a05af6760831a8b5e5dc34e40470dce6ee1760155',
17
+ partners_id: '0xc5c31fe1550e39c9890e0fe3d2608dd9b408a10d74020e5ff72ccfffe4c9c879',
18
18
  },
19
19
  },
20
20
  dlmm_router: {
21
- package_id: '0xe2c57dabc1ab2c48d17b50e418d77312c29d1f98594bdf5bffb643b07231ac09',
22
- published_at: '0x3249405dc05e570e642bc8029f8ce0800ee1e7589e8988af8acc6730fd83dbf5',
21
+ package_id: '0x70777a78c17b550170924b4bf598fa6d883106521cc02eda798401a315b6751b',
22
+ published_at: '0x70777a78c17b550170924b4bf598fa6d883106521cc02eda798401a315b6751b',
23
23
  version: 1,
24
24
  },
25
25
  faucet: {
@@ -116,7 +116,7 @@ export class ConfigModule implements IModule<CetusDlmmSDK> {
116
116
  size: fields.restriction.fields.blocked_user.fields.permissions.fields.size,
117
117
  },
118
118
  min_reward_duration: Number(reward_config.min_reward_duration),
119
- non_manager_initialize_reward_cap: Number(reward_config.non_manager_initialize_reward_cap),
119
+ non_manager_initialize_reward_cap: Number(reward_config.manager_reserved_reward_init_slots),
120
120
  reward_public: reward_config.reward_public,
121
121
  }
122
122
 
@@ -124,17 +124,11 @@ export class PositionModule implements IModule<CetusDlmmSDK> {
124
124
  */
125
125
  updatePositionFeeAndRewards(option: UpdatePositionFeeAndRewardsOption, tx: Transaction) {
126
126
  const { dlmm_pool } = this.sdk.sdkOptions
127
- const { versioned_id, global_config_id } = getPackagerConfigs(dlmm_pool)
127
+ const { versioned_id } = getPackagerConfigs(dlmm_pool)
128
128
  const { pool_id, position_id, coin_type_a, coin_type_b } = option
129
129
  tx.moveCall({
130
130
  target: `${dlmm_pool.published_at}::pool::update_position_fee_and_rewards`,
131
- arguments: [
132
- tx.object(pool_id),
133
- tx.pure.id(position_id),
134
- tx.object(global_config_id),
135
- tx.object(versioned_id),
136
- tx.object(CLOCK_ADDRESS),
137
- ],
131
+ arguments: [tx.object(pool_id), tx.pure.id(position_id), tx.object(versioned_id), tx.object(CLOCK_ADDRESS)],
138
132
  typeArguments: [coin_type_a, coin_type_b],
139
133
  })
140
134
 
@@ -114,7 +114,6 @@ export class RewardModule implements IModule<CetusDlmmSDK> {
114
114
  arguments: [
115
115
  tx.object(pool_id),
116
116
  reward_coin,
117
- tx.pure.u64(reward_amount),
118
117
  tx.pure.option('u64', start_time_seconds),
119
118
  tx.pure.u64(end_time_seconds),
120
119
  tx.object(global_config_id),
@@ -14,7 +14,7 @@ import {
14
14
  import { printTransaction, toDecimalsAmount } from '@cetusprotocol/common-sdk'
15
15
  import { BinUtils } from '../src/utils/binUtils'
16
16
 
17
- const pool_id = '0x5156119a3cc1143ac65c24f3e7e0b339b74ea057ff5e3a1532b407a749193394'
17
+ const pool_id = '0x833a468857db452508351dbbe5f9859ed557014bf0a23e4c8eba5dfa0c0741f0'
18
18
  const position_id = '0xf5139870fbc926d1ca1afdc536b4ab457a9c2a696440d10955572f04b95d9e29'
19
19
 
20
20
  describe('dlmm add liquidity spot', () => {
@@ -5,7 +5,7 @@ import { CetusDlmmSDK } from '../src/sdk'
5
5
  import { parseCurrentRewardPeriodEmission, parseRewardPeriodEmission } from '../src/utils/parseData'
6
6
 
7
7
  describe('config', () => {
8
- const sdk = CetusDlmmSDK.createSDK({ env: 'mainnet' })
8
+ const sdk = CetusDlmmSDK.createSDK({ env: 'testnet' })
9
9
  let send_key_pair: Ed25519Keypair
10
10
  let account: string
11
11
 
@@ -10,7 +10,7 @@ import { FeeUtils } from '../src/utils'
10
10
  import { FEE_PRECISION, MAX_FEE_RATE } from '../src/types/constants'
11
11
 
12
12
  describe('pool', () => {
13
- const sdk = CetusDlmmSDK.createSDK({ env: 'mainnet' })
13
+ const sdk = CetusDlmmSDK.createSDK({ env: 'testnet' })
14
14
  let send_key_pair: Ed25519Keypair
15
15
  let account: string
16
16
 
@@ -12,8 +12,8 @@ import {
12
12
  import { printTransaction } from '@cetusprotocol/common-sdk'
13
13
  import { parseLiquidityShares } from '../src/utils/parseData'
14
14
 
15
- const pool_id = '0x1702f2ab918c3def2a1265ddd5e4306807d3dcb1ba91b28fb42e50337895a857'
16
- const position_id = '0x47a4db49d4eaa6d943df9aa3eb1b4f1d0113298d03a5e0f44f523365002497b1'
15
+ const pool_id = '0x0bec57bb33a99d0a999a3257c047c8ab35e611acd59d7a2b7a0fb5d89aaffe9e'
16
+ const position_id = '0xa99890fa6a8d4be06413759d04351d712377e5fda3cc03daf7f4815d99477d77'
17
17
 
18
18
  describe('dlmm remove liquidity ', () => {
19
19
  const sdk = CetusDlmmSDK.createSDK({ env: 'testnet', full_rpc_url: 'https://rpc-testnet.suiscan.xyz' })
@@ -131,7 +131,7 @@ describe('dlmm remove liquidity ', () => {
131
131
 
132
132
  printTransaction(tx)
133
133
 
134
- const res = await sdk.FullClient.executeTx(send_key_pair, tx, true)
134
+ const res = await sdk.FullClient.executeTx(send_key_pair, tx, false)
135
135
  console.log('🚀 ~ test ~ res:', res)
136
136
  })
137
137
  })