Skip to content
Open
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
2 changes: 1 addition & 1 deletion libs/interchainjs/starship/__tests__/token.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('Token transfers', () => {
client = await createCosmosQueryClient(rpcEndpoint);

denom = (await getCoin()).base;
commonPrefix = chainInfo?.chain?.bech32_prefix;
commonPrefix = chainInfo?.chain?.bech32Prefix;

const mnemonic = generateMnemonic();
// Initialize wallet
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
4 changes: 2 additions & 2 deletions networks/cosmos/starship/__tests__/staking.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('Staking tokens testing', () => {
({ chainInfo, getCoin, getRpcEndpoint, creditFromFaucet } =
useChain('osmosis'));
denom = (await getCoin()).base;
commonPrefix = chainInfo?.chain?.bech32_prefix;
commonPrefix = chainInfo?.chain?.bech32Prefix;

// Set up query client
const rpcEndpoint = await getRpcEndpoint();
Expand Down Expand Up @@ -230,4 +230,4 @@ describe('Staking tokens testing', () => {
expect(delegationResponse!.balance.amount).toEqual(totalDelegationAmount.toString());
expect(delegationResponse!.balance.denom).toEqual(denom);
});
});
});
28 changes: 14 additions & 14 deletions networks/cosmos/starship/__tests__/token.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('Token transfers', () => {
client = await createCosmosQueryClient(endpoint);

denom = (await getCoin()).base;
commonPrefix = chainInfo?.chain?.bech32_prefix;
commonPrefix = chainInfo?.chain?.bech32Prefix;

const mnemonic = generateMnemonic();
// Initialize wallet with 4 accounts for testing
Expand Down Expand Up @@ -335,7 +335,7 @@ describe('Token transfers', () => {
const { chainInfo: cosmosChainInfo, getRpcEndpoint: getCosmosRpcEndpoint } =
useChain('cosmoshub');

const cosmosPrefix = cosmosChainInfo?.chain?.bech32_prefix;
const cosmosPrefix = cosmosChainInfo?.chain?.bech32Prefix;
const cosmosRpcEndpoint = await getCosmosRpcEndpoint();

const cosmosClient = await createCosmosQueryClient(cosmosRpcEndpoint);
Expand All @@ -352,19 +352,19 @@ describe('Token transfers', () => {
);
const cosmosAddress = (await cosmosWallet.getAccounts())[0].address;

const ibcInfos = chainInfo.fetcher.getChainIbcData(
chainInfo.chain.chain_name
);
const sourceIbcInfo = ibcInfos.find(
(i) =>
i.chain_1.chain_name === chainInfo.chain.chain_name &&
i.chain_2.chain_name === cosmosChainInfo.chain.chain_name
);
const ibcInfos = chainInfo.fetcher.getChainIbcData(
chainInfo.chain.chainName
);
const sourceIbcInfo = ibcInfos.find(
(i) =>
i.chain1.chainName === chainInfo.chain.chainName &&
i.chain2.chainName === cosmosChainInfo.chain.chainName
);

expect(sourceIbcInfo).toBeTruthy();
expect(sourceIbcInfo).toBeTruthy();

const { port_id: sourcePort, channel_id: sourceChannel } =
sourceIbcInfo!.channels[0].chain_1;
const { portId: sourcePort, channelId: sourceChannel } =
sourceIbcInfo!.channels[0].chain1;

// Transfer osmosis tokens via IBC to cosmos chain
const currentTime = Math.floor(Date.now()) * 1000000;
Expand Down Expand Up @@ -429,4 +429,4 @@ describe('Token transfers', () => {
// });
// expect(trace.denomTrace.baseDenom).toEqual(denom);
}, 40000);
});
});
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
12 changes: 6 additions & 6 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]), 'compact').addRecoveryBit(recoveryBit);

// Recover public key
const recoveredPubkey = signatureObj.recoverPublicKey(messageHash);
const pubkeyBytes = recoveredPubkey.toRawBytes(false); // Uncompressed format (65 bytes)
const recoveredPubkey = signatureObj.recoverPublicKey(messageHash);
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]), 'compact').addRecoveryBit(recovery);

// Recover public key
const recoveredPubkey = signatureObj.recoverPublicKey(msgHash);
const pubkeyBytes = recoveredPubkey.toRawBytes(false); // Uncompressed format (65 bytes)
const recoveredPubkey = signatureObj.recoverPublicKey(msgHash);
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
26 changes: 13 additions & 13 deletions networks/injective/starship/__tests__/token.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,19 @@ describe('Token transfers', () => {
const cosmosAddresses = await cosmosOfflineSigner.getAccounts();
const cosmosAddress = cosmosAddresses[0].address;

const ibcInfos = chainInfo.fetcher.getChainIbcData(
chainInfo.chain.chain_name
);
const ibcInfo = ibcInfos.find(
(i) =>
i.chain_1.chain_name === chainInfo.chain.chain_name &&
i.chain_2.chain_name === cosmosChainInfo.chain.chain_name
);

expect(ibcInfo).toBeTruthy();

const { port_id: sourcePort, channel_id: sourceChannel } =
ibcInfo!.channels[0].chain_1;
const ibcInfos = chainInfo.fetcher.getChainIbcData(
chainInfo.chain.chainName
);
const ibcInfo = ibcInfos.find(
(i) =>
i.chain1.chainName === chainInfo.chain.chainName &&
i.chain2.chainName === cosmosChainInfo.chain.chainName
);

expect(ibcInfo).toBeTruthy();

const { portId: sourcePort, channelId: sourceChannel } =
ibcInfo!.channels[0].chain1;

// Transfer injective tokens via IBC to cosmos chain
const currentTime = Math.floor(Date.now()) * 1000000;
Expand Down
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"
}
}
6 changes: 3 additions & 3 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
"@interchainjs/crypto": "workspace:*",
"@interchainjs/types": "workspace:*",
"@interchainjs/utils": "workspace:*",
"@noble/curves": "^1.1.0",
"@noble/hashes": "^1.3.1",
"@scure/bip32": "^1.0.10",
"@noble/curves": "^2.0.1",
"@noble/hashes": "^2.0.1",
"@scure/bip32": "^2.0.1",
"bech32": "^2.0.0",
"elliptic": "^6.5.4",
"libsodium-wrappers-sumo": "^0.8.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/auth/src/strategies/built-in.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IAddressStrategy, IAlgo } from '@interchainjs/types';
import { bech32 } from 'bech32';
import { sha256 } from '@noble/hashes/sha256';
import { ripemd160 } from '@noble/hashes/ripemd160';
import { sha256 } from '@noble/hashes/sha2';
import { ripemd160 } from '@noble/hashes/legacy';
import { keccak_256 } from '@noble/hashes/sha3';
import { toHex, fromHex } from '@interchainjs/utils';

Expand Down
2 changes: 1 addition & 1 deletion packages/auth/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { fromUtf8 } from '@interchainjs/utils';
import { pbkdf2 } from '@noble/hashes/pbkdf2';
import { sha512 } from '@noble/hashes/sha512';
import { sha512 } from '@noble/hashes/sha2';

export function getSeedFromMnemonic(mnemonic: string, password?: string) {
const mnemonicBytes = fromUtf8(mnemonic.normalize('NFKD'));
Expand Down
2 changes: 1 addition & 1 deletion packages/crypto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@interchainjs/encoding": "workspace:*",
"@interchainjs/math": "workspace:*",
"@interchainjs/utils": "workspace:*",
"@noble/hashes": "^1",
"@noble/hashes": "^2.0.1",
"bn.js": "^5.2.0",
"elliptic": "^6.5.4",
"libsodium-wrappers-sumo": "^0.8.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/crypto/src/pbkdf2.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert } from "@interchainjs/utils";
import { pbkdf2Async as noblePbkdf2Async } from "@noble/hashes/pbkdf2";
import { sha512 as nobleSha512 } from "@noble/hashes/sha512";
import { sha512 as nobleSha512 } from "@noble/hashes/sha2";

/**
* Returns the Node.js crypto module when available and `undefined`
Expand Down
2 changes: 1 addition & 1 deletion packages/crypto/src/ripemd.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ripemd160 as nobleRipemd160 } from "@noble/hashes/ripemd160";
import { ripemd160 as nobleRipemd160 } from "@noble/hashes/legacy";

import { HashFunction } from "./hash";
import { toRealUint8Array } from "./utils";
Expand Down
3 changes: 1 addition & 2 deletions packages/crypto/src/sha.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { sha256 as nobleSha256 } from "@noble/hashes/sha256";
import { sha512 as nobleSha512 } from "@noble/hashes/sha512";
import { sha256 as nobleSha256, sha512 as nobleSha512 } from "@noble/hashes/sha2";

import { HashFunction } from "./hash";
import { toRealUint8Array } from "./utils";
Expand Down
Loading
Loading