Skip to content

Commit

Permalink
AcreSDK: current position (#233)
Browse files Browse the repository at this point in the history
Closes: #149 
---

### SDK: Return current position

---

SDK exposes the current staker's balances with two values:
stBTC shares balance (Obtained from: stBTC.balanceOf(address))
tBTC assets balance (Obtained from: stBTC.assetsBalanceOf(address) -
depends on #221)
  • Loading branch information
r-czajkowski authored Mar 5, 2024
2 parents 10a62b2 + 0618fef commit 8226f97
Show file tree
Hide file tree
Showing 9 changed files with 1,848 additions and 2 deletions.
3 changes: 3 additions & 0 deletions sdk/src/lib/contracts/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { TBTCDepositor } from "./tbtc-depositor"
import { StBTC } from "./stbtc"

export * from "./tbtc-depositor"
export * from "./chain-identifier"
export * from "./stbtc"
export * from "./depositor-proxy"

/**
* Represents all contracts that allow interaction with the Acre network.
*/
export type AcreContracts = {
tbtcDepositor: TBTCDepositor
stBTC: StBTC
}
15 changes: 15 additions & 0 deletions sdk/src/lib/contracts/stbtc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { ChainIdentifier } from "./chain-identifier"

export interface StBTC {
/**
* @param identifier The generic chain identifier.
* @returns Value of the basis for calculating final BTC balance.
*/
balanceOf(identifier: ChainIdentifier): Promise<bigint>

/**
* @param identifier The generic chain identifier.
* @returns Maximum withdraw value.
*/
assetsBalanceOf(identifier: ChainIdentifier): Promise<bigint>
}
Loading

0 comments on commit 8226f97

Please sign in to comment.