on master help sign in
l2transaction: update types and call signature
db8e768Hunter Miller
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';
2import WalletConnect from '@walletconnect/client';
14import WalletConnect from '@walletconnect/client';
3import BridgeWallet from './BridgeWallet';
15import BridgeWallet from './BridgeWallet';
4
16
@@ -37,7 +49,16 @@ export interface L2TransactionArgs extends SendL2Params {
37
49
38export interface TransactionData {
50export interface TransactionData {
39 data: any;
51 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>);
41}
62}
42
63
43export interface ReticketProgressCallback {
64export interface ReticketProgressCallback {
src/lib/utils/roller.ts+2−2
@@ -272,7 +272,7 @@ const getDataAndMethod = (args: L2TransactionArgs) => {
272 sponsee,
272 sponsee,
273 ship,
273 ship,
274 } = args;
274 } = args;
275− const result: TransactionData = { data: { address }, method: () => null };
275+ const result: TransactionData = { data: { address }, method: async () => '' };
276
276
277 switch (args.type) {
277 switch (args.type) {
278 case 'transferPoint':
278 case 'transferPoint':
@@ -360,7 +360,7 @@ export const submitL2Transaction = async (args: L2TransactionArgs) => {
360 connector
360 connector
361 );
361 );
362
362
363− return method(sig, from, wallet.address, data);
363+ return method(sig, false, from, wallet.address, data);
364};
364};
365
365
366export const reticketL2Point = async () => {};
366export const reticketL2Point = async () => {};