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

Add support for DR bundle methods #98

Merged
merged 1 commit into from
Sep 24, 2024
Merged

Add support for DR bundle methods #98

merged 1 commit into from
Sep 24, 2024

Conversation

Thomasvdam
Copy link
Member

Motivation

Make it easier to post several DRs in one go.

Explanation of Changes

Added Bundle versions of all DR related methods.

Testing

I used the following script to test the postAndAwaitDataRequestBundle

import { Signer, buildSigningConfig, postAndAwaitDataRequestBundle } from "./";

async function main() {
	const signingConfig = buildSigningConfig({});
	const signer = await Signer.fromPartial(signingConfig);

	console.log("Posting and waiting for results, this may take a lil while..");

	const result = await postAndAwaitDataRequestBundle(
		signer,
		[
			"eth-usdc",
			"sol-btc",
		].map((pair) => {
			return {
				consensusOptions: {
					method: "none",
				},
				oracleProgramId:
					"470fca08d461761f16d42a357d04732524c85f00e32e0360a246a9396a9d2fc0",
				drInputs: Buffer.from(pair),
				tallyInputs: Buffer.from([]),
				memo: Buffer.from(`pair_${pair}_${new Date().toISOString()}`),
			};
		}),
		undefined,
		{ timeoutSeconds: 300, pollingIntervalSeconds: 10 },
	);

	console.table(result);
}

main();

Related PRs and Issues

N.A.

@Thomasvdam Thomasvdam requested review from jasperdg and a team September 24, 2024 08:57
@Thomasvdam Thomasvdam merged commit ef467bc into main Sep 24, 2024
1 check passed
@Thomasvdam Thomasvdam deleted the feat/dr-bundles branch September 24, 2024 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants