@zebec-network/exchange-card-sdk 1.1.6 → 1.1.8

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.
@@ -34,6 +34,15 @@ export declare class StellarService {
34
34
  address: string;
35
35
  tag?: string;
36
36
  }>;
37
+ /**
38
+ * Fetches the Vault address.
39
+ *
40
+ * @returns {Promise<string>} A promise that resolves to the Vault address.
41
+ */
42
+ fetchUSDCVault(): Promise<{
43
+ address: string;
44
+ tag?: string;
45
+ }>;
37
46
  /**
38
47
  * Purchases a card by transferring XDB tokens.
39
48
  *
@@ -66,5 +75,5 @@ export declare class StellarService {
66
75
  * @returns {Promise<string>} - A promise that resolves to the balance of the token.
67
76
  */
68
77
  getTokenBalance(wallet: string, asset: Asset): Promise<string>;
69
- getAsset(assetCode: string, usdcIssuer: string): Promise<Asset>;
78
+ getAsset(assetCode: string, assetIssuer: string): Promise<Asset>;
70
79
  }
@@ -42,6 +42,15 @@ class StellarService {
42
42
  const data = await this.apiService.fetchVault("XLM");
43
43
  return data;
44
44
  }
45
+ /**
46
+ * Fetches the Vault address.
47
+ *
48
+ * @returns {Promise<string>} A promise that resolves to the Vault address.
49
+ */
50
+ async fetchUSDCVault() {
51
+ const data = await this.apiService.fetchVault("xlm-usdc");
52
+ return data;
53
+ }
45
54
  /**
46
55
  * Purchases a card by transferring XDB tokens.
47
56
  *
@@ -112,7 +121,7 @@ class StellarService {
112
121
  */
113
122
  async transferUSDC(amount) {
114
123
  // Fetch deposit address
115
- const vault = await this.fetchVault();
124
+ const vault = await this.fetchUSDCVault();
116
125
  const accountAddress = await this.kit.getAddress();
117
126
  // Prepare transaction
118
127
  const account = await this.server.loadAccount(accountAddress.address);
@@ -196,8 +205,8 @@ class StellarService {
196
205
  return "0";
197
206
  }
198
207
  }
199
- async getAsset(assetCode, usdcIssuer) {
200
- return new stellar_sdk_1.Asset(assetCode, usdcIssuer);
208
+ async getAsset(assetCode, assetIssuer) {
209
+ return new stellar_sdk_1.Asset(assetCode, assetIssuer);
201
210
  }
202
211
  }
203
212
  exports.StellarService = StellarService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zebec-network/exchange-card-sdk",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "An sdk for purchasing silver card in zebec",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",