Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Waiting to run
CI/CD Pipeline / Security Scanning (push) Waiting to run
CI/CD Pipeline / Lint and Format (push) Waiting to run
CI/CD Pipeline / Terraform Validation (push) Waiting to run
CI/CD Pipeline / Kubernetes Validation (push) Waiting to run
Deploy ChainID 138 / Deploy ChainID 138 (push) Waiting to run
Validation / validate-genesis (push) Waiting to run
Validation / validate-terraform (push) Waiting to run
Validation / validate-kubernetes (push) Waiting to run
Validation / validate-smart-contracts (push) Waiting to run
Validation / validate-security (push) Waiting to run
Validation / validate-documentation (push) Waiting to run
Verify Deployment / Verify Deployment (push) Has been cancelled
42 lines
1.4 KiB
JavaScript
42 lines
1.4 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
import axios from 'axios';
|
|
|
|
const baseUrl = process.env.TOKEN_AGGREGATION_BASE_URL || 'http://localhost:3000';
|
|
|
|
const body = {
|
|
partner: process.env.PARTNER || '0x',
|
|
amount: process.env.AMOUNT || '1000000',
|
|
fromChainId: process.env.FROM_CHAIN_ID ? Number(process.env.FROM_CHAIN_ID) : 138,
|
|
toChainId: process.env.TO_CHAIN_ID ? Number(process.env.TO_CHAIN_ID) : 138,
|
|
routeType: process.env.ROUTE_TYPE || 'swap',
|
|
tokenIn: process.env.TOKEN_IN || '0x93E66202A11B1772E55407B32B44e5Cd8eda7f22',
|
|
tokenOut: process.env.TOKEN_OUT || '0xf22258f57794CC8E06237084b353Ab30fFfa640b',
|
|
takerAddress: process.env.TAKER_ADDRESS || '0x000000000000000000000000000000000000dEaD',
|
|
recipient: process.env.RECIPIENT || '0x000000000000000000000000000000000000dEaD',
|
|
includeUnsupported: String(process.env.INCLUDE_UNSUPPORTED || 'true').toLowerCase() === 'true',
|
|
};
|
|
|
|
async function main() {
|
|
const response = await axios.post(
|
|
`${baseUrl.replace(/\/+$/, '')}/api/v1/routes/partner-payloads/resolve`,
|
|
body,
|
|
{
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
Accept: 'application/json',
|
|
},
|
|
timeout: 15000,
|
|
}
|
|
);
|
|
|
|
console.log(JSON.stringify(response.data, null, 2));
|
|
}
|
|
|
|
main().catch((error) => {
|
|
const message = error?.response?.data || error?.message || error;
|
|
console.error('Partner payload resolution failed:', message);
|
|
process.exit(1);
|
|
});
|
|
|