@epoch-protocol/inventory-sdk 1.0.0
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/.github/workflows/main.yml +91 -0
- package/dist/chainlink-ops/chainlink-abi.d.ts +40 -0
- package/dist/chainlink-ops/chainlink-abi.d.ts.map +1 -0
- package/dist/chainlink-ops/chainlink-abi.js +287 -0
- package/dist/chainlink-ops/chainlink-abi.js.map +1 -0
- package/dist/chainlink-ops/index.d.ts +8 -0
- package/dist/chainlink-ops/index.d.ts.map +1 -0
- package/dist/chainlink-ops/index.js +35 -0
- package/dist/chainlink-ops/index.js.map +1 -0
- package/dist/chainlink-ops/models.d.ts +2 -0
- package/dist/chainlink-ops/models.d.ts.map +1 -0
- package/dist/chainlink-ops/models.js +3 -0
- package/dist/chainlink-ops/models.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/safe-ops/index.d.ts +20 -0
- package/dist/safe-ops/index.d.ts.map +1 -0
- package/dist/safe-ops/index.js +99 -0
- package/dist/safe-ops/index.js.map +1 -0
- package/dist/safe-ops/models.d.ts +22 -0
- package/dist/safe-ops/models.d.ts.map +1 -0
- package/dist/safe-ops/models.js +6 -0
- package/dist/safe-ops/models.js.map +1 -0
- package/dist/safe-ops/safe-abi.d.ts +43 -0
- package/dist/safe-ops/safe-abi.d.ts.map +1 -0
- package/dist/safe-ops/safe-abi.js +565 -0
- package/dist/safe-ops/safe-abi.js.map +1 -0
- package/dist/token/erc20-abi.d.ts +39 -0
- package/dist/token/erc20-abi.d.ts.map +1 -0
- package/dist/token/erc20-abi.js +226 -0
- package/dist/token/erc20-abi.js.map +1 -0
- package/dist/token/index.d.ts +9 -0
- package/dist/token/index.d.ts.map +1 -0
- package/dist/token/index.js +109 -0
- package/dist/token/index.js.map +1 -0
- package/dist/token/models.d.ts +27 -0
- package/dist/token/models.d.ts.map +1 -0
- package/dist/token/models.js +3 -0
- package/dist/token/models.js.map +1 -0
- package/package.json +22 -0
- package/src/chainlink-ops/chainlink-abi.ts +283 -0
- package/src/chainlink-ops/index.ts +53 -0
- package/src/chainlink-ops/models.ts +0 -0
- package/src/index.ts +7 -0
- package/src/safe-ops/index.ts +98 -0
- package/src/safe-ops/models.ts +23 -0
- package/src/safe-ops/safe-abi.ts +561 -0
- package/src/token/erc20-abi.ts +222 -0
- package/src/token/index.ts +126 -0
- package/src/token/models.ts +32 -0
- package/tsconfig.json +43 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
name: Deploy to Server
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
deploy:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout code
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Setup SSH key
|
|
17
|
+
uses: webfactory/ssh-agent@v0.8.0
|
|
18
|
+
with:
|
|
19
|
+
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY_DEV }}
|
|
20
|
+
|
|
21
|
+
- name: Add server to known hosts
|
|
22
|
+
run: |
|
|
23
|
+
ssh-keyscan -H ${{ secrets.SERVER_HOST_DEV }} >> ~/.ssh/known_hosts
|
|
24
|
+
|
|
25
|
+
- name: Deploy to server
|
|
26
|
+
run: |
|
|
27
|
+
# Set project name - use workflow input if available, otherwise default
|
|
28
|
+
PROJECT_NAME="${{ github.event.repository.name }}"
|
|
29
|
+
BRANCH="${{ github.ref_name }}"
|
|
30
|
+
|
|
31
|
+
echo "Deploying project: $PROJECT_NAME on branch: $BRANCH"
|
|
32
|
+
|
|
33
|
+
# SSH into server and run deployment command
|
|
34
|
+
# Using nohup to ensure command continues after SSH disconnection
|
|
35
|
+
# Redirecting output to a log file for monitoring
|
|
36
|
+
LC_PROJECT_NAME=$PROJECT_NAME LC_BRANCH=$BRANCH ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USERNAME }}@${{ secrets.SERVER_HOST_DEV }} << 'ENDSSH'
|
|
37
|
+
set -e
|
|
38
|
+
# Navigate to deployment directory
|
|
39
|
+
cd /home/ubuntu
|
|
40
|
+
|
|
41
|
+
# Create log directory if it doesn't exist
|
|
42
|
+
mkdir -p logs
|
|
43
|
+
|
|
44
|
+
# Generate timestamp for log file
|
|
45
|
+
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
|
|
46
|
+
LOG_FILE="logs/deployment_${LC_PROJECT_NAME}_${TIMESTAMP}.log"
|
|
47
|
+
|
|
48
|
+
echo "Starting deployment at $(date)" > $LOG_FILE
|
|
49
|
+
echo "Project: ${LC_PROJECT_NAME}" >> $LOG_FILE
|
|
50
|
+
echo "Branch: ${LC_BRANCH}" >> $LOG_FILE
|
|
51
|
+
echo "----------------------------------------" >> $LOG_FILE
|
|
52
|
+
|
|
53
|
+
# Run deployment script with nohup to ensure it continues after SSH disconnection
|
|
54
|
+
# The script will run in background and output will be logged
|
|
55
|
+
nohup bash -c "
|
|
56
|
+
export PATH="/home/ubuntu/.nvm/versions/node/v22.18.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
|
|
57
|
+
# Run the deployment script
|
|
58
|
+
./deploy.sh '${LC_PROJECT_NAME}' '${LC_BRANCH}' 2>&1
|
|
59
|
+
|
|
60
|
+
# Log completion
|
|
61
|
+
echo 'Deployment completed at $(date)'
|
|
62
|
+
echo 'Process finished successfully'
|
|
63
|
+
|
|
64
|
+
# Exit bash after completion
|
|
65
|
+
exit 0
|
|
66
|
+
" >> $LOG_FILE 2>&1 &
|
|
67
|
+
|
|
68
|
+
# Get the process ID
|
|
69
|
+
DEPLOY_PID=$!
|
|
70
|
+
echo "Deployment started with PID: $DEPLOY_PID"
|
|
71
|
+
echo "Deployment PID: $DEPLOY_PID" >> $LOG_FILE
|
|
72
|
+
|
|
73
|
+
# Wait a moment to ensure the process started properly
|
|
74
|
+
sleep 5
|
|
75
|
+
|
|
76
|
+
# Check if process is still running (indicates successful start)
|
|
77
|
+
if kill -0 $DEPLOY_PID 2>/dev/null; then
|
|
78
|
+
echo "Deployment process is running successfully"
|
|
79
|
+
echo "Logs will be available at: $LOG_FILE"
|
|
80
|
+
echo "You can monitor progress with: tail -f $LOG_FILE"
|
|
81
|
+
else
|
|
82
|
+
echo "Warning: Deployment process may have finished quickly or encountered an error"
|
|
83
|
+
echo "Check the log file: $LOG_FILE"
|
|
84
|
+
fi
|
|
85
|
+
# The SSH session will end here, but the deployment continues
|
|
86
|
+
echo "SSH session ending - deployment continues in background"
|
|
87
|
+
ENDSSH
|
|
88
|
+
|
|
89
|
+
# These messages are shown after the SSH session ends, on the GitHub Actions runner
|
|
90
|
+
echo "Deployment initiated successfully!"
|
|
91
|
+
echo "The deployment process is now running on the server in the background."
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const CHAINLINK_FEED_ABI: ({
|
|
2
|
+
inputs: {
|
|
3
|
+
internalType: string;
|
|
4
|
+
name: string;
|
|
5
|
+
type: string;
|
|
6
|
+
}[];
|
|
7
|
+
stateMutability: string;
|
|
8
|
+
type: string;
|
|
9
|
+
anonymous?: never;
|
|
10
|
+
name?: never;
|
|
11
|
+
outputs?: never;
|
|
12
|
+
} | {
|
|
13
|
+
anonymous: boolean;
|
|
14
|
+
inputs: {
|
|
15
|
+
indexed: boolean;
|
|
16
|
+
internalType: string;
|
|
17
|
+
name: string;
|
|
18
|
+
type: string;
|
|
19
|
+
}[];
|
|
20
|
+
name: string;
|
|
21
|
+
type: string;
|
|
22
|
+
stateMutability?: never;
|
|
23
|
+
outputs?: never;
|
|
24
|
+
} | {
|
|
25
|
+
inputs: {
|
|
26
|
+
internalType: string;
|
|
27
|
+
name: string;
|
|
28
|
+
type: string;
|
|
29
|
+
}[];
|
|
30
|
+
name: string;
|
|
31
|
+
outputs: {
|
|
32
|
+
internalType: string;
|
|
33
|
+
name: string;
|
|
34
|
+
type: string;
|
|
35
|
+
}[];
|
|
36
|
+
stateMutability: string;
|
|
37
|
+
type: string;
|
|
38
|
+
anonymous?: never;
|
|
39
|
+
})[];
|
|
40
|
+
//# sourceMappingURL=chainlink-abi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chainlink-abi.d.ts","sourceRoot":"","sources":["../../src/chainlink-ops/chainlink-abi.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0R9B,CAAC"}
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CHAINLINK_FEED_ABI = void 0;
|
|
4
|
+
exports.CHAINLINK_FEED_ABI = [
|
|
5
|
+
{
|
|
6
|
+
inputs: [
|
|
7
|
+
{ internalType: "address", name: "_aggregator", type: "address" },
|
|
8
|
+
{ internalType: "address", name: "_accessController", type: "address" },
|
|
9
|
+
],
|
|
10
|
+
stateMutability: "nonpayable",
|
|
11
|
+
type: "constructor",
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
anonymous: false,
|
|
15
|
+
inputs: [
|
|
16
|
+
{
|
|
17
|
+
indexed: true,
|
|
18
|
+
internalType: "int256",
|
|
19
|
+
name: "current",
|
|
20
|
+
type: "int256",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
indexed: true,
|
|
24
|
+
internalType: "uint256",
|
|
25
|
+
name: "roundId",
|
|
26
|
+
type: "uint256",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
indexed: false,
|
|
30
|
+
internalType: "uint256",
|
|
31
|
+
name: "updatedAt",
|
|
32
|
+
type: "uint256",
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
name: "AnswerUpdated",
|
|
36
|
+
type: "event",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
anonymous: false,
|
|
40
|
+
inputs: [
|
|
41
|
+
{
|
|
42
|
+
indexed: true,
|
|
43
|
+
internalType: "uint256",
|
|
44
|
+
name: "roundId",
|
|
45
|
+
type: "uint256",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
indexed: true,
|
|
49
|
+
internalType: "address",
|
|
50
|
+
name: "startedBy",
|
|
51
|
+
type: "address",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
indexed: false,
|
|
55
|
+
internalType: "uint256",
|
|
56
|
+
name: "startedAt",
|
|
57
|
+
type: "uint256",
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
name: "NewRound",
|
|
61
|
+
type: "event",
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
anonymous: false,
|
|
65
|
+
inputs: [
|
|
66
|
+
{ indexed: true, internalType: "address", name: "from", type: "address" },
|
|
67
|
+
{ indexed: true, internalType: "address", name: "to", type: "address" },
|
|
68
|
+
],
|
|
69
|
+
name: "OwnershipTransferRequested",
|
|
70
|
+
type: "event",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
anonymous: false,
|
|
74
|
+
inputs: [
|
|
75
|
+
{ indexed: true, internalType: "address", name: "from", type: "address" },
|
|
76
|
+
{ indexed: true, internalType: "address", name: "to", type: "address" },
|
|
77
|
+
],
|
|
78
|
+
name: "OwnershipTransferred",
|
|
79
|
+
type: "event",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
inputs: [],
|
|
83
|
+
name: "acceptOwnership",
|
|
84
|
+
outputs: [],
|
|
85
|
+
stateMutability: "nonpayable",
|
|
86
|
+
type: "function",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
inputs: [],
|
|
90
|
+
name: "accessController",
|
|
91
|
+
outputs: [
|
|
92
|
+
{
|
|
93
|
+
internalType: "contract AccessControllerInterface",
|
|
94
|
+
name: "",
|
|
95
|
+
type: "address",
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
stateMutability: "view",
|
|
99
|
+
type: "function",
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
inputs: [],
|
|
103
|
+
name: "aggregator",
|
|
104
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
105
|
+
stateMutability: "view",
|
|
106
|
+
type: "function",
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
inputs: [{ internalType: "address", name: "_aggregator", type: "address" }],
|
|
110
|
+
name: "confirmAggregator",
|
|
111
|
+
outputs: [],
|
|
112
|
+
stateMutability: "nonpayable",
|
|
113
|
+
type: "function",
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
inputs: [],
|
|
117
|
+
name: "decimals",
|
|
118
|
+
outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
|
|
119
|
+
stateMutability: "view",
|
|
120
|
+
type: "function",
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
inputs: [],
|
|
124
|
+
name: "description",
|
|
125
|
+
outputs: [{ internalType: "string", name: "", type: "string" }],
|
|
126
|
+
stateMutability: "view",
|
|
127
|
+
type: "function",
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
inputs: [{ internalType: "uint256", name: "_roundId", type: "uint256" }],
|
|
131
|
+
name: "getAnswer",
|
|
132
|
+
outputs: [{ internalType: "int256", name: "", type: "int256" }],
|
|
133
|
+
stateMutability: "view",
|
|
134
|
+
type: "function",
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
inputs: [{ internalType: "uint80", name: "_roundId", type: "uint80" }],
|
|
138
|
+
name: "getRoundData",
|
|
139
|
+
outputs: [
|
|
140
|
+
{ internalType: "uint80", name: "roundId", type: "uint80" },
|
|
141
|
+
{ internalType: "int256", name: "answer", type: "int256" },
|
|
142
|
+
{ internalType: "uint256", name: "startedAt", type: "uint256" },
|
|
143
|
+
{ internalType: "uint256", name: "updatedAt", type: "uint256" },
|
|
144
|
+
{ internalType: "uint80", name: "answeredInRound", type: "uint80" },
|
|
145
|
+
],
|
|
146
|
+
stateMutability: "view",
|
|
147
|
+
type: "function",
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
inputs: [{ internalType: "uint256", name: "_roundId", type: "uint256" }],
|
|
151
|
+
name: "getTimestamp",
|
|
152
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
153
|
+
stateMutability: "view",
|
|
154
|
+
type: "function",
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
inputs: [],
|
|
158
|
+
name: "latestAnswer",
|
|
159
|
+
outputs: [{ internalType: "int256", name: "", type: "int256" }],
|
|
160
|
+
stateMutability: "view",
|
|
161
|
+
type: "function",
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
inputs: [],
|
|
165
|
+
name: "latestRound",
|
|
166
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
167
|
+
stateMutability: "view",
|
|
168
|
+
type: "function",
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
inputs: [],
|
|
172
|
+
name: "latestRoundData",
|
|
173
|
+
outputs: [
|
|
174
|
+
{ internalType: "uint80", name: "roundId", type: "uint80" },
|
|
175
|
+
{ internalType: "int256", name: "answer", type: "int256" },
|
|
176
|
+
{ internalType: "uint256", name: "startedAt", type: "uint256" },
|
|
177
|
+
{ internalType: "uint256", name: "updatedAt", type: "uint256" },
|
|
178
|
+
{ internalType: "uint80", name: "answeredInRound", type: "uint80" },
|
|
179
|
+
],
|
|
180
|
+
stateMutability: "view",
|
|
181
|
+
type: "function",
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
inputs: [],
|
|
185
|
+
name: "latestTimestamp",
|
|
186
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
187
|
+
stateMutability: "view",
|
|
188
|
+
type: "function",
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
inputs: [],
|
|
192
|
+
name: "owner",
|
|
193
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
194
|
+
stateMutability: "view",
|
|
195
|
+
type: "function",
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
inputs: [{ internalType: "uint16", name: "", type: "uint16" }],
|
|
199
|
+
name: "phaseAggregators",
|
|
200
|
+
outputs: [
|
|
201
|
+
{
|
|
202
|
+
internalType: "contract AggregatorV2V3Interface",
|
|
203
|
+
name: "",
|
|
204
|
+
type: "address",
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
stateMutability: "view",
|
|
208
|
+
type: "function",
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
inputs: [],
|
|
212
|
+
name: "phaseId",
|
|
213
|
+
outputs: [{ internalType: "uint16", name: "", type: "uint16" }],
|
|
214
|
+
stateMutability: "view",
|
|
215
|
+
type: "function",
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
inputs: [{ internalType: "address", name: "_aggregator", type: "address" }],
|
|
219
|
+
name: "proposeAggregator",
|
|
220
|
+
outputs: [],
|
|
221
|
+
stateMutability: "nonpayable",
|
|
222
|
+
type: "function",
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
inputs: [],
|
|
226
|
+
name: "proposedAggregator",
|
|
227
|
+
outputs: [
|
|
228
|
+
{
|
|
229
|
+
internalType: "contract AggregatorV2V3Interface",
|
|
230
|
+
name: "",
|
|
231
|
+
type: "address",
|
|
232
|
+
},
|
|
233
|
+
],
|
|
234
|
+
stateMutability: "view",
|
|
235
|
+
type: "function",
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
inputs: [{ internalType: "uint80", name: "_roundId", type: "uint80" }],
|
|
239
|
+
name: "proposedGetRoundData",
|
|
240
|
+
outputs: [
|
|
241
|
+
{ internalType: "uint80", name: "roundId", type: "uint80" },
|
|
242
|
+
{ internalType: "int256", name: "answer", type: "int256" },
|
|
243
|
+
{ internalType: "uint256", name: "startedAt", type: "uint256" },
|
|
244
|
+
{ internalType: "uint256", name: "updatedAt", type: "uint256" },
|
|
245
|
+
{ internalType: "uint80", name: "answeredInRound", type: "uint80" },
|
|
246
|
+
],
|
|
247
|
+
stateMutability: "view",
|
|
248
|
+
type: "function",
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
inputs: [],
|
|
252
|
+
name: "proposedLatestRoundData",
|
|
253
|
+
outputs: [
|
|
254
|
+
{ internalType: "uint80", name: "roundId", type: "uint80" },
|
|
255
|
+
{ internalType: "int256", name: "answer", type: "int256" },
|
|
256
|
+
{ internalType: "uint256", name: "startedAt", type: "uint256" },
|
|
257
|
+
{ internalType: "uint256", name: "updatedAt", type: "uint256" },
|
|
258
|
+
{ internalType: "uint80", name: "answeredInRound", type: "uint80" },
|
|
259
|
+
],
|
|
260
|
+
stateMutability: "view",
|
|
261
|
+
type: "function",
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
inputs: [
|
|
265
|
+
{ internalType: "address", name: "_accessController", type: "address" },
|
|
266
|
+
],
|
|
267
|
+
name: "setController",
|
|
268
|
+
outputs: [],
|
|
269
|
+
stateMutability: "nonpayable",
|
|
270
|
+
type: "function",
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
inputs: [{ internalType: "address", name: "_to", type: "address" }],
|
|
274
|
+
name: "transferOwnership",
|
|
275
|
+
outputs: [],
|
|
276
|
+
stateMutability: "nonpayable",
|
|
277
|
+
type: "function",
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
inputs: [],
|
|
281
|
+
name: "version",
|
|
282
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
283
|
+
stateMutability: "view",
|
|
284
|
+
type: "function",
|
|
285
|
+
},
|
|
286
|
+
];
|
|
287
|
+
//# sourceMappingURL=chainlink-abi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chainlink-abi.js","sourceRoot":"","sources":["../../src/chainlink-ops/chainlink-abi.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG;IAChC;QACE,MAAM,EAAE;YACN,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE;YACjE,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,SAAS,EAAE;SACxE;QACD,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,aAAa;KACpB;IACD;QACE,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACN;gBACE,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,QAAQ;gBACtB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;aACf;YACD;gBACE,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,OAAO,EAAE,KAAK;gBACd,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,SAAS;aAChB;SACF;QACD,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,OAAO;KACd;IACD;QACE,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACN;gBACE,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,OAAO,EAAE,KAAK;gBACd,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,SAAS;aAChB;SACF;QACD,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,OAAO;KACd;IACD;QACE,SAAS,EAAE,KAAK;QAChB,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okenInfo } from "../token/models";
|
|
3
|
+
export declare const getPrice: (tokenInfo: TokenInfo, amount: BigInt, provider: Provider) => Promise<TokenInfo>;
|
|
4
|
+
export declare const getMultiplePrices: (tokenInfoAndProviders: {
|
|
5
|
+
tokenInfo: TokenInfo;
|
|
6
|
+
provider: Provider;
|
|
7
|
+
}[]) => Promise<TokenInfo[]>;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chainlink-ops/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,eAAO,MAAM,QAAQ,GACnB,WAAW,SAAS,EACpB,QAAQ,MAAM,EACd,UAAU,QAAQ,uBA+BnB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,uBAAuB;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE,EAAE,yBAWtE,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMultiplePrices = exports.getPrice = void 0;
|
|
4
|
+
const ethers_1 = require("ethers");
|
|
5
|
+
const chainlink_abi_1 = require("./chainlink-abi");
|
|
6
|
+
const getPrice = async (tokenInfo, amount, provider) => {
|
|
7
|
+
const priceFeed = new ethers_1.Contract(tokenInfo.token.priceFeed.priceFeedAddress, chainlink_abi_1.CHAINLINK_FEED_ABI, provider);
|
|
8
|
+
console.log("priceFeed: ", tokenInfo.token.priceFeed.priceFeedAddress);
|
|
9
|
+
console.log("Networ", (await provider.getNetwork()).chainId);
|
|
10
|
+
const promises = Promise.all([
|
|
11
|
+
priceFeed?.latestAnswer?.(),
|
|
12
|
+
priceFeed?.decimals?.(),
|
|
13
|
+
]);
|
|
14
|
+
const [price, decimals] = await promises;
|
|
15
|
+
const differenceInPrecision = BigInt(18) - BigInt(decimals.toString());
|
|
16
|
+
const extraDecimals = BigInt(BigInt(10) ** BigInt(differenceInPrecision));
|
|
17
|
+
tokenInfo.price = BigInt(price) * extraDecimals;
|
|
18
|
+
tokenInfo.token.priceFeed.priceFeedDecimals = decimals;
|
|
19
|
+
const tokenDecimalsDifference = BigInt(18) - BigInt(tokenInfo.decimals.toString());
|
|
20
|
+
const tokenDecimalsExtra = BigInt(BigInt(10) ** BigInt(tokenDecimalsDifference));
|
|
21
|
+
tokenInfo.usdValue =
|
|
22
|
+
(BigInt(amount.toString()) *
|
|
23
|
+
tokenDecimalsExtra *
|
|
24
|
+
BigInt(tokenInfo.price.toString())) /
|
|
25
|
+
BigInt(BigInt(10) ** BigInt(18));
|
|
26
|
+
return tokenInfo;
|
|
27
|
+
};
|
|
28
|
+
exports.getPrice = getPrice;
|
|
29
|
+
const getMultiplePrices = async (tokenInfoAndProviders) => {
|
|
30
|
+
const promises = tokenInfoAndProviders.map((tokenInfoAndProvider) => (0, exports.getPrice)(tokenInfoAndProvider.tokenInfo, tokenInfoAndProvider.tokenInfo.balance, tokenInfoAndProvider.provider));
|
|
31
|
+
const results = await Promise.all(promises);
|
|
32
|
+
return results;
|
|
33
|
+
};
|
|
34
|
+
exports.getMultiplePrices = getMultiplePrices;
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/chainlink-ops/index.ts"],"names":[],"mappings":";;;AAAA,mCAA4C;AAE5C,mDAAqD;AAE9C,MAAM,QAAQ,GAAG,KAAK,EAC3B,SAAoB,EACpB,MAAc,EACd,QAAkB,EAClB,EAAE;IACF,MAAM,SAAS,GAAG,IAAI,iBAAQ,CAC5B,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,gBAAgB,EAC1C,kCAAkB,EAClB,QA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AAM,CAAC,EAAE,CAAC,CAAC,CAAC;IAEnC,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAlCW,QAAA,QAAQ,YAkCnB;AAEK,MAAM,iBAAiB,GAAG,KAAK,EACpC,qBAAqE,EACrE,EAAE;IACF,MAAM,QAAQ,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC,oBAAoB,EAAE,EAAE,CAClE,IAAA,gBAAQ,EACN,oBAAoB,CAAC,SAAS,EAC9B,oBAAoB,CAAC,SAAS,CAAC,OAAQ,EACvC,oBAAoB,CAAC,QAAQ,CAC9B,CACF,CAAC;IACF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC5C,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAZW,QAAA,iBAAiB,qBAY5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/chainlink-ops/models.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/chainlink-ops/models.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./token";
|
|
2
|
+
export * from "./safe-ops";
|
|
3
|
+
export * from "./chainlink-ops";
|
|
4
|
+
export * from "./chainlink-ops/models";
|
|
5
|
+
export * from "./safe-ops/models";
|
|
6
|
+
export * from "./token/erc20-abi";
|
|
7
|
+
export * from "./token/models";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./token"), exports);
|
|
18
|
+
__exportStar(require("./safe-ops"), exports);
|
|
19
|
+
__exportStar(require("./chainlink-ops"), exports);
|
|
20
|
+
__exportStar(require("./chainlink-ops/models"), exports);
|
|
21
|
+
__exportStar(require("./safe-ops/models"), exports);
|
|
22
|
+
__exportStar(require("./token/erc20-abi"), exports);
|
|
23
|
+
__exportStar(require("./token/models"), exports);
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA2B;AAC3B,kDAAgC;AAChC,yDAAuC;AACvC,oDAAkC;AAClC,oDAAkC;AAClC,iDAA+B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Safe from "@safe-global/protocol-kit";
|
|
2
|
+
import { SafeSignature, SafeTransaction, SafeTransactionData } from "@safe-global/types-kit";
|
|
3
|
+
import { DeconstructedSafeSignature, DeconstructedSafeTx } from "./models";
|
|
4
|
+
export declare const createSafeTx: (safe: Safe, txList: Array<{
|
|
5
|
+
to: string;
|
|
6
|
+
value: string;
|
|
7
|
+
data: string;
|
|
8
|
+
operation: number;
|
|
9
|
+
}>) => Promise<SafeTransaction>;
|
|
10
|
+
export declare const signSafeTx: (safe: Safe, safeTx: SafeTransaction) => Promise<SafeTransaction>;
|
|
11
|
+
export declare const getSafeInstance: (safeAddress: string, privateKey: string, rpcUrl: string) => Promise<Safe>;
|
|
12
|
+
export declare const deconstructSafeTx: (SafeTransaction: SafeTransaction) => Promise<{
|
|
13
|
+
safeTxElements: DeconstructedSafeTx;
|
|
14
|
+
signatures: DeconstructedSafeSignature[];
|
|
15
|
+
}>;
|
|
16
|
+
export declare const reconstructSafeTx: (deconstructedSafeTx: DeconstructedSafeTx, deconstructedSafeSignatures: DeconstructedSafeSignature[]) => Promise<{
|
|
17
|
+
safeTx: SafeTransactionData;
|
|
18
|
+
safeSignatures: SafeSignature[];
|
|
19
|
+
}>;
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/safe-ops/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAA0B,MAAM,2BAA2B,CAAC;AACnE,OAAO,EACL,aAAa,EACb,eAAe,EACf,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE3E,eAAO,MAAM,YAAY,GACvB,MAAM,IAAI,EACV,QAAQ,KAAK,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC,KACD,OAAO,CAAC,eAAe,CASzB,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,MAAM,IAAI,EACV,QAAQ,eAAe,KACtB,OAAO,CAAC,eAAe,CASzB,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,aAAa,MAAM,EACnB,YAAY,MAAM,EAClB,QAAQ,MAAM,KACb,OAAO,CAAC,IAAI,CAOd,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,iBAAiB,eAAe,KAC/B,OAAO,CAAC;IACT,cAAc,EAAE,mBAAmB,CAAC;IACpC,UAAU,EAAE,0BAA0B,EAAE,CAAC;CAC1C,CAcA,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,qBAAqB,mBAAmB,EACxC,6BAA6B,0BAA0B,EAAE,KACxD,OAAO,CAAC;IACT,MAAM,EAAE,mBAAmB,CAAC;IAC5B,cAAc,EAAE,aAAa,EAAE,CAAC;CACjC,CAgBA,CAAC"}
|