Skip to content
Closed
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 libs/injective-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@interchainjs/pubkey": "workspace:*",
"@interchainjs/types": "workspace:*",
"@interchainjs/utils": "workspace:*",
"@noble/hashes": "^1.3.1",
"@noble/hashes": "^2.0.1",
"decimal.js": "^10.4.3"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion libs/injective-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@interchainjs/pubkey": "workspace:*",
"@interchainjs/types": "workspace:*",
"@interchainjs/utils": "workspace:*",
"@noble/hashes": "^1.3.1",
"@noble/hashes": "^2.0.1",
"decimal.js": "^10.4.3"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion libs/injectivejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@interchainjs/pubkey": "workspace:*",
"@interchainjs/types": "workspace:*",
"@interchainjs/utils": "workspace:*",
"@noble/hashes": "^1.3.1",
"@noble/hashes": "^2.0.1",
"decimal.js": "^10.4.3"
},
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion libs/interchain-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@interchainjs/pubkey": "workspace:*",
"@interchainjs/types": "workspace:*",
"@interchainjs/utils": "workspace:*",
"@noble/hashes": "^1.3.1",
"@noble/hashes": "^2.0.1",
"decimal.js": "^10.4.3"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion libs/interchain-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@interchainjs/pubkey": "workspace:*",
"@interchainjs/types": "workspace:*",
"@interchainjs/utils": "workspace:*",
"@noble/hashes": "^1.3.1",
"@noble/hashes": "^2.0.1",
"decimal.js": "^10.4.3"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions libs/interchainjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@
"@interchainjs/solana": "workspace:^",
"@interchainjs/types": "workspace:*",
"@interchainjs/utils": "workspace:*",
"@noble/hashes": "^1.3.1",
"@noble/hashes": "^2.0.1",
"decimal.js": "^10.4.3"
},
"devDependencies": {
"@chain-registry/client": "1.18.1",
"@chain-registry/client": "2.0.163",
"@chain-registry/types": "^2.0.42",
"makage": "^0.1.12",
"starshipjs": "^2.4.0"
Expand Down
15 changes: 10 additions & 5 deletions networks/cosmos/jest.starship.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@ module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.tsx?$': [
'^.+\\.[jt]sx?$': [
'ts-jest',
{
babelConfig: false,
tsconfig: 'tsconfig.json',
diagnostics: false,
tsconfig: {
moduleResolution: 'node',
allowJs: true,
esModuleInterop: true,
skipLibCheck: true,
strict: false,
},
isolatedModules: true,
},
],
},
transformIgnorePatterns: [`/node_modules/*`],
transformIgnorePatterns: [`node_modules/(?!(.pnpm|@noble/hashes|@noble/curves|@scure/bip32|@scure/base|bech32|bs58|base-x))`],
modulePathIgnorePatterns: ['<rootDir>/dist/'],
testRegex: '/starship/__tests__/.*\\.(test|spec)\\.(jsx?|tsx?)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
Expand Down
12 changes: 6 additions & 6 deletions networks/cosmos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@
"@interchainjs/pubkey": "workspace:*",
"@interchainjs/types": "workspace:*",
"@interchainjs/utils": "workspace:*",
"@noble/curves": "^1.1.0",
"@noble/hashes": "^1.3.1",
"bech32": "^1.1.4",
"bignumber.js": "^9.1.0",
"@noble/curves": "^2.0.1",
"@noble/hashes": "^2.0.1",
"bech32": "^2.0.0",
"bignumber.js": "^10.0.2",
"bip39": "^3.1.0",
"decimal.js": "^10.4.3",
"deepmerge": "4.2.2",
"deepmerge": "4.3.1",
"ws": "^8.14.0"
},
"devDependencies": {
"@chain-registry/client": "1.18.1",
"@chain-registry/client": "2.0.163",
"@chain-registry/types": "^2.0.42",
"@jest/globals": "^30.0.0",
"interchainjs": "workspace:*",
Expand Down
14 changes: 10 additions & 4 deletions networks/ethereum/jest.starship.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@ module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.tsx?$': [
'^.+\\.[jt]sx?$': [
'ts-jest',
{
babelConfig: false,
tsconfig: 'tsconfig.json',
tsconfig: {
moduleResolution: 'node',
allowJs: true,
esModuleInterop: true,
skipLibCheck: true,
strict: false,
},
isolatedModules: true,
},
],
},
transformIgnorePatterns: [`/node_modules/*`],
transformIgnorePatterns: [`node_modules/(?!(.pnpm|@noble/hashes|@noble/curves|@scure/bip32|@scure/base|bech32|bs58|base-x))`],
modulePathIgnorePatterns: ['<rootDir>/dist/'],
testRegex: '/starship/__tests__/.*\\.(test|spec)\\.(jsx?|tsx?)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
Expand Down
6 changes: 3 additions & 3 deletions networks/ethereum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@
"@interchainjs/encoding": "workspace:^",
"@interchainjs/types": "workspace:*",
"@interchainjs/utils": "workspace:*",
"@noble/curves": "^1.1.0",
"@noble/hashes": "^1.3.1",
"@noble/curves": "^2.0.1",
"@noble/hashes": "^2.0.1",
"bip39": "^3.1.0",
"deepmerge": "4.2.2",
"deepmerge": "4.3.1",
"ethereum-cryptography": "^3.1.0",
"rlp": "^3.0.0"
},
Expand Down
8 changes: 4 additions & 4 deletions networks/ethereum/src/signers/base-signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,11 @@ export abstract class BaseEthereumSigner implements IEthereumSigner {
recoveryBit = v - 27;
}

signatureObj = secp256k1.Signature.fromCompact(new Uint8Array([...r, ...s])).addRecoveryBit(recoveryBit);
signatureObj = secp256k1.Signature.fromBytes(new Uint8Array([...r, ...s])).addRecoveryBit(recoveryBit);

// Recover public key
const recoveredPubkey = signatureObj.recoverPublicKey(messageHash);
const pubkeyBytes = recoveredPubkey.toRawBytes(false); // Uncompressed format (65 bytes)
const pubkeyBytes = recoveredPubkey.toBytes(false); // Uncompressed format (65 bytes)

// Derive address from public key
const pubNoPrefix = pubkeyBytes.slice(1); // Remove 0x04 prefix
Expand Down Expand Up @@ -264,11 +264,11 @@ export abstract class BaseEthereumSigner implements IEthereumSigner {
for (let recovery = 0; recovery <= 3; recovery++) {
try {
// Create signature object with this recovery value
const signatureObj = secp256k1.Signature.fromCompact(new Uint8Array([...r, ...s])).addRecoveryBit(recovery);
const signatureObj = secp256k1.Signature.fromBytes(new Uint8Array([...r, ...s])).addRecoveryBit(recovery);

// Recover public key
const recoveredPubkey = signatureObj.recoverPublicKey(msgHash);
const pubkeyBytes = recoveredPubkey.toRawBytes(false); // Uncompressed format (65 bytes)
const pubkeyBytes = recoveredPubkey.toBytes(false); // Uncompressed format (65 bytes)

// Derive address from public key
const pubNoPrefix = pubkeyBytes.slice(1); // Remove 0x04 prefix
Expand Down
8 changes: 4 additions & 4 deletions networks/injective/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@
"@interchainjs/ethereum": "workspace:*",
"@interchainjs/types": "workspace:*",
"@interchainjs/utils": "workspace:*",
"@noble/hashes": "^1.3.1",
"@noble/hashes": "^2.0.1",
"bech32": "^2.0.0",
"bignumber.js": "^9.1.0",
"bignumber.js": "^10.0.2",
"bip39": "^3.1.0",
"decimal.js": "^10.4.3",
"deepmerge": "4.2.2",
"deepmerge": "4.3.1",
"interchainjs": "workspace:*"
},
"keywords": [
"injective"
],
"devDependencies": {
"@chain-registry/client": "1.18.1",
"@chain-registry/client": "2.0.163",
"@chain-registry/types": "^2.0.42",
"dotenv": "^16.4.5",
"makage": "^0.1.12",
Expand Down
15 changes: 9 additions & 6 deletions networks/injective/src/signers/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PRESET_INJECTIVE_SIGNATURE_FORMATS } from './signature-processor';
import deepmerge from 'deepmerge';
import { CosmosCryptoSecp256k1PubKey as Secp256k1PubKey } from '@interchainjs/cosmos-types';
import { CosmosCryptoSecp256k1PubKey } from '@interchainjs/cosmos-types';
import { EncodedMessage, DocOptions, CosmosSignerConfig } from '@interchainjs/cosmos';
import { Any } from '@interchainjs/types';

Expand All @@ -11,8 +11,8 @@ import { Any } from '@interchainjs/types';
export const encodeInjectivePublicKey = (publicKey: Uint8Array): EncodedMessage => {
return {
typeUrl: '/injective.crypto.v1beta1.ethsecp256k1.PubKey',
value: Secp256k1PubKey.encode(
Secp256k1PubKey.fromPartial({ key: publicKey })
value: CosmosCryptoSecp256k1PubKey.encode(
CosmosCryptoSecp256k1PubKey.fromPartial({ key: publicKey })
).finish(),
};
};
Expand Down Expand Up @@ -45,9 +45,12 @@ export const DEFAULT_INJECTIVE_SIGNER_CONFIG: Partial<DocOptions> = {
// Public key encoding - Injective specific
encodePublicKey: encodeInjectivePublicKey,
pubkeyDecoders: {
'/injective.crypto.v1beta1.ethsecp256k1.PubKey': (pubkey: Any): Secp256k1PubKey => {
const { key } = Secp256k1PubKey.decode(pubkey.value);
return Secp256k1PubKey.fromPartial({ key });
'/injective.crypto.v1beta1.ethsecp256k1.PubKey': (pubkey: Any) => {
const { key } = CosmosCryptoSecp256k1PubKey.decode(pubkey.value);
return {
type: 'tendermint/PubKeySecp256k1',
value: Buffer.from(key).toString('base64'),
};
}
}
};
Expand Down
12 changes: 11 additions & 1 deletion networks/solana/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,15 @@ module.exports = {
preset: "ts-jest",
testEnvironment: "node",
setupFiles: ["<rootDir>/jest.setup.js"],
testPathIgnorePatterns: ["<rootDir>/starship/__tests__/"]
testPathIgnorePatterns: ["<rootDir>/starship/__tests__/"],
transform: {
'^.+\\.[jt]sx?$': [
'ts-jest',
{
babelConfig: false,
tsconfig: 'tsconfig.json',
},
],
},
transformIgnorePatterns: [`node_modules/(?!(.pnpm|bs58|base-x))`],
};
2 changes: 1 addition & 1 deletion networks/solana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@types/bn.js": "^5.2.0",
"@types/ws": "^8.18.1",
"bn.js": "^5.2.2",
"bs58": "^5.0.0",
"bs58": "^6.0.0",
"buffer": "^6.0.3",
"tweetnacl": "^1.0.3",
"ws": "^8.18.3"
Expand Down
2 changes: 1 addition & 1 deletion networks/solana/src/keypair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from '@interchainjs/types';
import { BaseCryptoBytes } from '@interchainjs/utils';
import * as nacl from 'tweetnacl';
import * as bs58 from 'bs58';
import bs58 from 'bs58';
import { PublicKey } from './types/solana-types';

const DEFAULT_SOLANA_DERIVATION = "m/44'/501'/0'/0/0";
Expand Down
2 changes: 1 addition & 1 deletion networks/solana/src/transaction.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PublicKey, TransactionInstruction, TransactionMessage } from './types/solana-types';
import { Keypair } from './keypair';
import { encodeSolanaCompactLength, concatUint8Arrays } from './utils';
import * as bs58 from 'bs58';
import bs58 from 'bs58';

export class Transaction {
signatures: Array<{
Expand Down
2 changes: 1 addition & 1 deletion networks/solana/src/types/codec/converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import { fromBase64, toBase64, apiToNumber as encApiToNumber, apiToBigInt as encApiToBigInt } from '@interchainjs/encoding';
import * as bs58 from 'bs58';
import bs58 from 'bs58';

// Re-export common converters from @interchainjs/encoding for consistency
export const apiToNumber = (value: unknown): number => {
Expand Down
2 changes: 1 addition & 1 deletion networks/solana/src/types/solana-types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BN from 'bn.js';
import * as bs58 from 'bs58';
import bs58 from 'bs58';

export interface PublicKeyInitData {
_bn: BN;
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
"doc:clean": "rimraf ./docs/libs; rimraf ./docs/networks; rimraf ./docs/packages; rimraf ./docs/_meta.json; rimraf ./docs/index.mdx; rimraf ./docs/migration-from-cosmjs.mdx;"
},
"devDependencies": {
"@chain-registry/client": "1.18.1",
"@hyperweb/telescope": "^1.17.4",
"@noble/hashes": "^1.4.0",
"@chain-registry/client": "2.0.163",
"@hyperweb/telescope": "^2.2.0",
"@noble/hashes": "^2.0.1",
"@starship-ci/cli": "^2.9.0",
"@types/jest": "^30.0.0",
"@types/node": "^20.12.7",
"@types/ws": "^8.5.8",
"@typescript-eslint/eslint-plugin": "^7.10.0",
"@typescript-eslint/parser": "^7.10.0",
"deepmerge": "4.2.2",
"deepmerge": "4.3.1",
"del-cli": "^5.1.0",
"eslint": "8.38.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -55,7 +55,7 @@
"ws": "^8.14.0"
},
"dependencies": {
"@scure/bip32": "^1.7.0",
"@scure/bip32": "^2.0.1",
"bip39": "^3.1.0"
}
}
11 changes: 9 additions & 2 deletions packages/amino/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,24 @@ module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.tsx?$': [
'^.+\\.[jt]sx?$': [
'ts-jest',
{
babelConfig: false,
tsconfig: 'tsconfig.json',
},
],
},
transformIgnorePatterns: [`/node_modules/*`],
transformIgnorePatterns: [`node_modules/(?!(.pnpm|@noble/hashes|@noble/curves|@scure/bip32|@scure/base|bech32))`],
modulePathIgnorePatterns: [
'<rootDir>/dist/',
],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
moduleNameMapper: {
'^@interchainjs/types$': '<rootDir>/../types/src',
'^@interchainjs/utils$': '<rootDir>/../utils/src',
'^@interchainjs/crypto$': '<rootDir>/../crypto/src',
'^@interchainjs/encoding$': '<rootDir>/../encoding/src',
'^@interchainjs/math$': '<rootDir>/../math/src',
},
};
Loading
Loading