@hyperweb/telescope 1.17.1 → 1.17.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,8 +5,8 @@ import { BinaryReader, BinaryWriter } from "./binary${options.restoreImportExten
5
5
  import { getRpcClient } from "./extern${options.restoreImportExtension ?? ""}";` : ''}
6
6
  import { isRpc, Rpc } from "./helpers${options.restoreImportExtension ?? ""}";${!options.isGeneratingCosmosTypes ? `
7
7
  import { TelescopeGeneratedCodec, DeliverTxResponse, Message, StdFee } from "./types${options.restoreImportExtension ?? ""}";` : ''}${!options.isGeneratingCosmosTypes ? `
8
- import { toConverters, toEncoders } from "@interchainjs/cosmos/utils";
9
- import { ISigningClient } from "@interchainjs/cosmos/types/signing-client${options.restoreImportExtension ?? ""}";` : ''}
8
+ import { toConverters, toEncoders } from "@interchainjs/cosmos";
9
+ import { ISigningClient } from "@interchainjs/cosmos";` : ''}
10
10
 
11
11
  export interface QueryBuilderOptions<TReq, TRes> {
12
12
  encode: (request: TReq, writer?: BinaryWriter) => BinaryWriter
@@ -5,8 +5,8 @@ import { BinaryReader, BinaryWriter } from "./binary${options.restoreImportExten
5
5
  import { getRpcClient } from "./extern${options.restoreImportExtension ?? ""}";` : ''}
6
6
  import { isRpc, Rpc } from "./helpers${options.restoreImportExtension ?? ""}";${!options.isGeneratingCosmosTypes ? `
7
7
  import { TelescopeGeneratedCodec, DeliverTxResponse, Message, StdFee } from "./types${options.restoreImportExtension ?? ""}";` : ''}${!options.isGeneratingCosmosTypes ? `
8
- import { toConverters, toEncoders } from "@interchainjs/cosmos/utils";
9
- import { ISigningClient } from "@interchainjs/cosmos/types/signing-client${options.restoreImportExtension ?? ""}";` : ''}
8
+ import { toConverters, toEncoders } from "@interchainjs/cosmos";
9
+ import { ISigningClient } from "@interchainjs/cosmos";` : ''}
10
10
 
11
11
  export interface QueryBuilderOptions<TReq, TRes> {
12
12
  encode: (request: TReq, writer?: BinaryWriter) => BinaryWriter
@@ -1,6 +1,7 @@
1
1
  export const getHelperForBigint = (options) => {
2
- return `
3
- declare var self: any | undefined;
2
+ return `${options.useInterchainJs ?
3
+ 'export { fromBase64 as bytesFromBase64, toBase64 as base64FromBytes } from \'@interchainjs/encoding\';' :
4
+ `declare var self: any | undefined;
4
5
  declare var window: any | undefined;
5
6
  declare var global: any | undefined;
6
7
  var globalThis: any = (() => {
@@ -34,7 +35,7 @@ export function base64FromBytes(arr: Uint8Array): string {
34
35
  bin.push(String.fromCharCode(byte));
35
36
  });
36
37
  return btoa(bin.join(''));
37
- }
38
+ }`}
38
39
 
39
40
  export interface AminoHeight {
40
41
  readonly revision_number?: string;
@@ -11,7 +11,9 @@ if (_m0.util.Long !== Long) {
11
11
 
12
12
  export { Long };
13
13
 
14
- declare var self: any | undefined;
14
+ ${options.useInterchainJs ?
15
+ 'export { fromBase64 as bytesFromBase64, toBase64 as base64FromBytes } from \'@interchainjs/encoding\';' :
16
+ `declare var self: any | undefined;
15
17
  declare var window: any | undefined;
16
18
  declare var global: any | undefined;
17
19
  var globalThis: any = (() => {
@@ -43,7 +45,7 @@ export function base64FromBytes(arr: Uint8Array): string {
43
45
  bin.push(String.fromCharCode(byte));
44
46
  });
45
47
  return btoa(bin.join(''));
46
- }
48
+ }`}
47
49
 
48
50
  export interface AminoHeight {
49
51
  readonly revision_number?: string;
@@ -9,7 +9,7 @@ import {
9
9
  ITxArgs,
10
10
  EndpointOrRpc,
11
11
  } from './helper-func-types${options.restoreImportExtension ?? ""}'
12
- import { ISigningClient, isISigningClient } from "@interchainjs/cosmos/types/signing-client${options.restoreImportExtension ?? ""}";
12
+ import { ISigningClient, isISigningClient } from "@interchainjs/cosmos";
13
13
  import {
14
14
  StdFee,
15
15
  DeliverTxResponse,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperweb/telescope",
3
- "version": "1.17.1",
3
+ "version": "1.17.3",
4
4
  "description": "A TypeScript Transpiler for Cosmos Protobufs",
5
5
  "author": "Dan Lynch <pyramation@gmail.com>",
6
6
  "homepage": "https://github.com/hyperweb-io/telescope/tree/master/packages/telescope#readme",
@@ -111,5 +111,5 @@
111
111
  "rimraf": "5.0.0",
112
112
  "yaml": "^2.3.4"
113
113
  },
114
- "gitHead": "264734b693e5e98c4601799b56c84221d2a992fa"
114
+ "gitHead": "a8d5404c05996b49916a64f05586e771d87629dd"
115
115
  }
@@ -5,7 +5,11 @@ import {
5
5
  exportTypesWithAlias,
6
6
  recursiveModuleBundle,
7
7
  } from "@cosmology/ast";
8
- import { duplicateImportPathsWithExt, makeAliasName, makeAliasNameWithPackageAtEnd } from "@cosmology/utils";
8
+ import {
9
+ duplicateImportPathsWithExt,
10
+ makeAliasName,
11
+ makeAliasNameWithPackageAtEnd,
12
+ } from "@cosmology/utils";
9
13
 
10
14
  export const plugin = (builder: TelescopeBuilder, bundler: Bundler) => {
11
15
  if (!builder.options.bundle.enabled) {
@@ -56,29 +60,29 @@ export const plugin = (builder: TelescopeBuilder, bundler: Bundler) => {
56
60
  );
57
61
  if (duplicatedTypeNames.length > 0) {
58
62
  // export each, some duplicated with alias
59
- const typesWithAlias = exportObj.exportedIdentifiers.map((identifier) => {
60
- const duplicatedType = duplicatedTypeNames.find((type) => type === identifier);
61
- if (duplicatedType) {
62
- let alias: string;
63
- if (exportObj.isHelperFunc) {
64
- const serialNumber = builder.store.getAndIncTypeSerialNumber(identifier);
65
- if (serialNumber > 0) {
66
- alias = makeAliasNameWithPackageAtEnd({ package: exportObj.pkg, name: identifier });
67
- } else {
68
- alias = identifier;
69
- }
70
- } else {
71
- const serialNumber = builder.store.getAndIncTypeSerialNumber(identifier);
72
- if (serialNumber > 0) {
73
- alias = makeAliasName({ package: exportObj.pkg, name: identifier });
63
+ const typesWithAlias = exportObj.exportedIdentifiers.map(
64
+ (identifier) => {
65
+ const duplicatedType = duplicatedTypeNames.find(
66
+ (type) => type === identifier
67
+ );
68
+ if (duplicatedType) {
69
+ let alias: string;
70
+ if (exportObj.isHelperFunc) {
71
+ alias = makeAliasNameWithPackageAtEnd({
72
+ package: exportObj.pkg,
73
+ name: identifier,
74
+ });
74
75
  } else {
75
- alias = identifier;
76
+ alias = makeAliasName({
77
+ package: exportObj.pkg,
78
+ name: identifier,
79
+ });
76
80
  }
81
+ return { name: identifier, alias: alias };
77
82
  }
78
- return { name: identifier, alias: alias };
83
+ return { name: identifier, alias: identifier };
79
84
  }
80
- return { name: identifier, alias: identifier };
81
- });
85
+ );
82
86
  prog.push(exportTypesWithAlias(typesWithAlias, exportObj.relativePath));
83
87
  } else {
84
88
  // export *