diff --git "a/.gitbook/assets/Capture d\342\200\231\303\251cran 2022-02-22 \303\240 12.25.00.png" "b/.gitbook/assets/Capture d\342\200\231\303\251cran 2022-02-22 \303\240 12.25.00.png" new file mode 100644 index 0000000..866d85b Binary files /dev/null and "b/.gitbook/assets/Capture d\342\200\231\303\251cran 2022-02-22 \303\240 12.25.00.png" differ diff --git "a/.gitbook/assets/Capture d\342\200\231\303\251cran 2022-02-22 \303\240 12.26.04.png" "b/.gitbook/assets/Capture d\342\200\231\303\251cran 2022-02-22 \303\240 12.26.04.png" new file mode 100644 index 0000000..01e64cb Binary files /dev/null and "b/.gitbook/assets/Capture d\342\200\231\303\251cran 2022-02-22 \303\240 12.26.04.png" differ diff --git "a/.gitbook/assets/Capture d\342\200\231\303\251cran 2022-02-22 \303\240 12.33.34.png" "b/.gitbook/assets/Capture d\342\200\231\303\251cran 2022-02-22 \303\240 12.33.34.png" new file mode 100644 index 0000000..8cc1080 Binary files /dev/null and "b/.gitbook/assets/Capture d\342\200\231\303\251cran 2022-02-22 \303\240 12.33.34.png" differ diff --git a/snapshot.js.md b/snapshot.js.md index 039efc1..e7e5a40 100644 --- a/snapshot.js.md +++ b/snapshot.js.md @@ -41,21 +41,26 @@ import { Web3Provider } from '@ethersproject/providers'; const web3 = new Web3Provider(window.ethereum); const [account] = await web3.listAccounts(); - -const receipt = await client.proposal(web3, account, { - space: 'yam.eth', - type: 'single-choice', - title: 'Test proposal using Snapshot.js', - body: '', - choices: ['Alice', 'Bob', 'Carol'], - start: 1636984800, - end: 1637244000, - snapshot: 13620822, - network: '1', - strategies: JSON.stringify({}), - plugins: JSON.stringify({}), - metadata: JSON.stringify({}) -}); +const now = Math.floor(Date.now() / 1000); + +const sendProposal = async () => { + + const receipt = await client.proposal(signer, getAddress(account), { + space: "yam.eth", + type: "single-choice", + title: "Test proposal using Snapshot", + body: "body", + discussion: "", + choices: ['Alice', 'Bob', 'Carol'], + start: now, + end: now + 10000, + snapshot: 11022534, + plugins: "{}", + }); + console.log(receipt) +}; + +sendProposal() ``` #### **Create or edit a space**