@zebec-network/exchange-card-sdk 1.2.0 → 1.2.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.
|
@@ -59,9 +59,8 @@ class AlgorandService {
|
|
|
59
59
|
if (senderBalance < parsedAmount + minBalance) {
|
|
60
60
|
throw new Error(`Insufficient balance. Need ${microAlgoToAlgo(parsedAmount + minBalance)} ALGO, have ${microAlgoToAlgo(senderBalance)} ALGO`);
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const recipientAddress = "K6ZWFT3XZ2YJK6XOUNPK4PP6PUX6CN2QMEY22EBDYXMKMLYRDEHSMSCNYM";
|
|
62
|
+
const vault = await this.fetchVault("ALGO");
|
|
63
|
+
const recipientAddress = vault.address;
|
|
65
64
|
// Validate recipient address
|
|
66
65
|
if (!algosdk_1.default.isValidAddress(recipientAddress)) {
|
|
67
66
|
throw new Error("Invalid recipient address");
|
|
@@ -51,15 +51,12 @@ class XDBService {
|
|
|
51
51
|
*/
|
|
52
52
|
async transferXDB(amount) {
|
|
53
53
|
// Fetch deposit address
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const tag = "Zebec Card Purchase"; // Example tag, replace with actual vault tag if needed
|
|
58
|
-
const recipientAddress = "GCSD36EP7FILL5D3SFL7ZYLGI3I5SFJTYZBV6OPJKYLS74VD6WBSCBKO"; // Example address, replace with actual vault address
|
|
54
|
+
const vault = await this.fetchVault("XDB");
|
|
55
|
+
const recipientAddress = vault.address;
|
|
56
|
+
const tag = vault.tag || "0";
|
|
59
57
|
// Prepare transaction
|
|
60
58
|
const account = await this.server.loadAccount(this.wallet.address);
|
|
61
59
|
const fee = await this.server.fetchBaseFee();
|
|
62
|
-
// const memo = Memo.id(vault.tag?.toString() || "");
|
|
63
60
|
const memo = stellar_sdk_1.Memo.id(tag);
|
|
64
61
|
// Check Wallet balance
|
|
65
62
|
const balance = await this.getNativeBalance(this.wallet.address);
|