@gurge/sdk 0.3.11 → 0.3.12
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/common/src/API/getServerURL.cjs +1 -1
- package/common/src/API/getServerURL.mjs +2 -2
- package/common/src/constants/server.constants.cjs +1 -1
- package/common/src/constants/server.constants.mjs +2 -2
- package/common/src/webworker/package.json +1 -1
- package/package.json +1 -1
- package/services/Hinkal.cjs +1 -1
- package/services/Hinkal.d.ts +3 -0
- package/services/Hinkal.mjs +7 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../constants/vite.constants.cjs`),t=require(`../constants/server.constants.cjs`);var n=(()=>{switch(e.deploymentMode){case e.DEPLOYMENT_MODE.DEVELOPMENT:return t.STAGING_URL;case e.DEPLOYMENT_MODE.PLAYGROUND:return t.PLAYGROUND_URL;case e.DEPLOYMENT_MODE.STAGING:return t.STAGING_URL;case e.DEPLOYMENT_MODE.PRODUCTION:return t.PRODUCTION_URL;default:return t.PRODUCTION_URL}})(),r=()
|
|
1
|
+
const e=require(`../constants/vite.constants.cjs`),t=require(`../constants/server.constants.cjs`);var n=(()=>{switch(e.deploymentMode){case e.DEPLOYMENT_MODE.DEVELOPMENT:return t.STAGING_URL;case e.DEPLOYMENT_MODE.PLAYGROUND:return t.PLAYGROUND_URL;case e.DEPLOYMENT_MODE.STAGING:return t.STAGING_URL;case e.DEPLOYMENT_MODE.PRODUCTION:return t.PRODUCTION_URL;default:return t.PRODUCTION_URL}})(),r=()=>`${n}${t.SERVER_URL_ENDPOINT}`,i=()=>`${n}${t.RELAYER_URL_ENDPOINT}`,a=()=>`${n}${t.SNAPSHOT_SERVER_URL_ENDPOINT}`,o=()=>`${n}${t.DATA_SERVER_URL_ENDPOINT}`,s=()=>`${n}${t.FUND_COMPLIANCE_URL_ENDPOINT}`,c=()=>{switch(e.deploymentMode){case e.DEPLOYMENT_MODE.DEVELOPMENT:return t.ENCLAVE_API_STAGING_URL;case e.DEPLOYMENT_MODE.PLAYGROUND:return t.ENCLAVE_API_STAGING_URL;case e.DEPLOYMENT_MODE.STAGING:return t.ENCLAVE_API_STAGING_URL;case e.DEPLOYMENT_MODE.PRODUCTION:return t.ENCLAVE_API_PRODUCTION_URL;default:return t.ENCLAVE_API_PRODUCTION_URL}},l=r(),u=i(),d=a(),f=o();s(),c(),exports.BACK_END_URL=n,exports.DATA_SERVER_URL=f,exports.RELAYER_URL=u,exports.SERVER_URL=l,exports.SNAPSHOT_SERVER_URL=d;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEPLOYMENT_MODE as e, deploymentMode as t } from "../constants/vite.constants.mjs";
|
|
2
|
-
import { DATA_SERVER_URL_ENDPOINT as n, ENCLAVE_API_PRODUCTION_URL as r, ENCLAVE_API_STAGING_URL as i, FUND_COMPLIANCE_URL_ENDPOINT as a, PLAYGROUND_URL as o, PRODUCTION_URL as s, RELAYER_URL_ENDPOINT as c,
|
|
2
|
+
import { DATA_SERVER_URL_ENDPOINT as n, ENCLAVE_API_PRODUCTION_URL as r, ENCLAVE_API_STAGING_URL as i, FUND_COMPLIANCE_URL_ENDPOINT as a, PLAYGROUND_URL as o, PRODUCTION_URL as s, RELAYER_URL_ENDPOINT as c, SERVER_URL_ENDPOINT as l, SNAPSHOT_SERVER_URL_ENDPOINT as u, STAGING_URL as d } from "../constants/server.constants.mjs";
|
|
3
3
|
var f = (() => {
|
|
4
4
|
switch (t) {
|
|
5
5
|
case e.DEVELOPMENT: return d;
|
|
@@ -8,7 +8,7 @@ var f = (() => {
|
|
|
8
8
|
case e.PRODUCTION: return s;
|
|
9
9
|
default: return s;
|
|
10
10
|
}
|
|
11
|
-
})(), p = () => l
|
|
11
|
+
})(), p = () => `${f}${l}`, m = () => `${f}${c}`, h = () => `${f}${u}`, g = () => `${f}${n}`, _ = () => `${f}${a}`, v = () => {
|
|
12
12
|
switch (t) {
|
|
13
13
|
case e.DEVELOPMENT: return i;
|
|
14
14
|
case e.PLAYGROUND: return i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./vite.constants.cjs`),t=require(`../types/new-rewards.type.cjs`);require(`../types/index.cjs`);var n={ROUTES:{checkKycStatus:`/check-kyc-status`,startReclaimVerification:`/start-reclaim-verification`,startUserVerification:`/start-aiprise-verification`,zkMeAccessToken:`/zkMeAccessToken`,getSnapshots:e=>`/snapshots/${e}`,getMerkleTreeSiblings:`/merkle-tree-siblings`,getSnapshotServerEvents:`/events`,callOdosAPI:`/OdosSwapData`,callOneInchAPI:`/OneInchSwapData`,callLifiAPI:`/LifiBridgeData`,callOkxAPI:`/OkxSwapData`,callNearIntentsQuote:`/near-intents/quote`,callNearIntentsTokens:`/near-intents/tokens`,getOdosPriceForToken:(e,t)=>`/getOdosPriceForToken/${e}/${t}`,monitor:`/monitor`,monitorBatch:`/monitor/batch`,checkRisk:e=>`/check-risk/${e}`,simulateTransaction:`/simulate-transaction`,simulateBatchTx:`/simulate-batch-tx`,simulateVolatileTokenTransfer:`/simulate-volatile-token-transfer`,getTokensInfo:`/get-tokens-info`,getTokensForChain:`/get-tokens-for-chain`,getTokenBySymbol:`/get-token-by-symbol`,getTokenData:e=>`/get-token-data/${e}`,getProxyAccounts:e=>`/get-proxy-accounts/${e}`,updateProxyAccounts:`/update-proxy-accounts`,getTemporaryWalletNonces:(e,t)=>`/temporary-wallets/nonces/${e}/${t}`,addTemporaryWalletNonce:`/temporary-wallets/add-nonce`,removeTemporaryWalletNonce:`/temporary-wallets/remove-nonce`,encodeMoonPayBuyUrl:`/moonpay-buy-url`,getMoonPayQuote:`/moonpay-quote`,privateSendTopUpRecipientInfos:`/private-send-recipient-info/top-up`,privateSendAllocateRecipientInfos:`/private-send-recipient-info/allocate`,privateSendNonceSync:`/private-send-nonce/sync`,privateSendNonceReserve:`/private-send-nonce/reserve`,getDashboardAccount:`/get-dashboard-account`,updateDashboardAccount:`/update-dashboard-account`,deleteDashboardAccount:`/delete-dashboard-account`,updateUserProfile:`/update-user-profile`,addDashboardContact:`/add-dashboard-contact`,deleteDashboardContact:`/delete-dashboard-contact`,updateDashboardContact:`/update-dashboard-contact`,getDashboardContacts:`/get-dashboard-contacts`,sendDashboardInvitationEmail:`/send-dashboard-invitation-email`,removeMember:`/remove-member`,editMember:`/edit-member`,createDashboardPayout:`/create-dashboard-payout`,getDashboardPayouts:`/get-dashboard-payouts`,syncDashboardBalances:`/sync-dashboard-balances`,getDashboardBalances:`/get-dashboard-balances`,changePayoutStatus:`/change-payout-status`,getDashboardTransactions:`/get-dashboard-transactions`,createDashboardTransactions:`/create-dashboard-transactions`,tronSubsidyEligibility:`/tron-subsidy/eligibility`,tronSubsidyRecord:`/tron-subsidy/record`,privateSendRecipientInfoGetAny:`/private-send-recipient-info/get-any`}},r={getGasEstimate:(e,t,n,r)=>`/gas-estimation/${e}/${n}/${t}/${r}`,getTokenPrices:`/get-token-prices`,TRANSACT:`/general-transact`,TRANSACT_BATCH:`/general-transact-batch`,SOLANA_TRANSACT:`/solana-transact`,SOLANA_TRANSACT_BATCH:`/solana-transact-batch`,getIdleRelay:`/get-idle-relay`,emitTxPublicData:`/emit-tx-public-data`,emitReferralTx:`/emit-referral-tx`,getScheduledTransactions:`/scheduled-transactions`,getScheduledTransactionById:e=>`/scheduled-transactions/${e}`,getScheduledTransactionsNullifierIndexes:`/scheduled-transactions/nullifier-indexes`,updateDepositAndWithdrawStatus:`/update-deposit-and-withdraw-status`,getTokenPriceChartData:`/get-token-price-chart-data`,getTokenPreviousDayPrices:`/get-token-previous-day-prices`,getPrivateTransactionsRatio:e=>`/get-private-transactions-ratio/${e}`,savePrivacyScoreAndGetPrivacyRank:`/save-privacy-score-and-get-privacy-rank`},i=[t.TaskTypes.firstSwap,t.TaskTypes.reclaim,t.TaskTypes.dailySwap,t.TaskTypes.dailyDappTx,t.TaskTypes.createOrJoinBH,t.TaskTypes.shieldUnshield,t.TaskTypes.moneyComes];t.TaskTypes.discord,t.TaskTypes.telegram,{...Object.fromEntries(i.map(e=>[e,e=>`/verify/wallet-task/${e}`]))};var a={createPresaleReferral:`/create-presale-referral`,updatePresaleReferralList:`/update-presale-referral-list`,generateTradingPoints:`/generate-trading-points`,getBrotherhoodUsers:e=>`/brotherhoods/${e}/users`,getCurrentUserBrotherhoodUsers:e=>`/get-current-user-brotherhood-users/${e}`,editBrotherhood:`/edit-brotherhood`,createBrotherhood:`/create-brotherhood`,getCurrentUserBrotherhood:`/get-current-user-brotherhood`,getPublicBrotherhoods:`/get-public-brotherhoods`,getBrotherhood:e=>`/brotherhoods/${e}`,leaveBrotherhood:e=>`/brotherhoods/${e}/leave`,joinBrotherhood:e=>`/brotherhoods/${e}/join`,getUserAnalytics:`/get-user-analytics`,getBrotherhoodAnalytics:`/brotherhood/analytics`,connectRewardsUser:`/connect-user`,updateRewardsUser:`/update-rewards-user`,getRewardsUser:e=>`/get-rewards-user/${e}`,checkUsernameAvailability:e=>`/check-username/${encodeURIComponent(e)}`,getSwapStreak:`/swap-streak`,getUserCurrentLeaderboard:`/current-users-leaderboard`,getBrotherhoodsLeaderboard:`/brotherhoods-leaderboard`,getCurrentUserReferral:`/current-user-referral`,submitReferralCode:`/refer-user`,getCurrentUserAppliedReferralCode:`/current-user-applied-referral-code`,submitAccessCode:`/submit-access-code`,getAccessCodeBenefits:`/get-access-code-benefits`,getTelegramCallback:`/auth/telegram/callback`,generateAumPoints:`/generate-aum-points`,getTasksProgress:e=>`/get-tasks-progress/${e}`,disconnectSocialNetwork:`/disconnect-social-network`,getNftMultiplier:e=>`/get-nft-multiplier/${e}`,seedlessInit:`/seedless/init`,seedlessBackup:`/seedless/backup`,seedlessCheckPassword:`/seedless/check-password`,seedlessStatus:`/seedless/status`,seedlessSalt:`/seedless/salt`,sendPrivateSendEmailNotifications:`/private-send-email-notifications`,webflowBlogPosts:`/webflow-blog-posts`,brevoSubscribe:`/brevo-subscribe`,versionChecker:e=>`/version-checker/${e}`};e.isNotProduction?e.deploymentMode:`${e.deploymentMode}`;var o=`https://wallet-playground.hinkal.io`,s=`https://wallet-staging-v2.hinkal.io`,c=`https://wallet-prodv12.hinkal.io`,l
|
|
1
|
+
const e=require(`./vite.constants.cjs`),t=require(`../types/new-rewards.type.cjs`);require(`../types/index.cjs`);var n={ROUTES:{checkKycStatus:`/check-kyc-status`,startReclaimVerification:`/start-reclaim-verification`,startUserVerification:`/start-aiprise-verification`,zkMeAccessToken:`/zkMeAccessToken`,getSnapshots:e=>`/snapshots/${e}`,getMerkleTreeSiblings:`/merkle-tree-siblings`,getSnapshotServerEvents:`/events`,callOdosAPI:`/OdosSwapData`,callOneInchAPI:`/OneInchSwapData`,callLifiAPI:`/LifiBridgeData`,callOkxAPI:`/OkxSwapData`,callNearIntentsQuote:`/near-intents/quote`,callNearIntentsTokens:`/near-intents/tokens`,getOdosPriceForToken:(e,t)=>`/getOdosPriceForToken/${e}/${t}`,monitor:`/monitor`,monitorBatch:`/monitor/batch`,checkRisk:e=>`/check-risk/${e}`,simulateTransaction:`/simulate-transaction`,simulateBatchTx:`/simulate-batch-tx`,simulateVolatileTokenTransfer:`/simulate-volatile-token-transfer`,getTokensInfo:`/get-tokens-info`,getTokensForChain:`/get-tokens-for-chain`,getTokenBySymbol:`/get-token-by-symbol`,getTokenData:e=>`/get-token-data/${e}`,getProxyAccounts:e=>`/get-proxy-accounts/${e}`,updateProxyAccounts:`/update-proxy-accounts`,getTemporaryWalletNonces:(e,t)=>`/temporary-wallets/nonces/${e}/${t}`,addTemporaryWalletNonce:`/temporary-wallets/add-nonce`,removeTemporaryWalletNonce:`/temporary-wallets/remove-nonce`,encodeMoonPayBuyUrl:`/moonpay-buy-url`,getMoonPayQuote:`/moonpay-quote`,privateSendTopUpRecipientInfos:`/private-send-recipient-info/top-up`,privateSendAllocateRecipientInfos:`/private-send-recipient-info/allocate`,privateSendNonceSync:`/private-send-nonce/sync`,privateSendNonceReserve:`/private-send-nonce/reserve`,getDashboardAccount:`/get-dashboard-account`,updateDashboardAccount:`/update-dashboard-account`,deleteDashboardAccount:`/delete-dashboard-account`,updateUserProfile:`/update-user-profile`,addDashboardContact:`/add-dashboard-contact`,deleteDashboardContact:`/delete-dashboard-contact`,updateDashboardContact:`/update-dashboard-contact`,getDashboardContacts:`/get-dashboard-contacts`,sendDashboardInvitationEmail:`/send-dashboard-invitation-email`,removeMember:`/remove-member`,editMember:`/edit-member`,createDashboardPayout:`/create-dashboard-payout`,getDashboardPayouts:`/get-dashboard-payouts`,syncDashboardBalances:`/sync-dashboard-balances`,getDashboardBalances:`/get-dashboard-balances`,changePayoutStatus:`/change-payout-status`,getDashboardTransactions:`/get-dashboard-transactions`,createDashboardTransactions:`/create-dashboard-transactions`,tronSubsidyEligibility:`/tron-subsidy/eligibility`,tronSubsidyRecord:`/tron-subsidy/record`,privateSendRecipientInfoGetAny:`/private-send-recipient-info/get-any`}},r={getGasEstimate:(e,t,n,r)=>`/gas-estimation/${e}/${n}/${t}/${r}`,getTokenPrices:`/get-token-prices`,TRANSACT:`/general-transact`,TRANSACT_BATCH:`/general-transact-batch`,SOLANA_TRANSACT:`/solana-transact`,SOLANA_TRANSACT_BATCH:`/solana-transact-batch`,getIdleRelay:`/get-idle-relay`,emitTxPublicData:`/emit-tx-public-data`,emitReferralTx:`/emit-referral-tx`,getScheduledTransactions:`/scheduled-transactions`,getScheduledTransactionById:e=>`/scheduled-transactions/${e}`,getScheduledTransactionsNullifierIndexes:`/scheduled-transactions/nullifier-indexes`,updateDepositAndWithdrawStatus:`/update-deposit-and-withdraw-status`,getTokenPriceChartData:`/get-token-price-chart-data`,getTokenPreviousDayPrices:`/get-token-previous-day-prices`,getPrivateTransactionsRatio:e=>`/get-private-transactions-ratio/${e}`,savePrivacyScoreAndGetPrivacyRank:`/save-privacy-score-and-get-privacy-rank`},i=[t.TaskTypes.firstSwap,t.TaskTypes.reclaim,t.TaskTypes.dailySwap,t.TaskTypes.dailyDappTx,t.TaskTypes.createOrJoinBH,t.TaskTypes.shieldUnshield,t.TaskTypes.moneyComes];t.TaskTypes.discord,t.TaskTypes.telegram,{...Object.fromEntries(i.map(e=>[e,e=>`/verify/wallet-task/${e}`]))};var a={createPresaleReferral:`/create-presale-referral`,updatePresaleReferralList:`/update-presale-referral-list`,generateTradingPoints:`/generate-trading-points`,getBrotherhoodUsers:e=>`/brotherhoods/${e}/users`,getCurrentUserBrotherhoodUsers:e=>`/get-current-user-brotherhood-users/${e}`,editBrotherhood:`/edit-brotherhood`,createBrotherhood:`/create-brotherhood`,getCurrentUserBrotherhood:`/get-current-user-brotherhood`,getPublicBrotherhoods:`/get-public-brotherhoods`,getBrotherhood:e=>`/brotherhoods/${e}`,leaveBrotherhood:e=>`/brotherhoods/${e}/leave`,joinBrotherhood:e=>`/brotherhoods/${e}/join`,getUserAnalytics:`/get-user-analytics`,getBrotherhoodAnalytics:`/brotherhood/analytics`,connectRewardsUser:`/connect-user`,updateRewardsUser:`/update-rewards-user`,getRewardsUser:e=>`/get-rewards-user/${e}`,checkUsernameAvailability:e=>`/check-username/${encodeURIComponent(e)}`,getSwapStreak:`/swap-streak`,getUserCurrentLeaderboard:`/current-users-leaderboard`,getBrotherhoodsLeaderboard:`/brotherhoods-leaderboard`,getCurrentUserReferral:`/current-user-referral`,submitReferralCode:`/refer-user`,getCurrentUserAppliedReferralCode:`/current-user-applied-referral-code`,submitAccessCode:`/submit-access-code`,getAccessCodeBenefits:`/get-access-code-benefits`,getTelegramCallback:`/auth/telegram/callback`,generateAumPoints:`/generate-aum-points`,getTasksProgress:e=>`/get-tasks-progress/${e}`,disconnectSocialNetwork:`/disconnect-social-network`,getNftMultiplier:e=>`/get-nft-multiplier/${e}`,seedlessInit:`/seedless/init`,seedlessBackup:`/seedless/backup`,seedlessCheckPassword:`/seedless/check-password`,seedlessStatus:`/seedless/status`,seedlessSalt:`/seedless/salt`,sendPrivateSendEmailNotifications:`/private-send-email-notifications`,webflowBlogPosts:`/webflow-blog-posts`,brevoSubscribe:`/brevo-subscribe`,versionChecker:e=>`/version-checker/${e}`};e.isNotProduction?e.deploymentMode:`${e.deploymentMode}`;var o=`https://wallet-playground.hinkal.io`,s=`https://wallet-staging-v2.hinkal.io`,c=`https://wallet-prodv12.hinkal.io`,l=`/server`,u=`/relayer`,d=`/snapshot-server`,f=`/data-server`,p=`/compliance-server`,m=`https://api-staging.hinkal.io`,h=`https://api.hinkal.io`;exports.API_CONFIG=n,exports.DATA_SERVER_CONFIG=a,exports.DATA_SERVER_URL_ENDPOINT=f,exports.ENCLAVE_API_PRODUCTION_URL=h,exports.ENCLAVE_API_STAGING_URL=m,exports.FUND_COMPLIANCE_URL_ENDPOINT=p,exports.PLAYGROUND_URL=o,exports.PRODUCTION_URL=c,exports.RELAYER_CONFIG=r,exports.RELAYER_URL_ENDPOINT=u,exports.SERVER_URL_ENDPOINT=l,exports.SNAPSHOT_SERVER_URL_ENDPOINT=d,exports.STAGING_URL=s,exports.WALLET_TASK_VERIFICATION_TYPES=i;
|
|
@@ -130,6 +130,6 @@ var o = {
|
|
|
130
130
|
versionChecker: (e) => `/version-checker/${e}`
|
|
131
131
|
};
|
|
132
132
|
t || `${e}`;
|
|
133
|
-
var s = "https://wallet-playground.hinkal.io", c = "https://wallet-staging-v2.hinkal.io", l = "https://wallet-prodv12.hinkal.io", u = "
|
|
133
|
+
var s = "https://wallet-playground.hinkal.io", c = "https://wallet-staging-v2.hinkal.io", l = "https://wallet-prodv12.hinkal.io", u = "/server", d = "/relayer", f = "/snapshot-server", p = "/data-server", m = "/compliance-server", h = "https://api-staging.hinkal.io", g = "https://api.hinkal.io";
|
|
134
134
|
//#endregion
|
|
135
|
-
export { r as API_CONFIG, o as DATA_SERVER_CONFIG, p as DATA_SERVER_URL_ENDPOINT, g as ENCLAVE_API_PRODUCTION_URL, h as ENCLAVE_API_STAGING_URL, m as FUND_COMPLIANCE_URL_ENDPOINT, s as PLAYGROUND_URL, l as PRODUCTION_URL, i as RELAYER_CONFIG, d as RELAYER_URL_ENDPOINT, u as
|
|
135
|
+
export { r as API_CONFIG, o as DATA_SERVER_CONFIG, p as DATA_SERVER_URL_ENDPOINT, g as ENCLAVE_API_PRODUCTION_URL, h as ENCLAVE_API_STAGING_URL, m as FUND_COMPLIANCE_URL_ENDPOINT, s as PLAYGROUND_URL, l as PRODUCTION_URL, i as RELAYER_CONFIG, d as RELAYER_URL_ENDPOINT, u as SERVER_URL_ENDPOINT, f as SNAPSHOT_SERVER_URL_ENDPOINT, c as STAGING_URL, a as WALLET_TASK_VERIFICATION_TYPES };
|
package/package.json
CHANGED
package/services/Hinkal.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../common/src/constants/chains.constants.cjs`),t=require(`../common/src/types/hinkal.types.cjs`);require(`../common/src/types/index.cjs`);const n=require(`../common/src/data-structures/Hinkal/Hinkal.cjs`),r=require(`../internal/token.utils.cjs`);var i=class{hinkalCommon;constructor(e){this.hinkalCommon=new n.Hinkal(e)}getProviderAdapter(e){return this.hinkalCommon.getProviderAdapter(e)}initProviderAdapter(e,t){return this.hinkalCommon.initProviderAdapter(e,t)}initUserKeys(e=t.LoginMessageMode.PROTOCOL){return this.hinkalCommon.initUserKeys(e)}initUserKeysWithSignature(e){return this.hinkalCommon.initUserKeysWithSignature(e)}initUserKeysFromSeedPhrases(e){return this.hinkalCommon.initUserKeysFromSeedPhrases(e)}storeAndGetInitialSignature(e,t=!1,n){return this.hinkalCommon.storeAndGetInitialSignature(e,t,n)}resetProviderAdapters(){return this.hinkalCommon.resetProviderAdapters()}disconnectFromConnector(){return this.hinkalCommon.disconnectFromConnector()}signMessage(e){return this.hinkalCommon.signMessage(e)}signTypedData(e,t,n){return this.hinkalCommon.signTypedData(e,t,n)}getSupportedChains(){return this.hinkalCommon.getSupportedChains()}isSelectedNetworkSupported(e){return this.hinkalCommon.isSelectedNetworkSupported(e)}switchNetwork(t){let n=e.networkRegistry[t];if(!n)throw Error(`Network with chainId ${t} not supported`);return this.hinkalCommon.switchNetwork(n)}resetMerkle(e){return this.hinkalCommon.resetMerkle(e)}resetMerkleTreesIfNecessary(e){return this.hinkalCommon.resetMerkleTreesIfNecessary(e)}get privateBalancesWithUSD(){return
|
|
1
|
+
const e=require(`../common/src/constants/chains.constants.cjs`),t=require(`../common/src/types/hinkal.types.cjs`);require(`../common/src/types/index.cjs`);const n=require(`../common/src/data-structures/Hinkal/Hinkal.cjs`),r=require(`../internal/token.utils.cjs`);var i=class{hinkalCommon;mappedPrivateBalancesSource;mappedPrivateBalances={};constructor(e){this.hinkalCommon=new n.Hinkal(e)}getProviderAdapter(e){return this.hinkalCommon.getProviderAdapter(e)}initProviderAdapter(e,t){return this.hinkalCommon.initProviderAdapter(e,t)}initUserKeys(e=t.LoginMessageMode.PROTOCOL){return this.hinkalCommon.initUserKeys(e)}initUserKeysWithSignature(e){return this.hinkalCommon.initUserKeysWithSignature(e)}initUserKeysFromSeedPhrases(e){return this.hinkalCommon.initUserKeysFromSeedPhrases(e)}storeAndGetInitialSignature(e,t=!1,n){return this.hinkalCommon.storeAndGetInitialSignature(e,t,n)}resetProviderAdapters(){return this.hinkalCommon.resetProviderAdapters()}disconnectFromConnector(){return this.hinkalCommon.disconnectFromConnector()}signMessage(e){return this.hinkalCommon.signMessage(e)}signTypedData(e,t,n){return this.hinkalCommon.signTypedData(e,t,n)}getSupportedChains(){return this.hinkalCommon.getSupportedChains()}isSelectedNetworkSupported(e){return this.hinkalCommon.isSelectedNetworkSupported(e)}switchNetwork(t){let n=e.networkRegistry[t];if(!n)throw Error(`Network with chainId ${t} not supported`);return this.hinkalCommon.switchNetwork(n)}resetMerkle(e){return this.hinkalCommon.resetMerkle(e)}resetMerkleTreesIfNecessary(e){return this.hinkalCommon.resetMerkleTreesIfNecessary(e)}getMappedPrivateBalances(e){return e===this.mappedPrivateBalancesSource?this.mappedPrivateBalances:(this.mappedPrivateBalancesSource=e,this.mappedPrivateBalances=r.mapPrivateBalances(e),this.mappedPrivateBalances)}get privateBalancesWithUSD(){return this.getMappedPrivateBalances(this.hinkalCommon.privateBalancesWithUSD)}onPrivateBalancesWithUSDChange(e){return this.hinkalCommon.onPrivateBalancesWithUSDChange(t=>e(this.getMappedPrivateBalances(t)))}async getTotalBalance(e,t=!1,n=!1){return(await this.hinkalCommon.getTotalBalance(e,void 0,void 0,t,n)).map(r.mapTokenBalance)}async getStuckShieldedBalances(e,t=!1,n=!1){return(await this.hinkalCommon.getStuckShieldedBalances(e,void 0,void 0,t,n)).map(r.mapTokenBalance)}monitorConnectedAddress(e){return this.hinkalCommon.monitorConnectedAddress(e)}getSupportedPassportLinks(){return this.hinkalCommon.getSupportedPassportLinks()}checkAccessToken(e,t){return this.hinkalCommon.checkAccessToken(e,t)}waitForTransaction(e,t,n){return this.hinkalCommon.waitForTransaction(e,t,n)}getSolanaPublicKey(){return this.hinkalCommon.getSolanaPublicKey()}getEthereumAddress(){return this.hinkalCommon.getEthereumAddress()}getEthereumAddressByChain(e){return this.hinkalCommon.getEthereumAddressByChain(e)}getRecipientInfo(){return this.hinkalCommon.getRecipientInfo()}getShieldedPublicKey(){return this.hinkalCommon.userKeys.getShieldedPublicKey()}async prooflessDeposit(e,t,n,i){return this.hinkalCommon.prooflessDeposit(await r.resolveErc20Tokens(e,t),n,i)}async prooflessDepositWithPublicFee(e,t,n,i,a){return this.hinkalCommon.prooflessDepositWithPublicFee(await r.resolveErc20Token(e,t),n,i,a)}async deposit(e,t,n,i,a){return this.hinkalCommon.deposit(await r.resolveErc20Tokens(e,t),n,i,a)}async depositSolana(e,t,n){return this.hinkalCommon.depositSolana(n,await r.resolveErc20Token(e,t))}async depositForOther(e,t,n,i,a,o){return this.hinkalCommon.depositForOther(await r.resolveErc20Tokens(e,t),n,i,a,o)}async depositSolanaForOther(e,t,n,i){return this.hinkalCommon.depositSolanaForOther(n,await r.resolveErc20Token(e,t),i)}async depositAndWithdraw(e,t,n,i,a,o,s){return this.hinkalCommon.depositAndWithdraw(await r.resolveErc20Token(e,t),n,i,a,o,void 0,void 0,void 0,s)}async depositAndBridge(e,t,n,i,a,o){return this.hinkalCommon.depositAndBridge(await r.resolveErc20Token(e,t),n,i,a,void 0,void 0,void 0,o)}async nearDepositAndBridge(e,t,n,i,a,o,s){return this.hinkalCommon.nearDepositAndBridge(await r.resolveErc20Token(e,t),n,i,a,o,s)}async claimUtxo(e,t,n,i,a){return this.hinkalCommon.claimUtxo(await r.resolveErc20Token(e,t),n,i,a)}async transfer(e,t,n,i,a,o){return this.hinkalCommon.transfer(await r.resolveErc20Tokens(e,t),n,i,a,o)}async withdraw(e,t,n,i,a,o,s){return this.hinkalCommon.withdraw(await r.resolveErc20Tokens(e,t),n,i,a,o,s)}async withdrawStuckUtxos(e,t,n){return this.hinkalCommon.withdrawStuckUtxos(await r.resolveErc20Token(e,t),n)}async swap(e,t,n,i,a,o,s){return this.hinkalCommon.swap(await r.resolveErc20Tokens(e,t),n,i,a,o,s)}async actionPrivateWallet(e,t,n,i,a,o,s,c,l){return this.hinkalCommon.actionPrivateWallet(e,await r.resolveErc20Tokens(e,t),n,i,a,await r.resolveCommonTokenChanges(e,o),s,c,l)}async proxySwap(e,t,n,i,a,o,s,c,l){return this.hinkalCommon.proxySwap(await r.resolveErc20Tokens(e,t),n,i,a,o,s,c,l)}async proxyToPrivate(e,t,n,i,a,o,s){return this.hinkalCommon.proxyToPrivate(await r.resolveErc20Tokens(e,t),n,i,a,o,s)}async proxySend(e,t,n,i,a,o,s){return this.hinkalCommon.proxySend(await r.resolveErc20Tokens(e,t),n,i,a,o,s)}};exports.Hinkal=i;
|
package/services/Hinkal.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ import { PublicKey } from '@solana/web3.js';
|
|
|
6
6
|
import { IHinkal, IProviderAdapter, PrivateBalancesState, TokenBalance, TokenChanges } from '../types';
|
|
7
7
|
export declare class Hinkal<ConnectorType> implements IHinkal<ConnectorType> {
|
|
8
8
|
private readonly hinkalCommon;
|
|
9
|
+
private mappedPrivateBalancesSource;
|
|
10
|
+
private mappedPrivateBalances;
|
|
9
11
|
constructor(hinkalConfig?: HinkalConfig);
|
|
10
12
|
getProviderAdapter(chainId?: number): IProviderAdapter;
|
|
11
13
|
initProviderAdapter(connector: ConnectorType, providerAdapter: IProviderAdapter<ConnectorType>): Promise<void>;
|
|
@@ -22,6 +24,7 @@ export declare class Hinkal<ConnectorType> implements IHinkal<ConnectorType> {
|
|
|
22
24
|
switchNetwork(chainId: number): Promise<unknown>;
|
|
23
25
|
resetMerkle(chainIdsToReset?: number[]): Promise<void>;
|
|
24
26
|
resetMerkleTreesIfNecessary(chainIdsToCheck?: number[]): Promise<void>;
|
|
27
|
+
private getMappedPrivateBalances;
|
|
25
28
|
get privateBalancesWithUSD(): PrivateBalancesState;
|
|
26
29
|
onPrivateBalancesWithUSDChange(callback: (state: PrivateBalancesState) => void): () => void;
|
|
27
30
|
getTotalBalance(chainId: number, resetCacheBefore?: boolean, updateTokensListBefore?: boolean): Promise<TokenBalance[]>;
|
package/services/Hinkal.mjs
CHANGED
|
@@ -6,6 +6,8 @@ import { mapPrivateBalances as r, mapTokenBalance as i, resolveCommonTokenChange
|
|
|
6
6
|
//#region libs/shared/sdk/src/services/Hinkal.ts
|
|
7
7
|
var c = class {
|
|
8
8
|
hinkalCommon;
|
|
9
|
+
mappedPrivateBalancesSource;
|
|
10
|
+
mappedPrivateBalances = {};
|
|
9
11
|
constructor(e) {
|
|
10
12
|
this.hinkalCommon = new n(e);
|
|
11
13
|
}
|
|
@@ -56,11 +58,14 @@ var c = class {
|
|
|
56
58
|
resetMerkleTreesIfNecessary(e) {
|
|
57
59
|
return this.hinkalCommon.resetMerkleTreesIfNecessary(e);
|
|
58
60
|
}
|
|
61
|
+
getMappedPrivateBalances(e) {
|
|
62
|
+
return e === this.mappedPrivateBalancesSource ? this.mappedPrivateBalances : (this.mappedPrivateBalancesSource = e, this.mappedPrivateBalances = r(e), this.mappedPrivateBalances);
|
|
63
|
+
}
|
|
59
64
|
get privateBalancesWithUSD() {
|
|
60
|
-
return
|
|
65
|
+
return this.getMappedPrivateBalances(this.hinkalCommon.privateBalancesWithUSD);
|
|
61
66
|
}
|
|
62
67
|
onPrivateBalancesWithUSDChange(e) {
|
|
63
|
-
return this.hinkalCommon.onPrivateBalancesWithUSDChange((t) => e(
|
|
68
|
+
return this.hinkalCommon.onPrivateBalancesWithUSDChange((t) => e(this.getMappedPrivateBalances(t)));
|
|
64
69
|
}
|
|
65
70
|
async getTotalBalance(e, t = !1, n = !1) {
|
|
66
71
|
return (await this.hinkalCommon.getTotalBalance(e, void 0, void 0, t, n)).map(i);
|