stackswap-front-api-test-02 1.1.50 → 1.1.51

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stackswap-front-api-test-02",
3
- "version": "1.1.50",
3
+ "version": "1.1.51",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "start": "tsc -b tsconfig.build.json --watch --verbose",
package/src/index.ts CHANGED
@@ -79,10 +79,13 @@ export class StackswapMainnetAPI implements StackswapAPI{
79
79
  swapManager: SwapManager;
80
80
  groupFarmManager: GroupFarmManager;
81
81
  bridgeManager:BridgeManager;
82
+ fixedSenderAddress: string|null;
83
+
84
+ constructor(farm_end_cycle: string = '', fixedSenderAddress: string|null = null, api_url: string| null) {
85
+ this.fixedSenderAddress = fixedSenderAddress;
82
86
 
83
- constructor(farm_end_cycle: string = '') {
84
87
  this.config = new StackswapMainetConfig(farm_end_cycle)
85
- this.network = new StacksMainnet({url: this.config.STACKS_API_URL()});
88
+ this.network = new StacksMainnet({url: api_url? api_url : this.config.STACKS_API_URL()});
86
89
  this.senderAdderss = this.config.NULL_ADDRESS();
87
90
  this.getConnectedWallet(((_err, _result) => {
88
91
  }));
@@ -106,7 +109,7 @@ export class StackswapMainnetAPI implements StackswapAPI{
106
109
  }
107
110
 
108
111
  getSenderAddress() : string {
109
- return this.senderAdderss;
112
+ return this.fixedSenderAddress? this.fixedSenderAddress : this.senderAdderss;
110
113
  }
111
114
 
112
115
 
@@ -204,8 +207,8 @@ export class StackswapMainnetAPI implements StackswapAPI{
204
207
 
205
208
  export class StackswapTestnetAPI extends StackswapMainnetAPI {
206
209
 
207
- constructor(farm_end_cycle: string = '99999') {
208
- super(farm_end_cycle);
210
+ constructor(farm_end_cycle: string = '99999', fixedSenderAddress: string|null = null, api_url: string| null) {
211
+ super(farm_end_cycle, fixedSenderAddress, api_url);
209
212
  this.config = new StackswapTestnetConfig(farm_end_cycle);
210
213
  this.network = new StacksTestnet();
211
214
  }
@@ -215,8 +218,8 @@ export class StackswapTestnetAPI extends StackswapMainnetAPI {
215
218
 
216
219
  export class StackswapDevnetAPI extends StackswapMainnetAPI {
217
220
 
218
- constructor(farm_end_cycle: string = '99999') {
219
- super(farm_end_cycle);
221
+ constructor(farm_end_cycle: string = '99999', fixedSenderAddress: string|null = null, api_url: string| null) {
222
+ super(farm_end_cycle, fixedSenderAddress, api_url);
220
223
  this.config = new StackswapDevnetConfig(farm_end_cycle);
221
224
  this.network = new StacksMocknet();
222
225
  }
@@ -225,8 +228,8 @@ export class StackswapDevnetAPI extends StackswapMainnetAPI {
225
228
 
226
229
  export class StackswapConfigAPI extends StackswapMainnetAPI {
227
230
 
228
- constructor(config: StackswapConfig, farm_end_cycle: string = '99999') {
229
- super(farm_end_cycle);
231
+ constructor(config: StackswapConfig, farm_end_cycle: string = '99999', fixedSenderAddress: string|null = null, api_url: string| null) {
232
+ super(farm_end_cycle,fixedSenderAddress, api_url);
230
233
  this.config = config;
231
234
  }
232
235