1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1
2
import yargs , { Argv } from 'yargs'
2
3
import { parseGRT } from '@graphprotocol/common-ts'
3
4
@@ -7,23 +8,23 @@ import { loadEnv, CLIArgs, CLIEnvironment } from '../../env'
7
8
8
9
export const setGSR = async ( cli : CLIEnvironment , cliArgs : CLIArgs ) : Promise < void > => {
9
10
const account = cliArgs . account
10
- const gdai = cli . contracts . GDAI
11
+ const gdai = ( cli . contracts as any ) . GDAI
11
12
12
13
logger . log ( `Setting GSR to ${ account } ...` )
13
14
await sendTransaction ( cli . wallet , gdai , 'setGSR' , [ account ] )
14
15
}
15
16
16
17
export const setRate = async ( cli : CLIEnvironment , cliArgs : CLIArgs ) : Promise < void > => {
17
18
const amount = parseGRT ( cliArgs . amount )
18
- const gsr = cli . contracts . GSRManager
19
+ const gsr = ( cli . contracts as any ) . GSRManager
19
20
20
21
logger . log ( `Setting rate to ${ amount } ...` )
21
22
await sendTransaction ( cli . wallet , gsr , 'setRate' , [ amount ] )
22
23
}
23
24
24
25
export const join = async ( cli : CLIEnvironment , cliArgs : CLIArgs ) : Promise < void > => {
25
26
const amount = parseGRT ( cliArgs . amount )
26
- const gsr = cli . contracts . GSRManager
27
+ const gsr = ( cli . contracts as any ) . GSRManager
27
28
28
29
logger . log ( `Reminder - you must call approve on the GSR before` )
29
30
logger . log ( `Joining GSR with ${ cliArgs . amount } tokens...` )
@@ -33,15 +34,15 @@ export const join = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise<void>
33
34
export const mint = async ( cli : CLIEnvironment , cliArgs : CLIArgs ) : Promise < void > => {
34
35
const amount = parseGRT ( cliArgs . amount )
35
36
const account = cliArgs . account
36
- const gdai = cli . contracts . GDAI
37
+ const gdai = ( cli . contracts as any ) . GDAI
37
38
38
39
logger . log ( `Minting ${ cliArgs . amount } GDAI for user ${ account } ...` )
39
40
await sendTransaction ( cli . wallet , gdai , 'mint' , [ account , amount ] )
40
41
}
41
42
42
43
export const burn = async ( cli : CLIEnvironment , cliArgs : CLIArgs ) : Promise < void > => {
43
44
const amount = parseGRT ( cliArgs . amount )
44
- const gdai = cli . contracts . GDAI
45
+ const gdai = ( cli . contracts as any ) . GDAI
45
46
46
47
logger . log ( `Burning ${ cliArgs . amount } GDAI...` )
47
48
await sendTransaction ( cli . wallet , gdai , 'burn' , [ amount ] )
@@ -50,7 +51,7 @@ export const burn = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise<void>
50
51
export const transfer = async ( cli : CLIEnvironment , cliArgs : CLIArgs ) : Promise < void > => {
51
52
const amount = parseGRT ( cliArgs . amount )
52
53
const account = cliArgs . account
53
- const gdai = cli . contracts . GDAI
54
+ const gdai = ( cli . contracts as any ) . GDAI
54
55
55
56
logger . log ( `Transferring ${ cliArgs . amount } tokens to user ${ account } ...` )
56
57
await sendTransaction ( cli . wallet , gdai , 'transfer' , [ account , amount ] )
@@ -59,7 +60,7 @@ export const transfer = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise<v
59
60
export const approve = async ( cli : CLIEnvironment , cliArgs : CLIArgs ) : Promise < void > => {
60
61
const amount = parseGRT ( cliArgs . amount )
61
62
const account = cliArgs . account
62
- const gdai = cli . contracts . GDAI
63
+ const gdai = ( cli . contracts as any ) . GDAI
63
64
64
65
logger . log ( `Approving ${ cliArgs . amount } GDAI for user ${ account } to spend...` )
65
66
await sendTransaction ( cli . wallet , gdai , 'approve' , [ account , amount ] )
0 commit comments