Skip to content

Commit

Permalink
Merge pull request #144 from buidler-labs/hashgraph-sdk-bump
Browse files Browse the repository at this point in the history
DRAFT: Final `v0.8.2` bump & sunsetting
  • Loading branch information
victorholo authored Jun 20, 2024
2 parents 2f897c4 + ed286d7 commit 9be5471
Show file tree
Hide file tree
Showing 17 changed files with 7,282 additions and 22,249 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Important sunsetting notice 🌇
## This project is no longer maintained. If you wish to develop on the [hedera](https://docs.hedera.com/hedera) network, please look at the [official JS hedera-sdk](https://github.com/hashgraph/hedera-sdk-js). Thank you for all your support and interest. It was a good run! 👋

# Hashgraph Venin JS

![NodeJS/JsDOM/Browser tests](https://img.shields.io/github/workflow/status/buidler-labs/hashgraph-venin-js/test-nodejs-jsdom?style=flat-square&label=tests&color=yellowgreen)
Expand Down
3 changes: 3 additions & 0 deletions jest.common.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ module.exports = {
transform: {
"^.+\\.ts?$": "ts-jest",
},
moduleNameMapper: {
"^axios$": require.resolve("axios"),
},
};
2 changes: 1 addition & 1 deletion lib/core/CreatableEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export interface CreatableEntity<
> {
get name(): string;

createVia({ session: ApiSession }: ArgumentsForCreate): Promise<T>;
createVia({ session }: ArgumentsForCreate): Promise<T>;
}
3 changes: 1 addition & 2 deletions lib/core/StratoAddress.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AccountId, ContractId } from "@hashgraph/sdk";
import { AccountId, ContractId, Long } from "@hashgraph/sdk";
import { Interface } from "@ethersproject/abi";

import { HederaEntityId, LiveEntity } from "../live/LiveEntity";
Expand All @@ -9,7 +9,6 @@ import {
import { ApiSession } from "../ApiSession";
import { LiveAccount } from "../live/LiveAccount";
import { LiveContract } from "../live/LiveContract";
import Long from "long";

export class StratoAddress implements SolidityAddressable {
public readonly id: string;
Expand Down
2 changes: 1 addition & 1 deletion lib/live/LiveContract.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { EventEmitter } from "events";
import Long from "long";

import {
ContractCallQuery,
Expand All @@ -14,6 +13,7 @@ import {
Hbar,
Transaction,
TransactionId,
Long,
} from "@hashgraph/sdk";
import { FunctionFragment, Interface } from "@ethersproject/abi";
import BigNumber from "bignumber.js";
Expand Down
1 change: 1 addition & 0 deletions lib/static/create/Account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
Hbar,
Key,
PrivateKey,
Long,
} from "@hashgraph/sdk";
import { BigNumber } from "@hashgraph/sdk/lib/Transfer";
import Duration from "@hashgraph/sdk/lib/Duration";
Expand Down
4 changes: 1 addition & 3 deletions lib/static/create/BasicCreatableEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,5 @@ export abstract class BasicCreatableEntity<
{
protected constructor(public readonly name: string) {}

public abstract createVia({
session: ApiSession,
}: ArgumentsForCreate): Promise<T>;
public abstract createVia({ session }: ArgumentsForCreate): Promise<T>;
}
14 changes: 8 additions & 6 deletions lib/static/create/Token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Timestamp,
TokenCreateTransaction,
TokenSupplyType,
Long,
} from "@hashgraph/sdk";
import Duration from "@hashgraph/sdk/lib/Duration";

Expand Down Expand Up @@ -164,18 +165,19 @@ export class Token extends BasicCreatableEntity<LiveToken> {
const createTokenTransaction = new TokenCreateTransaction(
constructorArgs as unknown
);

let transactionFee: Hbar;
if(this.info.maxTransactionFee) {
transactionFee = this.info.maxTransactionFee instanceof Hbar
? this.info.maxTransactionFee
: new Hbar(this.info.maxTransactionFee)
if (this.info.maxTransactionFee) {
transactionFee =
this.info.maxTransactionFee instanceof Hbar
? this.info.maxTransactionFee
: new Hbar(this.info.maxTransactionFee);
} else if (session.defaults.tokenCreateTransactionFee > 0) {
transactionFee = Hbar.fromTinybars(
session.defaults.tokenCreateTransactionFee
);
}
if(transactionFee) {
if (transactionFee) {
createTokenTransaction.setMaxTransactionFee(transactionFee);
}
const creationReceipt = await session.execute(
Expand Down
2 changes: 1 addition & 1 deletion lib/static/create/Topic.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AccountId, Key, TopicCreateTransaction } from "@hashgraph/sdk";
import { AccountId, Key, TopicCreateTransaction, Long } from "@hashgraph/sdk";
import Duration from "@hashgraph/sdk/lib/Duration";

import { ArgumentsForCreate } from "../../core/CreatableEntity";
Expand Down
Loading

0 comments on commit 9be5471

Please sign in to comment.