@flashbacktech/flashbackclient 0.1.65 → 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.
@@ -55,6 +55,12 @@ export declare class FlashOnStellarClientV2 {
55
55
  * @returns Promise resolving to the contract version
56
56
  */
57
57
  getVersion(): Promise<number>;
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
+ */
63
+ sendTransaction: (xdrToSend: string, bDebug?: boolean) => Promise<any>;
58
64
  /**
59
65
  * Gets the owner address of the contract
60
66
  * @returns Promise resolving to the owner address
@@ -82,6 +88,7 @@ export declare class FlashOnStellarClientV2 {
82
88
  * @returns Promise resolving to the update result
83
89
  */
84
90
  setStableAssetAddress(stable_asset_address: string): Promise<boolean>;
91
+ changeTrust: (source: string, issuerPublikKey: string, asset_ticker: string, bRemove: boolean) => Promise<void>;
85
92
  /**
86
93
  * Gets system statistics
87
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
@@ -26,6 +27,19 @@ class FlashOnStellarClientV2 {
26
27
  * @param config - Configuration options for the client
27
28
  */
28
29
  constructor(config) {
30
+ /**
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
+ */
35
+ this.sendTransaction = async (xdrToSend, bDebug = false) => {
36
+ return (0, transaction_1.sendTransaction)(this.getContext(), xdrToSend, bDebug);
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
+ };
29
43
  this.registerAsConsumerProvider = (0, decorator_1.withSignature)(async (address, description) => {
30
44
  await (0, transaction_1.executeMultiWalletTransactions)(this.getContext(), address, [
31
45
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.1.65",
3
+ "version": "0.1.67",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"