@allbridge/bridge-core-sdk 3.35.0-alpha.2 → 3.35.1

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.
Files changed (37) hide show
  1. package/README.md +213 -76
  2. package/dist/browser/index.js +2 -2
  3. package/dist/browser/index.js.map +2 -2
  4. package/dist/cjs/index.js +1 -1
  5. package/dist/cjs/index.js.map +2 -2
  6. package/dist/esm/index.js +2 -2
  7. package/dist/esm/index.js.map +2 -2
  8. package/dist/src/client/core-api/core-api.model.d.ts +33 -0
  9. package/dist/src/client/core-api/core-api.model.js +21 -0
  10. package/dist/src/client/core-api/core-api.model.js.map +1 -1
  11. package/dist/src/exceptions/exceptions.d.ts +6 -0
  12. package/dist/src/exceptions/exceptions.js +6 -0
  13. package/dist/src/exceptions/exceptions.js.map +1 -1
  14. package/dist/src/index.d.ts +87 -38
  15. package/dist/src/index.js +9 -8
  16. package/dist/src/index.js.map +1 -1
  17. package/dist/src/models/index.d.ts +4 -1
  18. package/dist/src/models/index.js.map +1 -1
  19. package/dist/src/services/models/index.d.ts +4 -0
  20. package/dist/src/services/models/index.js.map +1 -1
  21. package/dist/src/services/yield/index.d.ts +18 -0
  22. package/dist/src/services/yield/index.js +6 -0
  23. package/dist/src/services/yield/index.js.map +1 -1
  24. package/dist/src/services/yield/models/yield.model.d.ts +33 -0
  25. package/dist/src/services/yield/models/yield.model.js.map +1 -1
  26. package/dist/src/services/yield/raw-yield-transaction-builder.d.ts +9 -0
  27. package/dist/src/services/yield/raw-yield-transaction-builder.js +3 -0
  28. package/dist/src/services/yield/raw-yield-transaction-builder.js.map +1 -1
  29. package/dist/src/services/yield/validations.d.ts +2 -0
  30. package/dist/src/services/yield/validations.js +2 -0
  31. package/dist/src/services/yield/validations.js.map +1 -1
  32. package/dist/src/tokens-info/tokens-info.model.d.ts +29 -9
  33. package/dist/src/tokens-info/tokens-info.model.js.map +1 -1
  34. package/dist/src/version.d.ts +1 -1
  35. package/dist/src/version.js +1 -1
  36. package/dist/src/version.js.map +1 -1
  37. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"raw-yield-transaction-builder.js","sourceRoot":"","sources":["../../../../src/services/yield/raw-yield-transaction-builder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAIjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAyB/C,MAAM,OAAO,iCAAiC;IAElC;IACA;IACA;IACA;IAJV,YACU,GAAwB,EACxB,iBAAoC,EACpC,MAA+B,EAC/B,YAA0B;QAH1B,QAAG,GAAH,GAAG,CAAqB;QACxB,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,WAAM,GAAN,MAAM,CAAyB;QAC/B,iBAAY,GAAZ,YAAY,CAAc;IACjC,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,WAA+B,EAAE,QAAmB;QAChE,OAAO,IAAI,CAAC,YAAY,CAAC,0BAA0B,CACjD;YACE,GAAG,WAAW;YACd,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,YAAY;SACxC,EACD,QAAQ,CACT,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,MAA0B,EAAE,QAAmB;QAC3D,oBAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACpC,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACvE,oBAAoB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;QAC9C,sBAAsB,CAAC,kBAAkB,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;QACvE,MAAM,CAAC,MAAM,GAAG,uBAAuB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAC;QACxF,MAAM,CAAC,gBAAgB,GAAG,uBAAuB,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACxF,OAAO,oBAAoB,CACzB,MAAM,CAAC,KAAK,CAAC,WAAW,EACxB,IAAI,CAAC,GAAG,EACR,IAAI,CAAC,iBAAiB,EACtB,MAAM,CAAC,KAAK,EACZ,QAAQ,CACT,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,MAA2B,EAAE,QAAmB;QAC7D,oBAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACpC,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;QAClE,MAAM,CAAC,MAAM,GAAG,uBAAuB,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,OAAO,EAAE,CAAC;QACnF,OAAO,oBAAoB,CACzB,MAAM,CAAC,KAAK,CAAC,WAAW,EACxB,IAAI,CAAC,GAAG,EACR,IAAI,CAAC,iBAAiB,EACtB,MAAM,CAAC,KAAK,EACZ,QAAQ,CACT,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;CACF","sourcesContent":["import { NodeRpcUrlsConfig } from \"..\";\nimport { AllbridgeCoreClient } from \"../../client/core-api/core-client-base\";\nimport { AllbridgeCoreSdkOptions } from \"../../index\";\nimport { convertFloatAmountToInt } from \"../../utils/calculation\";\nimport { SYSTEM_PRECISION } from \"../../utils/calculation/constants\";\nimport { validateAmountDecimals, validateAmountGtZero } from \"../../utils/utils\";\nimport { Provider, RawTransaction } from \"../models\";\nimport { TokenService } from \"../token\";\nimport { YieldApproveParams, YieldDepositParams, YieldWithdrawParams } from \"./models/yield.model\";\nimport { getChainYieldService } from \"./index\";\n\nexport interface RawYieldTransactionBuilder {\n /**\n * Creates a Raw Transaction for approving tokens usage by the Yield\n * @param approveData\n * @param provider - will be used to access the network\n */\n approve(approveData: YieldApproveParams, provider?: Provider): Promise<RawTransaction>;\n\n /**\n * Creates a Raw Transaction for depositing tokens to Yield\n * @param params\n * @param provider - will be used to access the network\n */\n deposit(params: YieldDepositParams, provider?: Provider): Promise<RawTransaction>;\n\n /**\n * Creates a Raw Transaction for withdrawing tokens from Yield\n * @param params\n * @param provider - will be used to access the network\n */\n withdraw(params: YieldWithdrawParams, provider?: Provider): Promise<RawTransaction>;\n}\n\nexport class DefaultRawYieldTransactionBuilder implements RawYieldTransactionBuilder {\n constructor(\n private api: AllbridgeCoreClient,\n private nodeRpcUrlsConfig: NodeRpcUrlsConfig,\n private params: AllbridgeCoreSdkOptions,\n private tokenService: TokenService\n ) {}\n\n async approve(approveData: YieldApproveParams, provider?: Provider): Promise<RawTransaction> {\n return this.tokenService.buildRawTransactionApprove(\n {\n ...approveData,\n spender: approveData.token.yieldAddress,\n },\n provider\n );\n }\n\n async deposit(params: YieldDepositParams, provider?: Provider): Promise<RawTransaction> {\n validateAmountGtZero(params.amount);\n validateAmountDecimals(\"amount\", params.amount, params.token.decimals);\n validateAmountGtZero(params.minVirtualAmount);\n validateAmountDecimals(\"minVirtualAmount\", params.minVirtualAmount, 3);\n params.amount = convertFloatAmountToInt(params.amount, params.token.decimals).toFixed();\n params.minVirtualAmount = convertFloatAmountToInt(params.minVirtualAmount, 3).toFixed();\n return getChainYieldService(\n params.token.chainSymbol,\n this.api,\n this.nodeRpcUrlsConfig,\n params.owner,\n provider\n ).buildRawTransactionDeposit(params);\n }\n\n async withdraw(params: YieldWithdrawParams, provider?: Provider): Promise<RawTransaction> {\n validateAmountGtZero(params.amount);\n validateAmountDecimals(\"amount\", params.amount, SYSTEM_PRECISION);\n params.amount = convertFloatAmountToInt(params.amount, SYSTEM_PRECISION).toFixed();\n return getChainYieldService(\n params.token.chainSymbol,\n this.api,\n this.nodeRpcUrlsConfig,\n params.owner,\n provider\n ).buildRawTransactionWithdraw(params);\n }\n}\n"]}
1
+ {"version":3,"file":"raw-yield-transaction-builder.js","sourceRoot":"","sources":["../../../../src/services/yield/raw-yield-transaction-builder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAIjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AA+B/C;;GAEG;AACH,MAAM,OAAO,iCAAiC;IAElC;IACA;IACA;IACA;IAJV,YACU,GAAwB,EACxB,iBAAoC,EACpC,MAA+B,EAC/B,YAA0B;QAH1B,QAAG,GAAH,GAAG,CAAqB;QACxB,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,WAAM,GAAN,MAAM,CAAyB;QAC/B,iBAAY,GAAZ,YAAY,CAAc;IACjC,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,WAA+B,EAAE,QAAmB;QAChE,OAAO,IAAI,CAAC,YAAY,CAAC,0BAA0B,CACjD;YACE,GAAG,WAAW;YACd,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,YAAY;SACxC,EACD,QAAQ,CACT,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,MAA0B,EAAE,QAAmB;QAC3D,oBAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACpC,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACvE,oBAAoB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;QAC9C,sBAAsB,CAAC,kBAAkB,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;QACvE,MAAM,CAAC,MAAM,GAAG,uBAAuB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAC;QACxF,MAAM,CAAC,gBAAgB,GAAG,uBAAuB,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACxF,OAAO,oBAAoB,CACzB,MAAM,CAAC,KAAK,CAAC,WAAW,EACxB,IAAI,CAAC,GAAG,EACR,IAAI,CAAC,iBAAiB,EACtB,MAAM,CAAC,KAAK,EACZ,QAAQ,CACT,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,MAA2B,EAAE,QAAmB;QAC7D,oBAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACpC,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;QAClE,MAAM,CAAC,MAAM,GAAG,uBAAuB,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,OAAO,EAAE,CAAC;QACnF,OAAO,oBAAoB,CACzB,MAAM,CAAC,KAAK,CAAC,WAAW,EACxB,IAAI,CAAC,GAAG,EACR,IAAI,CAAC,iBAAiB,EACtB,MAAM,CAAC,KAAK,EACZ,QAAQ,CACT,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;CACF","sourcesContent":["import { NodeRpcUrlsConfig } from \"..\";\nimport { AllbridgeCoreClient } from \"../../client/core-api/core-client-base\";\nimport { AllbridgeCoreSdkOptions } from \"../../index\";\nimport { convertFloatAmountToInt } from \"../../utils/calculation\";\nimport { SYSTEM_PRECISION } from \"../../utils/calculation/constants\";\nimport { validateAmountDecimals, validateAmountGtZero } from \"../../utils/utils\";\nimport { Provider, RawTransaction } from \"../models\";\nimport { TokenService } from \"../token\";\nimport { YieldApproveParams, YieldDepositParams, YieldWithdrawParams } from \"./models/yield.model\";\nimport { getChainYieldService } from \"./index\";\n\n/**\n * @deprecated Do not use.\n */\nexport interface RawYieldTransactionBuilder {\n /**\n * Creates a Raw Transaction for approving tokens usage by the Yield\n * @param approveData\n * @param provider - will be used to access the network\n * @deprecated Do not use.\n */\n approve(approveData: YieldApproveParams, provider?: Provider): Promise<RawTransaction>;\n\n /**\n * Creates a Raw Transaction for depositing tokens to Yield\n * @param params\n * @param provider - will be used to access the network\n * @deprecated Do not use.\n */\n deposit(params: YieldDepositParams, provider?: Provider): Promise<RawTransaction>;\n\n /**\n * Creates a Raw Transaction for withdrawing tokens from Yield\n * @param params\n * @param provider - will be used to access the network\n * @deprecated Do not use.\n */\n withdraw(params: YieldWithdrawParams, provider?: Provider): Promise<RawTransaction>;\n}\n\n/**\n * @deprecated Do not use.\n */\nexport class DefaultRawYieldTransactionBuilder implements RawYieldTransactionBuilder {\n constructor(\n private api: AllbridgeCoreClient,\n private nodeRpcUrlsConfig: NodeRpcUrlsConfig,\n private params: AllbridgeCoreSdkOptions,\n private tokenService: TokenService\n ) {}\n\n async approve(approveData: YieldApproveParams, provider?: Provider): Promise<RawTransaction> {\n return this.tokenService.buildRawTransactionApprove(\n {\n ...approveData,\n spender: approveData.token.yieldAddress,\n },\n provider\n );\n }\n\n async deposit(params: YieldDepositParams, provider?: Provider): Promise<RawTransaction> {\n validateAmountGtZero(params.amount);\n validateAmountDecimals(\"amount\", params.amount, params.token.decimals);\n validateAmountGtZero(params.minVirtualAmount);\n validateAmountDecimals(\"minVirtualAmount\", params.minVirtualAmount, 3);\n params.amount = convertFloatAmountToInt(params.amount, params.token.decimals).toFixed();\n params.minVirtualAmount = convertFloatAmountToInt(params.minVirtualAmount, 3).toFixed();\n return getChainYieldService(\n params.token.chainSymbol,\n this.api,\n this.nodeRpcUrlsConfig,\n params.owner,\n provider\n ).buildRawTransactionDeposit(params);\n }\n\n async withdraw(params: YieldWithdrawParams, provider?: Provider): Promise<RawTransaction> {\n validateAmountGtZero(params.amount);\n validateAmountDecimals(\"amount\", params.amount, SYSTEM_PRECISION);\n params.amount = convertFloatAmountToInt(params.amount, SYSTEM_PRECISION).toFixed();\n return getChainYieldService(\n params.token.chainSymbol,\n this.api,\n this.nodeRpcUrlsConfig,\n params.owner,\n provider\n ).buildRawTransactionWithdraw(params);\n }\n}\n"]}
@@ -5,11 +5,13 @@ import { TokenWithChainDetailsYield } from "./models";
5
5
  * asserts token is TokenWithChainDetailsYield</br>
6
6
  * throws {@link YieldDoesNotSupportedError} if not
7
7
  * @param token
8
+ * @deprecated Do not use.
8
9
  */
9
10
  export declare function assertYieldIsSupported(token: TokenWithChainDetails): asserts token is TokenWithChainDetailsYield;
10
11
  /**
11
12
  * is Yield support
12
13
  * @param token
13
14
  * @return isYieldSupported
15
+ * @deprecated Do not use.
14
16
  */
15
17
  export declare function isYieldSupported(token: TokenWithChainDetails): token is TokenWithChainDetailsYield;
@@ -4,6 +4,7 @@ import { YieldDoesNotSupportedError } from "../../exceptions";
4
4
  * asserts token is TokenWithChainDetailsYield</br>
5
5
  * throws {@link YieldDoesNotSupportedError} if not
6
6
  * @param token
7
+ * @deprecated Do not use.
7
8
  */
8
9
  export function assertYieldIsSupported(token) {
9
10
  if (!isYieldSupported(token)) {
@@ -14,6 +15,7 @@ export function assertYieldIsSupported(token) {
14
15
  * is Yield support
15
16
  * @param token
16
17
  * @return isYieldSupported
18
+ * @deprecated Do not use.
17
19
  */
18
20
  export function isYieldSupported(token) {
19
21
  return !!token.yieldAddress && token.yieldId !== undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"validations.js","sourceRoot":"","sources":["../../../../src/services/yield/validations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAI9D;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAA4B;IACjE,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,0BAA0B,CAAC,8BAA8B,CAAC,CAAC;IACvE,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAA4B;IAC3D,OAAO,CAAC,CAAC,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC;AAC7D,CAAC","sourcesContent":["import { YieldDoesNotSupportedError } from \"../../exceptions\";\nimport { TokenWithChainDetails } from \"../../tokens-info\";\nimport { TokenWithChainDetailsYield } from \"./models\";\n\n/**\n * Assert that token is supported by Yield,</br>\n * asserts token is TokenWithChainDetailsYield</br>\n * throws {@link YieldDoesNotSupportedError} if not\n * @param token\n */\nexport function assertYieldIsSupported(token: TokenWithChainDetails): asserts token is TokenWithChainDetailsYield {\n if (!isYieldSupported(token)) {\n throw new YieldDoesNotSupportedError(\"Token does not support Yield\");\n }\n}\n\n/**\n * is Yield support\n * @param token\n * @return isYieldSupported\n */\nexport function isYieldSupported(token: TokenWithChainDetails): token is TokenWithChainDetailsYield {\n return !!token.yieldAddress && token.yieldId !== undefined;\n}\n"]}
1
+ {"version":3,"file":"validations.js","sourceRoot":"","sources":["../../../../src/services/yield/validations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAI9D;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAA4B;IACjE,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,0BAA0B,CAAC,8BAA8B,CAAC,CAAC;IACvE,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAA4B;IAC3D,OAAO,CAAC,CAAC,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC;AAC7D,CAAC","sourcesContent":["import { YieldDoesNotSupportedError } from \"../../exceptions\";\nimport { TokenWithChainDetails } from \"../../tokens-info\";\nimport { TokenWithChainDetailsYield } from \"./models\";\n\n/**\n * Assert that token is supported by Yield,</br>\n * asserts token is TokenWithChainDetailsYield</br>\n * throws {@link YieldDoesNotSupportedError} if not\n * @param token\n * @deprecated Do not use.\n */\nexport function assertYieldIsSupported(token: TokenWithChainDetails): asserts token is TokenWithChainDetailsYield {\n if (!isYieldSupported(token)) {\n throw new YieldDoesNotSupportedError(\"Token does not support Yield\");\n }\n}\n\n/**\n * is Yield support\n * @param token\n * @return isYieldSupported\n * @deprecated Do not use.\n */\nexport function isYieldSupported(token: TokenWithChainDetails): token is TokenWithChainDetailsYield {\n return !!token.yieldAddress && token.yieldId !== undefined;\n}\n"]}
@@ -42,12 +42,13 @@ export interface ChainDetails extends BasicChainProperties {
42
42
  */
43
43
  bridgeAddress: string;
44
44
  /**
45
- * OFT Bridge contract address
45
+ * OFT Bridge contract address (the contract to approve for {@link Messenger.OFT})
46
46
  * Optional. Defined if the chain supports OFT
47
47
  */
48
48
  oftBridgeAddress?: string;
49
49
  /**
50
50
  * Yield contract address
51
+ * @deprecated Do not use.
51
52
  */
52
53
  yieldAddress?: string;
53
54
  /**
@@ -120,7 +121,7 @@ export interface Token {
120
121
  */
121
122
  originTokenAddress?: string;
122
123
  /**
123
- * Token CCTP address</br>
124
+ * Token CCTP address (bridge contract to approve for {@link Messenger.CCTP})</br>
124
125
  * Optional. Defined if the token is supported by CCTP
125
126
  */
126
127
  cctpAddress?: string;
@@ -130,18 +131,18 @@ export interface Token {
130
131
  */
131
132
  cctpFeeShare?: string;
132
133
  /**
133
- * Token CCTP address</br>
134
- * Optional. Defined if the token is supported by CCTP
134
+ * Token CCTP V2 address (bridge contract to approve for {@link Messenger.CCTP_V2})</br>
135
+ * Optional. Defined if the token is supported by CCTP V2
135
136
  */
136
137
  cctpV2Address?: string;
137
138
  /**
138
139
  * Token fee share for CCTP V2</br>
139
- * Optional. Defined if the token is supported by CCTP
140
+ * Optional. Defined if the token is supported by CCTP V2
140
141
  */
141
142
  cctpV2FeeShare?: string;
142
143
  /**
143
- * XReserve bridge configuration for token.
144
- * Optional. Defined if the token is supported by XReserve
144
+ * xReserve bridge configuration for token, see {@link XReserveTokenInfo}.
145
+ * Optional. Defined if the token is supported by {@link Messenger.X_RESERVE}
145
146
  */
146
147
  xReserve?: XReserveTokenInfo;
147
148
  /**
@@ -150,7 +151,8 @@ export interface Token {
150
151
  * Used to link representations of a token deployed on multiple networks (e.g., Ethereum, BSC).
151
152
  * Tokens with the same `oftId` are considered to be equivalent.
152
153
  *
153
- * Optional. Defined if the token is supported by OFT
154
+ * Optional. Defined if the token is supported by {@link Messenger.OFT}.
155
+ * The bridge contract to approve is {@link ChainDetails.oftBridgeAddress}.
154
156
  */
155
157
  oftId?: string;
156
158
  /**
@@ -159,8 +161,8 @@ export interface Token {
159
161
  */
160
162
  feeShare: string;
161
163
  /**
162
- * @Deprecated use {@link apr7d}</br>
163
164
  * Token APR
165
+ * @deprecated Do not use.
164
166
  */
165
167
  apr: string;
166
168
  /**
@@ -178,6 +180,9 @@ export interface Token {
178
180
  * @deprecated Do not use.
179
181
  */
180
182
  lpRate: string;
183
+ /**
184
+ * @deprecated Do not use.
185
+ */
181
186
  yieldId?: number;
182
187
  /**
183
188
  * Sui addresses
@@ -185,10 +190,25 @@ export interface Token {
185
190
  */
186
191
  suiAddresses?: SuiAddresses;
187
192
  }
193
+ /**
194
+ * xReserve route configuration of a token, see {@link Messenger.X_RESERVE}
195
+ */
188
196
  export interface XReserveTokenInfo {
197
+ /**
198
+ * xReserve bridge contract address (the contract to approve)
199
+ */
189
200
  bridgeAddress: string;
201
+ /**
202
+ * Constant part of the fee, in the smallest denomination of the token
203
+ */
190
204
  feeConst: string;
205
+ /**
206
+ * Share of the transferred amount charged as a fee
207
+ */
191
208
  feeShare: string;
209
+ /**
210
+ * xReserve protocol contract address
211
+ */
192
212
  protocolAddress?: string;
193
213
  }
194
214
  export interface SuiAddresses {
@@ -1 +1 @@
1
- {"version":3,"file":"tokens-info.model.js","sourceRoot":"","sources":["../../../src/tokens-info/tokens-info.model.ts"],"names":[],"mappings":"","sourcesContent":["import { BasicChainProperties } from \"../chains/models\";\nimport { Messenger } from \"../client/core-api/core-api.model\";\n\n/**\n * Type representing a map of blockchain chain symbols to their corresponding details, including token information.\n *\n * @typedef {Record<string, ChainDetailsWithTokens>} ChainDetailsMap\n * @property {string} chainSymbol - The symbol of the chain representing one of the supported blockchain networks (e.g., \"ETH\" for Ethereum). For more details, see: {@link ChainSymbol}.\n * @property {ChainDetailsWithTokens} chainDetails - The detailed information of the specified chain, including token information.\n */\nexport type ChainDetailsMap = Record<string, ChainDetailsWithTokens>;\n\nexport type ChainDetailsMapWithFlags = Record<string, ChainDetailsWithTokensWithFlags>;\n\nexport interface AbrPayerChainInfo {\n /**\n * ABR proxy for paying fees with ABR\n */\n payerAddress: string;\n abrToken: TokenCoreFields;\n /**\n * Availability to pay by abr\n */\n payerAvailability: AbrPayerAvailability;\n}\n\n/**\n * Contains some blockchain details\n */\nexport interface ChainDetails extends BasicChainProperties {\n /**\n * Allbridge's Id\n */\n allbridgeChainId: number;\n /**\n * Algo Bridge appId\n */\n bridgeId?: string;\n /**\n * Algo Padding appId\n */\n paddingUtilId?: string;\n /**\n * Bridge contract address\n * @deprecated Do not use.\n */\n bridgeAddress: string;\n /**\n * OFT Bridge contract address\n * Optional. Defined if the chain supports OFT\n */\n oftBridgeAddress?: string;\n /**\n * Yield contract address\n */\n yieldAddress?: string;\n /**\n * ABR payer chain info\n */\n abrPayer?: AbrPayerChainInfo;\n /**\n * Average transfer time to other blockchains\n */\n transferTime: TransferTime;\n /**\n * Transfers costs\n */\n txCostAmount: TxCostAmount;\n /**\n * Number of confirmations required\n */\n confirmations: number;\n /**\n * Sui addresses\n * Optional. Defined for SUI\n */\n suiAddresses?: SuiAddresses;\n}\n\n/**\n * Contains tokens list\n */\nexport interface ChainDetailsWithTokens extends ChainDetails {\n /**\n * Tokens\n */\n tokens: TokenWithChainDetails[];\n}\n\n/**\n * Contains tokens list\n */\nexport interface ChainDetailsWithTokensWithFlags extends ChainDetails {\n /**\n * Tokens\n */\n tokens: TokenWithChainDetailsWithFlags[];\n}\n\n/**\n * Contains token information\n */\nexport interface Token {\n /**\n * Token symbol\n */\n symbol: string;\n /**\n * Token name\n */\n name: string;\n /**\n * Token decimals\n */\n decimals: number;\n /**\n * Token pool address\n * @deprecated Do not use.\n */\n poolAddress: string;\n /**\n * Token address\n */\n tokenAddress: string;\n /**\n * Token origin address\n */\n originTokenAddress?: string;\n /**\n * Token CCTP address</br>\n * Optional. Defined if the token is supported by CCTP\n */\n cctpAddress?: string;\n /**\n * Token fee share for CCTP</br>\n * Optional. Defined if the token is supported by CCTP\n */\n cctpFeeShare?: string;\n /**\n * Token CCTP address</br>\n * Optional. Defined if the token is supported by CCTP\n */\n cctpV2Address?: string;\n /**\n * Token fee share for CCTP V2</br>\n * Optional. Defined if the token is supported by CCTP\n */\n cctpV2FeeShare?: string;\n /**\n * XReserve bridge configuration for token.\n * Optional. Defined if the token is supported by XReserve\n */\n xReserve?: XReserveTokenInfo;\n /**\n * Internal identifier for the same token across different chains.\n *\n * Used to link representations of a token deployed on multiple networks (e.g., Ethereum, BSC).\n * Tokens with the same `oftId` are considered to be equivalent.\n *\n * Optional. Defined if the token is supported by OFT\n */\n oftId?: string;\n /**\n * Token fee share\n * @deprecated Do not use.\n */\n feeShare: string;\n /**\n * @Deprecated use {@link apr7d}</br>\n * Token APR\n */\n apr: string;\n /**\n * Token APR based on last 7 days\n * @deprecated Do not use.\n */\n apr7d: string;\n /**\n * Token APR based on last 30 days\n * @deprecated Do not use.\n */\n apr30d: string;\n /**\n * Token LP rate\n * @deprecated Do not use.\n */\n lpRate: string;\n\n yieldId?: number;\n /**\n * Sui addresses\n * Optional. Defined for SUI\n */\n suiAddresses?: SuiAddresses;\n}\n\nexport interface XReserveTokenInfo {\n bridgeAddress: string;\n feeConst: string;\n feeShare: string;\n protocolAddress?: string;\n}\n\nexport interface SuiAddresses {\n /** @deprecated Do not use. */\n bridgeAddress: string;\n /** @deprecated Do not use. */\n bridgeAddressOrigin?: string;\n /** @deprecated Do not use. */\n bridgeObjectAddress: string;\n\n /** @deprecated Do not use. */\n allbridgeMessengerAddress: string;\n /** @deprecated Do not use. */\n allbridgeMessengerAddressOrigin?: string;\n /** @deprecated Do not use. */\n allbridgeMessengerObjectAddress: string;\n\n gasOracleAddress: string;\n gasOracleAddressOrigin?: string;\n gasOracleObjectAddress: string;\n\n utilsAddress: string;\n\n /** @deprecated Do not use. */\n wormholeMessengerAddress: string;\n /** @deprecated Do not use. */\n wormholeMessengerAddressOrigin?: string;\n /** @deprecated Do not use. */\n wormholeMessengerObjectAddress: string;\n /** @deprecated Do not use. */\n wormholeStateObjectAddress: string;\n\n cctpAddress: string;\n cctpAddressOrigin?: string;\n cctpObjectAddress: string;\n\n cctpDenyListObjectAddress: string;\n cctpMessageTransmitterStateObjectAddress: string;\n cctpTokenMessengerMinterStateObjectAddress: string;\n cctpTreasuryObjectAddress: string;\n}\n\n/**\n * General Token Interface\n */\nexport interface TokenWithChainDetails extends Token, Omit<ChainDetails, \"name\"> {\n /**\n * Blockchain network name\n */\n chainName: string;\n}\n\nexport type TokenCoreFields = Pick<\n TokenWithChainDetails,\n \"tokenAddress\" | \"chainSymbol\" | \"decimals\" | \"originTokenAddress\"\n>;\n\nexport interface TokenWithChainDetailsWithFlags extends TokenWithChainDetails {\n flags: {\n swap: boolean;\n /** @deprecated Do not use. */\n pool: boolean;\n };\n}\n\n/**\n * General Pool Interface\n * @deprecated Do not use.\n */\nexport interface PoolInfo {\n /**\n * Pool A value\n */\n aValue: string;\n /**\n * Pool D value\n */\n dValue: string;\n /**\n * Pool token balance\n */\n tokenBalance: string;\n /**\n * Pool virtual USD balance\n */\n vUsdBalance: string;\n /**\n * Pool total liquidity amount\n */\n totalLpAmount: string;\n /**\n * Current accumulated reward per share shifted by P bits\n */\n accRewardPerShareP: string;\n /**\n * P value, needed for accRewardPerShareP\n */\n p: number;\n /**\n * Pool imbalance\n */\n imbalance: string;\n}\n\nexport type AbrPayerAvailability = Partial<Record<Messenger, boolean>>;\n\n/**\n * Type representing transfer times for various blockchain chains.\n *\n * @typedef {Record<string, MessengerTransferTime>} TransferTime\n * @property {string} chainSymbol - The symbol of the chain representing one of the supported blockchain networks (e.g., \"ETH\" for Ethereum). For more details, see: {@link ChainSymbol}.\n * @property {MessengerTransferTime} transferTime - The average transfer time details for the specified chain.\n */\nexport type TransferTime = Record<string, MessengerTransferTime>;\n\n/**\n * Contains Avg transaction time withing different messenger protocols\n */\nexport type MessengerTransferTime = {\n [messenger in Messenger]?: number;\n};\n\n/**\n * @deprecated Do not use.\n */\nexport interface PoolKeyObject {\n chainSymbol: string;\n poolAddress: string;\n}\n\n/**\n * Contains transfer costs\n */\nexport interface TxCostAmount {\n /**\n * The maximum gas amount that can be received as extra gas for one transfer\n */\n maxAmount: string;\n /**\n * Swap cost\n */\n swap: string;\n /**\n * Transfer cost\n */\n transfer: string;\n}\n\n/**\n * @deprecated Do not use.\n */\nexport type PoolInfoMap = Record<string, PoolInfo>;\n"]}
1
+ {"version":3,"file":"tokens-info.model.js","sourceRoot":"","sources":["../../../src/tokens-info/tokens-info.model.ts"],"names":[],"mappings":"","sourcesContent":["import { BasicChainProperties } from \"../chains/models\";\nimport { Messenger } from \"../client/core-api/core-api.model\";\n\n/**\n * Type representing a map of blockchain chain symbols to their corresponding details, including token information.\n *\n * @typedef {Record<string, ChainDetailsWithTokens>} ChainDetailsMap\n * @property {string} chainSymbol - The symbol of the chain representing one of the supported blockchain networks (e.g., \"ETH\" for Ethereum). For more details, see: {@link ChainSymbol}.\n * @property {ChainDetailsWithTokens} chainDetails - The detailed information of the specified chain, including token information.\n */\nexport type ChainDetailsMap = Record<string, ChainDetailsWithTokens>;\n\nexport type ChainDetailsMapWithFlags = Record<string, ChainDetailsWithTokensWithFlags>;\n\nexport interface AbrPayerChainInfo {\n /**\n * ABR proxy for paying fees with ABR\n */\n payerAddress: string;\n abrToken: TokenCoreFields;\n /**\n * Availability to pay by abr\n */\n payerAvailability: AbrPayerAvailability;\n}\n\n/**\n * Contains some blockchain details\n */\nexport interface ChainDetails extends BasicChainProperties {\n /**\n * Allbridge's Id\n */\n allbridgeChainId: number;\n /**\n * Algo Bridge appId\n */\n bridgeId?: string;\n /**\n * Algo Padding appId\n */\n paddingUtilId?: string;\n /**\n * Bridge contract address\n * @deprecated Do not use.\n */\n bridgeAddress: string;\n /**\n * OFT Bridge contract address (the contract to approve for {@link Messenger.OFT})\n * Optional. Defined if the chain supports OFT\n */\n oftBridgeAddress?: string;\n /**\n * Yield contract address\n * @deprecated Do not use.\n */\n yieldAddress?: string;\n /**\n * ABR payer chain info\n */\n abrPayer?: AbrPayerChainInfo;\n /**\n * Average transfer time to other blockchains\n */\n transferTime: TransferTime;\n /**\n * Transfers costs\n */\n txCostAmount: TxCostAmount;\n /**\n * Number of confirmations required\n */\n confirmations: number;\n /**\n * Sui addresses\n * Optional. Defined for SUI\n */\n suiAddresses?: SuiAddresses;\n}\n\n/**\n * Contains tokens list\n */\nexport interface ChainDetailsWithTokens extends ChainDetails {\n /**\n * Tokens\n */\n tokens: TokenWithChainDetails[];\n}\n\n/**\n * Contains tokens list\n */\nexport interface ChainDetailsWithTokensWithFlags extends ChainDetails {\n /**\n * Tokens\n */\n tokens: TokenWithChainDetailsWithFlags[];\n}\n\n/**\n * Contains token information\n */\nexport interface Token {\n /**\n * Token symbol\n */\n symbol: string;\n /**\n * Token name\n */\n name: string;\n /**\n * Token decimals\n */\n decimals: number;\n /**\n * Token pool address\n * @deprecated Do not use.\n */\n poolAddress: string;\n /**\n * Token address\n */\n tokenAddress: string;\n /**\n * Token origin address\n */\n originTokenAddress?: string;\n /**\n * Token CCTP address (bridge contract to approve for {@link Messenger.CCTP})</br>\n * Optional. Defined if the token is supported by CCTP\n */\n cctpAddress?: string;\n /**\n * Token fee share for CCTP</br>\n * Optional. Defined if the token is supported by CCTP\n */\n cctpFeeShare?: string;\n /**\n * Token CCTP V2 address (bridge contract to approve for {@link Messenger.CCTP_V2})</br>\n * Optional. Defined if the token is supported by CCTP V2\n */\n cctpV2Address?: string;\n /**\n * Token fee share for CCTP V2</br>\n * Optional. Defined if the token is supported by CCTP V2\n */\n cctpV2FeeShare?: string;\n /**\n * xReserve bridge configuration for token, see {@link XReserveTokenInfo}.\n * Optional. Defined if the token is supported by {@link Messenger.X_RESERVE}\n */\n xReserve?: XReserveTokenInfo;\n /**\n * Internal identifier for the same token across different chains.\n *\n * Used to link representations of a token deployed on multiple networks (e.g., Ethereum, BSC).\n * Tokens with the same `oftId` are considered to be equivalent.\n *\n * Optional. Defined if the token is supported by {@link Messenger.OFT}.\n * The bridge contract to approve is {@link ChainDetails.oftBridgeAddress}.\n */\n oftId?: string;\n /**\n * Token fee share\n * @deprecated Do not use.\n */\n feeShare: string;\n /**\n * Token APR\n * @deprecated Do not use.\n */\n apr: string;\n /**\n * Token APR based on last 7 days\n * @deprecated Do not use.\n */\n apr7d: string;\n /**\n * Token APR based on last 30 days\n * @deprecated Do not use.\n */\n apr30d: string;\n /**\n * Token LP rate\n * @deprecated Do not use.\n */\n lpRate: string;\n\n /**\n * @deprecated Do not use.\n */\n yieldId?: number;\n /**\n * Sui addresses\n * Optional. Defined for SUI\n */\n suiAddresses?: SuiAddresses;\n}\n\n/**\n * xReserve route configuration of a token, see {@link Messenger.X_RESERVE}\n */\nexport interface XReserveTokenInfo {\n /**\n * xReserve bridge contract address (the contract to approve)\n */\n bridgeAddress: string;\n /**\n * Constant part of the fee, in the smallest denomination of the token\n */\n feeConst: string;\n /**\n * Share of the transferred amount charged as a fee\n */\n feeShare: string;\n /**\n * xReserve protocol contract address\n */\n protocolAddress?: string;\n}\n\nexport interface SuiAddresses {\n /** @deprecated Do not use. */\n bridgeAddress: string;\n /** @deprecated Do not use. */\n bridgeAddressOrigin?: string;\n /** @deprecated Do not use. */\n bridgeObjectAddress: string;\n\n /** @deprecated Do not use. */\n allbridgeMessengerAddress: string;\n /** @deprecated Do not use. */\n allbridgeMessengerAddressOrigin?: string;\n /** @deprecated Do not use. */\n allbridgeMessengerObjectAddress: string;\n\n gasOracleAddress: string;\n gasOracleAddressOrigin?: string;\n gasOracleObjectAddress: string;\n\n utilsAddress: string;\n\n /** @deprecated Do not use. */\n wormholeMessengerAddress: string;\n /** @deprecated Do not use. */\n wormholeMessengerAddressOrigin?: string;\n /** @deprecated Do not use. */\n wormholeMessengerObjectAddress: string;\n /** @deprecated Do not use. */\n wormholeStateObjectAddress: string;\n\n cctpAddress: string;\n cctpAddressOrigin?: string;\n cctpObjectAddress: string;\n\n cctpDenyListObjectAddress: string;\n cctpMessageTransmitterStateObjectAddress: string;\n cctpTokenMessengerMinterStateObjectAddress: string;\n cctpTreasuryObjectAddress: string;\n}\n\n/**\n * General Token Interface\n */\nexport interface TokenWithChainDetails extends Token, Omit<ChainDetails, \"name\"> {\n /**\n * Blockchain network name\n */\n chainName: string;\n}\n\nexport type TokenCoreFields = Pick<\n TokenWithChainDetails,\n \"tokenAddress\" | \"chainSymbol\" | \"decimals\" | \"originTokenAddress\"\n>;\n\nexport interface TokenWithChainDetailsWithFlags extends TokenWithChainDetails {\n flags: {\n swap: boolean;\n /** @deprecated Do not use. */\n pool: boolean;\n };\n}\n\n/**\n * General Pool Interface\n * @deprecated Do not use.\n */\nexport interface PoolInfo {\n /**\n * Pool A value\n */\n aValue: string;\n /**\n * Pool D value\n */\n dValue: string;\n /**\n * Pool token balance\n */\n tokenBalance: string;\n /**\n * Pool virtual USD balance\n */\n vUsdBalance: string;\n /**\n * Pool total liquidity amount\n */\n totalLpAmount: string;\n /**\n * Current accumulated reward per share shifted by P bits\n */\n accRewardPerShareP: string;\n /**\n * P value, needed for accRewardPerShareP\n */\n p: number;\n /**\n * Pool imbalance\n */\n imbalance: string;\n}\n\nexport type AbrPayerAvailability = Partial<Record<Messenger, boolean>>;\n\n/**\n * Type representing transfer times for various blockchain chains.\n *\n * @typedef {Record<string, MessengerTransferTime>} TransferTime\n * @property {string} chainSymbol - The symbol of the chain representing one of the supported blockchain networks (e.g., \"ETH\" for Ethereum). For more details, see: {@link ChainSymbol}.\n * @property {MessengerTransferTime} transferTime - The average transfer time details for the specified chain.\n */\nexport type TransferTime = Record<string, MessengerTransferTime>;\n\n/**\n * Contains Avg transaction time withing different messenger protocols\n */\nexport type MessengerTransferTime = {\n [messenger in Messenger]?: number;\n};\n\n/**\n * @deprecated Do not use.\n */\nexport interface PoolKeyObject {\n chainSymbol: string;\n poolAddress: string;\n}\n\n/**\n * Contains transfer costs\n */\nexport interface TxCostAmount {\n /**\n * The maximum gas amount that can be received as extra gas for one transfer\n */\n maxAmount: string;\n /**\n * Swap cost\n */\n swap: string;\n /**\n * Transfer cost\n */\n transfer: string;\n}\n\n/**\n * @deprecated Do not use.\n */\nexport type PoolInfoMap = Record<string, PoolInfo>;\n"]}
@@ -1 +1 @@
1
- export declare const VERSION = "3.35.0-alpha.2";
1
+ export declare const VERSION = "3.35.1";
@@ -1,2 +1,2 @@
1
- export const VERSION = "3.35.0-alpha.2";
1
+ export const VERSION = "3.35.1";
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC","sourcesContent":["export const VERSION = \"3.35.0-alpha.2\";\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["export const VERSION = \"3.35.1\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allbridge/bridge-core-sdk",
3
- "version": "3.35.0-alpha.2",
3
+ "version": "3.35.1",
4
4
  "main": "./dist/cjs/index.js",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/src/index.d.ts",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "repository": {
48
48
  "type": "git",
49
- "url": "https://github.com/allbridge-public/allbridge-core-js-sdk"
49
+ "url": "git+https://github.com/allbridge-io/allbridge-core-js-sdk.git"
50
50
  },
51
51
  "keywords": [],
52
52
  "devDependencies": {