on master help sign in
Merge pull request #963 from urbit/hm/update-method-signature

l2transaction: update method signature

commitbded3d6abe0c436e14e7fa1f52a4b2fc208bf462 authortomholford <16504501+tomholford@users.noreply.github.com> dateSat 12 Feb 2022, 14:35 (5 years ago) parentfe6d1dbdb8e768
2 files changed+25−4
src/lib/types/L2Transaction.ts+23−2 src/lib/utils/roller.ts+2−2
src/lib/types/L2Transaction.ts+23−2
@@ -1,4 +1,16 @@
1−import RollerRPCAPI, { EthAddress, Proxy, Ship } from '@urbit/roller-api';
1+import RollerRPCAPI, {
2+ Adopt,
3+ CancelEscape,
4+ ConfigureKeys,
5+ Detach,
6+ Escape,
7+ EthAddress,
8+ Proxy,
9+ Reject,
10+ Ship,
11+ Spawn,
12+ TransferPoint,
13+} from '@urbit/roller-api';
214import WalletConnect from '@walletconnect/client';
315import BridgeWallet from './BridgeWallet';
416
@@ -37,7 +49,16 @@ export interface L2TransactionArgs extends SendL2Params {
3749
3850export interface TransactionData {
3951 data: any;
40− method: Function;
52+ method:
53+ | Spawn
54+ | TransferPoint
55+ | ConfigureKeys
56+ | Escape
57+ | CancelEscape
58+ | Adopt
59+ | Detach
60+ | Reject
61+ | (() => Promise<string>);
4162}
4263
4364export interface ReticketProgressCallback {
src/lib/utils/roller.ts+2−2
@@ -272,7 +272,7 @@ const getDataAndMethod = (args: L2TransactionArgs) => {
272272 sponsee,
273273 ship,
274274 } = args;
275− const result: TransactionData = { data: { address }, method: () => null };
275+ const result: TransactionData = { data: { address }, method: async () => '' };
276276
277277 switch (args.type) {
278278 case 'transferPoint':
@@ -360,7 +360,7 @@ export const submitL2Transaction = async (args: L2TransactionArgs) => {
360360 connector
361361 );
362362
363− return method(sig, from, wallet.address, data);
363+ return method(sig, false, from, wallet.address, data);
364364};
365365
366366export const reticketL2Point = async () => {};