@getpara/cosmjs-v0-integration 2.21.0 → 2.22.0

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.
@@ -38,7 +38,9 @@ var __async = (__this, __arguments, generator) => {
38
38
  var cosmosSigners_exports = {};
39
39
  __export(cosmosSigners_exports, {
40
40
  ParaAminoSigner: () => ParaAminoSigner,
41
- ParaProtoSigner: () => ParaProtoSigner
41
+ ParaProtoSigner: () => ParaProtoSigner,
42
+ createParaAminoSigner: () => createParaAminoSigner,
43
+ createParaProtoSigner: () => createParaProtoSigner
42
44
  });
43
45
  module.exports = __toCommonJS(cosmosSigners_exports);
44
46
  var import_amino = require("@cosmjs/amino");
@@ -143,8 +145,30 @@ class ParaAminoSigner extends ParaCosmosSigner {
143
145
  });
144
146
  }
145
147
  }
148
+ function createParaProtoSigner({
149
+ para,
150
+ address,
151
+ prefix,
152
+ walletId,
153
+ messageSigningTimeoutMs
154
+ }) {
155
+ const resolvedId = address ? para.findWalletByAddress(address, { type: ["COSMOS"] }).id : walletId;
156
+ return new ParaProtoSigner(para, prefix, resolvedId, messageSigningTimeoutMs);
157
+ }
158
+ function createParaAminoSigner({
159
+ para,
160
+ address,
161
+ prefix,
162
+ walletId,
163
+ messageSigningTimeoutMs
164
+ }) {
165
+ const resolvedId = address ? para.findWalletByAddress(address, { type: ["COSMOS"] }).id : walletId;
166
+ return new ParaAminoSigner(para, prefix, resolvedId, messageSigningTimeoutMs);
167
+ }
146
168
  // Annotate the CommonJS export names for ESM import in node:
147
169
  0 && (module.exports = {
148
170
  ParaAminoSigner,
149
- ParaProtoSigner
171
+ ParaProtoSigner,
172
+ createParaAminoSigner,
173
+ createParaProtoSigner
150
174
  });
@@ -110,7 +110,29 @@ class ParaAminoSigner extends ParaCosmosSigner {
110
110
  });
111
111
  }
112
112
  }
113
+ function createParaProtoSigner({
114
+ para,
115
+ address,
116
+ prefix,
117
+ walletId,
118
+ messageSigningTimeoutMs
119
+ }) {
120
+ const resolvedId = address ? para.findWalletByAddress(address, { type: ["COSMOS"] }).id : walletId;
121
+ return new ParaProtoSigner(para, prefix, resolvedId, messageSigningTimeoutMs);
122
+ }
123
+ function createParaAminoSigner({
124
+ para,
125
+ address,
126
+ prefix,
127
+ walletId,
128
+ messageSigningTimeoutMs
129
+ }) {
130
+ const resolvedId = address ? para.findWalletByAddress(address, { type: ["COSMOS"] }).id : walletId;
131
+ return new ParaAminoSigner(para, prefix, resolvedId, messageSigningTimeoutMs);
132
+ }
113
133
  export {
114
134
  ParaAminoSigner,
115
- ParaProtoSigner
135
+ ParaProtoSigner,
136
+ createParaAminoSigner,
137
+ createParaProtoSigner
116
138
  };
@@ -1,7 +1,7 @@
1
1
  import { AccountData, AminoSignResponse, OfflineAminoSigner, StdSignDoc } from '@cosmjs/amino';
2
2
  import { OfflineDirectSigner, DirectSignResponse } from '@cosmjs/proto-signing';
3
3
  import { SignDoc } from 'cosmjs-types/cosmos/tx/v1beta1/tx';
4
- import ParaCore, { Wallet } from '@getpara/core-sdk';
4
+ import ParaCore, { Wallet, type CreateParaSignerBaseOptions } from '@getpara/core-sdk';
5
5
  declare class ParaCosmosSigner {
6
6
  readonly prefix: string;
7
7
  readonly para: ParaCore;
@@ -27,4 +27,10 @@ export declare class ParaProtoSigner extends ParaCosmosSigner implements Offline
27
27
  export declare class ParaAminoSigner extends ParaCosmosSigner implements OfflineAminoSigner {
28
28
  signAmino(signerAddress: string, signDoc: StdSignDoc): Promise<AminoSignResponse>;
29
29
  }
30
+ export interface CreateParaCosmosSignerOptions extends CreateParaSignerBaseOptions {
31
+ prefix?: string;
32
+ messageSigningTimeoutMs?: number;
33
+ }
34
+ export declare function createParaProtoSigner({ para, address, prefix, walletId, messageSigningTimeoutMs, }: CreateParaCosmosSignerOptions): ParaProtoSigner;
35
+ export declare function createParaAminoSigner({ para, address, prefix, walletId, messageSigningTimeoutMs, }: CreateParaCosmosSignerOptions): ParaAminoSigner;
30
36
  export {};
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@getpara/cosmjs-v0-integration",
3
- "version": "2.21.0",
3
+ "version": "2.22.0",
4
4
  "dependencies": {
5
- "@getpara/core-sdk": "2.21.0"
5
+ "@getpara/core-sdk": "2.22.0"
6
6
  },
7
7
  "devDependencies": {
8
8
  "@cosmjs/amino": "^0.32.4",
@@ -16,7 +16,7 @@
16
16
  "dist",
17
17
  "package.json"
18
18
  ],
19
- "gitHead": "61f68bb1344dcec458f9016db39f631bb630b8f4",
19
+ "gitHead": "7191b8c823ec592eb1da16c9a085f8e69c6bf377",
20
20
  "main": "dist/cjs/index.js",
21
21
  "module": "dist/esm/index.js",
22
22
  "peerDependencies": {