Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions packages/wallet-lib/docs/account/getTransactionHistory.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,23 @@ Returns : sorted and classified transaction history

```js
const transactionHistory = account.getTransactionHistory();
//
```

/**
* [
{
from: [ { address: 'ySBsUTdfKSzqg5SHDFa6SZLRFzbbaBsrMX' } ],
to: [{
address: 'yUSaLsYdFxuuWxNJFEvoJNAcJk3KTotLpU',
satoshis: 3999989000
}
],
type: 'sent',
time: 1634325172,
txId: '97932c88eda0423578f26d32a0a1ba21b5792721f345c135bc8eb2cb4864184c',
blockHash: '000000f3a03c0c7c89dcd089f87edcb18bdd95051e85bc27e7de73666a071698',
isChainLocked: true,
isInstantLocked: true
}
]
*/
```
3 changes: 2 additions & 1 deletion packages/wallet-lib/src/types/Account/Account.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Strategy,
Network,
broadcastTransactionOpts,
Plugins, RawTransaction, TransactionsMap, WalletObj, StatusInfo
Plugins, RawTransaction, TransactionsMap, WalletObj, StatusInfo, TransactionsHistory
} from "../types";
import { KeyChain } from "../KeyChain/KeyChain";
import { InstantLock } from "@dashevo/dashcore-lib";
Expand Down Expand Up @@ -62,6 +62,7 @@ export declare class Account {
getPrivateKeys(addressList: [PublicAddress]): [PrivateKey];
getTotalBalance(displayDuffs?: boolean): number;
getTransaction(txid: transactionId): Transaction;
getTransactionHistory(): TransactionsHistory;
getTransactions(): [Transaction];
getUTXOS(): [UnspentOutput];
getUnconfirmedBalance(displayDuffs?: boolean): number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ const sortByHeightDescending = (a, b) => (b.height - a.height);

/**
* Get all the transaction history already formated
* @return {Promise<TransactionsHistory>}
* @return {TransactionsHistory}
*/
async function getTransactionHistory() {
function getTransactionHistory() {
const transactionHistory = [];

const {
Expand Down
6 changes: 4 additions & 2 deletions packages/wallet-lib/src/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,16 @@ export declare type TransactionHistory<T extends object = object> = T & {
address: string,
satoshis: number,
}],
time: number,
to: [{
address: string,
satoshis: number
}],
type: TransactionHistoryType
time: number,
txId: string,
blockHash: string
blockHash: string,
isChainLocked: boolean,
isInstantLocked: boolean
}

export declare type TransactionsHistory = [TransactionHistory]|[];
Expand Down