Skip to content

how do I call a public interface method from the ui? #10372

Answered by dckc
dckc asked this question in Q&A
Discussion options

You must be logged in to vote

The agoric platform doesn't have a special case for query methods in contracts. (Whether it could or should is a longer discussion...)

Instead, it has vstorage / chainStorage.

The addNote method can publish to chainStorage, and the ui code can query vstorage.

I see @amessbee put together a quick example where the contract does...

      await storePatientData(patientData.patientId, patientData);

-- https://github.com/amessbee/dapp-med-rep/blob/b0f3adb041d9383a7badee12b51bf457cce0e473/contract/src/med-rec-contract.js#L84C1-L84C66

The publishHandler function is close to an addNote function. Since this contract isn't actually trading assets, the indirection around makePublishInvitation is unf…

Replies: 2 comments 9 replies

Comment options

dckc
Oct 30, 2024
Collaborator Author

You must be logged in to vote
3 replies
@yribero
Comment options

@dckc
Comment options

dckc Oct 31, 2024
Collaborator Author

Answer selected by dckc
@yribero
Comment options

Comment options

dckc
Nov 6, 2024
Collaborator Author

You must be logged in to vote
6 replies
@dckc
Comment options

dckc Nov 22, 2024
Collaborator Author

@yribero
Comment options

@yribero
Comment options

@dckc
Comment options

dckc Dec 3, 2024
Collaborator Author

@yribero
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants