@aave/cli 4.1.2 → 4.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/action/borrow.d.ts +12 -0
- package/dist/commands/action/borrow.js +81 -0
- package/dist/commands/action/repay.d.ts +12 -0
- package/dist/commands/action/repay.js +83 -0
- package/dist/commands/action/supply.d.ts +13 -0
- package/dist/commands/action/supply.js +89 -0
- package/dist/commands/action/withdraw.d.ts +12 -0
- package/dist/commands/action/withdraw.js +81 -0
- package/dist/common.d.ts +4 -0
- package/dist/common.js +7 -0
- package/oclif.manifest.json +256 -1
- package/package.json +6 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InvariantError, type SendWithError, type TimeoutError, type TransactionReceipt } from '@aave/client';
|
|
2
|
+
import * as common from '../../common.js';
|
|
3
|
+
export default class ActionBorrow extends common.V4Command {
|
|
4
|
+
static description: string;
|
|
5
|
+
static flags: {
|
|
6
|
+
'reserve-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
amount: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'private-key': import("@oclif/core/interfaces").OptionFlag<`0x${string}` | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
private getBorrowRequest;
|
|
11
|
+
run(): Promise<TransactionReceipt | InvariantError | SendWithError | TimeoutError>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { bigDecimal, evmAddress, InvariantError, invariant, ok, ResultAsync, reserveId, } from '@aave/client';
|
|
2
|
+
import { borrow, reserve } from '@aave/client/actions';
|
|
3
|
+
import { sendWith, toViemChain } from '@aave/client/viem';
|
|
4
|
+
import { Flags } from '@oclif/core';
|
|
5
|
+
import { createWalletClient, http } from 'viem';
|
|
6
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
7
|
+
import * as common from '../../common.js';
|
|
8
|
+
export default class ActionBorrow extends common.V4Command {
|
|
9
|
+
static description = 'Borrow ERC20 tokens from a reserve';
|
|
10
|
+
static flags = {
|
|
11
|
+
'reserve-id': Flags.string({
|
|
12
|
+
required: true,
|
|
13
|
+
description: 'Reserve ID of the reserve to borrow from',
|
|
14
|
+
}),
|
|
15
|
+
amount: Flags.string({
|
|
16
|
+
required: true,
|
|
17
|
+
description: 'Amount of the token to borrow',
|
|
18
|
+
}),
|
|
19
|
+
'private-key': common.privateKey({
|
|
20
|
+
required: false,
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
23
|
+
getBorrowRequest() {
|
|
24
|
+
return ResultAsync.fromPromise(this.parse(ActionBorrow), (error) => new InvariantError(String(error))).andThen(({ flags }) => {
|
|
25
|
+
const privateKey = (flags['private-key'] ??
|
|
26
|
+
process.env.PRIVATE_KEY);
|
|
27
|
+
invariant(privateKey, 'Provide --private-key or PRIVATE_KEY environment variable');
|
|
28
|
+
const parsedReserveId = reserveId(flags['reserve-id']);
|
|
29
|
+
const amount = flags.amount.trim();
|
|
30
|
+
invariant(amount.length > 0, 'Amount cannot be empty');
|
|
31
|
+
const account = privateKeyToAccount(privateKey);
|
|
32
|
+
const sender = evmAddress(account.address);
|
|
33
|
+
return reserve(this.client, {
|
|
34
|
+
query: { reserveId: parsedReserveId },
|
|
35
|
+
user: sender,
|
|
36
|
+
}).andThen((reserveData) => {
|
|
37
|
+
invariant(reserveData, `Reserve not found: ${flags['reserve-id']}`);
|
|
38
|
+
return ok({
|
|
39
|
+
request: {
|
|
40
|
+
reserve: reserveData.id,
|
|
41
|
+
amount: {
|
|
42
|
+
erc20: {
|
|
43
|
+
value: bigDecimal(amount),
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
sender,
|
|
47
|
+
},
|
|
48
|
+
reserve: reserveData,
|
|
49
|
+
amount,
|
|
50
|
+
privateKey,
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
async run() {
|
|
56
|
+
const result = await this.getBorrowRequest().andThen(({ request, reserve, amount, privateKey }) => {
|
|
57
|
+
const wallet = createWalletClient({
|
|
58
|
+
account: privateKeyToAccount(privateKey),
|
|
59
|
+
chain: toViemChain(reserve.chain),
|
|
60
|
+
transport: http(reserve.chain.rpcUrl),
|
|
61
|
+
});
|
|
62
|
+
return borrow(this.client, request)
|
|
63
|
+
.andThen(sendWith(wallet))
|
|
64
|
+
.andTee((txResult) => this.log(`Borrow transaction sent with hash: ${txResult.txHash}`))
|
|
65
|
+
.andThen(this.client.waitForTransaction)
|
|
66
|
+
.map((txResult) => {
|
|
67
|
+
this.display([
|
|
68
|
+
['Reserve ID', reserve.id],
|
|
69
|
+
['Amount', `${amount} - ${reserve.asset.underlying.info.symbol}`],
|
|
70
|
+
['Transaction Hash', txResult.txHash],
|
|
71
|
+
['Url', `${reserve.chain.explorerUrl}/tx/${txResult.txHash}`],
|
|
72
|
+
]);
|
|
73
|
+
return txResult;
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
if (result.isErr()) {
|
|
77
|
+
this.error(result.error);
|
|
78
|
+
}
|
|
79
|
+
return result.value;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InvariantError, type SendWithError, type TimeoutError, type TransactionReceipt } from '@aave/client';
|
|
2
|
+
import * as common from '../../common.js';
|
|
3
|
+
export default class ActionRepay extends common.V4Command {
|
|
4
|
+
static description: string;
|
|
5
|
+
static flags: {
|
|
6
|
+
'reserve-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
amount: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'private-key': import("@oclif/core/interfaces").OptionFlag<`0x${string}` | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
private getRepayRequest;
|
|
11
|
+
run(): Promise<TransactionReceipt | InvariantError | SendWithError | TimeoutError>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { bigDecimal, evmAddress, InvariantError, invariant, ok, ResultAsync, reserveId, } from '@aave/client';
|
|
2
|
+
import { repay, reserve } from '@aave/client/actions';
|
|
3
|
+
import { sendWith, toViemChain } from '@aave/client/viem';
|
|
4
|
+
import { Flags } from '@oclif/core';
|
|
5
|
+
import { createWalletClient, http } from 'viem';
|
|
6
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
7
|
+
import * as common from '../../common.js';
|
|
8
|
+
export default class ActionRepay extends common.V4Command {
|
|
9
|
+
static description = 'Repay ERC20 debt to a reserve';
|
|
10
|
+
static flags = {
|
|
11
|
+
'reserve-id': Flags.string({
|
|
12
|
+
required: true,
|
|
13
|
+
description: 'Reserve ID of the reserve to repay',
|
|
14
|
+
}),
|
|
15
|
+
amount: Flags.string({
|
|
16
|
+
required: true,
|
|
17
|
+
description: 'Amount of the token to repay',
|
|
18
|
+
}),
|
|
19
|
+
'private-key': common.privateKey({
|
|
20
|
+
required: false,
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
23
|
+
getRepayRequest() {
|
|
24
|
+
return ResultAsync.fromPromise(this.parse(ActionRepay), (error) => new InvariantError(String(error))).andThen(({ flags }) => {
|
|
25
|
+
const privateKey = (flags['private-key'] ??
|
|
26
|
+
process.env.PRIVATE_KEY);
|
|
27
|
+
invariant(privateKey, 'Provide --private-key or PRIVATE_KEY environment variable');
|
|
28
|
+
const parsedReserveId = reserveId(flags['reserve-id']);
|
|
29
|
+
const amount = flags.amount.trim();
|
|
30
|
+
invariant(amount.length > 0, 'Amount cannot be empty');
|
|
31
|
+
const account = privateKeyToAccount(privateKey);
|
|
32
|
+
const sender = evmAddress(account.address);
|
|
33
|
+
return reserve(this.client, {
|
|
34
|
+
query: { reserveId: parsedReserveId },
|
|
35
|
+
user: sender,
|
|
36
|
+
}).andThen((reserveData) => {
|
|
37
|
+
invariant(reserveData, `Reserve not found: ${flags['reserve-id']}`);
|
|
38
|
+
return ok({
|
|
39
|
+
request: {
|
|
40
|
+
reserve: reserveData.id,
|
|
41
|
+
amount: {
|
|
42
|
+
erc20: {
|
|
43
|
+
value: {
|
|
44
|
+
exact: bigDecimal(amount),
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
sender,
|
|
49
|
+
},
|
|
50
|
+
reserve: reserveData,
|
|
51
|
+
amount,
|
|
52
|
+
privateKey,
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
async run() {
|
|
58
|
+
const result = await this.getRepayRequest().andThen(({ request, reserve, amount, privateKey }) => {
|
|
59
|
+
const wallet = createWalletClient({
|
|
60
|
+
account: privateKeyToAccount(privateKey),
|
|
61
|
+
chain: toViemChain(reserve.chain),
|
|
62
|
+
transport: http(reserve.chain.rpcUrl),
|
|
63
|
+
});
|
|
64
|
+
return repay(this.client, request)
|
|
65
|
+
.andThen(sendWith(wallet))
|
|
66
|
+
.andTee((txResult) => this.log(`Repay transaction sent with hash: ${txResult.txHash}`))
|
|
67
|
+
.andThen(this.client.waitForTransaction)
|
|
68
|
+
.map((txResult) => {
|
|
69
|
+
this.display([
|
|
70
|
+
['Reserve ID', reserve.id],
|
|
71
|
+
['Amount', `${amount} - ${reserve.asset.underlying.info.symbol}`],
|
|
72
|
+
['Transaction Hash', txResult.txHash],
|
|
73
|
+
['Url', `${reserve.chain.explorerUrl}/tx/${txResult.txHash}`],
|
|
74
|
+
]);
|
|
75
|
+
return txResult;
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
if (result.isErr()) {
|
|
79
|
+
this.error(result.error);
|
|
80
|
+
}
|
|
81
|
+
return result.value;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InvariantError, type SendWithError, type TimeoutError, type TransactionReceipt } from '@aave/client';
|
|
2
|
+
import * as common from '../../common.js';
|
|
3
|
+
export default class ActionSupply extends common.V4Command {
|
|
4
|
+
static description: string;
|
|
5
|
+
static flags: {
|
|
6
|
+
'reserve-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
amount: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'private-key': import("@oclif/core/interfaces").OptionFlag<`0x${string}` | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'enable-collateral': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
private getSupplyRequest;
|
|
12
|
+
run(): Promise<TransactionReceipt | InvariantError | SendWithError | TimeoutError>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { bigDecimal, evmAddress, InvariantError, invariant, ok, ResultAsync, reserveId, } from '@aave/client';
|
|
2
|
+
import { reserve, supply } from '@aave/client/actions';
|
|
3
|
+
import { sendWith, toViemChain } from '@aave/client/viem';
|
|
4
|
+
import { Flags } from '@oclif/core';
|
|
5
|
+
import { createWalletClient, http } from 'viem';
|
|
6
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
7
|
+
import * as common from '../../common.js';
|
|
8
|
+
export default class ActionSupply extends common.V4Command {
|
|
9
|
+
static description = 'Supply ERC20 tokens to a reserve';
|
|
10
|
+
static flags = {
|
|
11
|
+
'reserve-id': Flags.string({
|
|
12
|
+
required: true,
|
|
13
|
+
description: 'Reserve ID of the reserve to supply',
|
|
14
|
+
}),
|
|
15
|
+
amount: Flags.string({
|
|
16
|
+
required: true,
|
|
17
|
+
description: 'Amount of the token to supply',
|
|
18
|
+
}),
|
|
19
|
+
'private-key': common.privateKey({
|
|
20
|
+
required: false,
|
|
21
|
+
}),
|
|
22
|
+
'enable-collateral': Flags.boolean({
|
|
23
|
+
required: false,
|
|
24
|
+
default: false,
|
|
25
|
+
description: 'If provided, the supplied position is enabled as collateral',
|
|
26
|
+
}),
|
|
27
|
+
};
|
|
28
|
+
getSupplyRequest() {
|
|
29
|
+
return ResultAsync.fromPromise(this.parse(ActionSupply), (error) => new InvariantError(String(error))).andThen(({ flags }) => {
|
|
30
|
+
const privateKey = (flags['private-key'] ??
|
|
31
|
+
process.env.PRIVATE_KEY);
|
|
32
|
+
invariant(privateKey, 'Provide --private-key or PRIVATE_KEY environment variable');
|
|
33
|
+
const parsedReserveId = reserveId(flags['reserve-id']);
|
|
34
|
+
const amount = flags.amount.trim();
|
|
35
|
+
const collateralEnabled = flags['enable-collateral'];
|
|
36
|
+
invariant(amount.length > 0, 'Amount cannot be empty');
|
|
37
|
+
const account = privateKeyToAccount(privateKey);
|
|
38
|
+
const sender = evmAddress(account.address);
|
|
39
|
+
return reserve(this.client, {
|
|
40
|
+
query: { reserveId: parsedReserveId },
|
|
41
|
+
user: sender,
|
|
42
|
+
}).andThen((reserveData) => {
|
|
43
|
+
invariant(reserveData, `Reserve not found: ${flags['reserve-id']}`);
|
|
44
|
+
return ok({
|
|
45
|
+
request: {
|
|
46
|
+
reserve: reserveData.id,
|
|
47
|
+
amount: {
|
|
48
|
+
erc20: {
|
|
49
|
+
value: bigDecimal(amount),
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
sender,
|
|
53
|
+
enableCollateral: collateralEnabled ? true : null,
|
|
54
|
+
},
|
|
55
|
+
reserve: reserveData,
|
|
56
|
+
amount,
|
|
57
|
+
collateralEnabled,
|
|
58
|
+
privateKey,
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
async run() {
|
|
64
|
+
const result = await this.getSupplyRequest().andThen(({ request, reserve, amount, privateKey }) => {
|
|
65
|
+
const wallet = createWalletClient({
|
|
66
|
+
account: privateKeyToAccount(privateKey),
|
|
67
|
+
chain: toViemChain(reserve.chain),
|
|
68
|
+
transport: http(reserve.chain.rpcUrl),
|
|
69
|
+
});
|
|
70
|
+
return supply(this.client, request)
|
|
71
|
+
.andThen(sendWith(wallet))
|
|
72
|
+
.andTee((txResult) => this.log(`Supply transaction sent with hash: ${txResult.txHash}`))
|
|
73
|
+
.andThen(this.client.waitForTransaction)
|
|
74
|
+
.map((txResult) => {
|
|
75
|
+
this.display([
|
|
76
|
+
['Reserve ID', reserve.id],
|
|
77
|
+
['Amount', `${amount} - ${reserve.asset.underlying.info.symbol}`],
|
|
78
|
+
['Transaction Hash', txResult.txHash],
|
|
79
|
+
['Url', `${reserve.chain.explorerUrl}/tx/${txResult.txHash}`],
|
|
80
|
+
]);
|
|
81
|
+
return txResult;
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
if (result.isErr()) {
|
|
85
|
+
this.error(result.error);
|
|
86
|
+
}
|
|
87
|
+
return result.value;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InvariantError, type SendWithError, type TimeoutError, type TransactionReceipt } from '@aave/client';
|
|
2
|
+
import * as common from '../../common.js';
|
|
3
|
+
export default class ActionWithdraw extends common.V4Command {
|
|
4
|
+
static description: string;
|
|
5
|
+
static flags: {
|
|
6
|
+
'reserve-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
amount: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'private-key': import("@oclif/core/interfaces").OptionFlag<`0x${string}` | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
private getWithdrawRequest;
|
|
11
|
+
run(): Promise<TransactionReceipt | InvariantError | SendWithError | TimeoutError>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { bigDecimal, evmAddress, InvariantError, invariant, ok, ResultAsync, reserveId, } from '@aave/client';
|
|
2
|
+
import { reserve, withdraw } from '@aave/client/actions';
|
|
3
|
+
import { sendWith, toViemChain } from '@aave/client/viem';
|
|
4
|
+
import { Flags } from '@oclif/core';
|
|
5
|
+
import { createWalletClient, http } from 'viem';
|
|
6
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
7
|
+
import * as common from '../../common.js';
|
|
8
|
+
export default class ActionWithdraw extends common.V4Command {
|
|
9
|
+
static description = 'Withdraw ERC20 tokens from a reserve';
|
|
10
|
+
static flags = {
|
|
11
|
+
'reserve-id': Flags.string({
|
|
12
|
+
required: true,
|
|
13
|
+
description: 'Reserve ID of the reserve to withdraw from',
|
|
14
|
+
}),
|
|
15
|
+
amount: Flags.string({
|
|
16
|
+
required: true,
|
|
17
|
+
description: 'Amount of the token to withdraw',
|
|
18
|
+
}),
|
|
19
|
+
'private-key': common.privateKey({
|
|
20
|
+
required: false,
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
23
|
+
getWithdrawRequest() {
|
|
24
|
+
return ResultAsync.fromPromise(this.parse(ActionWithdraw), (error) => new InvariantError(String(error))).andThen(({ flags }) => {
|
|
25
|
+
const privateKey = (flags['private-key'] ??
|
|
26
|
+
process.env.PRIVATE_KEY);
|
|
27
|
+
invariant(privateKey, 'Provide --private-key or PRIVATE_KEY environment variable');
|
|
28
|
+
const parsedReserveId = reserveId(flags['reserve-id']);
|
|
29
|
+
const amount = flags.amount.trim();
|
|
30
|
+
invariant(amount.length > 0, 'Amount cannot be empty');
|
|
31
|
+
const account = privateKeyToAccount(privateKey);
|
|
32
|
+
const sender = evmAddress(account.address);
|
|
33
|
+
return reserve(this.client, {
|
|
34
|
+
query: { reserveId: parsedReserveId },
|
|
35
|
+
user: sender,
|
|
36
|
+
}).andThen((reserveData) => {
|
|
37
|
+
invariant(reserveData, `Reserve not found: ${flags['reserve-id']}`);
|
|
38
|
+
return ok({
|
|
39
|
+
request: {
|
|
40
|
+
reserve: reserveData.id,
|
|
41
|
+
amount: {
|
|
42
|
+
erc20: {
|
|
43
|
+
exact: bigDecimal(amount),
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
sender,
|
|
47
|
+
},
|
|
48
|
+
reserve: reserveData,
|
|
49
|
+
amount,
|
|
50
|
+
privateKey,
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
async run() {
|
|
56
|
+
const result = await this.getWithdrawRequest().andThen(({ request, reserve, amount, privateKey }) => {
|
|
57
|
+
const wallet = createWalletClient({
|
|
58
|
+
account: privateKeyToAccount(privateKey),
|
|
59
|
+
chain: toViemChain(reserve.chain),
|
|
60
|
+
transport: http(reserve.chain.rpcUrl),
|
|
61
|
+
});
|
|
62
|
+
return withdraw(this.client, request)
|
|
63
|
+
.andThen(sendWith(wallet))
|
|
64
|
+
.andTee((txResult) => this.log(`Withdraw transaction sent with hash: ${txResult.txHash}`))
|
|
65
|
+
.andThen(this.client.waitForTransaction)
|
|
66
|
+
.map((txResult) => {
|
|
67
|
+
this.display([
|
|
68
|
+
['Reserve ID', reserve.id],
|
|
69
|
+
['Amount', `${amount} - ${reserve.asset.underlying.info.symbol}`],
|
|
70
|
+
['Transaction Hash', txResult.txHash],
|
|
71
|
+
['Url', `${reserve.chain.explorerUrl}/tx/${txResult.txHash}`],
|
|
72
|
+
]);
|
|
73
|
+
return txResult;
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
if (result.isErr()) {
|
|
77
|
+
this.error(result.error);
|
|
78
|
+
}
|
|
79
|
+
return result.value;
|
|
80
|
+
}
|
|
81
|
+
}
|
package/dist/common.d.ts
CHANGED
|
@@ -17,6 +17,10 @@ export declare const address: import("@oclif/core/interfaces").FlagDefinition<Ev
|
|
|
17
17
|
multiple: false;
|
|
18
18
|
requiredOrDefaulted: false;
|
|
19
19
|
}>;
|
|
20
|
+
export declare const privateKey: import("@oclif/core/interfaces").FlagDefinition<`0x${string}`, import("@oclif/core/interfaces").CustomOptions, {
|
|
21
|
+
multiple: false;
|
|
22
|
+
requiredOrDefaulted: false;
|
|
23
|
+
}>;
|
|
20
24
|
export declare abstract class V4Command extends Command {
|
|
21
25
|
protected headers: TtyTable.Header[];
|
|
22
26
|
static enableJsonFlag: boolean;
|
package/dist/common.js
CHANGED
|
@@ -26,6 +26,13 @@ export const address = Flags.custom({
|
|
|
26
26
|
parse: async (input) => evmAddress(input),
|
|
27
27
|
helpValue: '<evm-address>',
|
|
28
28
|
});
|
|
29
|
+
export const privateKey = Flags.custom({
|
|
30
|
+
char: 'k',
|
|
31
|
+
name: 'private-key',
|
|
32
|
+
description: 'Private key to sign transactions (overrides PRIVATE_KEY env var)',
|
|
33
|
+
parse: async (input) => (input.startsWith('0x') ? input : `0x${input}`),
|
|
34
|
+
helpValue: '<private-key>',
|
|
35
|
+
});
|
|
29
36
|
function convertBigIntsToStrings(obj) {
|
|
30
37
|
if (typeof obj === 'bigint') {
|
|
31
38
|
return obj.toString();
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,260 @@
|
|
|
1
1
|
{
|
|
2
2
|
"commands": {
|
|
3
|
+
"action:borrow": {
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"args": {},
|
|
6
|
+
"description": "Borrow ERC20 tokens from a reserve",
|
|
7
|
+
"flags": {
|
|
8
|
+
"json": {
|
|
9
|
+
"description": "Format output as json.",
|
|
10
|
+
"helpGroup": "GLOBAL",
|
|
11
|
+
"name": "json",
|
|
12
|
+
"allowNo": false,
|
|
13
|
+
"type": "boolean"
|
|
14
|
+
},
|
|
15
|
+
"staging": {
|
|
16
|
+
"description": "Use staging environment",
|
|
17
|
+
"hidden": true,
|
|
18
|
+
"name": "staging",
|
|
19
|
+
"allowNo": false,
|
|
20
|
+
"type": "boolean"
|
|
21
|
+
},
|
|
22
|
+
"reserve-id": {
|
|
23
|
+
"description": "Reserve ID of the reserve to borrow from",
|
|
24
|
+
"name": "reserve-id",
|
|
25
|
+
"required": true,
|
|
26
|
+
"hasDynamicHelp": false,
|
|
27
|
+
"multiple": false,
|
|
28
|
+
"type": "option"
|
|
29
|
+
},
|
|
30
|
+
"amount": {
|
|
31
|
+
"description": "Amount of the token to borrow",
|
|
32
|
+
"name": "amount",
|
|
33
|
+
"required": true,
|
|
34
|
+
"hasDynamicHelp": false,
|
|
35
|
+
"multiple": false,
|
|
36
|
+
"type": "option"
|
|
37
|
+
},
|
|
38
|
+
"private-key": {
|
|
39
|
+
"char": "k",
|
|
40
|
+
"description": "Private key to sign transactions (overrides PRIVATE_KEY env var)",
|
|
41
|
+
"name": "private-key",
|
|
42
|
+
"required": false,
|
|
43
|
+
"hasDynamicHelp": false,
|
|
44
|
+
"helpValue": "<private-key>",
|
|
45
|
+
"multiple": false,
|
|
46
|
+
"type": "option"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"hasDynamicHelp": false,
|
|
50
|
+
"hiddenAliases": [],
|
|
51
|
+
"id": "action:borrow",
|
|
52
|
+
"pluginAlias": "@aave/cli",
|
|
53
|
+
"pluginName": "@aave/cli",
|
|
54
|
+
"pluginType": "core",
|
|
55
|
+
"strict": true,
|
|
56
|
+
"enableJsonFlag": true,
|
|
57
|
+
"isESM": true,
|
|
58
|
+
"relativePath": [
|
|
59
|
+
"dist",
|
|
60
|
+
"commands",
|
|
61
|
+
"action",
|
|
62
|
+
"borrow.js"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"action:repay": {
|
|
66
|
+
"aliases": [],
|
|
67
|
+
"args": {},
|
|
68
|
+
"description": "Repay ERC20 debt to a reserve",
|
|
69
|
+
"flags": {
|
|
70
|
+
"json": {
|
|
71
|
+
"description": "Format output as json.",
|
|
72
|
+
"helpGroup": "GLOBAL",
|
|
73
|
+
"name": "json",
|
|
74
|
+
"allowNo": false,
|
|
75
|
+
"type": "boolean"
|
|
76
|
+
},
|
|
77
|
+
"staging": {
|
|
78
|
+
"description": "Use staging environment",
|
|
79
|
+
"hidden": true,
|
|
80
|
+
"name": "staging",
|
|
81
|
+
"allowNo": false,
|
|
82
|
+
"type": "boolean"
|
|
83
|
+
},
|
|
84
|
+
"reserve-id": {
|
|
85
|
+
"description": "Reserve ID of the reserve to repay",
|
|
86
|
+
"name": "reserve-id",
|
|
87
|
+
"required": true,
|
|
88
|
+
"hasDynamicHelp": false,
|
|
89
|
+
"multiple": false,
|
|
90
|
+
"type": "option"
|
|
91
|
+
},
|
|
92
|
+
"amount": {
|
|
93
|
+
"description": "Amount of the token to repay",
|
|
94
|
+
"name": "amount",
|
|
95
|
+
"required": true,
|
|
96
|
+
"hasDynamicHelp": false,
|
|
97
|
+
"multiple": false,
|
|
98
|
+
"type": "option"
|
|
99
|
+
},
|
|
100
|
+
"private-key": {
|
|
101
|
+
"char": "k",
|
|
102
|
+
"description": "Private key to sign transactions (overrides PRIVATE_KEY env var)",
|
|
103
|
+
"name": "private-key",
|
|
104
|
+
"required": false,
|
|
105
|
+
"hasDynamicHelp": false,
|
|
106
|
+
"helpValue": "<private-key>",
|
|
107
|
+
"multiple": false,
|
|
108
|
+
"type": "option"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"hasDynamicHelp": false,
|
|
112
|
+
"hiddenAliases": [],
|
|
113
|
+
"id": "action:repay",
|
|
114
|
+
"pluginAlias": "@aave/cli",
|
|
115
|
+
"pluginName": "@aave/cli",
|
|
116
|
+
"pluginType": "core",
|
|
117
|
+
"strict": true,
|
|
118
|
+
"enableJsonFlag": true,
|
|
119
|
+
"isESM": true,
|
|
120
|
+
"relativePath": [
|
|
121
|
+
"dist",
|
|
122
|
+
"commands",
|
|
123
|
+
"action",
|
|
124
|
+
"repay.js"
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"action:supply": {
|
|
128
|
+
"aliases": [],
|
|
129
|
+
"args": {},
|
|
130
|
+
"description": "Supply ERC20 tokens to a reserve",
|
|
131
|
+
"flags": {
|
|
132
|
+
"json": {
|
|
133
|
+
"description": "Format output as json.",
|
|
134
|
+
"helpGroup": "GLOBAL",
|
|
135
|
+
"name": "json",
|
|
136
|
+
"allowNo": false,
|
|
137
|
+
"type": "boolean"
|
|
138
|
+
},
|
|
139
|
+
"staging": {
|
|
140
|
+
"description": "Use staging environment",
|
|
141
|
+
"hidden": true,
|
|
142
|
+
"name": "staging",
|
|
143
|
+
"allowNo": false,
|
|
144
|
+
"type": "boolean"
|
|
145
|
+
},
|
|
146
|
+
"reserve-id": {
|
|
147
|
+
"description": "Reserve ID of the reserve to supply",
|
|
148
|
+
"name": "reserve-id",
|
|
149
|
+
"required": true,
|
|
150
|
+
"hasDynamicHelp": false,
|
|
151
|
+
"multiple": false,
|
|
152
|
+
"type": "option"
|
|
153
|
+
},
|
|
154
|
+
"amount": {
|
|
155
|
+
"description": "Amount of the token to supply",
|
|
156
|
+
"name": "amount",
|
|
157
|
+
"required": true,
|
|
158
|
+
"hasDynamicHelp": false,
|
|
159
|
+
"multiple": false,
|
|
160
|
+
"type": "option"
|
|
161
|
+
},
|
|
162
|
+
"private-key": {
|
|
163
|
+
"char": "k",
|
|
164
|
+
"description": "Private key to sign transactions (overrides PRIVATE_KEY env var)",
|
|
165
|
+
"name": "private-key",
|
|
166
|
+
"required": false,
|
|
167
|
+
"hasDynamicHelp": false,
|
|
168
|
+
"helpValue": "<private-key>",
|
|
169
|
+
"multiple": false,
|
|
170
|
+
"type": "option"
|
|
171
|
+
},
|
|
172
|
+
"enable-collateral": {
|
|
173
|
+
"description": "If provided, the supplied position is enabled as collateral",
|
|
174
|
+
"name": "enable-collateral",
|
|
175
|
+
"required": false,
|
|
176
|
+
"allowNo": false,
|
|
177
|
+
"type": "boolean"
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"hasDynamicHelp": false,
|
|
181
|
+
"hiddenAliases": [],
|
|
182
|
+
"id": "action:supply",
|
|
183
|
+
"pluginAlias": "@aave/cli",
|
|
184
|
+
"pluginName": "@aave/cli",
|
|
185
|
+
"pluginType": "core",
|
|
186
|
+
"strict": true,
|
|
187
|
+
"enableJsonFlag": true,
|
|
188
|
+
"isESM": true,
|
|
189
|
+
"relativePath": [
|
|
190
|
+
"dist",
|
|
191
|
+
"commands",
|
|
192
|
+
"action",
|
|
193
|
+
"supply.js"
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
"action:withdraw": {
|
|
197
|
+
"aliases": [],
|
|
198
|
+
"args": {},
|
|
199
|
+
"description": "Withdraw ERC20 tokens from a reserve",
|
|
200
|
+
"flags": {
|
|
201
|
+
"json": {
|
|
202
|
+
"description": "Format output as json.",
|
|
203
|
+
"helpGroup": "GLOBAL",
|
|
204
|
+
"name": "json",
|
|
205
|
+
"allowNo": false,
|
|
206
|
+
"type": "boolean"
|
|
207
|
+
},
|
|
208
|
+
"staging": {
|
|
209
|
+
"description": "Use staging environment",
|
|
210
|
+
"hidden": true,
|
|
211
|
+
"name": "staging",
|
|
212
|
+
"allowNo": false,
|
|
213
|
+
"type": "boolean"
|
|
214
|
+
},
|
|
215
|
+
"reserve-id": {
|
|
216
|
+
"description": "Reserve ID of the reserve to withdraw from",
|
|
217
|
+
"name": "reserve-id",
|
|
218
|
+
"required": true,
|
|
219
|
+
"hasDynamicHelp": false,
|
|
220
|
+
"multiple": false,
|
|
221
|
+
"type": "option"
|
|
222
|
+
},
|
|
223
|
+
"amount": {
|
|
224
|
+
"description": "Amount of the token to withdraw",
|
|
225
|
+
"name": "amount",
|
|
226
|
+
"required": true,
|
|
227
|
+
"hasDynamicHelp": false,
|
|
228
|
+
"multiple": false,
|
|
229
|
+
"type": "option"
|
|
230
|
+
},
|
|
231
|
+
"private-key": {
|
|
232
|
+
"char": "k",
|
|
233
|
+
"description": "Private key to sign transactions (overrides PRIVATE_KEY env var)",
|
|
234
|
+
"name": "private-key",
|
|
235
|
+
"required": false,
|
|
236
|
+
"hasDynamicHelp": false,
|
|
237
|
+
"helpValue": "<private-key>",
|
|
238
|
+
"multiple": false,
|
|
239
|
+
"type": "option"
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
"hasDynamicHelp": false,
|
|
243
|
+
"hiddenAliases": [],
|
|
244
|
+
"id": "action:withdraw",
|
|
245
|
+
"pluginAlias": "@aave/cli",
|
|
246
|
+
"pluginName": "@aave/cli",
|
|
247
|
+
"pluginType": "core",
|
|
248
|
+
"strict": true,
|
|
249
|
+
"enableJsonFlag": true,
|
|
250
|
+
"isESM": true,
|
|
251
|
+
"relativePath": [
|
|
252
|
+
"dist",
|
|
253
|
+
"commands",
|
|
254
|
+
"action",
|
|
255
|
+
"withdraw.js"
|
|
256
|
+
]
|
|
257
|
+
},
|
|
3
258
|
"borrows:list": {
|
|
4
259
|
"aliases": [],
|
|
5
260
|
"args": {},
|
|
@@ -429,5 +684,5 @@
|
|
|
429
684
|
]
|
|
430
685
|
}
|
|
431
686
|
},
|
|
432
|
-
"version": "4.1.
|
|
687
|
+
"version": "4.1.4"
|
|
433
688
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aave/cli",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.4",
|
|
4
4
|
"description": "CLI to interact with AaveKit API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aave",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"@oclif/plugin-help": "^6",
|
|
31
31
|
"@oclif/plugin-plugins": "^5",
|
|
32
32
|
"tty-table": "^5.0.0",
|
|
33
|
-
"
|
|
33
|
+
"viem": "^2.47.0",
|
|
34
|
+
"@aave/client": "4.0.4"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
37
|
"@oclif/test": "^4",
|
|
@@ -46,6 +47,9 @@
|
|
|
46
47
|
"commands": "./dist/commands",
|
|
47
48
|
"topicSeparator": " ",
|
|
48
49
|
"topics": {
|
|
50
|
+
"action": {
|
|
51
|
+
"description": "Actions to perform in the Aave v4 protocol"
|
|
52
|
+
},
|
|
49
53
|
"hubs": {
|
|
50
54
|
"description": "List available liquidity hubs"
|
|
51
55
|
},
|