Skip to content

Commit a50353b

Browse files
committed
refactor: use getSigningAgoricClientOptions
1 parent dc92b79 commit a50353b

File tree

1 file changed

+7
-26
lines changed

1 file changed

+7
-26
lines changed

packages/web-components/src/wallet-connection/makeInteractiveSigner.js

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
import { fromBech32, toBech32, fromBase64, toBase64 } from '@cosmjs/encoding';
2-
import { Registry } from '@cosmjs/proto-signing';
31
import {
4-
AminoTypes,
5-
defaultRegistryTypes,
6-
assertIsDeliverTxSuccess,
7-
createBankAminoConverters,
8-
createAuthzAminoConverters,
9-
} from '@cosmjs/stargate';
2+
getSigningAgoricClientOptions
3+
} from '@agoric/cosmic-proto';
4+
import { fromBase64, fromBech32, toBase64, toBech32 } from '@cosmjs/encoding';
105
import {
11-
MsgWalletSpendAction,
12-
MsgProvision,
13-
} from '@agoric/cosmic-proto/swingset/msgs.js';
14-
import { stableCurrency, bech32Config } from './chainInfo.js';
6+
assertIsDeliverTxSuccess
7+
} from '@cosmjs/stargate';
158
import { Errors } from '../errors.js';
9+
import { bech32Config, stableCurrency } from './chainInfo.js';
1610

1711
/** @typedef {import("@cosmjs/proto-signing").EncodeObject} EncodeObject */
1812
/** @typedef {import("@cosmjs/stargate").AminoConverters} AminoConverters */
@@ -55,13 +49,6 @@ const SwingsetMsgs = {
5549

5650
/** @typedef {{owner: string, spendAction: string}} WalletSpendAction */
5751

58-
const SwingsetRegistry = new Registry([
59-
...defaultRegistryTypes,
60-
// XXX should this list be "upstreamed" to @agoric/cosmic-proto?
61-
[SwingsetMsgs.MsgWalletSpendAction.typeUrl, MsgWalletSpendAction],
62-
[SwingsetMsgs.MsgProvision.typeUrl, MsgProvision],
63-
]);
64-
6552
/**
6653
* @returns {StdFee}
6754
*/
@@ -159,14 +146,8 @@ export const makeInteractiveSigner = async (
159146
const [account] = await offlineSigner.getAccounts();
160147
const { address } = account;
161148

162-
const converters = {
163-
...SwingsetConverters,
164-
...createBankAminoConverters(),
165-
...createAuthzAminoConverters(),
166-
};
167149
const signingClient = await connectWithSigner(rpc, offlineSigner, {
168-
aminoTypes: new AminoTypes(converters),
169-
registry: SwingsetRegistry,
150+
...getSigningAgoricClientOptions(),
170151
});
171152
console.debug('InteractiveSigner', { signingClient });
172153

0 commit comments

Comments
 (0)