Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands - CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround - CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check - NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere - MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates - LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference Co-authored-by: Cursor <cursoragent@cursor.com>
51 lines
1.6 KiB
JavaScript
51 lines
1.6 KiB
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* Resolve Tezos wUSDC/wUSDT and related token addresses from Plenty API.
|
|
* Output: JSON suitable for TEZOS_TOKEN_REGISTRY or env config.
|
|
* Run: node scripts/resolve-tezos-tokens-from-plenty.js
|
|
*/
|
|
|
|
const PLENTY_TOKENS_URL = 'https://api.plenty.network/config/tokens';
|
|
|
|
async function main() {
|
|
try {
|
|
const res = await fetch(PLENTY_TOKENS_URL, { signal: AbortSignal.timeout(10000) });
|
|
if (!res.ok) {
|
|
console.error('Plenty API error:', res.status);
|
|
process.exit(1);
|
|
}
|
|
const tokens = await res.json();
|
|
const bySymbol = {};
|
|
for (const t of tokens) {
|
|
const sym = (t.symbol || t.tokenSymbol || '').toUpperCase();
|
|
if (sym && t.address) bySymbol[sym] = { ...t, symbol: sym };
|
|
}
|
|
const wusdc = bySymbol['WUSDC'] || bySymbol['Wrapped USDC'];
|
|
const wusdt = bySymbol['WUSDT'] || bySymbol['Wrapped USDT'];
|
|
const usdc = bySymbol['USDC'];
|
|
const usdt = bySymbol['USDT'];
|
|
const out = {
|
|
wUSDC: wusdc?.address || null,
|
|
wUSDT: wusdt?.address || null,
|
|
USDC: usdc?.address || null,
|
|
USDT: usdt?.address || null,
|
|
source: PLENTY_TOKENS_URL,
|
|
timestamp: new Date().toISOString(),
|
|
};
|
|
console.log(JSON.stringify(out, null, 2));
|
|
} catch (err) {
|
|
console.error('Failed to fetch Plenty tokens:', err.message);
|
|
console.log(JSON.stringify({
|
|
wUSDC: null,
|
|
wUSDT: null,
|
|
USDC: null,
|
|
USDT: null,
|
|
error: err.message,
|
|
note: 'Update TEZOS_TOKEN_REGISTRY manually or retry when Plenty API is available',
|
|
}, null, 2));
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
main();
|