1
+ import { decodeAddressHook } from '@agoric/cosmic-proto/address-hooks.js' ;
1
2
import { AmountMath } from '@agoric/ertp' ;
2
3
import { assertAllDefined , makeTracer } from '@agoric/internal' ;
3
4
import { AnyNatAmountShape , ChainAddressShape } from '@agoric/orchestration' ;
4
5
import { pickFacet } from '@agoric/vat-data' ;
5
6
import { VowShape } from '@agoric/vow' ;
6
7
import { q } from '@endo/errors' ;
7
8
import { E } from '@endo/far' ;
8
- import { M } from '@endo/patterns' ;
9
+ import { M , mustMatch } from '@endo/patterns' ;
9
10
import {
10
11
CctpTxEvidenceShape ,
11
- EudParamShape ,
12
+ AddressHookShape ,
12
13
EvmHashShape ,
13
14
} from '../type-guards.js' ;
14
- import { addressTools } from '../utils/address.js' ;
15
15
import { makeFeeTools } from '../utils/fees.js' ;
16
16
17
17
/**
@@ -22,7 +22,7 @@ import { makeFeeTools } from '../utils/fees.js';
22
22
* @import {ZoeTools} from '@agoric/orchestration/src/utils/zoe-tools.js';
23
23
* @import {VowTools} from '@agoric/vow';
24
24
* @import {Zone} from '@agoric/zone';
25
- * @import {CctpTxEvidence, EvmHash, FeeConfig, LogFn, NobleAddress} from '../types.js';
25
+ * @import {CctpTxEvidence, AddressHook, EvmHash, FeeConfig, LogFn, NobleAddress} from '../types.js';
26
26
* @import {StatusManager} from './status-manager.js';
27
27
* @import {LiquidityPoolKit} from './liquidity-pool.js';
28
28
*/
@@ -148,11 +148,10 @@ export const prepareAdvancerKit = (
148
148
149
149
const { borrowerFacet, poolAccount } = this . state ;
150
150
const { recipientAddress } = evidence . aux ;
151
- // throws if EUD is not found
152
- const { EUD } = addressTools . getQueryParams (
153
- recipientAddress ,
154
- EudParamShape ,
155
- ) ;
151
+ const decoded = decodeAddressHook ( recipientAddress ) ;
152
+ mustMatch ( decoded , AddressHookShape ) ;
153
+ const { EUD } = /** @type {AddressHook['query'] } */ ( decoded . query ) ;
154
+ log ( `decoded EUD: ${ EUD } ` ) ;
156
155
// throws if the bech32 prefix is not found
157
156
const destination = chainHub . makeChainAddress ( EUD ) ;
158
157
0 commit comments