chore: Upgrade CosmJS libs to 0.32.4 (#4209)

### Description

- Upgrade CosmJS libs to 0.32.4
- Remove explorer dep from ccip-server

### Related issues

https://github.com/hyperlane-xyz/hyperlane-warp-ui-template/issues/202

### Backward compatibility

No, major version bump required because CosmJS 0.32 is not backwards
compatible with 0.31

### Testing

Tested in Warp UI
pull/4216/head
J M Rossy 4 months ago committed by GitHub
parent ded5718a09
commit 488f949efa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      .changeset/cuddly-fans-chew.md
  2. 3
      typescript/ccip-server/package.json
  3. 3
      typescript/ccip-server/src/services/HyperlaneService.ts
  4. 4
      typescript/ccip-server/src/services/__mocks__/HyperlaneService.ts
  5. 60
      typescript/ccip-server/src/services/explorerTypes.ts
  6. 2
      typescript/infra/package.json
  7. 4
      typescript/sdk/package.json
  8. 6
      typescript/sdk/src/token/adapters/CosmosTokenAdapter.ts
  9. 2
      typescript/utils/package.json
  10. 3711
      yarn.lock

@ -0,0 +1,6 @@
---
'@hyperlane-xyz/utils': major
'@hyperlane-xyz/sdk': major
---
Upgrade CosmJS libs to 0.32.4

@ -33,7 +33,6 @@
"dependencies": {
"@chainlink/ccip-read-server": "^0.2.1",
"dotenv-flow": "^4.1.0",
"ethers": "5.7.2",
"hyperlane-explorer": "https://github.com/hyperlane-xyz/hyperlane-explorer.git"
"ethers": "5.7.2"
}
}

@ -1,5 +1,6 @@
import { info } from 'console';
import { Message, MessageTx } from 'hyperlane-explorer/src/types';
import { Message, MessageTx } from './explorerTypes';
// These types are copied from hyperlane-explorer. TODO: export them so this file can use them directly.
interface ApiResult<R> {

@ -1,7 +1,7 @@
import { MessageTx } from 'hyperlane-explorer/src/types';
import { MessageTx } from '../explorerTypes';
class HyperlaneService {
async getOriginBlockByMessageId(id: string): Promise<MessageTx> {
async getOriginBlockByMessageId(_messageId: string): Promise<MessageTx> {
return {
timestamp: 123456789,
hash: '0x123abc456def789',

@ -0,0 +1,60 @@
// TODO de-dupe this types with the Explorer by moving them to a shared lib
// These were originally imported from the explorer package but there were two issues
// 1. The explorer is not structured to be a lib (it's an app)
// 2. The explorer's deps on monorepo packages created circular deps leading to transitive deps conflicts
type Address = string;
export enum MessageStatus {
Unknown = 'unknown',
Pending = 'pending',
Delivered = 'delivered',
Failing = 'failing',
}
export interface MessageTxStub {
timestamp: number;
hash: string;
from: Address;
}
export interface MessageTx extends MessageTxStub {
to: Address;
blockHash: string;
blockNumber: number;
mailbox: Address;
nonce: number;
gasLimit: number;
gasPrice: number;
effectiveGasPrice: number;
gasUsed: number;
cumulativeGasUsed: number;
maxFeePerGas: number;
maxPriorityPerGas: number;
}
export interface MessageStub {
status: MessageStatus;
id: string; // Database id
msgId: string; // Message hash
nonce: number; // formerly leafIndex
sender: Address;
recipient: Address;
originChainId: number;
originDomainId: number;
destinationChainId: number;
destinationDomainId: number;
origin: MessageTxStub;
destination?: MessageTxStub;
isPiMsg?: boolean;
}
export interface Message extends MessageStub {
body: string;
decodedBody?: string;
origin: MessageTx;
destination?: MessageTx;
totalGasAmount?: string;
totalPayment?: string;
numPayments?: number;
}

@ -7,7 +7,7 @@
"@aws-sdk/client-iam": "^3.74.0",
"@aws-sdk/client-kms": "3.48.0",
"@aws-sdk/client-s3": "^3.74.0",
"@cosmjs/amino": "^0.31.3",
"@cosmjs/amino": "^0.32.4",
"@eth-optimism/sdk": "^3.1.6",
"@ethersproject/experimental": "^5.7.0",
"@ethersproject/hardware-wallets": "^5.7.0",

@ -4,8 +4,8 @@
"version": "4.1.0",
"dependencies": {
"@aws-sdk/client-s3": "^3.74.0",
"@cosmjs/cosmwasm-stargate": "^0.31.3",
"@cosmjs/stargate": "^0.31.3",
"@cosmjs/cosmwasm-stargate": "^0.32.4",
"@cosmjs/stargate": "^0.32.4",
"@hyperlane-xyz/core": "4.1.0",
"@hyperlane-xyz/utils": "4.1.0",
"@safe-global/api-kit": "1.3.0",

@ -1,5 +1,4 @@
import { MsgTransferEncodeObject } from '@cosmjs/stargate';
import Long from 'long';
import { Address, Domain, assert } from '@hyperlane-xyz/utils';
@ -128,9 +127,8 @@ export class CosmIbcTokenAdapter
sender: transferParams.fromAccountOwner,
receiver: transferParams.recipient,
// Represented as nano-seconds
timeoutTimestamp: Long.fromNumber(
new Date().getTime() + COSMOS_IBC_TRANSFER_TIMEOUT,
).multiply(1_000_000),
timeoutTimestamp:
BigInt(new Date().getTime() + COSMOS_IBC_TRANSFER_TIMEOUT) * 1000000n,
memo,
};
return {

@ -3,7 +3,7 @@
"description": "General utilities and types for the Hyperlane network",
"version": "4.1.0",
"dependencies": {
"@cosmjs/encoding": "^0.31.3",
"@cosmjs/encoding": "^0.32.4",
"@solana/web3.js": "^1.78.0",
"bignumber.js": "^9.1.1",
"ethers": "^5.7.2",

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save