@defuse-protocol/intents-sdk 0.67.2 → 0.68.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.
- package/dist/src/bridges/poa-bridge/poa-bridge-utils.cjs +4 -2
- package/dist/src/bridges/poa-bridge/poa-bridge-utils.js +4 -2
- package/dist/src/bridges/poa-bridge/poa-bridge.cjs +1 -1
- package/dist/src/bridges/poa-bridge/poa-bridge.js +1 -1
- package/dist/src/sdk.cjs +2 -0
- package/dist/src/sdk.js +2 -0
- package/dist/src/shared-types.d.cts +1 -0
- package/dist/src/shared-types.d.ts +1 -0
- package/package.json +2 -2
|
@@ -43,7 +43,8 @@ const caip2Mapping = {
|
|
|
43
43
|
[require_caip2.Chains.Litecoin]: "ltc:mainnet",
|
|
44
44
|
[require_caip2.Chains.Starknet]: "starknet:mainnet",
|
|
45
45
|
[require_caip2.Chains.Aleo]: "aleo:mainnet",
|
|
46
|
-
[require_caip2.Chains.Dash]: "dash:mainnet"
|
|
46
|
+
[require_caip2.Chains.Dash]: "dash:mainnet",
|
|
47
|
+
[require_caip2.Chains.Plasma]: "eth:9745"
|
|
47
48
|
};
|
|
48
49
|
function toPoaNetwork(caip2) {
|
|
49
50
|
if (caip2Mapping[caip2] == null) throw new Error(`Unsupported POA Bridge chain = ${caip2}`);
|
|
@@ -69,7 +70,8 @@ const tokenPrefixMapping = {
|
|
|
69
70
|
ltc: require_caip2.Chains.Litecoin,
|
|
70
71
|
starknet: require_caip2.Chains.Starknet,
|
|
71
72
|
aleo: require_caip2.Chains.Aleo,
|
|
72
|
-
dash: require_caip2.Chains.Dash
|
|
73
|
+
dash: require_caip2.Chains.Dash,
|
|
74
|
+
plasma: require_caip2.Chains.Plasma
|
|
73
75
|
};
|
|
74
76
|
function contractIdToCaip2(contractId) {
|
|
75
77
|
for (const [prefix, caip2] of Object.entries(tokenPrefixMapping)) if (contractId.startsWith(`${prefix}.`) || contractId.startsWith(`${prefix}-`)) return caip2;
|
|
@@ -42,7 +42,8 @@ const caip2Mapping = {
|
|
|
42
42
|
[Chains.Litecoin]: "ltc:mainnet",
|
|
43
43
|
[Chains.Starknet]: "starknet:mainnet",
|
|
44
44
|
[Chains.Aleo]: "aleo:mainnet",
|
|
45
|
-
[Chains.Dash]: "dash:mainnet"
|
|
45
|
+
[Chains.Dash]: "dash:mainnet",
|
|
46
|
+
[Chains.Plasma]: "eth:9745"
|
|
46
47
|
};
|
|
47
48
|
function toPoaNetwork(caip2) {
|
|
48
49
|
if (caip2Mapping[caip2] == null) throw new Error(`Unsupported POA Bridge chain = ${caip2}`);
|
|
@@ -68,7 +69,8 @@ const tokenPrefixMapping = {
|
|
|
68
69
|
ltc: Chains.Litecoin,
|
|
69
70
|
starknet: Chains.Starknet,
|
|
70
71
|
aleo: Chains.Aleo,
|
|
71
|
-
dash: Chains.Dash
|
|
72
|
+
dash: Chains.Dash,
|
|
73
|
+
plasma: Chains.Plasma
|
|
72
74
|
};
|
|
73
75
|
function contractIdToCaip2(contractId) {
|
|
74
76
|
for (const [prefix, caip2] of Object.entries(tokenPrefixMapping)) if (contractId.startsWith(`${prefix}.`) || contractId.startsWith(`${prefix}-`)) return caip2;
|
|
@@ -90,7 +90,7 @@ var PoaBridge = class {
|
|
|
90
90
|
const isXrp = assetInfo.contractId === "xrp.omft.near";
|
|
91
91
|
try {
|
|
92
92
|
const accountInfo = await _defuse_protocol_internal_utils.xrpl.httpClient.getAccountInfo(args.destinationAddress, xrplConfig);
|
|
93
|
-
if (accountInfo.account_flags.requireDestinationTag) throw new require_errors$1.XrplDestinationTagRequiredError(args.destinationAddress);
|
|
93
|
+
if (accountInfo.account_flags.requireDestinationTag && !args.destinationMemo) throw new require_errors$1.XrplDestinationTagRequiredError(args.destinationAddress);
|
|
94
94
|
if (accountInfo.account_flags.depositAuth) throw new require_errors$1.XrplDepositAuthEnabledError(args.destinationAddress);
|
|
95
95
|
} catch (error) {
|
|
96
96
|
if (!(isXrp && error instanceof _defuse_protocol_internal_utils.xrpl.httpClient.XrplAccountNotFundedError)) throw error;
|
|
@@ -88,7 +88,7 @@ var PoaBridge = class {
|
|
|
88
88
|
const isXrp = assetInfo.contractId === "xrp.omft.near";
|
|
89
89
|
try {
|
|
90
90
|
const accountInfo = await xrpl.httpClient.getAccountInfo(args.destinationAddress, xrplConfig);
|
|
91
|
-
if (accountInfo.account_flags.requireDestinationTag) throw new XrplDestinationTagRequiredError(args.destinationAddress);
|
|
91
|
+
if (accountInfo.account_flags.requireDestinationTag && !args.destinationMemo) throw new XrplDestinationTagRequiredError(args.destinationAddress);
|
|
92
92
|
if (accountInfo.account_flags.depositAuth) throw new XrplDepositAuthEnabledError(args.destinationAddress);
|
|
93
93
|
} catch (error) {
|
|
94
94
|
if (!(isXrp && error instanceof xrpl.httpClient.XrplAccountNotFundedError)) throw error;
|
package/dist/src/sdk.cjs
CHANGED
|
@@ -178,6 +178,7 @@ var IntentsSDK = class {
|
|
|
178
178
|
assetId: args.withdrawalParams.assetId,
|
|
179
179
|
amount: actualAmount,
|
|
180
180
|
destinationAddress: args.withdrawalParams.destinationAddress,
|
|
181
|
+
destinationMemo: args.withdrawalParams.destinationMemo,
|
|
181
182
|
feeEstimation: args.feeEstimation,
|
|
182
183
|
routeConfig: args.withdrawalParams.routeConfig,
|
|
183
184
|
logger: args.logger
|
|
@@ -221,6 +222,7 @@ var IntentsSDK = class {
|
|
|
221
222
|
feeEstimation: fee,
|
|
222
223
|
routeConfig: args.withdrawalParams.routeConfig,
|
|
223
224
|
logger: args.logger,
|
|
225
|
+
destinationMemo: args.withdrawalParams.destinationMemo,
|
|
224
226
|
skipMinAmountValidation: args.withdrawalParams.amount === 0n && args.withdrawalParams.feeInclusive === false
|
|
225
227
|
});
|
|
226
228
|
return fee;
|
package/dist/src/sdk.js
CHANGED
|
@@ -176,6 +176,7 @@ var IntentsSDK = class {
|
|
|
176
176
|
assetId: args.withdrawalParams.assetId,
|
|
177
177
|
amount: actualAmount,
|
|
178
178
|
destinationAddress: args.withdrawalParams.destinationAddress,
|
|
179
|
+
destinationMemo: args.withdrawalParams.destinationMemo,
|
|
179
180
|
feeEstimation: args.feeEstimation,
|
|
180
181
|
routeConfig: args.withdrawalParams.routeConfig,
|
|
181
182
|
logger: args.logger
|
|
@@ -219,6 +220,7 @@ var IntentsSDK = class {
|
|
|
219
220
|
feeEstimation: fee,
|
|
220
221
|
routeConfig: args.withdrawalParams.routeConfig,
|
|
221
222
|
logger: args.logger,
|
|
223
|
+
destinationMemo: args.withdrawalParams.destinationMemo,
|
|
222
224
|
skipMinAmountValidation: args.withdrawalParams.amount === 0n && args.withdrawalParams.feeInclusive === false
|
|
223
225
|
});
|
|
224
226
|
return fee;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defuse-protocol/intents-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.68.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"valibot": "^1.0.0",
|
|
51
51
|
"viem": "^2.0.0",
|
|
52
52
|
"@defuse-protocol/contract-types": "0.6.4",
|
|
53
|
-
"@defuse-protocol/internal-utils": "0.
|
|
53
|
+
"@defuse-protocol/internal-utils": "0.35.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@ton/core": "^0.60.0",
|