@aarc-dev/core-viem
Advanced tools
Comparing version
@@ -24,3 +24,3 @@ import { BalancesData, BalancesResponse, CheckoutDto, CheckoutOnrampParams, CheckoutRouteDto, DepositCalldataResponse, DepositDto, DepositOnRampParams, DepositRouteDto, ExecuteMigrationForwardDto, ExecuteMigrationGaslessDto, ExecuteMigrationNonGaslessDto, IsTokenSupportedResponse, MoonpayOnRampParams, PriceData, RelayedTxListResponse, SupportedChainInfo, SupportedTokensResponse, TrxStatusResponse, KadoOnRampParams, DepositAddressData, StatusResponseDto, DepositAddressDTO } from "./utils/CoreTypes"; | ||
}): Promise<BalancesData>; | ||
fetchTokenPrice(tokenSymbol: string, tokenAddress?: string): Promise<PriceData>; | ||
fetchTokenPrice(tokenSymbol: string, tokenAddress?: string, tokenChainId?: string): Promise<PriceData>; | ||
isTokenSupported(chainId: number, tokenAddress: string): Promise<IsTokenSupportedResponse>; | ||
@@ -40,3 +40,3 @@ getSupportedTokens(chainId: number): Promise<SupportedTokensResponse>; | ||
generateKadoOnrampUrl(onrampData: KadoOnRampParams): Promise<string | Error>; | ||
getDepositAddress({ toAmount, provider, gasLimit, slippage, routeType, fromAmount, userOpHash, fromChainId, fromAddress, transferOut, transferType, targetCalldata, userOperations, fromTokenAddress, destinationChainId, destinationRecipient, destinationTokenAddress, }: DepositAddressDTO): Promise<DepositAddressData>; | ||
getDepositAddress({ toAmount, provider, gasLimit, slippage, routeType, fromAmount, userOpHash, fromChainId, fromAddress, transferOut, transferType, targetCalldata, userOperations, fromTokenAddress, destinationChainId, destinationRecipient, destinationTokenAddress, refundAddress, }: DepositAddressDTO): Promise<DepositAddressData>; | ||
postExecuteToAddress({ depositData, trxHash, }: { | ||
@@ -43,0 +43,0 @@ depositData: DepositAddressData; |
@@ -187,4 +187,4 @@ "use strict"; | ||
} | ||
async fetchTokenPrice(tokenSymbol, tokenAddress) { | ||
return await (0, Helper_1.getTokenPrice)(this.apiKey, tokenSymbol, tokenAddress); | ||
async fetchTokenPrice(tokenSymbol, tokenAddress, tokenChainId) { | ||
return await (0, Helper_1.getTokenPrice)(this.apiKey, tokenSymbol, tokenAddress, tokenChainId); | ||
} | ||
@@ -684,3 +684,3 @@ async isTokenSupported(chainId, tokenAddress) { | ||
} | ||
async getDepositAddress({ toAmount, provider, gasLimit, slippage, routeType, fromAmount, userOpHash, fromChainId, fromAddress, transferOut, transferType, targetCalldata, userOperations, fromTokenAddress, destinationChainId, destinationRecipient, destinationTokenAddress, }) { | ||
async getDepositAddress({ toAmount, provider, gasLimit, slippage, routeType, fromAmount, userOpHash, fromChainId, fromAddress, transferOut, transferType, targetCalldata, userOperations, fromTokenAddress, destinationChainId, destinationRecipient, destinationTokenAddress, refundAddress, }) { | ||
var _a; | ||
@@ -718,2 +718,4 @@ if (transferType === CoreTypes_1.TransferType.WALLET) { | ||
payloadParams.fromAddress = fromAddress; | ||
if (refundAddress) | ||
payloadParams.refundAddress = refundAddress; | ||
if (slippage) { | ||
@@ -720,0 +722,0 @@ const slippageValue = parseFloat(slippage); |
@@ -1,10 +0,10 @@ | ||
export declare const MIGRATE_BASE_URL = "https://migrator.aarc.xyz"; | ||
export declare const MIGRATE_BASE_URL = "https://migrator.staging.aarc.xyz"; | ||
export declare const BRIDGE_SWAP_BASE_URL = "https://bridge-swap.staging.aarc.xyz"; | ||
export declare const BALANCES_ENDPOINT = "https://migrator.aarc.xyz/migrator/balances"; | ||
export declare const GENERATE_NON_GASLESS_CALL_DATA_ENDPOINT = "https://migrator.aarc.xyz/migrate/non-gasless-calldata"; | ||
export declare const GENERATE_GASLESS_CALL_DATA_ENDPOINT = "https://migrator.aarc.xyz/migrate/gasless-calldata"; | ||
export declare const EXECUTE_GASLESS_CALL_DATA_ENDPOINT = "https://migrator.aarc.xyz/migrate/gasless-calldata-trx"; | ||
export declare const GENERATE_FORWARD_CALL_DATA_ENDPOINT = "https://migrator.aarc.xyz/migrate/forward-calldata"; | ||
export declare const EXECUTE_FORWARD_CALL_DATA_ENDPOINT = "https://migrator.aarc.xyz/migrate/forward-calldata-trx"; | ||
export declare const TRX_STATUS_ENDPOINT = "https://migrator.aarc.xyz/migrator/tx/status"; | ||
export declare const BALANCES_ENDPOINT = "https://migrator.staging.aarc.xyz/migrator/balances"; | ||
export declare const GENERATE_NON_GASLESS_CALL_DATA_ENDPOINT = "https://migrator.staging.aarc.xyz/migrate/non-gasless-calldata"; | ||
export declare const GENERATE_GASLESS_CALL_DATA_ENDPOINT = "https://migrator.staging.aarc.xyz/migrate/gasless-calldata"; | ||
export declare const EXECUTE_GASLESS_CALL_DATA_ENDPOINT = "https://migrator.staging.aarc.xyz/migrate/gasless-calldata-trx"; | ||
export declare const GENERATE_FORWARD_CALL_DATA_ENDPOINT = "https://migrator.staging.aarc.xyz/migrate/forward-calldata"; | ||
export declare const EXECUTE_FORWARD_CALL_DATA_ENDPOINT = "https://migrator.staging.aarc.xyz/migrate/forward-calldata-trx"; | ||
export declare const TRX_STATUS_ENDPOINT = "https://migrator.staging.aarc.xyz/migrator/tx/status"; | ||
export declare const GENERATE_DEPOSIT_CALL_DATA_ENDPOINT = "https://bridge-swap.staging.aarc.xyz/deposit-calldata"; | ||
@@ -21,2 +21,2 @@ export declare const GENERATE_CHECKOUT_CALL_DATA_ENDPOINT = "https://bridge-swap.staging.aarc.xyz/checkout-contract-calldata"; | ||
export declare const PERMIT2_CONTRACT_ADDRESS = "0x000000000022D473030F116dDEE9F6B43aC78BA3"; | ||
export declare const ONRAMP_BASE_URL = "https://develop-v3--onramp-v3.netlify.app/"; | ||
export declare const ONRAMP_BASE_URL = "https://onramp-v3.aarc.xyz/"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ONRAMP_BASE_URL = exports.PERMIT2_CONTRACT_ADDRESS = exports.POST_EXECUTION_SCHEDULE_TRANSACTION_STATUS_ENDPOINT = exports.POST_EXECUTION_SCHEDULE_TRANSACTION_ENDPOINT = exports.DEPOSIT_ADDRESS_ENDPOINT = exports.CHAINS_SUPPORTED_ENDPOINT = exports.TOKENS_SUPPORTED_ENDPOINT = exports.IS_TOKEN_SUPPORTED_ENDPOINT = exports.TOKEN_PRICE_ENDPOINT = exports.MULTI_CHAIN_BALANCES_ENDPOINT = exports.GENERATE_CHECKOUT_CALL_DATA_ENDPOINT = exports.GENERATE_DEPOSIT_CALL_DATA_ENDPOINT = exports.TRX_STATUS_ENDPOINT = exports.EXECUTE_FORWARD_CALL_DATA_ENDPOINT = exports.GENERATE_FORWARD_CALL_DATA_ENDPOINT = exports.EXECUTE_GASLESS_CALL_DATA_ENDPOINT = exports.GENERATE_GASLESS_CALL_DATA_ENDPOINT = exports.GENERATE_NON_GASLESS_CALL_DATA_ENDPOINT = exports.BALANCES_ENDPOINT = exports.BRIDGE_SWAP_BASE_URL = exports.MIGRATE_BASE_URL = void 0; | ||
exports.MIGRATE_BASE_URL = "https://migrator.aarc.xyz"; | ||
exports.MIGRATE_BASE_URL = "https://migrator.staging.aarc.xyz"; | ||
exports.BRIDGE_SWAP_BASE_URL = "https://bridge-swap.staging.aarc.xyz"; | ||
@@ -24,3 +24,3 @@ exports.BALANCES_ENDPOINT = `${exports.MIGRATE_BASE_URL}/migrator/balances`; | ||
exports.PERMIT2_CONTRACT_ADDRESS = "0x000000000022D473030F116dDEE9F6B43aC78BA3"; | ||
exports.ONRAMP_BASE_URL = "https://develop-v3--onramp-v3.netlify.app/"; | ||
exports.ONRAMP_BASE_URL = "https://onramp-v3.aarc.xyz/"; | ||
//# sourceMappingURL=Constants.js.map |
@@ -553,3 +553,4 @@ import { ChainId } from "./ChainTypes"; | ||
userOperations?: any[]; | ||
refundAddress?: string; | ||
} | ||
export {}; |
@@ -24,2 +24,2 @@ import { BalancesData, BalancesResponse, CheckoutCallDataDto, CheckoutCalldataResponse, DepositCallDataDto, DepositCalldataResponse, ForwardCallDataDto, ForwardCalldataRes, GaslessCalldataResponse, IsTokenSupportedResponse, PriceData, RelayedTxListResponse, SupportedChainInfo, SupportedTokensResponse, TRX_RESPONSE } from "./CoreTypes"; | ||
export declare const GetTransactionStatus: (taskId: string) => Promise<any>; | ||
export declare const getTokenPrice: (apiKey: string, tokenSymbol: string, tokenAddress?: string) => Promise<PriceData>; | ||
export declare const getTokenPrice: (apiKey: string, tokenSymbol: string, tokenAddress?: string, tokenChainId?: string) => Promise<PriceData>; |
@@ -282,6 +282,8 @@ "use strict"; | ||
exports.GetTransactionStatus = GetTransactionStatus; | ||
const getTokenPrice = async (apiKey, tokenSymbol, tokenAddress) => { | ||
const url = tokenAddress | ||
? `${Constants_1.TOKEN_PRICE_ENDPOINT}/${tokenSymbol}?tokenAddress=${tokenAddress}` | ||
: `${Constants_1.TOKEN_PRICE_ENDPOINT}/${tokenSymbol}`; | ||
const getTokenPrice = async (apiKey, tokenSymbol, tokenAddress, tokenChainId) => { | ||
let url = `${Constants_1.TOKEN_PRICE_ENDPOINT}/${tokenSymbol}`; | ||
if (tokenAddress) | ||
url += `?tokenAddress=${tokenAddress}`; | ||
if (tokenChainId) | ||
url += `&tokenChainId=${tokenChainId}`; | ||
const response = await fetch(url, { | ||
@@ -288,0 +290,0 @@ method: "GET", |
{ | ||
"name": "@aarc-dev/core-viem", | ||
"version": "0.1.29", | ||
"version": "0.1.30", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/src/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
244368
12.37%2268
0.27%