@zebec-network/exchange-card-sdk 1.8.1 → 1.8.2
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.
|
@@ -27,18 +27,20 @@ export class XRPLService {
|
|
|
27
27
|
if (!isValidAddress(walletAddress)) {
|
|
28
28
|
throw new Error("Invalid wallet address");
|
|
29
29
|
}
|
|
30
|
-
const
|
|
31
|
-
const destination = fetchVault.address;
|
|
30
|
+
const { address: destination, tag } = await this.fetchVault();
|
|
32
31
|
console.debug("destination:", destination);
|
|
32
|
+
console.debug("tag:", tag);
|
|
33
33
|
if (!isValidAddress(destination)) {
|
|
34
34
|
throw new Error("Invalid destination address");
|
|
35
35
|
}
|
|
36
|
+
const destinationTag = tag && tag !== "" ? parseInt(tag) : undefined;
|
|
36
37
|
const amountInDrops = xrpToDrops(params.amount);
|
|
37
38
|
const transaction = {
|
|
38
39
|
TransactionType: "Payment",
|
|
39
40
|
Account: walletAddress,
|
|
40
41
|
Destination: destination,
|
|
41
42
|
Amount: amountInDrops,
|
|
43
|
+
DestinationTag: destinationTag,
|
|
42
44
|
};
|
|
43
45
|
await this.client.connect();
|
|
44
46
|
try {
|
|
@@ -60,12 +62,13 @@ export class XRPLService {
|
|
|
60
62
|
if (!isValidAddress(walletAddress)) {
|
|
61
63
|
throw new Error("Invalid wallet address");
|
|
62
64
|
}
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
console.
|
|
65
|
+
const { address: destination, tag } = await this.fetchVault();
|
|
66
|
+
console.debug("destination:", destination);
|
|
67
|
+
console.debug("tag:", tag);
|
|
66
68
|
if (!isValidAddress(destination)) {
|
|
67
69
|
throw new Error("Invalid destination address");
|
|
68
70
|
}
|
|
71
|
+
const destinationTag = tag && tag !== "" ? parseInt(tag) : undefined;
|
|
69
72
|
const transaction = {
|
|
70
73
|
TransactionType: "Payment",
|
|
71
74
|
Account: walletAddress,
|
|
@@ -75,6 +78,7 @@ export class XRPLService {
|
|
|
75
78
|
value: params.amount,
|
|
76
79
|
issuer: params.token.issuer,
|
|
77
80
|
},
|
|
81
|
+
DestinationTag: destinationTag,
|
|
78
82
|
};
|
|
79
83
|
await this.client.connect();
|
|
80
84
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zebec-network/exchange-card-sdk",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.2",
|
|
4
4
|
"description": "An sdk for purchasing silver card in zebec",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@near-js/transactions": "^2.5.1",
|
|
40
40
|
"@near-js/types": "^2.5.1",
|
|
41
41
|
"@near-js/utils": "^2.5.1",
|
|
42
|
-
"@stellar/stellar-sdk": "^
|
|
42
|
+
"@stellar/stellar-sdk": "^14.4.3",
|
|
43
43
|
"algosdk": "^3.4.0",
|
|
44
44
|
"axios": "^1.11.0",
|
|
45
45
|
"bignumber.js": "^9.3.1",
|