@flashbacktech/flashbackclient 0.1.66 → 0.1.67

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.
@@ -56,10 +56,10 @@ export declare class FlashOnStellarClientV2 {
56
56
  */
57
57
  getVersion(): Promise<number>;
58
58
  /**
59
- * Sends a transaction to the Stellar network
60
- * @param xdrToSend - The XDR-encoded transaction to send
61
- * @returns Promise resolving to the sent transaction
62
- */
59
+ * Sends a transaction to the Stellar network
60
+ * @param xdrToSend - The XDR-encoded transaction to send
61
+ * @returns Promise resolving to the sent transaction
62
+ */
63
63
  sendTransaction: (xdrToSend: string, bDebug?: boolean) => Promise<any>;
64
64
  /**
65
65
  * Gets the owner address of the contract
@@ -88,6 +88,7 @@ export declare class FlashOnStellarClientV2 {
88
88
  * @returns Promise resolving to the update result
89
89
  */
90
90
  setStableAssetAddress(stable_asset_address: string): Promise<boolean>;
91
+ changeTrust: (source: string, issuerPublikKey: string, asset_ticker: string, bRemove: boolean) => Promise<void>;
91
92
  /**
92
93
  * Gets system statistics
93
94
  * @returns Promise resolving to system statistics
@@ -8,6 +8,7 @@ const bucket_1 = require("./bucket");
8
8
  const deal_1 = require("./deal");
9
9
  const funding_1 = require("./funding");
10
10
  const decorator_1 = require("../utils/decorator");
11
+ const wallet_1 = require("../wallet");
11
12
  /**
12
13
  * Main client class for interacting with the FlashOnStellar V2 system
13
14
  * This client provides methods for managing providers, consumers, buckets, and deals
@@ -27,13 +28,18 @@ class FlashOnStellarClientV2 {
27
28
  */
28
29
  constructor(config) {
29
30
  /**
30
- * Sends a transaction to the Stellar network
31
- * @param xdrToSend - The XDR-encoded transaction to send
32
- * @returns Promise resolving to the sent transaction
33
- */
31
+ * Sends a transaction to the Stellar network
32
+ * @param xdrToSend - The XDR-encoded transaction to send
33
+ * @returns Promise resolving to the sent transaction
34
+ */
34
35
  this.sendTransaction = async (xdrToSend, bDebug = false) => {
35
36
  return (0, transaction_1.sendTransaction)(this.getContext(), xdrToSend, bDebug);
36
37
  };
38
+ this.changeTrust = async (source, issuerPublikKey, asset_ticker, bRemove) => {
39
+ const xdr = await (0, wallet_1.changeTrustXDR)(this.network, source, issuerPublikKey, asset_ticker, bRemove);
40
+ const signedXDR = await this.signTransaction(xdr);
41
+ return this.sendTransaction(signedXDR);
42
+ };
37
43
  this.registerAsConsumerProvider = (0, decorator_1.withSignature)(async (address, description) => {
38
44
  await (0, transaction_1.executeMultiWalletTransactions)(this.getContext(), address, [
39
45
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.1.66",
3
+ "version": "0.1.67",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"