-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtruffle.d.ts
114 lines (99 loc) · 2.96 KB
/
truffle.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import * as Web3 from "web3";
import {
BLTInstance,
BloomTokenSaleInstance,
MiniMeTokenInstance,
MiniMeVestedTokenInstance,
PlaceholderControllerInstance,
BloomPriceAdjustmentControllerInstance,
TokenVestingInstance,
TokenVestingContract
} from "./contracts";
declare global {
function contract(name: string, test: ContractTest): void;
var artifacts: Artifacts;
var web3: Web3;
var assert: Chai.AssertStatic;
}
declare type ContractTest = (accounts: string[]) => void;
interface TransactionMeta {
from: string;
}
interface Contract<T> {
"new"(...args: any[]): Promise<T>;
deployed(): Promise<T>;
at(address: string): T;
}
interface MetaCoinInstance {
getBalance(account: string): number;
getBalanceInEth(account: string): number;
sendCoin(
account: string,
amount: number,
meta?: TransactionMeta
): Promise<void>;
}
interface Transaction {
hash: string;
nonce: number;
blockHash: string | null;
blockNumber: number | null;
transactionIndex: number | null;
from: ContractInstance | string;
to: string | null;
value: BigNumber.BigNumber;
gasPrice: BigNumber.BigNumber;
gas: number;
input: string;
}
type TransactionOptions = Partial<Transaction>;
interface Ownable {
owner(): string;
transferOwnership(newOwner: string, options?: TransactionOptions): any;
}
type Address = string;
interface ContractInstance {
address: Address;
}
interface MockSaleInstance extends BloomTokenSaleInstance {
grantInstantlyVestedTokens(
recipient: Address,
amount: number,
options?: TransactionOptions
): Promise<void>;
}
interface MockTokenInstance extends BLTInstance {
canCreateGrants(subject: Address): any;
addGranter(subject: Address): Promise<void>;
}
interface ConfigurableMockInstance extends ContractInstance, Ownable {
count(...args: any[]): any;
finishConfiguration(...args: any[]): any;
increment(...args: any[]): any;
decrement(...args: any[]): any;
}
interface MockBLTInstance extends BLTInstance {
gift(recipient: Address, options?: TransactionOptions): Promise<void>;
bigGift(recipient: Address, options?: TransactionOptions): Promise<void>;
}
interface MockBLTContract extends Contract<MockBLTInstance> {
new (): Promise<MockBLTInstance>;
}
interface Artifacts {
require(name: "MiniMeVestedToken"): Contract<MiniMeVestedTokenInstance>;
require(name: "BloomTokenSale"): Contract<BloomTokenSaleInstance>;
require(
name: "BloomPriceAdjustmentController"
): Contract<BloomPriceAdjustmentControllerInstance>;
require(
name: "PlaceholderController"
): Contract<PlaceholderControllerInstance>;
require(name: "BLT"): Contract<BLTInstance>;
require(
name: "./helpers/ConfigurableMock"
): Contract<ConfigurableMockInstance>;
require(name: "./helpers/MockSale"): Contract<MockSaleInstance>;
require(name: "./helpers/MockToken"): Contract<MockTokenInstance>;
require(name: "./helpers/MockBLT"): Contract<MockBLTInstance>;
require(name: "TokenVesting"): TokenVestingContract;
}