@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/.turbo/turbo-build.log +29 -29
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/config/testnet.ts +10 -10
- package/src/modules/configModule.ts +1 -1
- package/src/modules/positionModule.ts +2 -8
- package/src/modules/rewardModule.ts +0 -1
- package/tests/add_liquidity_spot.test.ts +1 -1
- package/tests/config.test.ts +1 -1
- package/tests/pool.test.ts +1 -1
- package/tests/remove_liquidity.test.ts +3 -3
package/package.json
CHANGED
package/src/config/testnet.ts
CHANGED
|
@@ -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: '
|
|
9
|
-
published_at: '
|
|
8
|
+
package_id: '0x17a1f5a8779461ff44e942adf33325cce112c693d6a177ed77f035ca86d1fdb6',
|
|
9
|
+
published_at: '0x17a1f5a8779461ff44e942adf33325cce112c693d6a177ed77f035ca86d1fdb6',
|
|
10
10
|
version: 1,
|
|
11
11
|
config: {
|
|
12
|
-
registry_id: '
|
|
13
|
-
pools_id: '
|
|
14
|
-
global_config_id: '
|
|
15
|
-
versioned_id: '
|
|
16
|
-
admin_cap_id: '
|
|
17
|
-
partners_id: '
|
|
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: '
|
|
22
|
-
published_at: '
|
|
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.
|
|
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
|
|
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 = '
|
|
17
|
+
const pool_id = '0x833a468857db452508351dbbe5f9859ed557014bf0a23e4c8eba5dfa0c0741f0'
|
|
18
18
|
const position_id = '0xf5139870fbc926d1ca1afdc536b4ab457a9c2a696440d10955572f04b95d9e29'
|
|
19
19
|
|
|
20
20
|
describe('dlmm add liquidity spot', () => {
|
package/tests/config.test.ts
CHANGED
|
@@ -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: '
|
|
8
|
+
const sdk = CetusDlmmSDK.createSDK({ env: 'testnet' })
|
|
9
9
|
let send_key_pair: Ed25519Keypair
|
|
10
10
|
let account: string
|
|
11
11
|
|
package/tests/pool.test.ts
CHANGED
|
@@ -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: '
|
|
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 = '
|
|
16
|
-
const position_id = '
|
|
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,
|
|
134
|
+
const res = await sdk.FullClient.executeTx(send_key_pair, tx, false)
|
|
135
135
|
console.log('🚀 ~ test ~ res:', res)
|
|
136
136
|
})
|
|
137
137
|
})
|