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

feat: support read-only address url param #362

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

samsiegart
Copy link
Collaborator

@samsiegart samsiegart commented Aug 28, 2024

fixes #361

Description

Adds support for an address url param. E.g. https://ecb1905c.dapp-inter-test.pages.dev/?address=agoric1ldmtatp24qlllgxmrsjzcpe20fvlkp448zcuce. When used, it will connect to the dapp with that address in a read-only fashion, and let you copy messages to sign from the console.

I had to upgrade to the latest @agoric/web-components to use the newer clientConfig arg, which required updating some other deps and fixing some type issues along the way.

Screenshot of toast and console output after offer is "made"

Screen Shot 2024-08-27 at 10 39 48 PM

Example message copied from console (create vault)

[
    {
        "typeUrl": "/agoric.swingset.MsgWalletSpendAction",
        "value": {
            "owner": "+3a+rCqoP/+g2xwkLAcqeln7BrU=",
            "spendAction": "{\"body\":\"#{\\\"method\\\":\\\"executeOffer\\\",\\\"offer\\\":{\\\"id\\\":1724822982051,\\\"invitationSpec\\\":{\\\"callPipe\\\":[[\\\"getCollateralManager\\\",[\\\"$0.Alleged: ATOM brand#board01547\\\"]],[\\\"makeVaultInvitation\\\"]],\\\"instancePath\\\":[\\\"VaultFactory\\\"],\\\"source\\\":\\\"agoricContract\\\"},\\\"offerArgs\\\":\\\"#undefined\\\",\\\"proposal\\\":{\\\"give\\\":{\\\"Collateral\\\":{\\\"brand\\\":\\\"$0\\\",\\\"value\\\":\\\"+880256\\\"}},\\\"want\\\":{\\\"Minted\\\":{\\\"brand\\\":\\\"$1.Alleged: IST brand#board0257\\\",\\\"value\\\":\\\"+5000000\\\"}}}}}\",\"slots\":[\"board01547\",\"board0257\"]}"
        }
    }
]

@samsiegart samsiegart requested a review from dtribble August 28, 2024 05:44
Copy link

github-actions bot commented Aug 28, 2024

Network:
Commit: 7914bec
Ref: refs/pull/362/merge
IPFS v1 hash: bafybeig63d6pjqikzmn4eclxlp6sy3nqeb2gx4lwjyrjsf5dqwsx4c4s7y
CF - DWeb - 4EVERLAND

Copy link

cloudflare-workers-and-pages bot commented Aug 28, 2024

Deploying dapp-inter-test with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8415cca
Status: ✅  Deploy successful!
Preview URL: https://adf39582.dapp-inter-test.pages.dev
Branch Preview URL: https://readonly-address.dapp-inter-test.pages.dev

View logs

Copy link

Deploying agoric-dapp-inter-emerynet with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8415cca
Status: ✅  Deploy successful!
Preview URL: https://a29b9256.agoric-dapp-inter-emerynet.pages.dev
Branch Preview URL: https://readonly-address.agoric-dapp-inter-emerynet.pages.dev

View logs

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.

Add support for read-only address
1 participant