We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Docs for E(walletBridge).addOffer(offer) are incomplete; there's no documentation on the OfferState type.
OfferState
I learned how to do it from the REPL last night; the example I cribbed from was:
https://github.com/Agoric/dapp-amm/blob/32b4cb59bdb7d252630742094e2cfaf1dc1d6db7/ui/src/services/liquidity.service.js#L281-L308
but note that the instance and installation can be specified directly, without going via the board.
REPL transcript:
command[171] E(home.wallet).getPurses() history[171] [["ATOM",[Object Alleged: Virtual Purse]{}],["Agoric RUN currency",[Object Alleged: Virtual Purse]{}],["Agoric staking token",[Object Alleged: Virtual Purse]{}],["Default Zoe invite purse",[Object Alleged: Zoe Invitation purse]{}],["USDC Anchor",[Object Alleged: Virtual Purse]{}],[["AgoricAMM","AUSDLiquidity"],[Object Alleged: AUSDLiquidity purse]{}]] command[172] USDC.name='USDC Anchor' history[172] "USDC Anchor" command[173] RUN.name='Agoric RUN currency' history[173] "Agoric RUN currency" command[174] mkw= (kit, qty) => ({pursePetname: kit.name, value: qty * kit.unit}) history[174] [Function mkw] command[175] proposalTemplate = { give: {Secondary: mkw(USDC, 2n)}, {Central: mkw(RUN, 2n)}} history[175] exception: [SyntaxError: missing identifier] command[176] proposalTemplate = { give: {Secondary: mkw(USDC, 2n), Central: mkw(RUN, 2n)}} history[176] {"give":{"Secondary":{"pursePetname":"USDC Anchor","value":2000000n},"Central":{"pursePetname":"Agoric RUN currency","value":2000000n}}} command[177] E(amm.pub).makeAddLiquidityInvitation().then(invitation=> (offerConfig = { id: '4927', invitation, installationHandle: amm.installation, instanceHandle: amm.instance, proposalTemplate } history[177] exception: [SyntaxError: missing )] command[178] E(amm.pub).makeAddLiquidityInvitation().then(invitation=> (offerConfig = { id: '4927', invitation, installationHandle: amm.installation, instanceHandle: amm.instance, proposalTemplate }) history[178] exception: [SyntaxError: missing ,] command[179] E(amm.pub).makeAddLiquidityInvitation().then(invitation=> (offerConfig = { id: '4927', invitation, installationHandle: amm.installation, instanceHandle: amm.instance, proposalTemplate })) history[179] {"id":"4927","invitation":[Object Alleged: Zoe Invitation payment]{},"installationHandle":[Object Alleged: Installation]{},"instanceHandle":[Object Alleged: InstanceHandle]{},"proposalTemplate":{"give":{"Secondary":{"pursePetname":"USDC Anchor","value":2000000n},"Central":{"pursePetname":"Agoric RUN currency","value":2000000n}}}} command[180] offerConfig history[180] undefined command[181] E(wb).addOffer(offerConfig) history[181] "4927" command[182] E(amm.pub).makeAddLiquidityInvitation().then(invitation=> (offerConfig = { id: '4928', invitation, installationHandle: amm.installation, instanceHandle: amm.instance, proposalTemplate })) history[182] {"id":"4928","invitation":[Object Alleged: Zoe Invitation payment]{},"installationHandle":[Object Alleged: Installation]{},"instanceHandle":[Object Alleged: InstanceHandle]{},"proposalTemplate":{"give":{"Secondary":{"pursePetname":"USDC Anchor","value":2000000n},"Central":{"pursePetname":"Agoric RUN currency","value":2000000n}}}} command[183] E(wb).addOffer(offerConfig) history[183] "4928" command[184] ALiq.name = ["AgoricAMM","AUSDLiquidity"] history[184] ["AgoricAMM","AUSDLiquidity"] command[185] proposalTemplate = { give: {Secondary: mkw(USDC, 2n), Central: mkw(RUN, 2n)}, want: { Liquidity: mkw(ALiq, 0n) }} history[185] {"give":{"Secondary":{"pursePetname":"USDC Anchor","value":2000000n},"Central":{"pursePetname":"Agoric RUN currency","value":2000000n}},"want":{"Liquidity":{"pursePetname":["AgoricAMM","AUSDLiquidity"],"value":0n}}} command[186] E(amm.pub).makeAddLiquidityInvitation().then(invitation=> (offerConfig = { id: '4955', invitation, installationHandle: amm.installation, instanceHandle: amm.instance, proposalTemplate })) history[186] {"id":"4955","invitation":[Object Alleged: Zoe Invitation payment]{},"installationHandle":[Object Alleged: Installation]{},"instanceHandle":[Object Alleged: InstanceHandle]{},"proposalTemplate":{"give":{"Secondary":{"pursePetname":"USDC Anchor","value":2000000n},"Central":{"pursePetname":"Agoric RUN currency","value":2000000n}},"want":{"Liquidity":{"pursePetname":["AgoricAMM","AUSDLiquidity"],"value":0n}}}} command[187] E(wb).addOffer(offerConfig) history[187] "4955" command[188] E(amm.pub).getPoolAllocation(USDC.brand) history[188] {"Central":{"brand":[Object Alleged: RUN brand]{},"value":83146636n},"Liquidity":{"brand":[Object Alleged: AUSDLiquidity brand]{},"value":0n},"Secondary":{"brand":[Object Alleged: AUSD brand]{},"value":80861958n}} command[189] E(home.wallet).lookup('offerResult', '4955') history[189] Promise.reject("Error: \"id\" not found: (a string)") command[190] E(home.wallet).lookup('offerResult', '4928') history[190] Promise.reject("Error: \"id\" not found: (a string)") command[191] E(home.wallet).lookup('offerResultXX', '4928') history[191] Promise.reject("Error: \"lookups\" not found: (a string)") command[192] E(home.wallet).lookup('offerResult') history[192] [Object Alleged: offerResultLookup]{} command[193] E(home.wallet).lookup('offerResultXX', 'undefined#4928') history[193] Promise.reject("Error: \"lookups\" not found: (a string)") command[194] E(home.wallet).lookup('offerResultXX', '#4928') history[194] Promise.reject("Error: \"lookups\" not found: (a string)") command[195] E(home.wallet).lookup('offerResultXX', 'unknown#4928') history[195] Promise.reject("Error: \"lookups\" not found: (a string)") command[196] E(home.wallet).lookup('offerResultXX', 'http://127.0.0.1:8000/#4928') history[196] Promise.reject("Error: \"lookups\" not found: (a string)") command[197] E(home.wallet).lookup('offerResult', 'unknown#4955') history[197] "Added liquidity."
The text was updated successfully, but these errors were encountered:
I'll take care of this when I document Smart Wallet. (see #748)
Sorry, something went wrong.
No branches or pull requests
Docs for E(walletBridge).addOffer(offer) are incomplete; there's no documentation on the
OfferState
type.I learned how to do it from the REPL last night; the example I cribbed from was:
https://github.com/Agoric/dapp-amm/blob/32b4cb59bdb7d252630742094e2cfaf1dc1d6db7/ui/src/services/liquidity.service.js#L281-L308
but note that the instance and installation can be specified directly, without going via the board.
REPL transcript:
The text was updated successfully, but these errors were encountered: