1 | import { Address, BigNumberish, BigNumberJson, Bytes32, HexString } from "./basic";
|
2 | import { AppIdentity, MultisigOperation, ContractAddresses } from "./contracts";
|
3 | import { enumify } from "./utils";
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | export type MinimalTransaction = {
|
9 | to: Address;
|
10 | value: BigNumberish;
|
11 | data: HexString;
|
12 | };
|
13 |
|
14 |
|
15 | export interface EthereumCommitment {
|
16 | signatures: string[];
|
17 | encode(): HexString;
|
18 | hashToSign(): Bytes32;
|
19 | getSignedTransaction(): Promise<MinimalTransaction>;
|
20 | }
|
21 |
|
22 | export const CommitmentTypes = enumify({
|
23 | Conditional: "conditional",
|
24 | SetState: "setState",
|
25 | Setup: "setup",
|
26 | Withdraw: "withdraw",
|
27 | });
|
28 | export type CommitmentTypes = typeof CommitmentTypes[keyof typeof CommitmentTypes];
|
29 |
|
30 | export type MultisigTransaction = MinimalTransaction & {
|
31 | operation: MultisigOperation;
|
32 | };
|
33 |
|
34 | export type SetStateCommitmentJSON = {
|
35 | readonly appIdentity: AppIdentity;
|
36 | readonly appIdentityHash: HexString;
|
37 | readonly appStateHash: HexString;
|
38 | readonly challengeRegistryAddress: Address;
|
39 | readonly signatures: string[];
|
40 | readonly stateTimeout: BigNumberJson;
|
41 | readonly versionNumber: BigNumberJson;
|
42 | readonly transactionData: HexString;
|
43 | };
|
44 |
|
45 | export type ConditionalTransactionCommitmentJSON = {
|
46 | readonly appIdentityHash: HexString;
|
47 | readonly contractAddresses: ContractAddresses;
|
48 | readonly freeBalanceAppIdentityHash: HexString;
|
49 | readonly interpreterAddr: Address;
|
50 | readonly interpreterParams: HexString;
|
51 | readonly multisigAddress: Address;
|
52 | readonly multisigOwners: Address[];
|
53 | readonly signatures: string[];
|
54 | readonly transactionData: HexString;
|
55 | };
|