@reyaxyz/sdk 0.59.2 → 0.61.0
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/dist/services/lp/types.js.map +1 -1
- package/dist/services/token/approve.js +3 -3
- package/dist/services/token/approve.js.map +1 -1
- package/dist/services/token/types.js.map +1 -1
- package/dist/types/services/lp/types.d.ts +2 -5
- package/dist/types/services/lp/types.d.ts.map +1 -1
- package/dist/types/services/token/approve.d.ts.map +1 -1
- package/dist/types/services/token/types.d.ts +1 -0
- package/dist/types/services/token/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/services/lp/types.ts +4 -6
- package/src/services/token/approve.ts +3 -5
- package/src/services/token/types.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["services/lp/types.ts"],"names":[],"mappings":"","sourcesContent":["import { JsonRpcSigner, Signer } from 'ethers';\nimport {\n LpPoolEntity,\n LpWithdrawBalanceEntity,\n MarginAccountEntity,\n MoneyInOutChainId,\n OwnerMetadataEntity,\n ReyaChainId,\n TokenEntity,\n} from '@reyaxyz/common';\n\nexport type ProvideLiquidityParams = {\n signer: Signer | JsonRpcSigner;\n amount: number;\n lpPoolId: LpPoolEntity['id'];\n};\n\nexport type RemoveLiquidityParams = {\n signer: Signer | JsonRpcSigner;\n lpPoolId: LpPoolEntity['id'];\n amount: number;\n};\n\nexport type ProvideLiquidityResult = {\n transactionHash: string | null;\n};\n\nexport type RemoveLiquidityResult = {\n transactionHash: string | null;\n};\n\nexport type TransferFromMAToPoolParams = {\n signer: Signer | JsonRpcSigner;\n owner: Pick<OwnerMetadataEntity, 'coreSigNonce' | 'address'>;\n marginAccountId: MarginAccountEntity['id'];\n pool: Pick<LpPoolEntity, 'id' | 'tokenAddress'>;\n amount: number;\n};\n\nexport type TransferFromMAToPoolResult = {\n transactionHash: string | null;\n};\n\nexport type WithdrawPassivePoolAndBridgeParams = {\n signer: Signer | JsonRpcSigner;\n moneyInOutChainId: MoneyInOutChainId;\n owner: Pick<OwnerMetadataEntity, 'address' | 'poolSigNonce'>;\n pool: Pick<LpPoolEntity, 'id' | 'tokenAddress'>;\n amount: number;\n sharePrice: LpWithdrawBalanceEntity['poolSharePrice'];\n sharesAmount: number;\n withdrawMax: boolean;\n};\n\nexport type WithdrawPassivePoolAndBridgeResult = {\n transactionHash: string | null;\n};\n\nexport type BridgeAndDepositPassivePoolParams = {\n signer: Signer | JsonRpcSigner;\n ownerAddress: OwnerMetadataEntity['address'];\n pool: Pick<LpPoolEntity, 'id' | 'tokenAddress'>;\n amount: number;\n};\n\nexport type BridgeAndDepositPassivePoolResult = {\n transactionHash: string | null;\n};\n\nexport type BridgeAndDepositPassivePoolUnderAlphaTermsParams
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["services/lp/types.ts"],"names":[],"mappings":"","sourcesContent":["import { JsonRpcSigner, Signer } from 'ethers';\nimport {\n LpPoolEntity,\n LpWithdrawBalanceEntity,\n MarginAccountEntity,\n MoneyInOutChainId,\n OwnerMetadataEntity,\n ReyaChainId,\n TokenEntity,\n} from '@reyaxyz/common';\n\nexport type ProvideLiquidityParams = {\n signer: Signer | JsonRpcSigner;\n amount: number;\n lpPoolId: LpPoolEntity['id'];\n};\n\nexport type RemoveLiquidityParams = {\n signer: Signer | JsonRpcSigner;\n lpPoolId: LpPoolEntity['id'];\n amount: number;\n};\n\nexport type ProvideLiquidityResult = {\n transactionHash: string | null;\n};\n\nexport type RemoveLiquidityResult = {\n transactionHash: string | null;\n};\n\nexport type TransferFromMAToPoolParams = {\n signer: Signer | JsonRpcSigner;\n owner: Pick<OwnerMetadataEntity, 'coreSigNonce' | 'address'>;\n marginAccountId: MarginAccountEntity['id'];\n pool: Pick<LpPoolEntity, 'id' | 'tokenAddress'>;\n amount: number;\n};\n\nexport type TransferFromMAToPoolResult = {\n transactionHash: string | null;\n};\n\nexport type WithdrawPassivePoolAndBridgeParams = {\n signer: Signer | JsonRpcSigner;\n moneyInOutChainId: MoneyInOutChainId;\n owner: Pick<OwnerMetadataEntity, 'address' | 'poolSigNonce'>;\n pool: Pick<LpPoolEntity, 'id' | 'tokenAddress'>;\n amount: number;\n sharePrice: LpWithdrawBalanceEntity['poolSharePrice'];\n sharesAmount: number;\n withdrawMax: boolean;\n};\n\nexport type WithdrawPassivePoolAndBridgeResult = {\n transactionHash: string | null;\n};\n\nexport type BridgeAndDepositPassivePoolParams = {\n signer: Signer | JsonRpcSigner;\n ownerAddress: OwnerMetadataEntity['address'];\n pool: Pick<LpPoolEntity, 'id' | 'tokenAddress'>;\n amount: number;\n};\n\nexport type BridgeAndDepositPassivePoolResult = {\n transactionHash: string | null;\n};\n\nexport type BridgeAndDepositPassivePoolUnderAlphaTermsParams =\n BridgeAndDepositPassivePoolParams & {\n signedLink: string;\n };\n\nexport type BridgeAndDepositPassivePoolUnderAlphaTermsResult = {\n transactionHash: string | null;\n};\n\nexport type SimulateBridgeAndDepositPassivePoolResult = {\n fees: number;\n feesUnderlyingToken: TokenEntity['id'];\n bridgeTimeInMS: number;\n};\n\nexport type SimulateBridgeAndDepositPassivePoolParams = {\n moneyInOutChainId: MoneyInOutChainId;\n};\n\nexport type SimulateWithdrawPassivePoolAndBridgeResult = {\n fees: number;\n feesUnderlyingToken: TokenEntity['id'];\n bridgeTimeInMS: number;\n};\n\nexport type SimulateWithdrawPassivePoolAndBridgeParams = {\n reyaChainId: ReyaChainId;\n moneyInOutChainId: MoneyInOutChainId;\n tokenAddress: TokenEntity['address'];\n};\n"]}
|
|
@@ -42,7 +42,7 @@ var common_1 = require("@reyaxyz/common");
|
|
|
42
42
|
var contractAddresses_1 = require("../../utils/contractAddresses");
|
|
43
43
|
var common_2 = require("@reyaxyz/common");
|
|
44
44
|
var approveTokenSpending = function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
45
|
-
var network, chainId, tokenInfo, tokenContract, contractProxyAddress,
|
|
45
|
+
var network, chainId, tokenInfo, tokenContract, contractProxyAddress, scaledTokenAmount, approvalTransaction, error_1, _a, error_2;
|
|
46
46
|
var _b;
|
|
47
47
|
var _c;
|
|
48
48
|
return __generator(this, function (_d) {
|
|
@@ -72,9 +72,9 @@ var approveTokenSpending = function (params) { return __awaiter(void 0, void 0,
|
|
|
72
72
|
default:
|
|
73
73
|
throw new Error('Unexpected approval type in approveTokenSpending');
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
scaledTokenAmount = (0, common_1.scale)(tokenInfo.decimals)(params.amount);
|
|
76
76
|
return [4 /*yield*/, tokenContract
|
|
77
|
-
.approve(contractProxyAddress,
|
|
77
|
+
.approve(contractProxyAddress, scaledTokenAmount)
|
|
78
78
|
.catch(function (error) {
|
|
79
79
|
console.warn('Transaction Confirmation Error');
|
|
80
80
|
console.error(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approve.js","sourceRoot":"/","sources":["services/token/approve.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA2D;AAC3D,
|
|
1
|
+
{"version":3,"file":"approve.js","sourceRoot":"/","sources":["services/token/approve.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA2D;AAC3D,0CAOyB;AACzB,mEAAyE;AACzE,0CAAqD;AAE9C,IAAM,oBAAoB,GAAG,UAClC,MAA0B;;;;;;oBAEV,qBAAM,CAAA,MAAA,MAAM,CAAC,MAAM,CAAC,QAAQ,0CAAE,UAAU,EAAE,CAAA,EAAA;;gBAApD,OAAO,GAAG,SAA0C;gBACpD,OAAO,GAAG,MAAM,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAC,CAAC;gBAGrC,SAAS,GAAG,IAAA,8BAAqB,EAAC,MAAM,CAAC,YAAY,CAAC,CAAC;gBAC3D,IAAI,oBAAY,CAAC,MAAM,IAAI,SAAS,CAAC,IAAI,KAAK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AEjC,OAAO,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;gBACtC,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;;;gBAI5B,KAAA,0BAAiB,CAAA;;gBACb,qBAAM,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,EAAA;oBAD1C,qBAAM,mBACX,gBAAa,GAAE,SAAgC;wBAC/C,eAAY,GAAE,SAAS,CAAC,OAAO;wBAC/B,iBAAc,GAAE,oBAAoB;wBACpC,UAAO,GAAE,MAAM,CAAC,MAAM;6BACtB,EAAA;oBALF,sBAAO,SAKL,EAAC;;;gBAEH,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;;qBAG5C,sBAAO,CAAC,EAAC;;;KACV,CAAC;AA/DW,QAAA,oBAAoB,wBA+D/B","sourcesContent":["import { ApprovalType, ApproveTokenParams } from './types';\nimport {\n getERC20Allowance,\n getERC20TokenContract,\n getSocketVault,\n GetSocketVaultParams,\n getTokenInfoByAddress,\n scale,\n} from '@reyaxyz/common';\nimport { ContractType, getAddress } from '../../utils/contractAddresses';\nimport { getTokenInfoByName } from '@reyaxyz/common';\n\nexport const approveTokenSpending = async (\n params: ApproveTokenParams,\n): Promise<number> => {\n const network = await params.signer.provider?.getNetwork();\n const chainId = Number(network?.chainId);\n\n // todo: to be removed once lp form in offchain/UI is fixed\n let tokenInfo = getTokenInfoByAddress(params.tokenAddress);\n if (ApprovalType.BRIDGE && tokenInfo.name === 'RUSD') {\n tokenInfo = getTokenInfoByName('USDC', chainId);\n }\n\n const tokenContract = getERC20TokenContract(tokenInfo.address, params.signer);\n\n let contractProxyAddress;\n switch (params.type) {\n case ApprovalType.DEPOSIT:\n contractProxyAddress = getAddress(chainId, ContractType.CORE_PROXY);\n break;\n case ApprovalType.LP:\n contractProxyAddress = getAddress(\n chainId,\n ContractType.PASSIVE_POOL_PROXY,\n );\n break;\n case ApprovalType.BRIDGE:\n contractProxyAddress = getSocketVault({\n moneyInOutChainId: chainId,\n tokenName: tokenInfo.name,\n } as GetSocketVaultParams);\n break;\n default:\n throw new Error('Unexpected approval type in approveTokenSpending');\n }\n\n const scaledTokenAmount = scale(tokenInfo.decimals)(params.amount);\n\n const approvalTransaction = await tokenContract\n .approve(contractProxyAddress, scaledTokenAmount)\n .catch((error) => {\n console.warn('Transaction Confirmation Error');\n console.error(error);\n throw new Error('Transaction Confirmation Error');\n });\n try {\n await approvalTransaction.wait();\n } catch (error) {\n console.warn('Token approval failed');\n throw new Error('Token approval failed');\n }\n\n try {\n return await getERC20Allowance({\n walletAddress: await params.signer.getAddress(),\n tokenAddress: tokenInfo.address,\n spenderAddress: contractProxyAddress,\n subject: params.signer,\n });\n } catch (error) {\n console.warn('Fetching allowance failed');\n }\n\n return 0;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["services/token/types.ts"],"names":[],"mappings":";;;AAGA,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,2CAAE,CAAA;IACF,qDAAO,CAAA;IACP,mDAAM,CAAA;AACR,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB","sourcesContent":["import { JsonRpcSigner, Signer } from 'ethers';\nimport { TokenEntity } from '@reyaxyz/common';\n\nexport enum ApprovalType {\n LP,\n DEPOSIT,\n BRIDGE,\n}\n\nexport type ApproveTokenParams = {\n signer: Signer | JsonRpcSigner;\n tokenAddress: TokenEntity['address'];\n type: ApprovalType;\n};\n\nexport type GetAllowanceParams = {\n signer: Signer | JsonRpcSigner;\n tokenAddress: TokenEntity['address'];\n type: ApprovalType;\n};\n\nexport type GetBalanceByTokenAddressParams = {\n signer: Signer | JsonRpcSigner;\n tokenAddress: TokenEntity['address'];\n};\n\nexport type GetUsdcBalanceParams = {\n signer: Signer | JsonRpcSigner;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["services/token/types.ts"],"names":[],"mappings":";;;AAGA,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,2CAAE,CAAA;IACF,qDAAO,CAAA;IACP,mDAAM,CAAA;AACR,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB","sourcesContent":["import { JsonRpcSigner, Signer } from 'ethers';\nimport { TokenEntity } from '@reyaxyz/common';\n\nexport enum ApprovalType {\n LP,\n DEPOSIT,\n BRIDGE,\n}\n\nexport type ApproveTokenParams = {\n signer: Signer | JsonRpcSigner;\n tokenAddress: TokenEntity['address'];\n amount: number;\n type: ApprovalType;\n};\n\nexport type GetAllowanceParams = {\n signer: Signer | JsonRpcSigner;\n tokenAddress: TokenEntity['address'];\n type: ApprovalType;\n};\n\nexport type GetBalanceByTokenAddressParams = {\n signer: Signer | JsonRpcSigner;\n tokenAddress: TokenEntity['address'];\n};\n\nexport type GetUsdcBalanceParams = {\n signer: Signer | JsonRpcSigner;\n};\n"]}
|
|
@@ -48,11 +48,8 @@ export type BridgeAndDepositPassivePoolParams = {
|
|
|
48
48
|
export type BridgeAndDepositPassivePoolResult = {
|
|
49
49
|
transactionHash: string | null;
|
|
50
50
|
};
|
|
51
|
-
export type BridgeAndDepositPassivePoolUnderAlphaTermsParams = {
|
|
52
|
-
|
|
53
|
-
ownerAddress: OwnerMetadataEntity['address'];
|
|
54
|
-
pool: Pick<LpPoolEntity, 'id' | 'tokenAddress'>;
|
|
55
|
-
amount: number;
|
|
51
|
+
export type BridgeAndDepositPassivePoolUnderAlphaTermsParams = BridgeAndDepositPassivePoolParams & {
|
|
52
|
+
signedLink: string;
|
|
56
53
|
};
|
|
57
54
|
export type BridgeAndDepositPassivePoolUnderAlphaTermsResult = {
|
|
58
55
|
transactionHash: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["services/lp/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EACL,YAAY,EACZ,uBAAuB,EAC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IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,cAAc,CAAC,CAAC;IAChD,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,gDAAgD,GAC1D,iCAAiC,GAAG;IAClC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEJ,MAAM,MAAM,gDAAgD,GAAG;IAC7D,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,yCAAyC,GAAG;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IACvC,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,yCAAyC,GAAG;IACtD,iBAAiB,EAAE,iBAAiB,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,0CAA0C,GAAG;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IACvC,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,0CAA0C,GAAG;IACvD,WAAW,EAAE,WAAW,CAAC;IACzB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;CACtC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approve.d.ts","sourceRoot":"/","sources":["services/token/approve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,kBAAkB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"approve.d.ts","sourceRoot":"/","sources":["services/token/approve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAY3D,eAAO,MAAM,oBAAoB,WACvB,kBAAkB,KACzB,QAAQ,MAAM,CA6DhB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["services/token/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,oBAAY,YAAY;IACtB,EAAE,IAAA;IACF,OAAO,IAAA;IACP,MAAM,IAAA;CACP;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACrC,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACrC,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;CAChC,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["services/token/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,oBAAY,YAAY;IACtB,EAAE,IAAA;IACF,OAAO,IAAA;IACP,MAAM,IAAA;CACP;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACrC,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;CAChC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.61.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"ethers": "6.9.0"
|
|
35
35
|
},
|
|
36
36
|
"packageManager": "pnpm@8.10.4",
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "d6baad56c3374010ded5c516fa47c14b8f491db2"
|
|
38
38
|
}
|
package/src/services/lp/types.ts
CHANGED
|
@@ -67,12 +67,10 @@ export type BridgeAndDepositPassivePoolResult = {
|
|
|
67
67
|
transactionHash: string | null;
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
-
export type BridgeAndDepositPassivePoolUnderAlphaTermsParams =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
amount: number;
|
|
75
|
-
};
|
|
70
|
+
export type BridgeAndDepositPassivePoolUnderAlphaTermsParams =
|
|
71
|
+
BridgeAndDepositPassivePoolParams & {
|
|
72
|
+
signedLink: string;
|
|
73
|
+
};
|
|
76
74
|
|
|
77
75
|
export type BridgeAndDepositPassivePoolUnderAlphaTermsResult = {
|
|
78
76
|
transactionHash: string | null;
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
getSocketVault,
|
|
6
6
|
GetSocketVaultParams,
|
|
7
7
|
getTokenInfoByAddress,
|
|
8
|
+
scale,
|
|
8
9
|
} from '@reyaxyz/common';
|
|
9
10
|
import { ContractType, getAddress } from '../../utils/contractAddresses';
|
|
10
11
|
import { getTokenInfoByName } from '@reyaxyz/common';
|
|
@@ -44,13 +45,10 @@ export const approveTokenSpending = async (
|
|
|
44
45
|
throw new Error('Unexpected approval type in approveTokenSpending');
|
|
45
46
|
}
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
const maxUint256Bn = BigInt(
|
|
49
|
-
'115792089237316195423570985008687907853269984665640564039457584007913129639935',
|
|
50
|
-
);
|
|
48
|
+
const scaledTokenAmount = scale(tokenInfo.decimals)(params.amount);
|
|
51
49
|
|
|
52
50
|
const approvalTransaction = await tokenContract
|
|
53
|
-
.approve(contractProxyAddress,
|
|
51
|
+
.approve(contractProxyAddress, scaledTokenAmount)
|
|
54
52
|
.catch((error) => {
|
|
55
53
|
console.warn('Transaction Confirmation Error');
|
|
56
54
|
console.error(error);
|