stackswap-front-api-test-02 1.2.8 → 1.2.9

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.2.8",
3
+ "version": "1.2.9",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "start": "tsc -b tsconfig.build.json --watch --verbose",
package/src/index.ts CHANGED
@@ -25,7 +25,6 @@ import {LBTCStakingManager} from "./stackswap/manager/lbtcstaking.manager";
25
25
  import {GroupFarmManager} from "./stackswap/manager/groupfarm.manager";
26
26
  import {BridgeManager} from "./stackswap/manager/bridge.manager";
27
27
  import {Farm3Manager} from "./stackswap/manager/farm3.manager";
28
- import {hexToCV} from "@stacks/transactions";
29
28
 
30
29
  export interface StackswapAPI {
31
30
  config : StackswapConfig;
@@ -117,9 +116,8 @@ export class StackswapMainnetAPI implements StackswapAPI{
117
116
  return this.fixedSenderAddress? this.fixedSenderAddress : this.senderAdderss;
118
117
  }
119
118
  getTenureBlockHeight: ()=> Promise<any> = async () => {
120
- const get_result = await axios.post(`${this.config.STACKS_API_URL()}/v2/contracts/call-read/SP3RF75T6HCZF0DG7ZATSHRBJ3Q17CBYMN1AEBR1Q/tenure-block/get-block-numbers`, {sender:"SP3RF75T6HCZF0DG7ZATSHRBJ3Q17CBYMN1AEBR1Q",arguments:[]}
121
- );
122
- return Number((hexToCV(get_result.data.result) as any).value);
119
+ const get_result = await axios.get(this.config.STACKS_API_URL() + '/v2/info');
120
+ return get_result.data.tenure_height;
123
121
  }
124
122
 
125
123
  getFastBlockHeight: ()=> Promise<any> = async () => {
@@ -137,7 +135,7 @@ export class StackswapMainnetAPI implements StackswapAPI{
137
135
  // @ts-ignore
138
136
  async getCurrentBlocks() {
139
137
  const get_result = await axios.get(this.config.STACKS_API_URL() + '/v2/info');
140
- return {block_height : get_result.data.stacks_tip_height, burn_block_height : get_result.data.burn_block_height, tenure_block_height : await this.getTenureBlockHeight()};
138
+ return {block_height : get_result.data.stacks_tip_height, burn_block_height : get_result.data.burn_block_height, tenure_block_height : get_result.data.tenure_height};
141
139
  }
142
140
 
143
141
  getQualifiedAddress(address: string): string {