on 07faa93 help sign in
bridge/src/lib/types/L2Transaction.ts
83 lines 1.5 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 WalletConnect from '@walletconnect/client';
15import BridgeWallet from './BridgeWallet';
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;
50export interface TransactionData {
51 data: any;
52 method:
53 | Spawn
54 | TransferPoint
55 | ConfigureKeys
56 | Escape
57 | CancelEscape
58 | Adopt
59 | Detach
60 | Reject
61 | (() => Promise<string>);
64export interface ReticketProgressCallback {
65 ({
66 type,
67 state,
68 value,
69 }: {
70 type: string;
71 state: number;
72 value?: string;
73 }): void;
76export interface ReticketParams {
77 point: Ship;
78 to: EthAddress;
79 manager: EthAddress;
80 fromWallet: BridgeWallet;
81 toWallet: UrbitWallet;
82 onUpdate?: ReticketProgressCallback;