|
1 | | -import { fromBech32, toBech32, fromBase64, toBase64 } from '@cosmjs/encoding'; |
2 | | -import { Registry } from '@cosmjs/proto-signing'; |
3 | 1 | 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'; |
10 | 5 | 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'; |
15 | 8 | import { Errors } from '../errors.js'; |
| 9 | +import { bech32Config, stableCurrency } from './chainInfo.js'; |
16 | 10 |
|
17 | 11 | /** @typedef {import("@cosmjs/proto-signing").EncodeObject} EncodeObject */ |
18 | 12 | /** @typedef {import("@cosmjs/stargate").AminoConverters} AminoConverters */ |
@@ -55,13 +49,6 @@ const SwingsetMsgs = { |
55 | 49 |
|
56 | 50 | /** @typedef {{owner: string, spendAction: string}} WalletSpendAction */ |
57 | 51 |
|
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 | | - |
65 | 52 | /** |
66 | 53 | * @returns {StdFee} |
67 | 54 | */ |
@@ -159,14 +146,8 @@ export const makeInteractiveSigner = async ( |
159 | 146 | const [account] = await offlineSigner.getAccounts(); |
160 | 147 | const { address } = account; |
161 | 148 |
|
162 | | - const converters = { |
163 | | - ...SwingsetConverters, |
164 | | - ...createBankAminoConverters(), |
165 | | - ...createAuthzAminoConverters(), |
166 | | - }; |
167 | 149 | const signingClient = await connectWithSigner(rpc, offlineSigner, { |
168 | | - aminoTypes: new AminoTypes(converters), |
169 | | - registry: SwingsetRegistry, |
| 150 | + ...getSigningAgoricClientOptions(), |
170 | 151 | }); |
171 | 152 | console.debug('InteractiveSigner', { signingClient }); |
172 | 153 |
|
|
0 commit comments