@pioneer-platform/pioneer-discovery 8.15.30 ā 8.15.32
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/CHANGELOG.md +16 -0
- package/data/coingecko-mapping.json +4 -3
- package/data/coingecko-mapping.json.bak +10170 -0
- package/lib/generatedAssetData.json +14121 -14119
- package/package.json +2 -2
- package/scripts/download-icons.log +28250 -0
- package/scripts/fix-major-tokens.log +399 -0
- package/scripts/fix-major-tokens.sh +156 -0
- package/scripts/missing-assets.json +46864 -10688
- package/scripts/upload-both-cases.js +174 -0
- package/scripts/upload-both.log +68 -0
- package/scripts/upload-to-s3.js +1 -1
- package/scripts/upload.log +42713 -0
- package/scripts/validate-and-download-icons-fast.js +1 -1
- package/scripts/.download-progress.json +0 -65
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Upload icons with BOTH lowercase and checksummed Ethereum addresses
|
|
5
|
+
* This fixes the case sensitivity issue by uploading both variants
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const { execSync } = require('child_process');
|
|
11
|
+
const https = require('https');
|
|
12
|
+
|
|
13
|
+
// Configuration
|
|
14
|
+
const S3_ENDPOINT = 'https://sfo3.digitaloceanspaces.com';
|
|
15
|
+
const S3_BUCKET = 'keepkey';
|
|
16
|
+
const S3_REGION = 'sfo3';
|
|
17
|
+
const CDN_URL = 'https://keepkey.sfo3.cdn.digitaloceanspaces.com';
|
|
18
|
+
|
|
19
|
+
// Paths
|
|
20
|
+
const DATA_FILE = path.join(__dirname, '..', 'src', 'generatedAssetData.json');
|
|
21
|
+
const LOCAL_COINS_DIR = path.join(__dirname, '..', '..', '..', '..', 'services', 'pioneer-server', 'coins');
|
|
22
|
+
|
|
23
|
+
// AWS credentials
|
|
24
|
+
const AWS_ACCESS_KEY_ID = process.env.AWS_ACCESS_KEY_ID || 'DO00FXP8KK64LCXYAEZP';
|
|
25
|
+
const AWS_SECRET_ACCESS_KEY = process.env.AWS_SECRET_ACCESS_KEY || 'Uyw/cq63rrQmFV9yy1HbovTSMNhLkEwImqPa88N/E/s';
|
|
26
|
+
|
|
27
|
+
function encodeAssetId(assetId) {
|
|
28
|
+
return Buffer.from(assetId).toString('base64');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function toChecksumAddress(address) {
|
|
32
|
+
// Simple checksum implementation
|
|
33
|
+
const addr = address.toLowerCase().replace('0x', '');
|
|
34
|
+
const hash = require('crypto').createHash('sha256').update(addr).digest('hex');
|
|
35
|
+
let checksummed = '0x';
|
|
36
|
+
|
|
37
|
+
for (let i = 0; i < addr.length; i++) {
|
|
38
|
+
if (parseInt(hash[i], 16) >= 8) {
|
|
39
|
+
checksummed += addr[i].toUpperCase();
|
|
40
|
+
} else {
|
|
41
|
+
checksummed += addr[i];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return checksummed;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function generateVariants(assetId) {
|
|
48
|
+
const variants = [assetId];
|
|
49
|
+
|
|
50
|
+
// Check if it's an ERC20 token (contains erc20: and 0x address)
|
|
51
|
+
if (assetId.includes('/erc20:0x') || assetId.includes('/bep20:0x')) {
|
|
52
|
+
const parts = assetId.split(':');
|
|
53
|
+
const address = parts[parts.length - 1];
|
|
54
|
+
|
|
55
|
+
if (address && address.startsWith('0x')) {
|
|
56
|
+
// Generate lowercase variant
|
|
57
|
+
const lowerParts = [...parts];
|
|
58
|
+
lowerParts[lowerParts.length - 1] = address.toLowerCase();
|
|
59
|
+
const lowerVariant = lowerParts.join(':');
|
|
60
|
+
|
|
61
|
+
// Generate checksummed variant
|
|
62
|
+
const checksummed = toChecksumAddress(address);
|
|
63
|
+
const checksumParts = [...parts];
|
|
64
|
+
checksumParts[checksumParts.length - 1] = checksummed;
|
|
65
|
+
const checksumVariant = checksumParts.join(':');
|
|
66
|
+
|
|
67
|
+
return [lowerVariant, checksumVariant];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return variants;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function uploadFile(localFile, s3Key) {
|
|
75
|
+
const cmd = `aws s3 cp "${localFile}" "s3://${S3_BUCKET}/${s3Key}" \
|
|
76
|
+
--endpoint-url=${S3_ENDPOINT} \
|
|
77
|
+
--acl public-read \
|
|
78
|
+
--region ${S3_REGION}`;
|
|
79
|
+
|
|
80
|
+
execSync(cmd, {
|
|
81
|
+
env: {
|
|
82
|
+
...process.env,
|
|
83
|
+
AWS_ACCESS_KEY_ID,
|
|
84
|
+
AWS_SECRET_ACCESS_KEY
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function checkAccessible(url) {
|
|
90
|
+
return new Promise((resolve) => {
|
|
91
|
+
https.get(url, { method: 'HEAD' }, (res) => {
|
|
92
|
+
resolve(res.statusCode === 200);
|
|
93
|
+
}).on('error', () => resolve(false));
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async function main() {
|
|
98
|
+
console.log('š Starting dual-case icon upload...\n');
|
|
99
|
+
console.log(`š Local coins directory: ${LOCAL_COINS_DIR}`);
|
|
100
|
+
console.log(`āļø S3 bucket: ${S3_BUCKET}`);
|
|
101
|
+
console.log(`š CDN URL: ${CDN_URL}\n`);
|
|
102
|
+
|
|
103
|
+
// Check local directory exists
|
|
104
|
+
if (!fs.existsSync(LOCAL_COINS_DIR)) {
|
|
105
|
+
console.error(`ā Local coins directory not found: ${LOCAL_COINS_DIR}`);
|
|
106
|
+
process.exit(1);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Read asset data
|
|
110
|
+
const assetData = JSON.parse(fs.readFileSync(DATA_FILE, 'utf8'));
|
|
111
|
+
const assets = Object.entries(assetData);
|
|
112
|
+
|
|
113
|
+
console.log(`š Total assets: ${assets.length}\n`);
|
|
114
|
+
|
|
115
|
+
let processed = 0;
|
|
116
|
+
let uploaded = 0;
|
|
117
|
+
let variants = 0;
|
|
118
|
+
|
|
119
|
+
for (const [assetId, asset] of assets) {
|
|
120
|
+
processed++;
|
|
121
|
+
|
|
122
|
+
// Generate all variants (lowercase + checksummed for ERC20)
|
|
123
|
+
const assetVariants = generateVariants(assetId);
|
|
124
|
+
const primaryEncoded = encodeAssetId(assetVariants[0]);
|
|
125
|
+
const localFile = path.join(LOCAL_COINS_DIR, `${primaryEncoded}.png`);
|
|
126
|
+
|
|
127
|
+
if (!fs.existsSync(localFile)) {
|
|
128
|
+
continue; // Skip if no local file
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
console.log(`\nš [${processed}] ${asset.symbol || asset.name}`);
|
|
132
|
+
console.log(` š¦ Variants: ${assetVariants.length}`);
|
|
133
|
+
|
|
134
|
+
for (const variant of assetVariants) {
|
|
135
|
+
const encoded = encodeAssetId(variant);
|
|
136
|
+
const s3Key = `coins/${encoded}.png`;
|
|
137
|
+
const cdnUrl = `${CDN_URL}/coins/${encoded}.png`;
|
|
138
|
+
|
|
139
|
+
try {
|
|
140
|
+
// Upload
|
|
141
|
+
uploadFile(localFile, s3Key);
|
|
142
|
+
|
|
143
|
+
// Verify
|
|
144
|
+
await new Promise(resolve => setTimeout(resolve, 500));
|
|
145
|
+
const accessible = await checkAccessible(cdnUrl);
|
|
146
|
+
|
|
147
|
+
if (accessible) {
|
|
148
|
+
console.log(` ā
${variant} ā accessible`);
|
|
149
|
+
uploaded++;
|
|
150
|
+
} else {
|
|
151
|
+
console.log(` ā ļø ${variant} ā not accessible yet`);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
variants++;
|
|
155
|
+
} catch (error) {
|
|
156
|
+
console.log(` ā ${variant} ā upload failed: ${error.message}`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (processed % 10 === 0) {
|
|
161
|
+
console.log(`\nš Progress: ${processed}/${assets.length} processed, ${uploaded} verified, ${variants} variants uploaded`);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
console.log(`\n\nš FINAL SUMMARY`);
|
|
166
|
+
console.log(`================================================================================`);
|
|
167
|
+
console.log(`Total assets processed: ${processed}`);
|
|
168
|
+
console.log(`Total variants uploaded: ${variants}`);
|
|
169
|
+
console.log(`Verified accessible: ${uploaded}`);
|
|
170
|
+
console.log(`================================================================================`);
|
|
171
|
+
console.log(`\nā
Dual-case upload complete!`);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
main().catch(console.error);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
š Starting dual-case icon upload...
|
|
2
|
+
|
|
3
|
+
š Local coins directory: /Users/highlander/WebstormProjects/keepkey-stack/projects/pioneer/services/pioneer-server/coins
|
|
4
|
+
āļø S3 bucket: keepkey
|
|
5
|
+
š CDN URL: https://keepkey.sfo3.cdn.digitaloceanspaces.com
|
|
6
|
+
|
|
7
|
+
š Total assets: 14173
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
š [4] BTC
|
|
11
|
+
š¦ Variants: 1
|
|
12
|
+
ā
bip122:000000000019d6689c085ae165831e93/slip44:0 ā accessible
|
|
13
|
+
|
|
14
|
+
š [5] ETH
|
|
15
|
+
š¦ Variants: 1
|
|
16
|
+
ā
eip155:1/slip44:60 ā accessible
|
|
17
|
+
|
|
18
|
+
š [7] OSMO
|
|
19
|
+
š¦ Variants: 1
|
|
20
|
+
ā
cosmos:osmosis-1/slip44:118 ā accessible
|
|
21
|
+
|
|
22
|
+
š [8] RUNE
|
|
23
|
+
š¦ Variants: 1
|
|
24
|
+
ā
cosmos:thorchain-mainnet-v1/slip44:931 ā accessible
|
|
25
|
+
|
|
26
|
+
š [12] BCH
|
|
27
|
+
š¦ Variants: 1
|
|
28
|
+
ā
bip122:000000000000000000651ef99cb9fcbe/slip44:145 ā accessible
|
|
29
|
+
|
|
30
|
+
š [13] DOGE
|
|
31
|
+
š¦ Variants: 1
|
|
32
|
+
ā
bip122:00000000001a91e3dace36e2be3bf030/slip44:3 ā accessible
|
|
33
|
+
|
|
34
|
+
š [14] DASH
|
|
35
|
+
š¦ Variants: 1
|
|
36
|
+
ā
bip122:000007d91d1254d60e2dd1ae58038307/slip44:5 ā accessible
|
|
37
|
+
|
|
38
|
+
š [18] AVAX
|
|
39
|
+
š¦ Variants: 1
|
|
40
|
+
ā
eip155:43114/slip44:60 ā accessible
|
|
41
|
+
|
|
42
|
+
š [19] MATIC
|
|
43
|
+
š¦ Variants: 1
|
|
44
|
+
ā
eip155:137/slip44:60 ā accessible
|
|
45
|
+
|
|
46
|
+
š [20] ARB
|
|
47
|
+
š¦ Variants: 1
|
|
48
|
+
ā
eip155:42161/slip44:60 ā accessible
|
|
49
|
+
|
|
50
|
+
š Progress: 20/14173 processed, 10 verified, 10 variants uploaded
|
|
51
|
+
|
|
52
|
+
š [21] OP
|
|
53
|
+
š¦ Variants: 1
|
|
54
|
+
ā
eip155:10/slip44:60 ā accessible
|
|
55
|
+
|
|
56
|
+
š [22] BASE
|
|
57
|
+
š¦ Variants: 1
|
|
58
|
+
ā
eip155:8453/slip44:60 ā accessible
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
š FINAL SUMMARY
|
|
62
|
+
================================================================================
|
|
63
|
+
Total assets processed: 14173
|
|
64
|
+
Total variants uploaded: 12
|
|
65
|
+
Verified accessible: 12
|
|
66
|
+
================================================================================
|
|
67
|
+
|
|
68
|
+
ā
Dual-case upload complete!
|
package/scripts/upload-to-s3.js
CHANGED
|
@@ -26,7 +26,7 @@ const CDN_URL = 'https://keepkey.sfo3.cdn.digitaloceanspaces.com';
|
|
|
26
26
|
|
|
27
27
|
// Paths
|
|
28
28
|
const DATA_FILE = path.join(__dirname, '..', 'src', 'generatedAssetData.json');
|
|
29
|
-
const LOCAL_COINS_DIR = path.join(__dirname, '..', '..', '..', '..', '
|
|
29
|
+
const LOCAL_COINS_DIR = path.join(__dirname, '..', '..', '..', '..', 'services', 'pioneer-server', 'coins');
|
|
30
30
|
const PROGRESS_FILE = path.join(__dirname, '.upload-progress.json');
|
|
31
31
|
const FAILED_FILE = path.join(__dirname, '.upload-failed.json');
|
|
32
32
|
|