@rhea-finance/cross-chain-sdk 0.1.3 → 0.1.4
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/README.md +1 -1
- package/dist/index.cjs +7 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import * as near_api_js from 'near-api-js';
|
|
2
|
+
import { Near } from 'near-api-js';
|
|
1
3
|
import Decimal from 'decimal.js';
|
|
2
4
|
|
|
5
|
+
declare function getNearConnection(): Promise<Near>;
|
|
6
|
+
declare function getAccountConnection(accountId?: string): Promise<near_api_js.Account>;
|
|
3
7
|
declare function view_on_near({ contractId, methodName, args, }: {
|
|
4
8
|
contractId: string;
|
|
5
9
|
methodName: string;
|
|
@@ -1117,4 +1121,4 @@ declare const getWithdrawMaxAmount: ({ tokenId, assets, portfolio, }: {
|
|
|
1117
1121
|
portfolio: Portfolio;
|
|
1118
1122
|
}) => number;
|
|
1119
1123
|
|
|
1120
|
-
export { type AccountFarmRewardView, type Asset, type Assets, ChangeMethodsLogic, ChangeMethodsOracle, DEFAULT_POSITION, FRACTION_DIGITS, type Farm, type IAccountAllPositionsDetailed, type IAssetConfig, type IAssetDetailed, type IAssetFarm, type IAssetFarmReward, type IAssetFarmView, type IAssetPrice, type IAssetsView, type IBoosterStaking, type IBusiness, type IChain, type IConfig, type IExecutionResult, type IFarm, type IFarmId, type IFarms, type IGasData, type IIntentItem, type IIntentSwapDetails, type IIntentsQuote, type IIntentsQuoteResult, type ILendingData, type IMetadata, type IPool, type IPortfolioAssetOrigin, type IPositions, type IPositionsOrigin, type IPrice, type IPrices, type IPythInfo, type IPythPrice, type IRelayerResult, type ISimpleWithdraw, type IStatus, type IWallet, MAX_RATIO, NDeposit, NEAR_STORAGE_DEPOSIT, type Portfolio, type PortfolioAsset, type QuotationParams, TGas, TOKEN_STORAGE_DEPOSIT_READ, type TokenAction, ViewMethodsLogic, ViewMethodsOracle, ViewMethodsPyth, ViewMethodsToken, batchViews, computeRelayerGas, computeWithdrawMaxAmount, config_btc, config_evm, config_near, config_solana, decimalMax, decimalMin, expandToken, expandTokenDecimal, fetchIntentsQuotation, fetchIntentsTokens, fetchIntentsTransactionStatus, format_wallet, getAccountAllPositions, getAccountBalance, getAdjustedSum, getAllFarms, getAssets, getAssetsDetail, getAuthenticationHeaders, getBalance, getBoosterTokens, getBorrowMaxAmount, getCeateMcaFee, getConfig, getCreateMcaCustomRecipientMsg, getCreateMcaFeePaged, getListWalletsByMca, getMcaByWallet, getMultichainLendingConfig, getMultichainLendingData, getMultichainLendingHistory, getMultichainTokensByChains, getNearValue, getNearValuesPaged, getPrices, getRepayCustomRecipientMsg, getSignature, getSupplyCustomRecipientMsg, getTokenPythInfos, getWithdrawMaxAmount, get_all_tokens_metadata, get_interest_rate, get_liquidations, get_nonce_deadline, get_records, get_simple_withdraw_tx, get_token_detail, get_tx_id, hasZeroSharesFarmRewards, initialStaking, intentsQuotation, listFarmToMap, lpTokenPrefix, pollingRelayerTransactionResult, pollingTransactionStatus, postMultichainLendingReport, postMultichainLendingRequests, prepareBusinessDataOnAddWallet, prepareBusinessDataOnAdjust, prepareBusinessDataOnBorrow, prepareBusinessDataOnClaim, prepareBusinessDataOnRemoveWallet, prepareBusinessDataOnRepayFromSupplied, prepareBusinessDataOnWithdraw, prepareBusinessDataOninnerWithdraw, prepare_sign_message_btc, prepare_sign_message_evm, prepare_sign_message_solana, process_signature_btc, process_signature_evm, process_signature_solana, query_account_register_token_tx, query_intents_tansfer_txs, recomputeHealthFactorAdjust, recomputeHealthFactorBorrow, recomputeHealthFactorRepay, recomputeHealthFactorRepayFromDeposits, recomputeHealthFactorSupply, recomputeHealthFactorWithdraw, serializationObj, setCustomNodeUrl, shrinkToken, shrinkTokenDecimal, submitSignedTransactionToRelayer, transformAccountFarms, transformAssetFarms, transformAssets, transformFarms, transformPortfolio, view_on_near };
|
|
1124
|
+
export { type AccountFarmRewardView, type Asset, type Assets, ChangeMethodsLogic, ChangeMethodsOracle, DEFAULT_POSITION, FRACTION_DIGITS, type Farm, type IAccountAllPositionsDetailed, type IAssetConfig, type IAssetDetailed, type IAssetFarm, type IAssetFarmReward, type IAssetFarmView, type IAssetPrice, type IAssetsView, type IBoosterStaking, type IBusiness, type IChain, type IConfig, type IExecutionResult, type IFarm, type IFarmId, type IFarms, type IGasData, type IIntentItem, type IIntentSwapDetails, type IIntentsQuote, type IIntentsQuoteResult, type ILendingData, type IMetadata, type IPool, type IPortfolioAssetOrigin, type IPositions, type IPositionsOrigin, type IPrice, type IPrices, type IPythInfo, type IPythPrice, type IRelayerResult, type ISimpleWithdraw, type IStatus, type IWallet, MAX_RATIO, NDeposit, NEAR_STORAGE_DEPOSIT, type Portfolio, type PortfolioAsset, type QuotationParams, TGas, TOKEN_STORAGE_DEPOSIT_READ, type TokenAction, ViewMethodsLogic, ViewMethodsOracle, ViewMethodsPyth, ViewMethodsToken, batchViews, computeRelayerGas, computeWithdrawMaxAmount, config_btc, config_evm, config_near, config_solana, decimalMax, decimalMin, expandToken, expandTokenDecimal, fetchIntentsQuotation, fetchIntentsTokens, fetchIntentsTransactionStatus, format_wallet, getAccountAllPositions, getAccountBalance, getAccountConnection, getAdjustedSum, getAllFarms, getAssets, getAssetsDetail, getAuthenticationHeaders, getBalance, getBoosterTokens, getBorrowMaxAmount, getCeateMcaFee, getConfig, getCreateMcaCustomRecipientMsg, getCreateMcaFeePaged, getListWalletsByMca, getMcaByWallet, getMultichainLendingConfig, getMultichainLendingData, getMultichainLendingHistory, getMultichainTokensByChains, getNearConnection, getNearValue, getNearValuesPaged, getPrices, getRepayCustomRecipientMsg, getSignature, getSupplyCustomRecipientMsg, getTokenPythInfos, getWithdrawMaxAmount, get_all_tokens_metadata, get_interest_rate, get_liquidations, get_nonce_deadline, get_records, get_simple_withdraw_tx, get_token_detail, get_tx_id, hasZeroSharesFarmRewards, initialStaking, intentsQuotation, listFarmToMap, lpTokenPrefix, pollingRelayerTransactionResult, pollingTransactionStatus, postMultichainLendingReport, postMultichainLendingRequests, prepareBusinessDataOnAddWallet, prepareBusinessDataOnAdjust, prepareBusinessDataOnBorrow, prepareBusinessDataOnClaim, prepareBusinessDataOnRemoveWallet, prepareBusinessDataOnRepayFromSupplied, prepareBusinessDataOnWithdraw, prepareBusinessDataOninnerWithdraw, prepare_sign_message_btc, prepare_sign_message_evm, prepare_sign_message_solana, process_signature_btc, process_signature_evm, process_signature_solana, query_account_register_token_tx, query_intents_tansfer_txs, recomputeHealthFactorAdjust, recomputeHealthFactorBorrow, recomputeHealthFactorRepay, recomputeHealthFactorRepayFromDeposits, recomputeHealthFactorSupply, recomputeHealthFactorWithdraw, serializationObj, setCustomNodeUrl, shrinkToken, shrinkTokenDecimal, submitSignedTransactionToRelayer, transformAccountFarms, transformAssetFarms, transformAssets, transformFarms, transformPortfolio, view_on_near };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import * as near_api_js from 'near-api-js';
|
|
2
|
+
import { Near } from 'near-api-js';
|
|
1
3
|
import Decimal from 'decimal.js';
|
|
2
4
|
|
|
5
|
+
declare function getNearConnection(): Promise<Near>;
|
|
6
|
+
declare function getAccountConnection(accountId?: string): Promise<near_api_js.Account>;
|
|
3
7
|
declare function view_on_near({ contractId, methodName, args, }: {
|
|
4
8
|
contractId: string;
|
|
5
9
|
methodName: string;
|
|
@@ -1117,4 +1121,4 @@ declare const getWithdrawMaxAmount: ({ tokenId, assets, portfolio, }: {
|
|
|
1117
1121
|
portfolio: Portfolio;
|
|
1118
1122
|
}) => number;
|
|
1119
1123
|
|
|
1120
|
-
export { type AccountFarmRewardView, type Asset, type Assets, ChangeMethodsLogic, ChangeMethodsOracle, DEFAULT_POSITION, FRACTION_DIGITS, type Farm, type IAccountAllPositionsDetailed, type IAssetConfig, type IAssetDetailed, type IAssetFarm, type IAssetFarmReward, type IAssetFarmView, type IAssetPrice, type IAssetsView, type IBoosterStaking, type IBusiness, type IChain, type IConfig, type IExecutionResult, type IFarm, type IFarmId, type IFarms, type IGasData, type IIntentItem, type IIntentSwapDetails, type IIntentsQuote, type IIntentsQuoteResult, type ILendingData, type IMetadata, type IPool, type IPortfolioAssetOrigin, type IPositions, type IPositionsOrigin, type IPrice, type IPrices, type IPythInfo, type IPythPrice, type IRelayerResult, type ISimpleWithdraw, type IStatus, type IWallet, MAX_RATIO, NDeposit, NEAR_STORAGE_DEPOSIT, type Portfolio, type PortfolioAsset, type QuotationParams, TGas, TOKEN_STORAGE_DEPOSIT_READ, type TokenAction, ViewMethodsLogic, ViewMethodsOracle, ViewMethodsPyth, ViewMethodsToken, batchViews, computeRelayerGas, computeWithdrawMaxAmount, config_btc, config_evm, config_near, config_solana, decimalMax, decimalMin, expandToken, expandTokenDecimal, fetchIntentsQuotation, fetchIntentsTokens, fetchIntentsTransactionStatus, format_wallet, getAccountAllPositions, getAccountBalance, getAdjustedSum, getAllFarms, getAssets, getAssetsDetail, getAuthenticationHeaders, getBalance, getBoosterTokens, getBorrowMaxAmount, getCeateMcaFee, getConfig, getCreateMcaCustomRecipientMsg, getCreateMcaFeePaged, getListWalletsByMca, getMcaByWallet, getMultichainLendingConfig, getMultichainLendingData, getMultichainLendingHistory, getMultichainTokensByChains, getNearValue, getNearValuesPaged, getPrices, getRepayCustomRecipientMsg, getSignature, getSupplyCustomRecipientMsg, getTokenPythInfos, getWithdrawMaxAmount, get_all_tokens_metadata, get_interest_rate, get_liquidations, get_nonce_deadline, get_records, get_simple_withdraw_tx, get_token_detail, get_tx_id, hasZeroSharesFarmRewards, initialStaking, intentsQuotation, listFarmToMap, lpTokenPrefix, pollingRelayerTransactionResult, pollingTransactionStatus, postMultichainLendingReport, postMultichainLendingRequests, prepareBusinessDataOnAddWallet, prepareBusinessDataOnAdjust, prepareBusinessDataOnBorrow, prepareBusinessDataOnClaim, prepareBusinessDataOnRemoveWallet, prepareBusinessDataOnRepayFromSupplied, prepareBusinessDataOnWithdraw, prepareBusinessDataOninnerWithdraw, prepare_sign_message_btc, prepare_sign_message_evm, prepare_sign_message_solana, process_signature_btc, process_signature_evm, process_signature_solana, query_account_register_token_tx, query_intents_tansfer_txs, recomputeHealthFactorAdjust, recomputeHealthFactorBorrow, recomputeHealthFactorRepay, recomputeHealthFactorRepayFromDeposits, recomputeHealthFactorSupply, recomputeHealthFactorWithdraw, serializationObj, setCustomNodeUrl, shrinkToken, shrinkTokenDecimal, submitSignedTransactionToRelayer, transformAccountFarms, transformAssetFarms, transformAssets, transformFarms, transformPortfolio, view_on_near };
|
|
1124
|
+
export { type AccountFarmRewardView, type Asset, type Assets, ChangeMethodsLogic, ChangeMethodsOracle, DEFAULT_POSITION, FRACTION_DIGITS, type Farm, type IAccountAllPositionsDetailed, type IAssetConfig, type IAssetDetailed, type IAssetFarm, type IAssetFarmReward, type IAssetFarmView, type IAssetPrice, type IAssetsView, type IBoosterStaking, type IBusiness, type IChain, type IConfig, type IExecutionResult, type IFarm, type IFarmId, type IFarms, type IGasData, type IIntentItem, type IIntentSwapDetails, type IIntentsQuote, type IIntentsQuoteResult, type ILendingData, type IMetadata, type IPool, type IPortfolioAssetOrigin, type IPositions, type IPositionsOrigin, type IPrice, type IPrices, type IPythInfo, type IPythPrice, type IRelayerResult, type ISimpleWithdraw, type IStatus, type IWallet, MAX_RATIO, NDeposit, NEAR_STORAGE_DEPOSIT, type Portfolio, type PortfolioAsset, type QuotationParams, TGas, TOKEN_STORAGE_DEPOSIT_READ, type TokenAction, ViewMethodsLogic, ViewMethodsOracle, ViewMethodsPyth, ViewMethodsToken, batchViews, computeRelayerGas, computeWithdrawMaxAmount, config_btc, config_evm, config_near, config_solana, decimalMax, decimalMin, expandToken, expandTokenDecimal, fetchIntentsQuotation, fetchIntentsTokens, fetchIntentsTransactionStatus, format_wallet, getAccountAllPositions, getAccountBalance, getAccountConnection, getAdjustedSum, getAllFarms, getAssets, getAssetsDetail, getAuthenticationHeaders, getBalance, getBoosterTokens, getBorrowMaxAmount, getCeateMcaFee, getConfig, getCreateMcaCustomRecipientMsg, getCreateMcaFeePaged, getListWalletsByMca, getMcaByWallet, getMultichainLendingConfig, getMultichainLendingData, getMultichainLendingHistory, getMultichainTokensByChains, getNearConnection, getNearValue, getNearValuesPaged, getPrices, getRepayCustomRecipientMsg, getSignature, getSupplyCustomRecipientMsg, getTokenPythInfos, getWithdrawMaxAmount, get_all_tokens_metadata, get_interest_rate, get_liquidations, get_nonce_deadline, get_records, get_simple_withdraw_tx, get_token_detail, get_tx_id, hasZeroSharesFarmRewards, initialStaking, intentsQuotation, listFarmToMap, lpTokenPrefix, pollingRelayerTransactionResult, pollingTransactionStatus, postMultichainLendingReport, postMultichainLendingRequests, prepareBusinessDataOnAddWallet, prepareBusinessDataOnAdjust, prepareBusinessDataOnBorrow, prepareBusinessDataOnClaim, prepareBusinessDataOnRemoveWallet, prepareBusinessDataOnRepayFromSupplied, prepareBusinessDataOnWithdraw, prepareBusinessDataOninnerWithdraw, prepare_sign_message_btc, prepare_sign_message_evm, prepare_sign_message_solana, process_signature_btc, process_signature_evm, process_signature_solana, query_account_register_token_tx, query_intents_tansfer_txs, recomputeHealthFactorAdjust, recomputeHealthFactorBorrow, recomputeHealthFactorRepay, recomputeHealthFactorRepayFromDeposits, recomputeHealthFactorSupply, recomputeHealthFactorWithdraw, serializationObj, setCustomNodeUrl, shrinkToken, shrinkTokenDecimal, submitSignedTransactionToRelayer, transformAccountFarms, transformAssetFarms, transformAssets, transformFarms, transformPortfolio, view_on_near };
|
package/dist/index.js
CHANGED
|
@@ -231,7 +231,7 @@ var DEFAULT_POSITION = "REGULAR";
|
|
|
231
231
|
var lpTokenPrefix = "shadow_ref_v1";
|
|
232
232
|
|
|
233
233
|
// src/chains/near.ts
|
|
234
|
-
async function
|
|
234
|
+
async function getNearConnection() {
|
|
235
235
|
let keyStore;
|
|
236
236
|
if (typeof globalThis["window"] === "undefined") {
|
|
237
237
|
keyStore = new keyStores.InMemoryKeyStore();
|
|
@@ -243,6 +243,10 @@ async function getAccountConnection(accountId) {
|
|
|
243
243
|
networkId: config_near.networkId,
|
|
244
244
|
nodeUrl: config_near.nodeUrl
|
|
245
245
|
});
|
|
246
|
+
return connection;
|
|
247
|
+
}
|
|
248
|
+
async function getAccountConnection(accountId) {
|
|
249
|
+
const connection = await getNearConnection();
|
|
246
250
|
const account = await connection.account(
|
|
247
251
|
accountId || config_near.LOGIC_CONTRACT_NAME
|
|
248
252
|
);
|
|
@@ -2792,6 +2796,6 @@ var getWithdrawMaxAmount = ({
|
|
|
2792
2796
|
return Number(shrinkToken(maxAmount.toFixed(), decimals));
|
|
2793
2797
|
};
|
|
2794
2798
|
|
|
2795
|
-
export { DEFAULT_POSITION, FRACTION_DIGITS, MAX_RATIO, NDeposit, NEAR_STORAGE_DEPOSIT, TGas, TOKEN_STORAGE_DEPOSIT_READ, batchViews, computeRelayerGas, computeWithdrawMaxAmount, config_btc, config_evm, config_near, config_solana, decimalMax, decimalMin, expandToken, expandTokenDecimal, fetchIntentsQuotation, fetchIntentsTokens, fetchIntentsTransactionStatus, format_wallet, getAccountAllPositions, getAccountBalance, getAdjustedSum, getAllFarms, getAssets, getAssetsDetail, getAuthenticationHeaders, getBalance, getBoosterTokens, getBorrowMaxAmount, getCeateMcaFee, getConfig2 as getConfig, getCreateMcaCustomRecipientMsg, getCreateMcaFeePaged, getListWalletsByMca, getMcaByWallet, getMultichainLendingConfig, getMultichainLendingData, getMultichainLendingHistory, getMultichainTokensByChains, getNearValue, getNearValuesPaged, getPrices, getRepayCustomRecipientMsg, getSignature, getSupplyCustomRecipientMsg, getTokenPythInfos, getWithdrawMaxAmount, get_all_tokens_metadata, get_interest_rate, get_liquidations, get_nonce_deadline, get_records, get_simple_withdraw_tx, get_token_detail, get_tx_id, hasZeroSharesFarmRewards, initialStaking, intentsQuotation, listFarmToMap, lpTokenPrefix, pollingRelayerTransactionResult, pollingTransactionStatus, postMultichainLendingReport, postMultichainLendingRequests, prepareBusinessDataOnAddWallet, prepareBusinessDataOnAdjust, prepareBusinessDataOnBorrow, prepareBusinessDataOnClaim, prepareBusinessDataOnRemoveWallet, prepareBusinessDataOnRepayFromSupplied, prepareBusinessDataOnWithdraw, prepareBusinessDataOninnerWithdraw, prepare_sign_message_btc, prepare_sign_message_evm, prepare_sign_message_solana, process_signature_btc, process_signature_evm, process_signature_solana, query_account_register_token_tx, query_intents_tansfer_txs, recomputeHealthFactorAdjust, recomputeHealthFactorBorrow, recomputeHealthFactorRepay, recomputeHealthFactorRepayFromDeposits, recomputeHealthFactorSupply, recomputeHealthFactorWithdraw, serializationObj, setCustomNodeUrl, shrinkToken, shrinkTokenDecimal, submitSignedTransactionToRelayer, transformAccountFarms, transformAssetFarms, transformAssets, transformFarms, transformPortfolio, view_on_near };
|
|
2799
|
+
export { DEFAULT_POSITION, FRACTION_DIGITS, MAX_RATIO, NDeposit, NEAR_STORAGE_DEPOSIT, TGas, TOKEN_STORAGE_DEPOSIT_READ, batchViews, computeRelayerGas, computeWithdrawMaxAmount, config_btc, config_evm, config_near, config_solana, decimalMax, decimalMin, expandToken, expandTokenDecimal, fetchIntentsQuotation, fetchIntentsTokens, fetchIntentsTransactionStatus, format_wallet, getAccountAllPositions, getAccountBalance, getAccountConnection, getAdjustedSum, getAllFarms, getAssets, getAssetsDetail, getAuthenticationHeaders, getBalance, getBoosterTokens, getBorrowMaxAmount, getCeateMcaFee, getConfig2 as getConfig, getCreateMcaCustomRecipientMsg, getCreateMcaFeePaged, getListWalletsByMca, getMcaByWallet, getMultichainLendingConfig, getMultichainLendingData, getMultichainLendingHistory, getMultichainTokensByChains, getNearConnection, getNearValue, getNearValuesPaged, getPrices, getRepayCustomRecipientMsg, getSignature, getSupplyCustomRecipientMsg, getTokenPythInfos, getWithdrawMaxAmount, get_all_tokens_metadata, get_interest_rate, get_liquidations, get_nonce_deadline, get_records, get_simple_withdraw_tx, get_token_detail, get_tx_id, hasZeroSharesFarmRewards, initialStaking, intentsQuotation, listFarmToMap, lpTokenPrefix, pollingRelayerTransactionResult, pollingTransactionStatus, postMultichainLendingReport, postMultichainLendingRequests, prepareBusinessDataOnAddWallet, prepareBusinessDataOnAdjust, prepareBusinessDataOnBorrow, prepareBusinessDataOnClaim, prepareBusinessDataOnRemoveWallet, prepareBusinessDataOnRepayFromSupplied, prepareBusinessDataOnWithdraw, prepareBusinessDataOninnerWithdraw, prepare_sign_message_btc, prepare_sign_message_evm, prepare_sign_message_solana, process_signature_btc, process_signature_evm, process_signature_solana, query_account_register_token_tx, query_intents_tansfer_txs, recomputeHealthFactorAdjust, recomputeHealthFactorBorrow, recomputeHealthFactorRepay, recomputeHealthFactorRepayFromDeposits, recomputeHealthFactorSupply, recomputeHealthFactorWithdraw, serializationObj, setCustomNodeUrl, shrinkToken, shrinkTokenDecimal, submitSignedTransactionToRelayer, transformAccountFarms, transformAssetFarms, transformAssets, transformFarms, transformPortfolio, view_on_near };
|
|
2796
2800
|
//# sourceMappingURL=index.js.map
|
|
2797
2801
|
//# sourceMappingURL=index.js.map
|