Skip to content

Commit

Permalink
lerna version bump and import fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tatomir-streamflow committed Sep 4, 2024
1 parent 40c141f commit 43c4418
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 27 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"packages": [
"packages/*"
],
"version": "7.0.0-alpha.1",
"version": "7.0.0-alpha.2",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
12 changes: 5 additions & 7 deletions packages/stream/aptos/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { WalletContextState } from "@manahippo/aptos-wallet-adapter";
import BigNumber from "bignumber.js";
import { Buffer } from "buffer";

import { buildStreamType, calculateUnlockedAmount } from "../common/contractUtils";
import { Stream, StreamType } from "../common/types";
import { normalizeAptosAddress } from "./utils";
import { buildStreamType, calculateUnlockedAmount } from "../common/contractUtils.js";
import { Stream, StreamType } from "../common/types.js";
import { normalizeAptosAddress } from "./utils.js";
import { getNumberFromBigNumber } from "../common/utils.js";

export interface ICreateStreamAptosExt {
senderWallet: WalletContextState | AptosAccount;
Expand Down Expand Up @@ -211,9 +212,6 @@ export class Contract implements Stream {
}

remaining(decimals: number): number {
return this.depositedAmount
.minus(this.withdrawnAmount)
.div(10 ** decimals)
.toNumber();
return getNumberFromBigNumber(this.depositedAmount.minus(this.withdrawnAmount), decimals);
}
}
10 changes: 4 additions & 6 deletions packages/stream/evm/types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import BigNumber from "bignumber.js";
import { BigNumber as BigNumberEvm } from "ethers";

import { buildStreamType, calculateUnlockedAmount } from "../common/contractUtils";
import { Stream, StreamType } from "../common/types";
import { buildStreamType, calculateUnlockedAmount } from "../common/contractUtils.js";
import { Stream, StreamType } from "../common/types.js";
import { getNumberFromBigNumber } from "../common/utils.js";

export interface StreamAbiResult {
amount: BigNumberEvm;
Expand Down Expand Up @@ -194,9 +195,6 @@ export class EvmContract implements Stream {
}

remaining(decimals: number): number {
return this.depositedAmount
.minus(this.withdrawnAmount)
.div(10 ** decimals)
.toNumber();
return getNumberFromBigNumber(this.depositedAmount.minus(this.withdrawnAmount), decimals);
}
}
6 changes: 3 additions & 3 deletions packages/stream/solana/instructions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { PublicKey, TransactionInstruction } from "@solana/web3.js";
import BigNumber from "bignumber.js";
import { createHash } from "node:crypto";

import * as Layout from "./layout";
import { IUpdateData } from "../common/types";
import { toBuffer } from "./utils";
import * as Layout from "./layout.js";
import { IUpdateData } from "../common/types.js";
import { toBuffer } from "./utils.js";

const hasher = () => createHash("sha256");
const sha256 = {
Expand Down
6 changes: 2 additions & 4 deletions packages/stream/solana/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import BigNumber from "bignumber.js";

import { buildStreamType, calculateUnlockedAmount } from "../common/contractUtils.js";
import { IRecipient, Stream, StreamType } from "../common/types.js";
import { getNumberFromBigNumber } from "../common/utils.js";

export interface Account {
pubkey: PublicKey;
Expand Down Expand Up @@ -173,10 +174,7 @@ export class Contract implements Stream {
}

remaining(decimals: number): number {
return this.depositedAmount
.minus(this.withdrawnAmount)
.div(10 ** decimals)
.toNumber();
return getNumberFromBigNumber(this.depositedAmount.minus(this.withdrawnAmount), decimals);
}
}

Expand Down
10 changes: 4 additions & 6 deletions packages/stream/sui/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { TransactionBlock } from "@mysten/sui.js/transactions";
import { ExecuteTransactionRequestType, SuiTransactionBlockResponseOptions } from "@mysten/sui.js/client";
import BigNumber from "bignumber.js";

import { buildStreamType, calculateUnlockedAmount } from "../common/contractUtils";
import { Stream, StreamType } from "../common/types";
import { buildStreamType, calculateUnlockedAmount } from "../common/contractUtils.js";
import { Stream, StreamType } from "../common/types.js";
import { getNumberFromBigNumber } from "../common/utils.js";

export interface ICreateStreamSuiExt {
senderWallet: WalletContextState | Keypair;
Expand Down Expand Up @@ -256,10 +257,7 @@ export class Contract implements Stream {
}

remaining(decimals: number): number {
return this.depositedAmount
.minus(this.withdrawnAmount)
.div(10 ** decimals)
.toNumber();
return getNumberFromBigNumber(this.depositedAmount.minus(this.withdrawnAmount), decimals);
}
}

Expand Down

0 comments on commit 43c4418

Please sign in to comment.