Skip to content

Commit

Permalink
v11.1.0: adds platform specific packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
10xSebastian committed May 25, 2023
1 parent 9bd1657 commit 2437636
Show file tree
Hide file tree
Showing 54 changed files with 120,034 additions and 162 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/publish-evm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish EVM

on:
release:
types: [created]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'

- run: mv package.evm.json package.json

- run: yarn install

- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master

- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/publish-solana.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish Solana

on:
release:
types: [created]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'

- run: mv package.solana.json package.json

- run: yarn install

- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master

- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
54 changes: 30 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,30 @@ yarn add ethers react react-dom
npm install ethers react react-dom --save
```

## Platform specific packaging

In case you want to use and package only specific platforms, use the platform-specific package:

### EVM platform specific packaging

```
yarn add @depay/widgets-evm
```

```javascript
import DePayWidgets from '@depay/widgets-evm'
```

### Solana platform specific packaging

```
yarn add @depay/widgets-solana
```

```javascript
import DePayWidgets from '@depay/widgets-solana'
```

## Server-side rendering

Make sure you load this library as a client-side script for client-side rendering (CSR), in case you are using a server-side rendering (SSR) framework like next.js.
Expand All @@ -46,7 +70,7 @@ https://app.depay.com/integrations/new

For a more low-key technical example/demo page have a look at:

https://depayfi.github.io/widgets/dev.bundle.html
https://depayfi.github.io/widgets/demo.bundle.html

## Support

Expand All @@ -55,31 +79,13 @@ https://depayfi.github.io/widgets/dev.bundle.html
- [Ethereum](https://ethereum.org)
- [BNB Smart Chain](https://www.binance.org/smartChain)
- [Polygon](https://polygon.technology)
- [Solana](https://solana.com)

### Wallets

DePay supports the most popular crypto wallets:

- [MetaMask](https://metamask.io)
- [Coinbase Wallet](https://wallet.coinbase.com)

100+ additional wallets via [WalletConnect](https://walletconnect.org), such as:
- [Trust Wallet](https://trustwallet.com)
- [DeFi Wallet by crypto.com](https://crypto.com/defi-wallet)
- [1inch Wallet](https://1inch.io/wallet/)
- [imToken Wallet](https://www.token.im)
- [TokenPocket](https://www.tokenpocket.pro/en)
- [Pillar](https://www.pillar.fi/)
- [Math Wallet](https://mathwallet.org/)
- [Ledger Live](https://www.ledger.com/ledger-live)
- [Argent Wallet](https://www.argent.xyz)
- [AlphaWallet](https://alphawallet.com/)
- [Unstoppable Wallet](https://unstoppable.money)
- [Atomic Wallet](https://atomicwallet.io)
- [Rainbow](https://rainbow.me/)
- and more...

## DePay Payments
DePay supports [most crypto wallets](https://depay.com/wallets).

## DePayWidgets: Payments

DePay Payments allows you to accept and perform crypto payments.

Expand Down Expand Up @@ -906,7 +912,7 @@ DePayWidgets.Payment({
})
```

## DePay Sales
## DePayWidgets: Sale

DePay Sales allows you to sell tokens directly from your website or dApp with automatic any-to-any payment conversion (so people can use any token when buying your token directly off your website or dApp).

Expand Down
104 changes: 85 additions & 19 deletions dev.bundle.html → demo.bundle.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="https://depay.com/favicon.png"/>
<title>Development</title>
<title>Demo (bundled)</title>
<script defer async src="dist/umd/index.bundle.js"></script>
<link rel="stylesheet" href="https://unpkg.com/bootstrap@4.1.0/dist/css/bootstrap.css">
<style>
Expand Down Expand Up @@ -151,8 +151,8 @@ <h5 class="px-4">Payment: Solana</h5>
accept: [
{
blockchain: 'solana',
amount: 0.1,
token: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
amount: 0.001,
token: '11111111111111111111111111111111',
receiver: '3Hrw6AsNyJAp71Nkgo4tzJwvGM47DzqMdAtf8ojptkXk'
},
]
Expand All @@ -163,6 +163,47 @@ <h5 class="px-4">Payment: Solana</h5>
</div>
</div>
</div>

<div class="d-block d-md-inline-block p-2 col-12 col-md-4">
<div class="px-0 py-4 rounded-lg bg-white border">
<div class="col px-0">
<div class="overflow-auto" style="height: 140px;">
<h5 class="px-4">Payment: Solana with Fee + Tracking</h5>
<div class="px-4">
<div class="text-secondary ">Accept payments on solana.</div>
</div>
</div>
<div class="px-4 pt-3">
<button class='btn btn-primary' id="paySolanaWithFeeAndTracking">Try it</button>
<script>
var button = document.getElementById("paySolanaWithFeeAndTracking");
button.addEventListener("click",function(e){
DePayWidgets.Payment({
accept: [
{
blockchain: 'solana',
amount: 0.01,
token: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
receiver: '3Hrw6AsNyJAp71Nkgo4tzJwvGM47DzqMdAtf8ojptkXk',
fee: {
amount: "51%",
receiver: "5AcFMJZkXo14r3Hj99iYd1HScPiM4hAcLZf552DfZkxa"
}
},
],
track: {
method: (payment)=>{
console.log('TRACK', payment)
return axios.post('/track', payment)
}
}
});
});
</script>
</div>
</div>
</div>
</div>

<div class="d-block d-md-inline-block p-2 col-12 col-md-4">
<div class="px-0 py-4 rounded-lg bg-white border">
Expand Down Expand Up @@ -230,6 +271,32 @@ <h5 class="px-4">Payment: fromToken+fromAmount</h5>
</div>
</div>

<div class="d-block d-md-inline-block p-2 col-12 col-md-4">
<div class="px-0 py-4 rounded-lg bg-white border">
<div class="col px-0">
<div class="overflow-auto" style="height: 140px;">
<h5 class="px-4">Payment: change title to donation</h5>
</div>
<div class="px-4 pt-3">
<button id="payChangeTitleAndAction" class="btn btn-primary">Try it</button>
<script>
var button = document.getElementById("payChangeTitleAndAction");
button.addEventListener("click",function(e){
DePayWidgets.Payment({
title: 'Donation',
accept: [{
blockchain: 'bsc',
token: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
receiver: '0x08B277154218CCF3380CAE48d630DA13462E3950'
}]
});
});
</script>
</div>
</div>
</div>
</div>


<div class="d-block d-md-inline-block p-2 col-12 col-md-4">
<div class="px-0 py-4 rounded-lg bg-white border">
Expand Down Expand Up @@ -480,12 +547,12 @@ <h5 class="px-4">Payment: with Fee</h5>
blockchain: 'bsc',
amount: 100,
token: '0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56',
receiver: '0x08B277154218CCF3380CAE48d630DA13462E3950'
receiver: '0x08B277154218CCF3380CAE48d630DA13462E3950',
fee: {
amount: '10%',
receiver: '0x8a4aDA571ab235BF7d586d02E534D08552B3dedb'
}
}],
fee: {
amount: '10%',
receiver: '0x8a4aDA571ab235BF7d586d02E534D08552B3dedb'
}
});
});
</script>
Expand Down Expand Up @@ -514,12 +581,12 @@ <h5 class="px-4">Payment: with Fee and tracking/validation</h5>
blockchain: 'polygon',
amount: 0.0001,
token: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
receiver: '0x317D875cA3B9f8d14f960486C0d1D1913be74e90'
receiver: '0x317D875cA3B9f8d14f960486C0d1D1913be74e90',
fee: {
amount: '1%',
receiver: '0x8a4aDA571ab235BF7d586d02E534D08552B3dedb'
},
}],
fee: {
amount: '1%',
receiver: '0x8a4aDA571ab235BF7d586d02E534D08552B3dedb'
},
track: {
endpoint: '/track'
}
Expand Down Expand Up @@ -551,12 +618,12 @@ <h5 class="px-4">Payment: with Fee and tracking/validation Token</h5>
blockchain: 'polygon',
amount: 1,
token: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174',
receiver: '0x08B277154218CCF3380CAE48d630DA13462E3950'
receiver: '0x08B277154218CCF3380CAE48d630DA13462E3950',
fee: {
amount: '1%',
receiver: '0x8a4aDA571ab235BF7d586d02E534D08552B3dedb'
},
}],
fee: {
amount: '1%',
receiver: '0x8a4aDA571ab235BF7d586d02E534D08552B3dedb'
},
track: {
endpoint: '/track'
}
Expand Down Expand Up @@ -1006,7 +1073,6 @@ <h5 class="px-4">Loading Dialog</h5>
</div>
</div>
</div>

</div>
</div>
</body>
Expand Down
Loading

0 comments on commit 2437636

Please sign in to comment.