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

[Build Tx] Add a Soroban Operation - Extend TTL #1226

Closed
wants to merge 22 commits into from
Closed

Conversation

jeesunikim
Copy link
Contributor

@jeesunikim jeesunikim commented Jan 17, 2025

Add Soroban Operation - Extend TTL

includes:

  • displaying only one operation when soroban operation is selected
  • add a fetch minimum resource fee button that simulates tx and calculates the resource fee
  • it follows how cli is operating using key-xdr (cli doc) (as recommended by dima)
  • I used auth soroban example to invoke a contract and use stellat js sdk to get the key xdr (example)
  • On sign transaction, method dropdown to auto select rpc if it's a soroban tx
  • separate the soroban logic from classic in Operation
  • createStore to include a separate soroban object that stores xdr and params
  • added tests
  • Updated saved page

@stellar-jenkins
Copy link

@stellar-jenkins
Copy link

@stellar-jenkins
Copy link

@stellar-jenkins
Copy link

src/store/createStore.ts Outdated Show resolved Hide resolved
@jeesunikim jeesunikim marked this pull request as ready for review January 21, 2025 06:36
@stellar-jenkins
Copy link

Comment on lines 947 to 960
if (isSorobanOperationType(e.target.value)) {
updateSorobanBuildOperation({
operation_type: e.target.value,
params: defaultParams,
source_account: "",
});
} else {
updateBuildSingleOperation(index, {
operation_type: e.target.value,
params: defaultParams,
source_account: "",
});
resetSorobanOperation();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We also need to reset the Classic operations when working with a Soroban operation.

Comment on lines 91 to 104
return operations.some((op: DecodedOperation) => {
const body = op?.body;
if (!body) {
return false;
}

const sorobanOps = [
body.extend_footprint_ttl,
body.restore_footprint,
body.invoke_host_function,
];

return sorobanOps.some((op) => op?.ext === "v0");
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add more details for this logic here? I'm not sure I fully understand it. 😊

src/components/FormElements/ResourceFeePicker.tsx Outdated Show resolved Hide resolved
case "key":
return {
render: (templ: {
value: string | undefined;
error: string | undefined;
onChange: (val: any) => void;
disabled?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can't we leave disabled here? There might be cases where we need that.

Comment on lines 165 to 167
if (!readOnlyXdrLedgerKey && !readWriteXdrLedgerKey) {
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we check for length here since we're setting default values as empty arrays?

tests/buildTransaction.test.ts Outdated Show resolved Hide resolved
tests/buildTransaction.test.ts Show resolved Hide resolved
@jeesunikim jeesunikim closed this Jan 28, 2025
@jeesunikim
Copy link
Contributor Author

I'll create smaller new PRs tomorrow

@stellar-jenkins
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants