on master help sign in
reticket: sign set spawn proxy TX w/ MT wal
73ef2e5tomholford
src/lib/useReticketL2Spawn.ts+12−1
@@ -97,12 +97,23 @@ export const useReticketL2Spawn = () => {
97 });
97 });
98
98
99 // instead, set spawn proxy on L2
99 // instead, set spawn proxy on L2
100+ // In most TX sending cases, we would use the fromWallet to sign and send
101+ // the TX. However, because we are transferring this point during the
102+ // reticket, we will instead sign the final set spawn proxy TX with the
103+ // receiving wallet's private key.
104+
105+ // `registerProxyAddress` expects a toWallet object shaped like a
106+ // BridgeWallet with `address` and `privateKey` properties.
107+ const toWalletStub = {
108+ address: toWallet.ownership.keys.address,
109+ privateKey: Buffer.from(toWallet.ownership.keys.private, 'hex'),
110+ };
100 const proxy = 'own';
111 const proxy = 'own';
101 const nonce = await api.getNonce({ ship: point, proxy });
112 const nonce = await api.getNonce({ ship: point, proxy });
102
113
103 await registerProxyAddress(
114 await registerProxyAddress(
104 api,
115 api,
105− fromWallet,
116+ toWalletStub,
106 point,
117 point,
107 proxy,
118 proxy,
108 'spawn',
119 'spawn',
src/lib/utils/roller.ts+1−1
@@ -208,7 +208,7 @@ const setProxy = async (
208
208
209export const registerProxyAddress = async (
209export const registerProxyAddress = async (
210 api: RollerRPCAPI,
210 api: RollerRPCAPI,
211− wallet: any,
211+ wallet: any, // BridgeWallet
212 _point: Ship,
212 _point: Ship,
213 proxy: string,
213 proxy: string,
214 proxyAddressType: string,
214 proxyAddressType: string,