Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALL-9923 Fixed version in report for Docker #113

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tatumio/tatum-kms",
"version": "7.0.7",
"version": "7.0.8",
"description": "Tatum KMS - Key Management System for Tatum-powered apps.",
"main": "dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
4 changes: 3 additions & 1 deletion src/management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import { utils } from './utils'
import semver from 'semver'

import { version } from '../package.json'

const ensurePathExists = (path: string) => {
const dir = dirname(path)
if (!existsSync(dir)) {
Expand Down Expand Up @@ -134,7 +136,7 @@
}

const generatePureWallet = async (chain: Currency, testnet: boolean, mnemonic?: string) => {
let wallet: any

Check warning on line 139 in src/management.ts

View workflow job for this annotation

GitHub Actions / 🏗️ Install and build

Unexpected any. Specify a different type
if (chain === Currency.SOL) {
const sdk = TatumSolanaSDK({ apiKey: '' })
wallet = sdk.wallet.wallet()
Expand Down Expand Up @@ -236,7 +238,7 @@
const cnt = Number(count)
for (let i = 0; i < cnt; i++) {
const wallet = await generatePureWallet(chain, testnet)
let address: any

Check warning on line 241 in src/management.ts

View workflow job for this annotation

GitHub Actions / 🏗️ Install and build

Unexpected any. Specify a different type
if (wallet.address) {
address = wallet.address
} else {
Expand Down Expand Up @@ -273,7 +275,7 @@
}

// TODO: validate all properties from wallet and create a type or interface to replace any bellow
export const isWalletsValid = (wallets: any, options: WalletsValidationOptions) => {

Check warning on line 278 in src/management.ts

View workflow job for this annotation

GitHub Actions / 🏗️ Install and build

Unexpected any. Specify a different type
if (Object.keys(wallets).length === 0) {
console.error(JSON.stringify({ error: `No such wallet for chain '${options.chain}'.` }, null, 2))
return false
Expand Down Expand Up @@ -366,7 +368,7 @@
console.error(JSON.stringify({ error: `No such wallet for signatureId '${id}'.` }, null, 2))
return null
}
let pk: { address: any }

Check warning on line 371 in src/management.ts

View workflow job for this annotation

GitHub Actions / 🏗️ Install and build

Unexpected any. Specify a different type
if (wallet[id].address) {
pk = {
address: wallet[id].address,
Expand Down Expand Up @@ -545,7 +547,7 @@
}

const getKmsVersion = (): string => {
return process.env.npm_package_version ?? 'N/A'
return version || 'N/A'
}

const getPathToWallet = (path?: string) => {
Expand Down
5 changes: 3 additions & 2 deletions src/signatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import { getManagedWallets, getWallet, getWalletForSignature } from './management'
import semver from 'semver'
import { Config, ConfigOption } from './config'
import { version } from '../package.json'

const TATUM_URL: string = process.env.TATUM_API_URL || 'https://api.tatum.io'

Expand All @@ -77,7 +78,7 @@
return result
}

function validatePrivateKeyWasFound(wallet: any, blockchainSignature: TransactionKMS, privateKey: string | undefined) {

Check warning on line 81 in src/signatures.ts

View workflow job for this annotation

GitHub Actions / 🏗️ Install and build

Unexpected any. Specify a different type
if (privateKey) return

const index = blockchainSignature.index
Expand Down Expand Up @@ -156,7 +157,7 @@
return
}
case Currency.SOL: {
const solSDK = TatumSolanaSDK({ apiKey, url: TATUM_URL as any })

Check warning on line 160 in src/signatures.ts

View workflow job for this annotation

GitHub Actions / 🏗️ Install and build

Unexpected any. Specify a different type
txData = await solSDK.kms.sign(
blockchainSignature as PendingTransaction,
wallets.map(w => w.privateKey),
Expand Down Expand Up @@ -204,16 +205,16 @@
return
}
case Currency.XRP: {
const xrpSdk = TatumXrpSDK({ apiKey, url: TATUM_URL as any })

Check warning on line 208 in src/signatures.ts

View workflow job for this annotation

GitHub Actions / 🏗️ Install and build

Unexpected any. Specify a different type
const xrpSecret = wallets[0].secret ? wallets[0].secret : wallets[0].privateKey
txData = await xrpSdk.kms.sign(blockchainSignature as any, xrpSecret)

Check warning on line 210 in src/signatures.ts

View workflow job for this annotation

GitHub Actions / 🏗️ Install and build

Unexpected any. Specify a different type
await xrpSdk.blockchain.broadcast({ txData, signatureId: blockchainSignature.id })
return
}
case Currency.XLM: {
const xlmSdk = TatumXlmSDK({ apiKey, url: TATUM_URL as any })

Check warning on line 215 in src/signatures.ts

View workflow job for this annotation

GitHub Actions / 🏗️ Install and build

Unexpected any. Specify a different type
const xlmSecret = wallets[0].secret ? wallets[0].secret : wallets[0].privateKey
txData = await xlmSdk.kms.sign(blockchainSignature as any, xlmSecret, testnet)

Check warning on line 217 in src/signatures.ts

View workflow job for this annotation

GitHub Actions / 🏗️ Install and build

Unexpected any. Specify a different type
await xlmSdk.blockchain.broadcast({ txData, signatureId: blockchainSignature.id })
return
}
Expand Down Expand Up @@ -516,7 +517,7 @@
versionUpdateState.level = parts[1]?.toUpperCase()?.trim()
versionUpdateState.logFunction = versionUpdateState.level === 'ERROR' ? console.error : console.log
versionUpdateState.message = parts[2]?.trim()
versionUpdateState.currentVersion = process.env.npm_package_version ?? ''
versionUpdateState.currentVersion = version ?? ''

if (
!versionUpdateState.running &&
Expand Down Expand Up @@ -562,7 +563,7 @@
{
headers: {
'x-api-key': Config.getValue(ConfigOption.TATUM_API_KEY),
'x-ttm-kms-client-version': process.env.npm_package_version ?? '',
'x-ttm-kms-client-version': version ?? '',
},
},
)
Expand Down
Loading