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

PLT-7691 flat version get transaction per contract #40

Merged

Conversation

hrajchert
Copy link
Collaborator

This PR adds the method getTransactionsForContract to the RestAPI of the runtime-rest-client and improves the generated documentation of related methods. To test you can build the project, modify the poc/rest-client-flow.html so that it uses local build and not latest release and then use the new method from the page.

Also, build the docs and make sure that the documentation makes sense.

@nhenin , @jhbertra , please note the DISCUSSION topics added in this PR

Comment on lines +96 to +98
// DISCUSSION: What should this return when contractId is not found? Currently it throws an exception
// with an AxiosError 404, we could return a nullable value or wrap the error into a custom
// ContractNotFound error and specify it in the docs.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine if we throw an exception here - the caller should be sure the contract exists, not use this as a means of testing for its existence. Wrapping in a custom error is not a bad idea.

@@ -5,7 +5,7 @@ import { split } from "fp-ts/lib/string.js";
import { pipe } from "fp-ts/lib/function.js";
import { head } from "fp-ts/lib/ReadonlyNonEmptyArray.js";
import { TxId } from "../tx/id.js";
import { ContractId } from "../contract/id.js";
import { ContractIdGuard } from "../contract/id.js";
import { AssetId, Assets } from "../asset/index.js";

// QUESTION: @N.H: What is the difference between PayoutId and WithdrawalId?
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @nhenin

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PayoutId is the id of the payout 🙂 meaning you’ll use it to withdraw the tokens from these payouts….
WithdrawalId are the id of the Tx when you withdraw from this payout…

@@ -3,10 +3,18 @@ import * as t from "io-ts/lib/index.js";
export type Tag = t.TypeOf<typeof Tag>;
export const Tag = t.string;

export type TagContent = t.TypeOf<typeof TagContent>;
// QUESTION: @Jamie, N.H. is this right, TagContent can be anything?
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so...

@@ -5,7 +5,11 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Vesting Flow</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="/dist/local-importmap.js"></script>
<!-- This import map tells the browser what version of the SDK to use, use the local-importmap for local
development and the jsdelivr importmap for the latest published version.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool

@nhenin nhenin merged commit 94fe4e6 into main Oct 12, 2023
2 checks passed
@nhenin nhenin deleted the hrajchert/PLT-7691-flat-version-get-transaction-per-contract branch October 12, 2023 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants