Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate supplementary Protocol Buffers (protobuf) parameters into the JS client to augment the extensibility and functionality of the data model within the designated oneof constructs, ensuring a more comprehensive representation and utilization of transaction related information #185

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d126588
Bump glob-parent from 5.1.1 to 5.1.2
dependabot[bot] Jun 9, 2021
00bb4a9
Merge pull request #58 from hyperledger/dependabot/npm_and_yarn/glob-…
DenisNikiforov Jun 9, 2021
1cbefd1
extending TxPaginationMeta (#63)
Pawlak00 Sep 14, 2021
10befff
Adding tx hash and status to sendTransactions return
Nov 3, 2021
f291711
Merge pull request #81 from travis-payne/returning-hash-and-status
stefashkaa Dec 7, 2021
5eef4f7
Bump version
stefashkaa Dec 7, 2021
7c2f4c4
Merge pull request #85 from hyperledger/feat/bump
stefashkaa Dec 7, 2021
3da96e9
Update README.md
LiraLemur Dec 7, 2021
8b79bb0
Merge pull request #86 from hyperledger/fix/badge
stefashkaa Dec 7, 2021
d6ab376
feat: Add smart-contract example
yashrajdesai Jul 10, 2022
a68afb9
feat: Add smart-contract code
yashrajdesai Jul 15, 2022
4bf0c1c
fix: Add keccak to devDependencies
yashrajdesai Aug 2, 2022
c970342
Merge pull request #110 from yashrajdesai/iroha-js-smart-contract
stefashkaa Aug 2, 2022
490bf1c
feat: update lib with latest proto
yashrajdesai Sep 18, 2022
50077cf
Increase version
stefashkaa Nov 2, 2022
fa9a8ca
Merge pull request #132 from hyperledger/feature/release-1.5.0-prepar…
6r1d Nov 2, 2022
d83d1e4
Add MAINTAINERS.md
safinsaf Mar 22, 2023
f4e8f68
Merge pull request #151 from hyperledger/fix/add-maintainers.md
safinsaf Mar 22, 2023
381e247
Create `MAINTAINERS.md`
appetrosyan Mar 9, 2023
3215805
Fix: typos (#158)
omahs Jul 11, 2023
72ab5b6
build(deps): migrate from grpc to @grpc/grpc-js and make it a prod de…
petermetz Dec 2, 2023
968bd48
Implement addition of new parameters to Iroha Core for enhanced mess…
Feb 10, 2024
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
Prev Previous commit
Next Next commit
extending TxPaginationMeta (#63)
* extended tx pagination meta queries added

Signed-off-by: Piotr Pawlowski <[email protected]>

* semicolon removed

Signed-off-by: Piotr Pawlowski <[email protected]>

* proto donwgraded

Signed-off-by: Piotr Pawlowski <[email protected]>

* example changed, args ordering updated, Pending txs updated

Signed-off-by: Piotr Pawlowski <[email protected]>

* params description added

Signed-off-by: Piotr Pawlowski <[email protected]>

* setField fixed

Signed-off-by: Piotr Pawlowski <[email protected]>

* version fixed

Signed-off-by: Piotr Pawlowski <[email protected]>

* version fixed

Signed-off-by: Piotr Pawlowski <[email protected]>

* yarn.lock fixed

Signed-off-by: Piotr Pawlowski <[email protected]>

* fix

Signed-off-by: Piotr Pawlowski <[email protected]>
  • Loading branch information
Pawlak00 committed Sep 14, 2021
commit 1cbefd111881453bde5c23249da6b2dafb65a7fc
34 changes: 32 additions & 2 deletions example/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import grpc from 'grpc'
import {
QueryService_v1Client as QueryService,
CommandService_v1Client as CommandService
} from '../lib/proto/endpoint_grpc_pb'

import { TxBuilder, BatchBuilder } from '../lib/chain'
import queries from '../lib/queries'

const IROHA_ADDRESS = 'localhost:50051'

Expand All @@ -17,9 +19,14 @@ const commandService = new CommandService(
grpc.credentials.createInsecure()
)

const queryService = new QueryService(
IROHA_ADDRESS,
grpc.credentials.createInsecure()
)

const firstTx = new TxBuilder()
.createAccount({
accountName: 'user1',
accountName: 'usera',
domainId: 'test',
publicKey: '0000000000000000000000000000000000000000000000000000000000000000'
})
Expand All @@ -28,7 +35,7 @@ const firstTx = new TxBuilder()

const secondTx = new TxBuilder()
.createAccount({
accountName: 'user2',
accountName: 'userb',
domainId: 'test',
publicKey: '0000000000000000000000000000000000000000000000000000000000000000'
})
Expand All @@ -45,3 +52,26 @@ new BatchBuilder([
.send(commandService)
.then(res => console.log(res))
.catch(err => console.error(err))

Promise.all([
queries.getAccountTransactions({
privateKey: adminPriv,
creatorAccountId: 'admin@test',
queryService,
timeoutLimit: 5000
}, {
accountId: 'admin@test',
pageSize: 10,
firstTxHash: undefined,
ordering: {
field: undefined,
direction: undefined
},
firstTxTime: undefined,
lastTxTime: undefined,
firstTxHeight: 1,
lastTxHeight: 3
})
])
.then(a => console.log(a))
.catch(e => console.error(e))
4 changes: 4 additions & 0 deletions example/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ Promise.all([
accountId: 'admin@test',
pageSize: 5,
firstTxHash: undefined,
firstTxTime: undefined,
lastTxTime: undefined,
firstTxHeight: undefined,
lastTxHeight: undefined,
ordering: {
field: undefined,
direction: undefined
Expand Down
4 changes: 4 additions & 0 deletions example/tls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ queries.getAccountTransactions({
accountId: 'admin@test',
firstTxHash: null,
pageSize: 100,
firstTxTime: null,
lastTxTime: null,
firstTxHeight: null,
lastTxHeight: null,
ordering: {
field: 0,
direction: 1
Expand Down
49 changes: 49 additions & 0 deletions src/proto/queries_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import * as jspb from "google-protobuf";
import * as primitive_pb from "./primitive_pb";
import * as google_protobuf_timestamp_pb from "google-protobuf/google/protobuf/timestamp_pb";

export class Ordering extends jspb.Message {
clearSequenceList(): void;
Expand Down Expand Up @@ -64,7 +65,31 @@ export class TxPaginationMeta extends jspb.Message {
getOrdering(): Ordering | undefined;
setOrdering(value?: Ordering): void;

hasFirstTxTime(): boolean;
clearFirstTxTime(): void;
getFirstTxTime(): google_protobuf_timestamp_pb.Timestamp | undefined;
setFirstTxTime(value?: google_protobuf_timestamp_pb.Timestamp): void;

hasLastTxTime(): boolean;
clearLastTxTime(): void;
getLastTxTime(): google_protobuf_timestamp_pb.Timestamp | undefined;
setLastTxTime(value?: google_protobuf_timestamp_pb.Timestamp): void;

hasFirstTxHeight(): boolean;
clearFirstTxHeight(): void;
getFirstTxHeight(): number;
setFirstTxHeight(value: number): void;

hasLastTxHeight(): boolean;
clearLastTxHeight(): void;
getLastTxHeight(): number;
setLastTxHeight(value: number): void;

getOptFirstTxHashCase(): TxPaginationMeta.OptFirstTxHashCase;
getOptFirstTxTimeCase(): TxPaginationMeta.OptFirstTxTimeCase;
getOptLastTxTimeCase(): TxPaginationMeta.OptLastTxTimeCase;
getOptFirstTxHeightCase(): TxPaginationMeta.OptFirstTxHeightCase;
getOptLastTxHeightCase(): TxPaginationMeta.OptLastTxHeightCase;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): TxPaginationMeta.AsObject;
static toObject(includeInstance: boolean, msg: TxPaginationMeta): TxPaginationMeta.AsObject;
Expand All @@ -80,12 +105,36 @@ export namespace TxPaginationMeta {
pageSize: number,
firstTxHash: string,
ordering?: Ordering.AsObject,
firstTxTime?: google_protobuf_timestamp_pb.Timestamp.AsObject,
lastTxTime?: google_protobuf_timestamp_pb.Timestamp.AsObject,
firstTxHeight: number,
lastTxHeight: number,
}

export enum OptFirstTxHashCase {
OPT_FIRST_TX_HASH_NOT_SET = 0,
FIRST_TX_HASH = 2,
}

export enum OptFirstTxTimeCase {
OPT_FIRST_TX_TIME_NOT_SET = 0,
FIRST_TX_TIME = 4,
}

export enum OptLastTxTimeCase {
OPT_LAST_TX_TIME_NOT_SET = 0,
LAST_TX_TIME = 5,
}

export enum OptFirstTxHeightCase {
OPT_FIRST_TX_HEIGHT_NOT_SET = 0,
FIRST_TX_HEIGHT = 6,
}

export enum OptLastTxHeightCase {
OPT_LAST_TX_HEIGHT_NOT_SET = 0,
LAST_TX_HEIGHT = 7,
}
}

export class AssetPaginationMeta extends jspb.Message {
Expand Down
Loading