Merge pull request #6 from status-im/rename-wakuconnect
This commit is contained in:
commit
32974eb109
12
README.md
12
README.md
|
@ -1,10 +1,10 @@
|
|||
# DappConnect Vote & Poll SDKs
|
||||
# WakuConnect Vote & Poll SDKs
|
||||
|
||||
A set of DappConnect SDKs to enable gas efficient voting and gasless polling over Waku
|
||||
A set of WakuConnect SDKs to enable gas efficient voting and gasless polling over Waku
|
||||
|
||||
## DappConnect Vote SDK
|
||||
## WakuConnect Vote SDK
|
||||
|
||||
The DappConnect Vote SDK allows you to leverage Waku to save gas fees for most voters.
|
||||
The WakuConnect Vote SDK allows you to leverage Waku to save gas fees for most voters.
|
||||
|
||||
It leverages Waku, a decentralized communication network, to broadcast and aggregates votes.
|
||||
Most token holders will not need to spend gas to vote.
|
||||
|
@ -151,8 +151,8 @@ A vote may become invalid between reception over Waku and submission to the smar
|
|||
- The voter has transferred a number of token out of their account, making the account balance lesser than the vote weight,
|
||||
- A vote for this voter has already been submitted to the smart contract (whether or not it has the same value).
|
||||
|
||||
## DappConnect Poll SDK
|
||||
## WakuConnect Poll SDK
|
||||
|
||||
The DappConnect Poll SDK allows users to create, answer and view polls in a decentralized, censorship-resistant manner.
|
||||
The WakuConnect Poll SDK allows users to create, answer and view polls in a decentralized, censorship-resistant manner.
|
||||
|
||||
The polls are published over Waku, there is no interaction with any blockchain, removing gas costs.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@dappconnect/vote-poll-sdk",
|
||||
"repository": "git@github.com:status-im/dappconnect-vote-poll-sdk.git",
|
||||
"name": "@waku/vote-poll-sdk",
|
||||
"repository": "https://github.com/status-im/wakuconnect-vote-poll-sdk",
|
||||
"private": true,
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"engines": {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// SPDX-License-Identifier: MIT OR Apache-2.0
|
||||
|
||||
pragma solidity ^0.8.5;
|
||||
|
||||
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"name": "@dappconnect/vote-sdk-contracts",
|
||||
"name": "@waku/vote-sdk-contracts",
|
||||
"version": "0.0.1",
|
||||
"main": "index.js",
|
||||
"repository": "git@github.com:status-im/dappconnect-vote-poll-sdk.git",
|
||||
"repository": "https://github.com/status-im/wakuconnect-vote-poll-sdk",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"scripts": {
|
||||
"clean:all": "yarn clean && rimraf node_modules/",
|
||||
|
|
|
@ -56,7 +56,7 @@ WakuVoting create function expects name of DApp and address of a voting contract
|
|||
Address of token is derived from votingContract
|
||||
|
||||
```ts
|
||||
import { WakuVoting } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { WakuVoting } from '@waku/vote-poll-sdk-core'
|
||||
|
||||
await WakuVoting.create(appName, contractAddress, provider, multicallAddress, waku)
|
||||
```
|
||||
|
@ -148,7 +148,7 @@ To make it easier to use WakuPolling class was created
|
|||
WakuPolling create expects name of DApp and address of a token contract, web3provider, also as optional parameter can take custom Waku object.
|
||||
|
||||
```ts
|
||||
import { WakuPolling } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { WakuPolling } from '@waku/vote-poll-sdk-core'
|
||||
|
||||
await WakuPolling.create(appName, tokenAddress, provider, multicallAddress, waku)
|
||||
```
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@dappconnect/vote-poll-sdk-core",
|
||||
"repository": "git@github.com:status-im/dappconnect-vote-poll-sdk.git",
|
||||
"name": "@waku/vote-poll-sdk-core",
|
||||
"repository": "https://github.com/status-im/wakuconnect-vote-poll-sdk",
|
||||
"main": "dist/cjs/src/index.js",
|
||||
"module": "dist/esm/src/index.js",
|
||||
"types": "dist/esm/src/index.d.ts",
|
||||
|
@ -42,7 +42,7 @@
|
|||
"typescript": "^4.3.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dappconnect/vote-sdk-contracts": "^0.0.1",
|
||||
"@waku/vote-sdk-contracts": "^0.0.1",
|
||||
"eth-sig-util": "^3.0.1",
|
||||
"ethers": "^5.4.4",
|
||||
"js-waku": "^0.11.0",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { VotingContract } from '@dappconnect/vote-sdk-contracts/abi'
|
||||
import { VotingContract } from '@waku/vote-sdk-contracts/abi'
|
||||
import { WakuMessaging } from './WakuMessaging'
|
||||
import { Contract, Wallet, BigNumber, ethers, utils } from 'ethers'
|
||||
import { Waku, WakuMessage } from 'js-waku'
|
||||
|
|
|
@ -1 +1 @@
|
|||
# DappConnect Vote & Poll SDK Example
|
||||
# WakuConnect Vote & Poll SDK Example
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@dappconnect/vote-poll-sdk-example",
|
||||
"repository": "git@github.com:status-im/dappconnect-vote-poll-sdk.git",
|
||||
"name": "@waku/vote-poll-sdk-example",
|
||||
"repository": "https://github.com/status-im/wakuconnect-vote-poll-sdk",
|
||||
"version": "0.1.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
|
@ -16,8 +16,8 @@
|
|||
"lint:prettier": "yarn prettier './{src,test}/**/*.{ts,tsx}'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dappconnect/poll-sdk-example": "^0.1.0",
|
||||
"@dappconnect/vote-sdk-example": "^0.1.0",
|
||||
"@waku/poll-sdk-example": "^0.1.0",
|
||||
"@waku/vote-sdk-example": "^0.1.0",
|
||||
"assert": "^2.0.0",
|
||||
"buffer": "^6.0.3",
|
||||
"crypto-browserify": "^3.12.0",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import { PollingPage } from '@dappconnect/poll-sdk-example'
|
||||
import { VotingPage } from '@dappconnect/vote-sdk-example'
|
||||
import { PollingPage } from '@waku/poll-sdk-example'
|
||||
import { VotingPage } from '@waku/vote-sdk-example'
|
||||
import { BrowserRouter } from 'react-router-dom'
|
||||
import { Route, Switch } from 'react-router'
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
# Mainnet DappConnect Poll SDK Example
|
||||
# Mainnet WakuConnect Poll SDK Example
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"name": "@dappconnect/mainnet-poll-sdk-example",
|
||||
"name": "@waku/mainnet-poll-sdk-example",
|
||||
"version": "0.1.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"scripts": {
|
||||
"clean:all": "yarn clean && rimraf node_modules/",
|
||||
"clean": "rimraf dist/",
|
||||
|
@ -15,10 +15,10 @@
|
|||
"lint:prettier": "yarn prettier './{src,test}/**/*.{ts,tsx}'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dappconnect/vote-poll-sdk-core": "^0.1.0",
|
||||
"@dappconnect/poll-sdk-react-components": "^0.1.0",
|
||||
"@dappconnect/poll-sdk-react-hooks": "^0.1.0",
|
||||
"@dappconnect/vote-poll-sdk-react-components": "^0.1.0",
|
||||
"@waku/vote-poll-sdk-core": "^0.1.0",
|
||||
"@waku/poll-sdk-react-components": "^0.1.0",
|
||||
"@waku/poll-sdk-react-hooks": "^0.1.0",
|
||||
"@waku/vote-poll-sdk-react-components": "^0.1.0",
|
||||
"@usedapp/core": "^0.4.7",
|
||||
"ethers": "^5.4.4",
|
||||
"react": "^17.0.2",
|
||||
|
|
|
@ -2,11 +2,11 @@ import React, { useState, useEffect } from 'react'
|
|||
import { useConfig, useEthers } from '@usedapp/core'
|
||||
|
||||
import styled from 'styled-components'
|
||||
import { PollList, PollCreation } from '@dappconnect/poll-sdk-react-components'
|
||||
import { PollList, PollCreation } from '@waku/poll-sdk-react-components'
|
||||
import { JsonRpcSigner } from '@ethersproject/providers'
|
||||
import { useWakuPolling } from '@dappconnect/poll-sdk-react-hooks'
|
||||
import { Modal, Networks, CreateButton } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { Theme } from '@dappconnect/vote-poll-sdk-react-components/dist/esm/src/style/themes'
|
||||
import { useWakuPolling } from '@waku/poll-sdk-react-hooks'
|
||||
import { Modal, Networks, CreateButton } from '@waku/vote-poll-sdk-react-components'
|
||||
import { Theme } from '@waku/vote-poll-sdk-react-components/dist/esm/src/style/themes'
|
||||
|
||||
type WakuPollingProps = {
|
||||
appName: string
|
||||
|
|
|
@ -3,10 +3,10 @@ import styled from 'styled-components'
|
|||
import { DAppProvider, ChainId, useEthers } from '@usedapp/core'
|
||||
import { DEFAULT_CONFIG } from '@usedapp/core/dist/cjs/src/model/config/default'
|
||||
import { WakuPolling } from './components/WakuPolling'
|
||||
import { TopBar, GlobalStyle } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { TopBar, GlobalStyle } from '@waku/vote-poll-sdk-react-components'
|
||||
import pollingIcon from './assets/images/pollingIcon.png'
|
||||
import { JsonRpcSigner } from '@ethersproject/providers'
|
||||
import { orangeTheme } from '@dappconnect/vote-poll-sdk-react-components/dist/esm/src/style/themes'
|
||||
import { orangeTheme } from '@waku/vote-poll-sdk-react-components/dist/esm/src/style/themes'
|
||||
import ReactDOM from 'react-dom'
|
||||
import { BrowserRouter } from 'react-router-dom'
|
||||
import { Route, Switch } from 'react-router'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# DappConnect Poll SDK Example
|
||||
# WakuConnect Poll SDK Example
|
||||
|
||||
This package is example usage of WakuPolling
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@dappconnect/poll-sdk-example",
|
||||
"repository": "git@github.com:status-im/dappconnect-vote-poll-sdk.git",
|
||||
"name": "@waku/poll-sdk-example",
|
||||
"repository": "https://github.com/status-im/wakuconnect-vote-poll-sdk",
|
||||
"version": "0.1.0",
|
||||
"main": "dist/cjs/src/index.js",
|
||||
"module": "dist/esm/src/index.js",
|
||||
|
@ -31,10 +31,10 @@
|
|||
"lint:prettier": "yarn prettier './{src,test}/**/*.{ts,tsx}'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dappconnect/vote-poll-sdk-core": "^0.1.0",
|
||||
"@dappconnect/poll-sdk-react-components": "^0.1.0",
|
||||
"@dappconnect/poll-sdk-react-hooks": "^0.1.0",
|
||||
"@dappconnect/vote-poll-sdk-react-components": "^0.1.0",
|
||||
"@waku/vote-poll-sdk-core": "^0.1.0",
|
||||
"@waku/poll-sdk-react-components": "^0.1.0",
|
||||
"@waku/poll-sdk-react-hooks": "^0.1.0",
|
||||
"@waku/vote-poll-sdk-react-components": "^0.1.0",
|
||||
"@usedapp/core": "^0.4.7",
|
||||
"ethers": "^5.4.4",
|
||||
"react": "^17.0.2",
|
||||
|
|
|
@ -2,11 +2,11 @@ import React, { useState, useEffect } from 'react'
|
|||
import { useConfig, useEthers } from '@usedapp/core'
|
||||
|
||||
import styled from 'styled-components'
|
||||
import { PollList, PollCreation } from '@dappconnect/poll-sdk-react-components'
|
||||
import { PollList, PollCreation } from '@waku/poll-sdk-react-components'
|
||||
import { JsonRpcSigner } from '@ethersproject/providers'
|
||||
import { useWakuPolling } from '@dappconnect/poll-sdk-react-hooks'
|
||||
import { Modal, Networks, CreateButton } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { Theme } from '@dappconnect/vote-poll-sdk-react-components/dist/esm/src/style/themes'
|
||||
import { useWakuPolling } from '@waku/poll-sdk-react-hooks'
|
||||
import { Modal, Networks, CreateButton } from '@waku/vote-poll-sdk-react-components'
|
||||
import { Theme } from '@waku/vote-poll-sdk-react-components/dist/esm/src/style/themes'
|
||||
|
||||
type WakuPollingProps = {
|
||||
appName: string
|
||||
|
|
|
@ -3,10 +3,10 @@ import styled from 'styled-components'
|
|||
import { DAppProvider, ChainId, useEthers } from '@usedapp/core'
|
||||
import { DEFAULT_CONFIG } from '@usedapp/core/dist/cjs/src/model/config/default'
|
||||
import { WakuPolling } from './components/WakuPolling'
|
||||
import { TopBar, GlobalStyle } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { TopBar, GlobalStyle } from '@waku/vote-poll-sdk-react-components'
|
||||
import pollingIcon from './assets/images/pollingIcon.png'
|
||||
import { JsonRpcSigner } from '@ethersproject/providers'
|
||||
import { orangeTheme } from '@dappconnect/vote-poll-sdk-react-components/dist/esm/src/style/themes'
|
||||
import { orangeTheme } from '@waku/vote-poll-sdk-react-components/dist/esm/src/style/themes'
|
||||
|
||||
const config = {
|
||||
readOnlyChainId: ChainId.Ropsten,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@dappconnect/poll-sdk-react-components",
|
||||
"repository": "git@github.com:status-im/dappconnect-vote-poll-sdk.git",
|
||||
"name": "@waku/poll-sdk-react-components",
|
||||
"repository": "https://github.com/status-im/wakuconnect-vote-poll-sdk",
|
||||
"version": "0.1.0",
|
||||
"main": "dist/cjs/src/index.js",
|
||||
"module": "dist/esm/src/index.js",
|
||||
|
@ -33,9 +33,9 @@
|
|||
"lint:prettier": "yarn prettier './{src,test}/**/*.{ts,tsx}'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dappconnect/vote-poll-sdk-core": "^0.1.0",
|
||||
"@dappconnect/poll-sdk-react-hooks": "^0.1.0",
|
||||
"@dappconnect/vote-poll-sdk-react-components": "^0.1.0",
|
||||
"@waku/vote-poll-sdk-core": "^0.1.0",
|
||||
"@waku/poll-sdk-react-hooks": "^0.1.0",
|
||||
"@waku/vote-poll-sdk-react-components": "^0.1.0",
|
||||
"ethers": "^5.4.4",
|
||||
"react": "^17.0.2",
|
||||
"styled-components": "^5.3.0"
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { WakuPolling } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { DetailedTimedPoll } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/models/DetailedTimedPoll'
|
||||
import { WakuPolling } from '@waku/vote-poll-sdk-core'
|
||||
import { DetailedTimedPoll } from '@waku/vote-poll-sdk-core/dist/esm/src/models/DetailedTimedPoll'
|
||||
import { BigNumber } from 'ethers'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { PollType } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { PollType } from '@waku/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import styled from 'styled-components'
|
||||
import { RadioGroup, SmallButton, Theme } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { RadioGroup, SmallButton, Theme } from '@waku/vote-poll-sdk-react-components'
|
||||
import { PollResults } from './PollResults'
|
||||
import { Modal } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { Modal } from '@waku/vote-poll-sdk-react-components'
|
||||
|
||||
type PollProps = {
|
||||
theme: Theme
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import React, { ReactNode, useState } from 'react'
|
||||
import styled from 'styled-components'
|
||||
import { PollType } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { WakuPolling } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { Input, addIcon, SmallButton, Modal, Theme } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { MESSAGE_SENDING_RESULT } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/classes/WakuPolling'
|
||||
import { PollType } from '@waku/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { WakuPolling } from '@waku/vote-poll-sdk-core'
|
||||
import { Input, addIcon, SmallButton, Modal, Theme } from '@waku/vote-poll-sdk-react-components'
|
||||
import { MESSAGE_SENDING_RESULT } from '@waku/vote-poll-sdk-core/dist/esm/src/classes/WakuPolling'
|
||||
|
||||
const defaultPollDuration = 7 * 24 * 60 * 60 * 1000 // One week in ms.
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { WakuPolling } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { DetailedTimedPoll } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/models/DetailedTimedPoll'
|
||||
import { WakuPolling } from '@waku/vote-poll-sdk-core'
|
||||
import { DetailedTimedPoll } from '@waku/vote-poll-sdk-core/dist/esm/src/models/DetailedTimedPoll'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { Poll } from './Poll'
|
||||
import styled from 'styled-components'
|
||||
import { Theme } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { usePollList } from '@dappconnect/poll-sdk-react-hooks'
|
||||
import { Theme } from '@waku/vote-poll-sdk-react-components'
|
||||
import { usePollList } from '@waku/poll-sdk-react-hooks'
|
||||
type PollListProps = {
|
||||
theme: Theme
|
||||
wakuPolling: WakuPolling | undefined
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react'
|
||||
import { DetailedTimedPoll } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/models/DetailedTimedPoll'
|
||||
import { DetailedTimedPoll } from '@waku/vote-poll-sdk-core/dist/esm/src/models/DetailedTimedPoll'
|
||||
import styled from 'styled-components'
|
||||
import { colorRouletteGenerator, checkCircleIcon } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { colorRouletteGenerator, checkCircleIcon } from '@waku/vote-poll-sdk-react-components'
|
||||
|
||||
type PollResultsProps = {
|
||||
poll: DetailedTimedPoll
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@dappconnect/poll-sdk-react-hooks",
|
||||
"repository": "git@github.com:status-im/dappconnect-vote-poll-sdk.git",
|
||||
"name": "@waku/poll-sdk-react-hooks",
|
||||
"repository": "https://github.com/status-im/wakuconnect-vote-poll-sdk",
|
||||
"version": "0.1.0",
|
||||
"main": "dist/cjs/src/index.js",
|
||||
"module": "dist/esm/src/index.js",
|
||||
|
@ -29,7 +29,7 @@
|
|||
"lint:prettier": "yarn prettier './{src,test}/**/*.{ts,tsx}'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dappconnect/vote-poll-sdk-core": "^0.1.0",
|
||||
"@waku/vote-poll-sdk-core": "^0.1.0",
|
||||
"@usedapp/core": "^0.4.7",
|
||||
"ethers": "^5.4.4",
|
||||
"react": "^17.0.2",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { WakuPolling } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { DetailedTimedPoll } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/models/DetailedTimedPoll'
|
||||
import { WakuPolling } from '@waku/vote-poll-sdk-core'
|
||||
import { DetailedTimedPoll } from '@waku/vote-poll-sdk-core/dist/esm/src/models/DetailedTimedPoll'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
|
||||
export function usePollList(wakuPolling: WakuPolling | undefined) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { useEffect, useState, useRef } from 'react'
|
||||
import { WakuPolling } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { WakuPolling } from '@waku/vote-poll-sdk-core'
|
||||
import { Web3Provider } from '@ethersproject/providers'
|
||||
|
||||
export function useWakuPolling(
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@dappconnect/vote-poll-sdk-react-components",
|
||||
"repository": "git@github.com:status-im/dappconnect-vote-poll-sdk.git",
|
||||
"name": "@waku/vote-poll-sdk-react-components",
|
||||
"repository": "https://github.com/status-im/wakuconnect-vote-poll-sdk",
|
||||
"main": "dist/cjs/src/index.js",
|
||||
"module": "dist/esm/src/index.js",
|
||||
"types": "dist/esm/src/index.d.ts",
|
||||
|
@ -34,7 +34,7 @@
|
|||
"ethers": "^5.4.4",
|
||||
"react": "^17.0.2",
|
||||
"styled-components": "^5.3.0",
|
||||
"@dappconnect/vote-poll-sdk-core": "^0.1.0"
|
||||
"@waku/vote-poll-sdk-core": "^0.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/chai": "^4.2.21",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { WakuMessaging } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { WakuMessaging } from '@waku/vote-poll-sdk-core'
|
||||
import { BigNumber } from 'ethers'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# DappConnect Vote SDK Example
|
||||
# WakuConnect Vote SDK Example
|
||||
|
||||
Package contains example usage of DappConnect Vote SDK
|
||||
Package contains example usage of WakuConnect Vote SDK
|
||||
|
||||
For more detailed api please see README in voting-hooks and voting-components
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@dappconnect/vote-sdk-example",
|
||||
"repository": "git@github.com:status-im/dappconnect-vote-poll-sdk.git",
|
||||
"name": "@waku/vote-sdk-example",
|
||||
"repository": "https://github.com/status-im/wakuconnect-vote-poll-sdk",
|
||||
"version": "0.1.0",
|
||||
"main": "dist/cjs/src/index.js",
|
||||
"module": "dist/esm/src/index.js",
|
||||
|
@ -33,10 +33,10 @@
|
|||
"lint:prettier": "yarn prettier './{src,test}/**/*.{ts,tsx}'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dappconnect/vote-poll-sdk-core": "^0.1.0",
|
||||
"@dappconnect/vote-sdk-react-components": "^0.1.0",
|
||||
"@dappconnect/vote-sdk-react-hooks": "^0.1.0",
|
||||
"@dappconnect/vote-poll-sdk-react-components": "^0.1.0",
|
||||
"@waku/vote-poll-sdk-core": "^0.1.0",
|
||||
"@waku/vote-sdk-react-components": "^0.1.0",
|
||||
"@waku/vote-sdk-react-hooks": "^0.1.0",
|
||||
"@waku/vote-poll-sdk-react-components": "^0.1.0",
|
||||
"@usedapp/core": "^0.4.7",
|
||||
"ethers": "^5.4.4",
|
||||
"react": "^17.0.2",
|
||||
|
|
|
@ -5,14 +5,14 @@ import {
|
|||
VotingRoomList,
|
||||
VotingRoomListEmpty,
|
||||
NewVotingRoomModal,
|
||||
} from '@dappconnect/vote-sdk-react-components'
|
||||
import { blueTheme } from '@dappconnect/vote-poll-sdk-react-components/dist/esm/src/style/themes'
|
||||
import { WakuVoting } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { useTokenBalance } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
} from '@waku/vote-sdk-react-components'
|
||||
import { blueTheme } from '@waku/vote-poll-sdk-react-components/dist/esm/src/style/themes'
|
||||
import { WakuVoting } from '@waku/vote-poll-sdk-core'
|
||||
import { useTokenBalance } from '@waku/vote-poll-sdk-react-components'
|
||||
import { useEthers } from '@usedapp/core'
|
||||
import { Modal, Networks, useMobileVersion, Theme } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { useVotingRoomsId } from '@dappconnect/vote-sdk-react-hooks'
|
||||
import { VotingRoom } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { Modal, Networks, useMobileVersion, Theme } from '@waku/vote-poll-sdk-react-components'
|
||||
import { useVotingRoomsId } from '@waku/vote-sdk-react-hooks'
|
||||
import { VotingRoom } from '@waku/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { useHistory } from 'react-router'
|
||||
|
||||
type VotingListHeaderProps = {
|
||||
|
|
|
@ -2,10 +2,10 @@ import React from 'react'
|
|||
import { Redirect, Route, Switch, useHistory } from 'react-router'
|
||||
import { BrowserRouter } from 'react-router-dom'
|
||||
import styled from 'styled-components'
|
||||
import { VotingRoomMobile, NewVotingRoomMobile } from '@dappconnect/vote-sdk-react-components'
|
||||
import { VotingRoomMobile, NewVotingRoomMobile } from '@waku/vote-sdk-react-components'
|
||||
import { Voting } from './Voting'
|
||||
import { WakuVoting } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { useTokenBalance } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { WakuVoting } from '@waku/vote-poll-sdk-core'
|
||||
import { useTokenBalance } from '@waku/vote-poll-sdk-react-components'
|
||||
|
||||
type VotingRoomCreationProps = {
|
||||
tokenBalance: number
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import React, { useRef } from 'react'
|
||||
import { useWakuVoting } from '@dappconnect/vote-sdk-react-hooks'
|
||||
import { useWakuVoting } from '@waku/vote-sdk-react-hooks'
|
||||
import { VotingMobile } from './components/VotingMobile'
|
||||
import { Voting } from './components/Voting'
|
||||
import { TopBar, GlobalStyle, useMobileVersion } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { TopBar, GlobalStyle, useMobileVersion } from '@waku/vote-poll-sdk-react-components'
|
||||
import votingIcon from './assets/images/voting.png'
|
||||
import styled from 'styled-components'
|
||||
import { blueTheme } from '@dappconnect/vote-poll-sdk-react-components/dist/esm/src/style/themes'
|
||||
import { blueTheme } from '@waku/vote-poll-sdk-react-components/dist/esm/src/style/themes'
|
||||
import { DAppProvider, ChainId, useEthers, useConfig } from '@usedapp/core'
|
||||
import { DEFAULT_CONFIG } from '@usedapp/core/dist/cjs/src/model/config/default'
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@dappconnect/vote-sdk-react-components",
|
||||
"repository": "git@github.com:status-im/dappconnect-vote-poll-sdk.git",
|
||||
"name": "@waku/vote-sdk-react-components",
|
||||
"repository": "https://github.com/status-im/wakuconnect-vote-poll-sdk",
|
||||
"version": "0.1.0",
|
||||
"main": "dist/cjs/src/index.js",
|
||||
"module": "dist/esm/src/index.js",
|
||||
|
@ -33,9 +33,9 @@
|
|||
"lint:prettier": "yarn prettier './{src,test}/**/*.{ts,tsx}'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dappconnect/vote-poll-sdk-core": "^0.1.0",
|
||||
"@dappconnect/vote-sdk-react-hooks": "^0.1.0",
|
||||
"@dappconnect/vote-poll-sdk-react-components": "^0.1.0",
|
||||
"@waku/vote-poll-sdk-core": "^0.1.0",
|
||||
"@waku/vote-sdk-react-hooks": "^0.1.0",
|
||||
"@waku/vote-poll-sdk-react-components": "^0.1.0",
|
||||
"ethers": "^5.4.4",
|
||||
"humanize-duration": "^3.27.0",
|
||||
"react": "^17.0.2",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Button } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { Button } from '@waku/vote-poll-sdk-react-components'
|
||||
import styled from 'styled-components'
|
||||
|
||||
export const Btn = styled(Button)`
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useState } from 'react'
|
||||
import { blueTheme } from '@dappconnect/vote-poll-sdk-react-components/dist/esm/src/style/themes'
|
||||
import { CloseButton } from '@dappconnect/vote-poll-sdk-react-components/dist/esm/src/components/misc/Buttons'
|
||||
import { blueTheme } from '@waku/vote-poll-sdk-react-components/dist/esm/src/style/themes'
|
||||
import { CloseButton } from '@waku/vote-poll-sdk-react-components/dist/esm/src/components/misc/Buttons'
|
||||
import styled from 'styled-components'
|
||||
import { NotificationLink } from './ViewLink'
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { VotingRoom } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { VotingRoom } from '@waku/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import React from 'react'
|
||||
import styled from 'styled-components'
|
||||
import { ViewLink } from './ViewLink'
|
||||
|
|
|
@ -4,8 +4,8 @@ import { FinalBtn, VoteBtnAgainst, VoteBtnFor } from '../Buttons'
|
|||
import { VoteSubmitButton } from './VoteSubmitButton'
|
||||
import { VoteChart } from './VoteChart'
|
||||
import { ViewLink } from '../ViewLink'
|
||||
import { VotingRoom } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { WakuVoting } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { VotingRoom } from '@waku/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { WakuVoting } from '@waku/vote-poll-sdk-core'
|
||||
|
||||
interface ProposalVoteProps {
|
||||
votingRoom: VotingRoom
|
||||
|
|
|
@ -8,9 +8,9 @@ import crossIcon from '../../assets/svg/cross.svg'
|
|||
import crossWinnerIcon from '../../assets/svg/crossWinner.svg'
|
||||
import checkIcon from '../../assets/svg/check.svg'
|
||||
import checkWinnerIcon from '../../assets/svg/checkWinner.svg'
|
||||
import { useMobileVersion } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { VotingRoom } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { WakuVoting } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { useMobileVersion } from '@waku/vote-poll-sdk-react-components'
|
||||
import { VotingRoom } from '@waku/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { WakuVoting } from '@waku/vote-poll-sdk-core'
|
||||
|
||||
export interface VoteChartProps {
|
||||
votingRoom: VotingRoom
|
||||
|
|
|
@ -3,8 +3,8 @@ import styled from 'styled-components'
|
|||
import { VoteChart } from '../ProposalVoteCard/VoteChart'
|
||||
import { DisabledButton, VoteBtnAgainst, VoteBtnFor } from '../Buttons'
|
||||
import { VotePropose } from '../VotePropose'
|
||||
import { VotingRoom } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { WakuVoting } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { VotingRoom } from '@waku/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { WakuVoting } from '@waku/vote-poll-sdk-core'
|
||||
import { BigNumber } from 'ethers'
|
||||
|
||||
export interface AmountModalProps {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { WakuVoting } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { VotingRoom } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { WakuVoting } from '@waku/vote-poll-sdk-core'
|
||||
import { VotingRoom } from '@waku/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import React from 'react'
|
||||
import styled from 'styled-components'
|
||||
import { FinalBtn } from '../Buttons'
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import React, { useEffect, useMemo, useState } from 'react'
|
||||
import { VotingRoom } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { Modal, Theme } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { VotingRoom } from '@waku/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { Modal, Theme } from '@waku/vote-poll-sdk-react-components'
|
||||
import { AmountModal } from './AmountModal'
|
||||
import { ConfirmModal } from './ConfirmModal'
|
||||
import { WakuVoting } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { WakuVoting } from '@waku/vote-poll-sdk-core'
|
||||
|
||||
export interface VoteModalProps {
|
||||
setShowModal: (val: boolean) => void
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { WakuVoting } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { WakuVoting } from '@waku/vote-poll-sdk-core'
|
||||
import React, { useCallback, useMemo } from 'react'
|
||||
import { useState } from 'react'
|
||||
import styled from 'styled-components'
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import React, { ReactElement, useCallback, useState, useRef, useMemo } from 'react'
|
||||
import styled from 'styled-components'
|
||||
import { Theme } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { Theme } from '@waku/vote-poll-sdk-react-components'
|
||||
import { ProposalInfo } from './ProposalInfo'
|
||||
import { ProposalVote } from './ProposalVoteCard/ProposalVote'
|
||||
import { WakuVoting } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { useVotingRoom } from '@dappconnect/vote-sdk-react-hooks'
|
||||
import { WakuVoting } from '@waku/vote-poll-sdk-core'
|
||||
import { useVotingRoom } from '@waku/vote-sdk-react-hooks'
|
||||
import { VoteModal, VoteModalProps } from './VoteModal/VoteModal'
|
||||
import { useRefMobileVersion } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { VotingRoom } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { useRefMobileVersion } from '@waku/vote-poll-sdk-react-components'
|
||||
import { VotingRoom } from '@waku/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
|
||||
interface VotingRoomCardProps {
|
||||
votingRoomId: number
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import React from 'react'
|
||||
import styled from 'styled-components'
|
||||
import { Theme } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { Theme } from '@waku/vote-poll-sdk-react-components'
|
||||
import { VotingRoomCard } from './VotingRoomCard'
|
||||
import { WakuVoting } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { WakuVoting } from '@waku/vote-poll-sdk-core'
|
||||
|
||||
import { VotingRoom } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { VotingRoom } from '@waku/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
|
||||
type VotingRoomListProps = {
|
||||
theme: Theme
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react'
|
||||
import styled from 'styled-components'
|
||||
import { CreateButton, Theme } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { CreateButton, Theme } from '@waku/vote-poll-sdk-react-components'
|
||||
|
||||
type VotingRoomListEmptyProps = {
|
||||
theme: Theme
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react'
|
||||
import styled from 'styled-components'
|
||||
import { CreateButton } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { Theme } from '@dappconnect/vote-poll-sdk-react-components/dist/esm/src/style/themes'
|
||||
import { CreateButton } from '@waku/vote-poll-sdk-react-components'
|
||||
import { Theme } from '@waku/vote-poll-sdk-react-components/dist/esm/src/style/themes'
|
||||
|
||||
type VotingRoomListHeaderProps = {
|
||||
theme: Theme
|
||||
|
|
|
@ -3,7 +3,7 @@ import styled from 'styled-components'
|
|||
import { CardHeading } from '../ProposalInfo'
|
||||
import { VotingRoomDetailInput, ProposingData } from '../newVoteModal/VotingRoomDetailInput'
|
||||
import { TokenAmountScreen } from '../newVoteModal/TokenAmountScreen'
|
||||
import { WakuVoting } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { WakuVoting } from '@waku/vote-poll-sdk-core'
|
||||
|
||||
interface NewVotingRoomMobileProps {
|
||||
availableAmount: number
|
||||
|
|
|
@ -7,8 +7,8 @@ import { VoteChart } from '../ProposalVoteCard/VoteChart'
|
|||
import { ProposalInfo } from '../ProposalInfo'
|
||||
import { VotePropose } from '../VotePropose'
|
||||
import { VotesBtns } from '../ProposalVoteCard/ProposalVote'
|
||||
import { useVotingRoom } from '@dappconnect/vote-sdk-react-hooks'
|
||||
import { WakuVoting } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { useVotingRoom } from '@waku/vote-sdk-react-hooks'
|
||||
import { WakuVoting } from '@waku/vote-poll-sdk-core'
|
||||
import { BigNumber } from 'ethers'
|
||||
interface VotingRoomMobileProps {
|
||||
wakuVoting: WakuVoting
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { WakuVoting } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { Modal, Theme } from '@dappconnect/vote-poll-sdk-react-components'
|
||||
import { WakuVoting } from '@waku/vote-poll-sdk-core'
|
||||
import { Modal, Theme } from '@waku/vote-poll-sdk-react-components'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { VotingRoomDetailInput } from './VotingRoomDetailInput'
|
||||
import { TokenAmountScreen } from './TokenAmountScreen'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { WakuVoting } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { WakuVoting } from '@waku/vote-poll-sdk-core'
|
||||
import { useEthers } from '@usedapp/core'
|
||||
import React, { useState } from 'react'
|
||||
import styled from 'styled-components'
|
||||
|
|
|
@ -2,8 +2,8 @@ import React, { useMemo } from 'react'
|
|||
import styled from 'styled-components'
|
||||
import { ProposingBtn } from '../Buttons'
|
||||
import { TextArea } from '../Input'
|
||||
import { blueTheme } from '@dappconnect/vote-poll-sdk-react-components/dist/esm/src/style/themes'
|
||||
import { WakuVoting } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { blueTheme } from '@waku/vote-poll-sdk-react-components/dist/esm/src/style/themes'
|
||||
import { WakuVoting } from '@waku/vote-poll-sdk-core'
|
||||
|
||||
interface VotingRoomDetailInputProps {
|
||||
availableAmount: number
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@dappconnect/vote-sdk-react-hooks",
|
||||
"repository": "git@github.com:status-im/dappconnect-vote-poll-sdk.git",
|
||||
"name": "@waku/vote-sdk-react-hooks",
|
||||
"repository": "https://github.com/status-im/wakuconnect-vote-poll-sdk",
|
||||
"version": "0.1.0",
|
||||
"main": "dist/cjs/src/index.js",
|
||||
"module": "dist/esm/src/index.js",
|
||||
|
@ -27,7 +27,7 @@
|
|||
"lint:prettier": "yarn prettier './{src,test}/**/*.{ts,tsx}'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dappconnect/vote-poll-sdk-core": "^0.1.0",
|
||||
"@waku/vote-poll-sdk-core": "^0.1.0",
|
||||
"ethers": "^5.4.4",
|
||||
"react": "^17.0.2",
|
||||
"styled-components": "^5.3.0"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useEffect, useState, useRef } from 'react'
|
||||
import { WakuVoting } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { VotingRoom } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { WakuVoting } from '@waku/vote-poll-sdk-core'
|
||||
import { VotingRoom } from '@waku/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
|
||||
export function useVotingRoom(id: number, wakuVoting: WakuVoting) {
|
||||
const [votingRoom, setVotingRoom] = useState<VotingRoom | undefined>(undefined)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { id } from '@ethersproject/hash'
|
||||
import { WakuVoting } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { VotingRoom } from '@dappconnect/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import { WakuVoting } from '@waku/vote-poll-sdk-core'
|
||||
import { VotingRoom } from '@waku/vote-poll-sdk-core/dist/esm/src/types/PollType'
|
||||
import React, { useEffect, useRef, useState } from 'react'
|
||||
|
||||
export function useVotingRoomsId(wakuVoting: WakuVoting) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { WakuVoting } from '@dappconnect/vote-poll-sdk-core'
|
||||
import { WakuVoting } from '@waku/vote-poll-sdk-core'
|
||||
import React, { useEffect, useRef, useState } from 'react'
|
||||
import { Web3Provider } from '@ethersproject/providers'
|
||||
|
||||
|
|
Loading…
Reference in New Issue