Skip to content

Commit

Permalink
Merge pull request #55 from fileverse/update-interfaces-core
Browse files Browse the repository at this point in the history
Update Interfaces
  • Loading branch information
nadeem-fileverse authored Apr 3, 2024
2 parents adeeed0 + 851baef commit ae0393a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/yellow-socks-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fileverse/heartbit-core": minor
---

Updated Interfaces
12 changes: 6 additions & 6 deletions packages/heartbit-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ async function main() {
const totalSupply = await coreSDK.getTotalHeartBitCountByHash({ hash });

// Get Total Mints By User
const address = "0x...ethaddress";
const account = "0x...ethaddress";
const mintsByUser = await coreSDK.getHeartBitByUser({
hash,
address,
account,
});
}
```
Expand All @@ -81,15 +81,15 @@ async function main() {
const endTime = 1706898251;
const hash = "ipfs://cid"; // unique identifier for token. eg ipfs://somecid
const apiKey = "hello";
const address = "0x...ethaddress";
const account = "0x...ethaddress";

// Mint HeartBit

await coreSDK.unSignedMintHeartBit({
startTime,
endTime,
hash,
account: address,
account,
apiKey,
});

Expand All @@ -100,7 +100,7 @@ async function main() {
// Get Total Mints By User
const mintsByUser = await coreSDK.getHeartBitByUser({
hash,
address,
account,
});
}
```
Expand All @@ -121,7 +121,7 @@ interface TotalHeartBitCountArgs {

interface HeartBitCountByUserArgs {
hash: string; // unique identifier for token. eg ipfs://somecid
address: string; // ethereum wallet address
account: string; // ethereum wallet address
}

interface MintHeartBitArgs {
Expand Down
4 changes: 2 additions & 2 deletions packages/heartbit-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ export class HeartBitCore {
}

async getHeartBitByUser(opts: HeartBitCountByUserArgs): Promise<number> {
const { address, hash } = opts;
const { account, hash } = opts;
const tokenId = await this.getHeartbitHashTokenMap(hash);

const balance = await this.#contract.balanceOf?.(address, tokenId);
const balance = await this.#contract.balanceOf?.(account, tokenId);
return parseInt(balance);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/heartbit-core/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface TotalHeartBitCountArgs {

export interface HeartBitCountByUserArgs {
hash: string;
address: string;
account: string;
}

export interface HeartBitCoreOptions {
Expand Down

0 comments on commit ae0393a

Please sign in to comment.