-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.d.ts
67 lines (62 loc) · 1.85 KB
/
main.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
import { ethers } from "ethers";
type NetworkName = "local" | "pilot" | "poa" | "test" | "tobalaba" | "volta";
interface Signature {
hash: Uint8Array;
r: string;
s: string;
recoveryParam?: number;
v?: number;
}
interface ContractDefinition {
abi: {
constants: boolean;
input: {
name: string;
type: string;
}[];
name: string;
outputs: {
name: string;
type: string;
}[];
payable: boolean;
stateMutability: string;
type: string;
signature: string;
};
address: string;
bytecode: string;
}
interface EthersTransactionReceipt {
to?: string;
from?: string;
contractAddress?: string;
transactionIndex?: number;
root?: string;
gasUsed?: any;
logsBloom?: string;
blockHash?: string;
transactionHash?: string;
logs?: Array<any>;
blockNumber?: number;
confirmations?: number;
cumulativeGasUsed?: any;
byzantium: boolean;
status?: number;
}
export default class SnC {
provider: ethers.providers.BaseProvider;
wallet: ethers.Wallet;
settlementJson: ContractDefinition;
eurTokenJson: ContractDefinition;
usdTokenJson: ContractDefinition;
chfTokenJson: ContractDefinition;
settlement: ethers.Contract;
eurToken: ethers.Contract;
usdToken: ethers.Contract;
chfToken: ethers.Contract;
constructor(network: NetworkName, privateKey?: string, provider?: ethers.providers.BaseProvider);
provisionPaymentTokens(token: ethers.Contract, amount: number, recipient: string): Promise<EthersTransactionReceipt>;
getSignedTransfer(cdrId: string, recipient: string, amount: number | string, currency: string): Signature;
transfer(cdrId: string, recipient: string, amount: number, currency: string, signature: Signature): Promise<string>;
}