Skip to content

Commit

Permalink
moved token transfer verificn server-side
Browse files Browse the repository at this point in the history
  • Loading branch information
Akshay Patel committed Jan 11, 2020
1 parent 931a1c2 commit 889c150
Show file tree
Hide file tree
Showing 26 changed files with 5,381 additions and 53 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@ import {PayFiat} from 'payfiat'
class Example extends Component {
render () {
return (
<PayFiat oceanAmount={50} currency="EUR"/>
<PayFiat
oceanAmount={50}
currency="EUR"
receiverAccount="0xB4Ba48998CF672d43b8216D43EE8f16143c9055C"
/>
)
}
}
```
> **Note** - if `receiverAccount` prop is not provided, then ethereum account address is exported from injected web3 provided like Metamask.
## License

Expand Down
2 changes: 1 addition & 1 deletion example/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default class App extends Component {
render() {
return (
<div>
<PayFiat oceanAmount={105} currency="EUR" />
<PayFiat oceanAmount={200} currency="EUR" receiverAccount="0x5f410f5eE92D8BBE4df673ceef9D90B414B04f67" />
</div>
)
}
Expand Down
1 change: 0 additions & 1 deletion example/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ import ReactDOM from 'react-dom'
import './index.css'
import App from './App'

console.log(process.env.REACT_APP_PAYFIAT_SERVER_URL)
ReactDOM.render(<App />, document.getElementById('root'))
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "payfiat",
"version": "1.0.0",
"version": "1.1.0",
"description": "React component to allow users to pay for Ocean Protocol assets in fiat currency",
"author": "akshay-ap",
"license": "Apache 2.0",
Expand Down Expand Up @@ -70,4 +70,4 @@
"files": [
"dist"
]
}
}
10 changes: 10 additions & 0 deletions server/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
STRIPE_PUBLISHABLE_KEY=<your-stripe-publsih-key>
STRIPE_SECRET_KEY=<your-stripe-secret-key>
STRIPE_WEBHOOK_SECRET=<your-stripe-webhook-secret>

INFURA_NODE=<infura-node-url>
PACIFIC_NODE="https://pacific.oceanprotocol.com"
PORT=4242
OCEAN_CONTRACT_ADDRESS=<ocean-token-contract-address-based-on-network>
OCEAN_FROM_KEY=<ocean-token-funding-wallet-private-key-without-0x>
OCEAN_FROM_ADDRESS=<ocean-token-funding-wallet-address>
12 changes: 12 additions & 0 deletions server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Running the server

We included several RESTful server that each implement the same endpoints and logic.
Pick the language you are most comfortable in and follow the instructions in the directory on how to run.

# Supported languages

* [JavaScript (Node)](node/README.md)
* [Python (Flask)](python/README.md)
* [Ruby (Sinatra)](ruby/README.md)
* [PHP (Slim)](php/README.md)
* [Java (Spark)](java/README.md)
20 changes: 20 additions & 0 deletions server/src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Name of sample
An [Express server](http://expressjs.com) implementation

## Requirements
* Node v10+
* [Configured .env file](../README.md)

## How to run

1. Install dependencies

```
npm install
```

2. Run the application

```
npm start
```
1 change: 1 addition & 0 deletions server/src/abi/ERC20.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"name": "Transfer", "inputs": [{"type": "address", "name": "_from", "indexed": true}, {"type": "address", "name": "_to", "indexed": true}, {"type": "uint256", "name": "_value", "indexed": false}], "anonymous": false, "type": "event"}, {"name": "Approval", "inputs": [{"type": "address", "name": "_owner", "indexed": true}, {"type": "address", "name": "_spender", "indexed": true}, {"type": "uint256", "name": "_value", "indexed": false}], "anonymous": false, "type": "event"}, {"name": "__init__", "outputs": [], "inputs": [{"type": "bytes32", "name": "_name"}, {"type": "bytes32", "name": "_symbol"}, {"type": "uint256", "name": "_decimals"}, {"type": "uint256", "name": "_supply"}], "constant": false, "payable": false, "type": "constructor"}, {"name": "deposit", "outputs": [], "inputs": [], "constant": false, "payable": true, "type": "function", "gas": 74279}, {"name": "withdraw", "outputs": [{"type": "bool", "name": "out"}], "inputs": [{"type": "uint256", "name": "_value"}], "constant": false, "payable": false, "type": "function", "gas": 108706}, {"name": "totalSupply", "outputs": [{"type": "uint256", "name": "out"}], "inputs": [], "constant": true, "payable": false, "type": "function", "gas": 543}, {"name": "balanceOf", "outputs": [{"type": "uint256", "name": "out"}], "inputs": [{"type": "address", "name": "_owner"}], "constant": true, "payable": false, "type": "function", "gas": 745}, {"name": "transfer", "outputs": [{"type": "bool", "name": "out"}], "inputs": [{"type": "address", "name": "_to"}, {"type": "uint256", "name": "_value"}], "constant": false, "payable": false, "type": "function", "gas": 74698}, {"name": "transferFrom", "outputs": [{"type": "bool", "name": "out"}], "inputs": [{"type": "address", "name": "_from"}, {"type": "address", "name": "_to"}, {"type": "uint256", "name": "_value"}], "constant": false, "payable": false, "type": "function", "gas": 110600}, {"name": "approve", "outputs": [{"type": "bool", "name": "out"}], "inputs": [{"type": "address", "name": "_spender"}, {"type": "uint256", "name": "_value"}], "constant": false, "payable": false, "type": "function", "gas": 37888}, {"name": "allowance", "outputs": [{"type": "uint256", "name": "out"}], "inputs": [{"type": "address", "name": "_owner"}, {"type": "address", "name": "_spender"}], "constant": true, "payable": false, "type": "function", "gas": 1025}, {"name": "name", "outputs": [{"type": "bytes32", "name": "out"}], "inputs": [], "constant": true, "payable": false, "type": "function", "gas": 723}, {"name": "symbol", "outputs": [{"type": "bytes32", "name": "out"}], "inputs": [], "constant": true, "payable": false, "type": "function", "gas": 753}, {"name": "decimals", "outputs": [{"type": "uint256", "name": "out"}], "inputs": [], "constant": true, "payable": false, "type": "function", "gas": 783}]
Loading

0 comments on commit 889c150

Please sign in to comment.