Skip to content

Commit 9de10d6

Browse files
bump sdk & cli version to 1.0.9
Synced from glamsystems/glam e34bf257910fd8e9f3cb58aa59066607f642105a
1 parent 3044929 commit 9de10d6

File tree

3 files changed

+8
-24
lines changed

3 files changed

+8
-24
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@glamsystems/glam-cli",
3-
"version": "1.0.8",
3+
"version": "1.0.9",
44
"description": "CLI for interacting with the GLAM Protocol",
55
"main": "./main.js",
66
"bin": {
@@ -21,7 +21,7 @@
2121
"node": ">=20.20.0"
2222
},
2323
"dependencies": {
24-
"@glamsystems/glam-sdk": "1.0.8",
24+
"@glamsystems/glam-sdk": "1.0.9",
2525
"@switchboard-xyz/common": "^3.0.0",
2626
"commander": "^11.1.0",
2727
"decimal.js": "^10.6.0",

src/cmds/kamino-lend.ts

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
2-
ASSETS_MAINNET,
32
bfToDecimal,
43
Fraction,
4+
getAssetMeta,
55
KaminoLendingPolicy,
66
PkMap,
77
PkSet,
@@ -278,11 +278,7 @@ export function installKaminoLendCommands(klend: Command, context: CliContext) {
278278
.option("-y, --yes", "Skip confirmation prompt", false)
279279
.description("Deposit to Kamino Lending market")
280280
.action(async (market, asset, amount, options) => {
281-
const decimals = ASSETS_MAINNET.get(asset)?.decimals;
282-
if (!decimals) {
283-
console.error(`Asset ${asset} not supported`);
284-
process.exit(1);
285-
}
281+
const { decimals } = getAssetMeta(asset);
286282

287283
await executeTxWithErrorHandling(
288284
() =>
@@ -308,11 +304,7 @@ export function installKaminoLendCommands(klend: Command, context: CliContext) {
308304
.option("-y, --yes", "Skip confirmation prompt", false)
309305
.description("Withdraw asset from Kamino Lending market")
310306
.action(async (market, asset, amount, options) => {
311-
const decimals = ASSETS_MAINNET.get(asset)?.decimals;
312-
if (!decimals) {
313-
console.error(`Asset ${asset} not supported`);
314-
process.exit(1);
315-
}
307+
const { decimals } = getAssetMeta(asset);
316308

317309
await executeTxWithErrorHandling(
318310
() =>
@@ -338,11 +330,7 @@ export function installKaminoLendCommands(klend: Command, context: CliContext) {
338330
.option("-y, --yes", "Skip confirmation prompt", false)
339331
.description("Borrow from Kamino Lending market")
340332
.action(async (market, asset, amount, options) => {
341-
const decimals = ASSETS_MAINNET.get(asset)?.decimals;
342-
if (!decimals) {
343-
console.error(`Asset ${asset} not supported`);
344-
process.exit(1);
345-
}
333+
const { decimals } = getAssetMeta(asset);
346334

347335
await executeTxWithErrorHandling(
348336
() =>
@@ -368,11 +356,7 @@ export function installKaminoLendCommands(klend: Command, context: CliContext) {
368356
.option("-y, --yes", "Skip confirmation prompt", false)
369357
.description("Repay loan from Kamino Lending market")
370358
.action(async (market, asset, amount, options) => {
371-
const decimals = ASSETS_MAINNET.get(asset)?.decimals;
372-
if (!decimals) {
373-
console.error(`Asset ${asset} not supported`);
374-
process.exit(1);
375-
}
359+
const { decimals } = getAssetMeta(asset);
376360

377361
await executeTxWithErrorHandling(
378362
() =>

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ program
108108
initialize(config, skipSimulation);
109109
await idlCheck(context.glamClient);
110110
})
111-
.version("1.0.8");
111+
.version("1.0.9");
112112

113113
program
114114
.command("env")

0 commit comments

Comments
 (0)