on master help sign in
bridge/src/lib/types/L2Transaction.ts
85 lines 1.6 kB history raw
1import 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';
14import BridgeWallet from './BridgeWallet';
15import { SignClient as WalletConnect } from '@walletconnect/sign-client/dist/types/client';
17export type TransactionType =
18 | 'transferPoint'
19 | 'spawn'
20 | 'configureKeys'
21 | 'escape'
22 | 'cancelEscape'
23 | 'adopt'
24 | 'detach'
25 | 'reject';
27export interface SendL2Params {
28 address?: string; // Destination address
29 breach?: boolean;
30 networkSeed?: any;
31 newSponsor?: Ship;
32 sponsee?: Ship;
33 nonce: number;
34 pointToSpawn?: number;
35 proxy: Proxy;
36 proxyAddressType?: string;
37 reset?: boolean;
38 ship: Ship;
39 type: TransactionType;
42export interface L2TransactionArgs extends SendL2Params {
43 api: RollerRPCAPI;
44 wallet: any;
45 walletType: symbol;
46 web3: any;
47 connector: WalletConnect | null;
48 isConnected: Function;
49 signPersonalMessage: Function;
52export interface TransactionData {
53 data: any;
54 method:
55 | Spawn
56 | TransferPoint
57 | ConfigureKeys
58 | Escape
59 | CancelEscape
60 | Adopt
61 | Detach
62 | Reject
63 | (() => Promise<string>);
66export interface ReticketProgressCallback {
67 ({
68 type,
69 state,
70 value,
71 }: {
72 type: string;
73 state: number;
74 value?: string;
75 }): void;
78export interface ReticketParams {
79 point: Ship;
80 to: EthAddress;
81 manager: EthAddress;
82 fromWallet: BridgeWallet;
83 toWallet: UrbitWallet;
84 onUpdate?: ReticketProgressCallback;