@kapa123456789/sdk 0.0.82 → 0.0.83
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/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/common/src/data-structures/Hinkal/Hinkal.mjs +4 -41
- package/common/src/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalDeposit.mjs +46 -73
- package/common/src/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalTransfer.mjs +16 -37
- package/common/src/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalWithdraw.mjs +18 -47
- package/common/src/functions/pre-transaction/getFeeStructure.cjs +1 -1
- package/common/src/functions/pre-transaction/getFeeStructure.mjs +10 -21
- package/common/src/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/common/src/functions/snarkjs/constructGeneralZkProof.mjs +71 -89
- package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.cjs +1 -1
- package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.mjs +8 -17
- package/common/src/functions/snarkjs/generateZkProof.cjs +1 -1
- package/common/src/functions/snarkjs/generateZkProof.mjs +8 -26
- package/common/src/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
- package/common/src/functions/web3/functionCalls/transactCallDirect.mjs +43 -61
- package/common/src/functions/web3/functionCalls/transactCallDirectTron.cjs +1 -1
- package/common/src/functions/web3/functionCalls/transactCallDirectTron.mjs +65 -73
- package/common/src/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/common/src/functions/web3/functionCalls/transactCallRelayer.mjs +14 -22
- package/common/src/webworker/package.json +3 -2
- package/functions/integrations/swapApi.cjs +1 -1
- package/functions/integrations/swapApi.mjs +4 -9
- package/package.json +3 -2
- package/scripts/strip-blake-hash-native.cjs +35 -0
- package/services/Hinkal.cjs +1 -1
- package/services/Hinkal.mjs +3 -42
|
@@ -11,28 +11,20 @@ var c = (t) => {
|
|
|
11
11
|
if (t.status === "success") return t.message;
|
|
12
12
|
throw t.message && t.error ? new e(t.error, t.message) : Error(t.error);
|
|
13
13
|
}, l = async (e, t, n, r, i, o, l, u, d) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
adminData: u,
|
|
29
|
-
tronProofSignature: d,
|
|
30
|
-
commitmentValidationData: i
|
|
31
|
-
}));
|
|
32
|
-
return console.log("[transactCallRelayer] success", { txHash: p }), p;
|
|
33
|
-
} catch (e) {
|
|
34
|
-
throw console.log("[transactCallRelayer] error", e), e;
|
|
35
|
-
}
|
|
14
|
+
let f = s(r);
|
|
15
|
+
return c(await a({
|
|
16
|
+
chainId: e,
|
|
17
|
+
a: t[0],
|
|
18
|
+
b: t[1],
|
|
19
|
+
c: t[2],
|
|
20
|
+
dimData: n,
|
|
21
|
+
circomData: f,
|
|
22
|
+
withUniswapWorkAround: o,
|
|
23
|
+
authorizationData: l,
|
|
24
|
+
adminData: u,
|
|
25
|
+
tronProofSignature: d,
|
|
26
|
+
commitmentValidationData: i
|
|
27
|
+
}));
|
|
36
28
|
}, u = async (e) => c(await r.post(`${n}${t.SOLANA_TRANSACT}`, e)), d = (e) => {
|
|
37
29
|
if (e.status === "success") return e.message.scheduleId;
|
|
38
30
|
throw Error(e.error || "Batch transaction failed");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kapa123456789/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.83",
|
|
4
4
|
"homepage": "hinkal.io",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Hinkal Protocol"
|
|
@@ -63,7 +63,8 @@
|
|
|
63
63
|
"prebuild": "nx prebuild:workers",
|
|
64
64
|
"build": "nx build",
|
|
65
65
|
"lint": "nx lint",
|
|
66
|
-
"test": "nx test"
|
|
66
|
+
"test": "nx test",
|
|
67
|
+
"postinstall": "node ./scripts/strip-blake-hash-native.cjs"
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
69
70
|
"nx": "22.6.4",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../common/src/functions/utils/erc20tokenFunctions.cjs`),t=require(`../../common/src/functions/utils/process.utils.cjs`),n=require(`../../common/src/functions/web3/uniswapAPI.cjs`),r=require(`../../common/src/functions/web3/odosAPI.cjs`),i=require(`../../common/src/functions/web3/oneInchAPI.cjs`),a=require(`../../common/src/functions/web3/okxAPI.cjs`);require(`../../common/src/functions/index.cjs`);var o=async(t,r,i,a,o)=>{let s=t.hinkalCommon,[c,l]=await e.resolveErc20Tokens(r,[a,o]);return n.getUniswapPrice(s,r,i,c,l)},s=async(n,a,s,c,l)=>{
|
|
1
|
+
const e=require(`../../common/src/functions/utils/erc20tokenFunctions.cjs`),t=require(`../../common/src/functions/utils/process.utils.cjs`),n=require(`../../common/src/functions/web3/uniswapAPI.cjs`),r=require(`../../common/src/functions/web3/odosAPI.cjs`),i=require(`../../common/src/functions/web3/oneInchAPI.cjs`),a=require(`../../common/src/functions/web3/okxAPI.cjs`);require(`../../common/src/functions/index.cjs`);var o=async(t,r,i,a,o)=>{let s=t.hinkalCommon,[c,l]=await e.resolveErc20Tokens(r,[a,o]);return n.getUniswapPrice(s,r,i,c,l)},s=async(n,a,s,c,l)=>{let[u,d]=await e.resolveErc20Tokens(a,[c,l]),[f,p,m]=await Promise.allSettled([t.withTimeout(o(n,a,s,c,l)),t.withTimeout(r.getOdosPrice(a,u,d,s)),t.withTimeout(i.getOneInchPrice(a,u,d,s))]);return{uniswap:f.status===`fulfilled`?f.value:null,odos:p.status===`fulfilled`?p.value:null,oneInch:m.status===`fulfilled`?m.value:null}},c=async(n,r,i,o)=>{let[s,c]=await e.resolveErc20Tokens(n,[i,o]);try{return{okx:await t.withTimeout(a.getOKXPrice(n,s,c,r))}}catch{return{okx:null}}};exports.getEvmSwapPrices=s,exports.getSolanaSwapPrices=c;
|
|
@@ -10,27 +10,22 @@ var o = async (t, r, i, a, o) => {
|
|
|
10
10
|
let s = t.hinkalCommon, [c, l] = await e(r, [a, o]);
|
|
11
11
|
return n(s, r, i, c, l);
|
|
12
12
|
}, s = async (n, a, s, c, l) => {
|
|
13
|
-
|
|
14
|
-
let [u, d] = await e(a, [c, l]);
|
|
15
|
-
console.log("getEvmSwapPrices", u, d);
|
|
16
|
-
let [f, p, m] = await Promise.allSettled([
|
|
13
|
+
let [u, d] = await e(a, [c, l]), [f, p, m] = await Promise.allSettled([
|
|
17
14
|
t(o(n, a, s, c, l)),
|
|
18
15
|
t(r(a, u, d, s)),
|
|
19
16
|
t(i(a, u, d, s))
|
|
20
17
|
]);
|
|
21
|
-
return
|
|
18
|
+
return {
|
|
22
19
|
uniswap: f.status === "fulfilled" ? f.value : null,
|
|
23
20
|
odos: p.status === "fulfilled" ? p.value : null,
|
|
24
21
|
oneInch: m.status === "fulfilled" ? m.value : null
|
|
25
22
|
};
|
|
26
23
|
}, c = async (n, r, i, o) => {
|
|
27
|
-
console.log("getSolanaSwapPrices", n, r, i, o);
|
|
28
24
|
let [s, c] = await e(n, [i, o]);
|
|
29
|
-
console.log("getSolanaSwapPrices", s, c);
|
|
30
25
|
try {
|
|
31
26
|
return { okx: await t(a(n, s, c, r)) };
|
|
32
|
-
} catch
|
|
33
|
-
return
|
|
27
|
+
} catch {
|
|
28
|
+
return { okx: null };
|
|
34
29
|
}
|
|
35
30
|
};
|
|
36
31
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kapa123456789/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.83",
|
|
4
4
|
"homepage": "hinkal.io",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Hinkal Protocol"
|
|
@@ -63,7 +63,8 @@
|
|
|
63
63
|
"prebuild": "nx prebuild:workers",
|
|
64
64
|
"build": "nx build",
|
|
65
65
|
"lint": "nx lint",
|
|
66
|
-
"test": "nx test"
|
|
66
|
+
"test": "nx test",
|
|
67
|
+
"postinstall": "node ./scripts/strip-blake-hash-native.cjs"
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
69
70
|
"nx": "22.6.4",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
const stripPrebuildsDir = (blakeHashDir) => {
|
|
5
|
+
const prebuildsDir = path.join(blakeHashDir, 'prebuilds');
|
|
6
|
+
console.log({ prebuildsDir });
|
|
7
|
+
if (!fs.existsSync(prebuildsDir)) return;
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
10
|
+
for (const platform of fs.readdirSync(prebuildsDir)) {
|
|
11
|
+
console.log({ platform });
|
|
12
|
+
const nativeBinary = path.join(prebuildsDir, platform, 'node.napi.node');
|
|
13
|
+
console.log({ nativeBinary });
|
|
14
|
+
if (fs.existsSync(nativeBinary)) {
|
|
15
|
+
fs.unlinkSync(nativeBinary);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
let dir = __dirname;
|
|
21
|
+
for (let depth = 0; depth < 10; depth += 1) {
|
|
22
|
+
const candidate = path.join(dir, 'node_modules', 'blake-hash');
|
|
23
|
+
console.log({ candidate });
|
|
24
|
+
if (fs.existsSync(candidate)) {
|
|
25
|
+
console.log('stripping blake hash native');
|
|
26
|
+
stripPrebuildsDir(candidate);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const parent = path.dirname(dir);
|
|
30
|
+
console.log({ parent });
|
|
31
|
+
console.log('dir', dir);
|
|
32
|
+
console.log('parent === dir', parent === dir);
|
|
33
|
+
if (parent === dir) break;
|
|
34
|
+
dir = parent;
|
|
35
|
+
}
|
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/functions/utils/erc20tokenFunctions.cjs`);require(`../common/src/functions/index.cjs`);const r=require(`../common/src/data-structures/Hinkal/Hinkal.cjs`),i=require(`../internal/token.utils.cjs`);var a=class{hinkalCommon;mappedPrivateBalancesSource;mappedPrivateBalances={};constructor(e){this.hinkalCommon=new r.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()}destroy(){return this.hinkalCommon.destroy()}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=i.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(i.mapTokenBalance)}async getStuckShieldedBalances(e,t=!1,n=!1){return(await this.hinkalCommon.getStuckShieldedBalances(e,void 0,void 0,t,n)).map(i.mapTokenBalance)}monitorConnectedAddress(e){return this.hinkalCommon.monitorConnectedAddress(e)}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,r,i){return this.hinkalCommon.prooflessDeposit(await n.resolveErc20Tokens(e,t),r,i)}async prooflessDepositWithPublicFee(e,t,r,i,a){return this.hinkalCommon.prooflessDepositWithPublicFee(await n.resolveErc20Token(e,t),r,i,a)}async deposit(e,t,r,i,a){
|
|
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/functions/utils/erc20tokenFunctions.cjs`);require(`../common/src/functions/index.cjs`);const r=require(`../common/src/data-structures/Hinkal/Hinkal.cjs`),i=require(`../internal/token.utils.cjs`);var a=class{hinkalCommon;mappedPrivateBalancesSource;mappedPrivateBalances={};constructor(e){this.hinkalCommon=new r.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()}destroy(){return this.hinkalCommon.destroy()}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=i.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(i.mapTokenBalance)}async getStuckShieldedBalances(e,t=!1,n=!1){return(await this.hinkalCommon.getStuckShieldedBalances(e,void 0,void 0,t,n)).map(i.mapTokenBalance)}monitorConnectedAddress(e){return this.hinkalCommon.monitorConnectedAddress(e)}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,r,i){return this.hinkalCommon.prooflessDeposit(await n.resolveErc20Tokens(e,t),r,i)}async prooflessDepositWithPublicFee(e,t,r,i,a){return this.hinkalCommon.prooflessDepositWithPublicFee(await n.resolveErc20Token(e,t),r,i,a)}async deposit(e,t,r,i,a){return this.hinkalCommon.deposit(await n.resolveErc20Tokens(e,t),r,i,a)}async depositSolana(e,t,r){return this.hinkalCommon.depositSolana(r,await n.resolveErc20Token(e,t))}async depositForOther(e,t,r,i,a,o){return this.hinkalCommon.depositForOther(await n.resolveErc20Tokens(e,t),r,i,a,o)}async depositSolanaForOther(e,t,r,i){return this.hinkalCommon.depositSolanaForOther(r,await n.resolveErc20Token(e,t),i)}async depositAndWithdraw(e,t,r,i,a,o,s){return this.hinkalCommon.depositAndWithdraw(await n.resolveErc20Token(e,t),r,i,a,o,void 0,void 0,void 0,s)}async depositAndBridge(e,t,r,i,a,o){return this.hinkalCommon.depositAndBridge(await n.resolveErc20Token(e,t),r,i,a,void 0,void 0,void 0,o)}async checkSendTransactionStatus(e){return this.hinkalCommon.checkSendTransactionStatus(e)}async nearDepositAndBridge(e,t,r,i,a,o,s){return this.hinkalCommon.nearDepositAndBridge(await n.resolveErc20Token(e,t),r,i,a,o,s)}async claimUtxo(e,t,r,i,a){return this.hinkalCommon.claimUtxo(await n.resolveErc20Token(e,t),r,i,a)}async transfer(e,t,r,i,a,o){return this.hinkalCommon.transfer(await n.resolveErc20Tokens(e,t),r,i,a,o)}async withdraw(e,t,r,i,a,o,s){return this.hinkalCommon.withdraw(await n.resolveErc20Tokens(e,t),r,i,a,o,s)}async withdrawStuckUtxos(e,t,r){return this.hinkalCommon.withdrawStuckUtxos(await n.resolveErc20Token(e,t),r)}async swap(e,t,r,i,a,o,s){return this.hinkalCommon.swap(await n.resolveErc20Tokens(e,t),r,i,a,o,s)}async actionPrivateWallet(e,t,r,a,o,s,c,l,u){return this.hinkalCommon.actionPrivateWallet(e,await n.resolveErc20Tokens(e,t),r,a,o,await i.resolveCommonTokenChanges(e,s),c,l,u)}async proxySwap(e,t,r,i,a,o,s,c,l){return this.hinkalCommon.proxySwap(await n.resolveErc20Tokens(e,t),r,i,a,o,s,c,l)}async proxyToPrivate(e,t,r,i,a,o,s){return this.hinkalCommon.proxyToPrivate(await n.resolveErc20Tokens(e,t),r,i,a,o,s)}async proxySend(e,t,r,i,a,o,s){return this.hinkalCommon.proxySend(await n.resolveErc20Tokens(e,t),r,i,a,o,s)}};exports.Hinkal=a;
|
package/services/Hinkal.mjs
CHANGED
|
@@ -106,19 +106,7 @@ var c = class {
|
|
|
106
106
|
return this.hinkalCommon.prooflessDepositWithPublicFee(await n(e, t), r, i, a);
|
|
107
107
|
}
|
|
108
108
|
async deposit(e, t, n, i, a) {
|
|
109
|
-
|
|
110
|
-
chainId: e,
|
|
111
|
-
erc20Addresses: t,
|
|
112
|
-
amountChanges: n.map(String)
|
|
113
|
-
});
|
|
114
|
-
try {
|
|
115
|
-
let o = await r(e, t);
|
|
116
|
-
console.log("[hinkal.deposit] resolved tokens");
|
|
117
|
-
let s = await this.hinkalCommon.deposit(o, n, i, a);
|
|
118
|
-
return console.log("[hinkal.deposit] success", { result: s }), s;
|
|
119
|
-
} catch (e) {
|
|
120
|
-
throw console.log("[hinkal.deposit] error", e), e;
|
|
121
|
-
}
|
|
109
|
+
return this.hinkalCommon.deposit(await r(e, t), n, i, a);
|
|
122
110
|
}
|
|
123
111
|
async depositSolana(e, t, r) {
|
|
124
112
|
return this.hinkalCommon.depositSolana(r, await n(e, t));
|
|
@@ -145,37 +133,10 @@ var c = class {
|
|
|
145
133
|
return this.hinkalCommon.claimUtxo(await n(e, t), r, i, a);
|
|
146
134
|
}
|
|
147
135
|
async transfer(e, t, n, i, a, o) {
|
|
148
|
-
|
|
149
|
-
chainId: e,
|
|
150
|
-
erc20Addresses: t,
|
|
151
|
-
amountChanges: n.map(String),
|
|
152
|
-
recipientAddress: i
|
|
153
|
-
});
|
|
154
|
-
try {
|
|
155
|
-
let s = await r(e, t);
|
|
156
|
-
console.log("[hinkal.transfer] resolved tokens");
|
|
157
|
-
let c = await this.hinkalCommon.transfer(s, n, i, a, o);
|
|
158
|
-
return console.log("[hinkal.transfer] success", { result: c }), c;
|
|
159
|
-
} catch (e) {
|
|
160
|
-
throw console.log("[hinkal.transfer] error", e), e;
|
|
161
|
-
}
|
|
136
|
+
return this.hinkalCommon.transfer(await r(e, t), n, i, a, o);
|
|
162
137
|
}
|
|
163
138
|
async withdraw(e, t, n, i, a, o, s) {
|
|
164
|
-
|
|
165
|
-
chainId: e,
|
|
166
|
-
erc20Addresses: t,
|
|
167
|
-
deltaAmounts: n.map(String),
|
|
168
|
-
recipientAddress: i,
|
|
169
|
-
isRelayerOff: a
|
|
170
|
-
});
|
|
171
|
-
try {
|
|
172
|
-
let c = await r(e, t);
|
|
173
|
-
console.log("[hinkal.withdraw] resolved tokens");
|
|
174
|
-
let l = await this.hinkalCommon.withdraw(c, n, i, a, o, s);
|
|
175
|
-
return console.log("[hinkal.withdraw] success", { result: l }), l;
|
|
176
|
-
} catch (e) {
|
|
177
|
-
throw console.log("[hinkal.withdraw] error", e), e;
|
|
178
|
-
}
|
|
139
|
+
return this.hinkalCommon.withdraw(await r(e, t), n, i, a, o, s);
|
|
179
140
|
}
|
|
180
141
|
async withdrawStuckUtxos(e, t, r) {
|
|
181
142
|
return this.hinkalCommon.withdrawStuckUtxos(await n(e, t), r);
|