Skip to content

Commit

Permalink
add interchainjs deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Zetazzz committed Feb 13, 2025
1 parent 4a9c479 commit 6f533c2
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Duration, DurationAmino } from "../../../google/protobuf/duration";
import { Coin, CoinAmino } from "../../base/v1beta1/coin";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { DeepPartial, toTimestamp, fromTimestamp } from "../../../helpers";
import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing";
import { encodePubkey, decodePubkey } from "@interchainjs/pubkey";
import { Pubkey } from "@cosmjs/amino";
/** BondStatus is the status of a validator. */
export enum BondStatus {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Coin, CoinAmino } from "../../base/v1beta1/coin";
import { Timestamp } from "../../../google/protobuf/timestamp";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { DeepPartial, toTimestamp, fromTimestamp } from "../../../helpers";
import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing";
import { encodePubkey, decodePubkey } from "@interchainjs/pubkey";
import { Pubkey } from "@cosmjs/amino";
/** MsgCreateValidator defines a SDK message for creating a new validator. */
export interface MsgCreateValidator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AccessConfig, AccessConfigAmino } from "./types";
import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { DeepPartial } from "../../../helpers";
import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding";
import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@interchainjs/encoding";
/** StoreCodeProposal gov proposal content type to submit WASM code to the system */
export interface StoreCodeProposal {
/** Title is a short summary */
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/v-next/outputicjs/cosmwasm/wasm/v1/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { PageRequest, PageRequestAmino, PageResponse, PageResponseAmino } from "
import { ContractInfo, ContractInfoAmino, ContractCodeHistoryEntry, ContractCodeHistoryEntryAmino, Model, ModelAmino } from "./types";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers";
import { toUtf8, fromUtf8 } from "@cosmjs/encoding";
import { toUtf8, fromUtf8 } from "@interchainjs/encoding";
/**
* QueryContractInfoRequest is the request type for the Query/ContractInfo RPC
* method
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/v-next/outputicjs/cosmwasm/wasm/v1/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AccessConfig, AccessConfigAmino } from "./types";
import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers";
import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding";
import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@interchainjs/encoding";
/** MsgStoreCode submit Wasm code to the system */
export interface MsgStoreCode {
/** Sender is the that actor that signed the messages */
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/v-next/outputicjs/cosmwasm/wasm/v1/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { DeepPartial, bytesFromBase64, base64FromBytes } from "../../../helpers";
import { toUtf8, fromUtf8 } from "@cosmjs/encoding";
import { toUtf8, fromUtf8 } from "@interchainjs/encoding";
/** AccessType permission types */
export enum AccessType {
/** ACCESS_TYPE_UNSPECIFIED - AccessTypeUnspecified placeholder for empty value */
Expand Down
12 changes: 12 additions & 0 deletions packages/telescope/src/generators/customize-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ import { TelescopeBuilder } from '../builder';
import { UTILS } from '../utils';

export const plugin = (builder: TelescopeBuilder) => {
if(builder.options.useInterchainJs) {
UTILS.encodePubkey = '@interchainjs/pubkey';
UTILS.decodePubkey = '@interchainjs/pubkey';

UTILS.fromBase64 = '@interchainjs/encoding';
UTILS.fromBech32 = '@interchainjs/encoding';
UTILS.fromHex = '@interchainjs/encoding';
UTILS.fromUtf8 = '@interchainjs/encoding';
UTILS.toBase64 = '@interchainjs/encoding';
UTILS.toUtf8 = '@interchainjs/encoding';
}

if (
builder.options.prototypes.typingsFormat.customTypes.useEnhancedDecimal ===
true
Expand Down

0 comments on commit 6f533c2

Please sign in to comment.