Closed dckc closed 6 months ago
great hello, world @dckc!
I had to remove shell
from line 1 so that it would work on MacOS (shown below)
STATE=$(endo where state)
This took a whopping ~5 seconds.... aaand voila! 🪄
🚀 amazing way to break ground on (what i expect to be the) safest adult playground to ever grace the interwebs 😎
Prerequisite: ALICE_SECRET
env has the 24 words corresponding to an account with a smart wallet already provisioned a la agoric-3-proposals as used in Your First Agoric Dapp
$ direnv allow
direnv: loading ~/projects/playground/.envrc
direnv: export +ALICE_SECRET +JACK_SECRET ~PATH
Then:
~/projects/playground/packages/ag-trade$ make clean
endo reset
~/projects/playground/packages/ag-trade$ make reserve-add
++ install cosmos fetch plugin
endo make --UNSAFE src/cosmosFetch.js -n cosmos-fetch
Object [Alleged: CosmosFetch] {}
endo make src/net-local.js -n local -p cosmos-fetch
{ lcd: Object [Alleged: LCD] {}, rpc: Object [Alleged: RpcClient] {} }
++ start smart wallet caplet -- TODO: should not need UNSAFE
endo make --UNSAFE src/smartWallet.js -n client-maker
Object [Alleged: SmartWalletFactory] {}
endo eval "E(wf).makeWalletKit('survey thank ...', local.rpc, local.lcd)" \
local wf:client-maker -n alice-wk
{
query: Object [Alleged: QueryTool] {},
smartWallet: Object [Alleged: SmartWallet] {},
tx: Object [Alleged: SigningClient] {}
}
endo make --UNSAFE src/fresh-id.js -n fresh
Object [Alleged: FreshMaker] {}
endo eval "E(fresh).start('trade-')" fresh -n fresh-trade-id
Object [Alleged: Fresh] {}
endo mkguest alice
Object [Alleged: EndoGuest] {}
endo send alice @wallet:alice-wk
endo send alice @fresh:fresh-trade-id
endo inbox --as alice
0. "HOST" sent "@wallet" at "2024-01-10T07:00:27.268Z"
1. "HOST" sent "@fresh" at "2024-01-10T07:00:27.362Z"
# these 0/1 message numbers are fragile
endo adopt 0 wallet --as alice
endo adopt 1 fresh --as alice
endo run src/reserve-add.js 1 IST -p alice
{
status: {
id: 'trade-0700.0',
invitationSpec: {
callPipe: [Array],
instancePath: [Array],
source: 'agoricContract'
},
numWantsSatisfied: 1,
payouts: { Collateral: [Object] },
proposal: { give: [Object] },
result: 'added Collateral to the Reserve'
},
tx: {
height: 26737,
transactionHash: '937A033D429EF5E00774C2A94109E7627C784115BF0EB57BA4C9B91E86D6D5CA'
}
}
While working on some prototypes Agoric dapps in an internal hackathon, we had agoric1...
addresses on the screen here and there. Even form fields where the user entered and address. I thought to myself:
rest of details moved to README
fixes #1
After setting up lint/test devtools and such (#6), I'm migrating stuff from finquick and swaparoo.
A hello-world chain interaction works:
cc @tgrecojs @kriskowal