Skip to content

Commit

Permalink
v13.12.8: fix whitelist should not contain native if native is not on…
Browse files Browse the repository at this point in the history
… the whitelist
  • Loading branch information
0xNe0x1 committed Oct 19, 2024
1 parent a6640d3 commit 96d5a77
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 14 deletions.
5 changes: 4 additions & 1 deletion dist/esm/index.evm.js
Original file line number Diff line number Diff line change
Expand Up @@ -51458,7 +51458,10 @@ function route({ accept, from, whitelist, blacklist, drip }) {

// add native currency as priority if does not exist already
[...new Set(blockchains)].forEach((blockchain)=>{
if(!priority.find((priority)=>priority.blockchain === blockchain && priority.address === Blockchains[blockchain].currency.address)) {
if(
!priority.find((priority)=>priority.blockchain === blockchain && priority.address === Blockchains[blockchain].currency.address) &&
(!whitelist || (whitelist && whitelist[blockchain] && whitelist[blockchain].includes(Blockchains[blockchain].currency.address)))
) {
priority.push({ blockchain, address: Blockchains[blockchain].currency.address });
}
});
Expand Down
5 changes: 4 additions & 1 deletion dist/esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2505,7 +2505,10 @@ function route({ accept, from, whitelist, blacklist, drip }) {

// add native currency as priority if does not exist already
[...new Set(blockchains)].forEach((blockchain)=>{
if(!priority.find((priority)=>priority.blockchain === blockchain && priority.address === Blockchains[blockchain].currency.address)) {
if(
!priority.find((priority)=>priority.blockchain === blockchain && priority.address === Blockchains[blockchain].currency.address) &&
(!whitelist || (whitelist && whitelist[blockchain] && whitelist[blockchain].includes(Blockchains[blockchain].currency.address)))
) {
priority.push({ blockchain, address: Blockchains[blockchain].currency.address });
}
});
Expand Down
5 changes: 4 additions & 1 deletion dist/esm/index.solana.js
Original file line number Diff line number Diff line change
Expand Up @@ -3502,7 +3502,10 @@ function route({ accept, from, whitelist, blacklist, drip }) {

// add native currency as priority if does not exist already
[...new Set(blockchains)].forEach((blockchain)=>{
if(!priority.find((priority)=>priority.blockchain === blockchain && priority.address === Blockchains[blockchain].currency.address)) {
if(
!priority.find((priority)=>priority.blockchain === blockchain && priority.address === Blockchains[blockchain].currency.address) &&
(!whitelist || (whitelist && whitelist[blockchain] && whitelist[blockchain].includes(Blockchains[blockchain].currency.address)))
) {
priority.push({ blockchain, address: Blockchains[blockchain].currency.address });
}
});
Expand Down
5 changes: 4 additions & 1 deletion dist/umd/index.evm.js
Original file line number Diff line number Diff line change
Expand Up @@ -51464,7 +51464,10 @@

// add native currency as priority if does not exist already
[...new Set(blockchains)].forEach((blockchain)=>{
if(!priority.find((priority)=>priority.blockchain === blockchain && priority.address === Blockchains__default["default"][blockchain].currency.address)) {
if(
!priority.find((priority)=>priority.blockchain === blockchain && priority.address === Blockchains__default["default"][blockchain].currency.address) &&
(!whitelist || (whitelist && whitelist[blockchain] && whitelist[blockchain].includes(Blockchains__default["default"][blockchain].currency.address)))
) {
priority.push({ blockchain, address: Blockchains__default["default"][blockchain].currency.address });
}
});
Expand Down
5 changes: 4 additions & 1 deletion dist/umd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2510,7 +2510,10 @@

// add native currency as priority if does not exist already
[...new Set(blockchains)].forEach((blockchain)=>{
if(!priority.find((priority)=>priority.blockchain === blockchain && priority.address === Blockchains__default["default"][blockchain].currency.address)) {
if(
!priority.find((priority)=>priority.blockchain === blockchain && priority.address === Blockchains__default["default"][blockchain].currency.address) &&
(!whitelist || (whitelist && whitelist[blockchain] && whitelist[blockchain].includes(Blockchains__default["default"][blockchain].currency.address)))
) {
priority.push({ blockchain, address: Blockchains__default["default"][blockchain].currency.address });
}
});
Expand Down
5 changes: 4 additions & 1 deletion dist/umd/index.solana.js
Original file line number Diff line number Diff line change
Expand Up @@ -3507,7 +3507,10 @@

// add native currency as priority if does not exist already
[...new Set(blockchains)].forEach((blockchain)=>{
if(!priority.find((priority)=>priority.blockchain === blockchain && priority.address === Blockchains__default["default"][blockchain].currency.address)) {
if(
!priority.find((priority)=>priority.blockchain === blockchain && priority.address === Blockchains__default["default"][blockchain].currency.address) &&
(!whitelist || (whitelist && whitelist[blockchain] && whitelist[blockchain].includes(Blockchains__default["default"][blockchain].currency.address)))
) {
priority.push({ blockchain, address: Blockchains__default["default"][blockchain].currency.address });
}
});
Expand Down
4 changes: 2 additions & 2 deletions package.evm.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/web3-payments-evm",
"moduleName": "Web3Payments",
"version": "13.12.7",
"version": "13.12.8",
"description": "JavaScript library to scan crypto wallets for liquefiable assets and perform cost-effective, auto-converted payments on-chain.",
"main": "dist/umd/index.evm.js",
"module": "dist/esm/index.evm.js",
Expand All @@ -27,7 +27,7 @@
"dependencies": {},
"peerDependencies": {
"@depay/web3-assets-evm": "^7.4.0",
"@depay/web3-blockchains": "^9.6.5",
"@depay/web3-blockchains": "^9.6.9",
"@depay/web3-exchanges-evm": "^13.11.0",
"@depay/web3-tokens-evm": "^10.4.3",
"ethers": "^5.7.1"
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/web3-payments",
"moduleName": "Web3Payments",
"version": "13.12.7",
"version": "13.12.8",
"description": "JavaScript library to scan crypto wallets for liquefiable assets and perform cost-effective, auto-converted payments on-chain.",
"main": "dist/umd/index.js",
"module": "dist/esm/index.js",
Expand Down Expand Up @@ -38,7 +38,7 @@
"peerDependencies": {
"@depay/solana-web3.js": "^1.26.0",
"@depay/web3-assets": "^7.4.0",
"@depay/web3-blockchains": "^9.6.5",
"@depay/web3-blockchains": "^9.6.9",
"@depay/web3-exchanges": "^13.11.0",
"@depay/web3-tokens": "^10.4.3",
"decimal.js": "^10.4.3",
Expand All @@ -56,7 +56,7 @@
"@depay/web3-assets": "^7.4.0",
"@depay/web3-assets-evm": "^7.4.0",
"@depay/web3-assets-solana": "^7.4.0",
"@depay/web3-blockchains": "^9.6.5",
"@depay/web3-blockchains": "^9.6.9",
"@depay/web3-client": "^10.19.1",
"@depay/web3-client-evm": "^10.19.1",
"@depay/web3-client-solana": "^10.19.1",
Expand Down
4 changes: 2 additions & 2 deletions package.solana.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/web3-payments-solana",
"moduleName": "Web3Payments",
"version": "13.12.7",
"version": "13.12.8",
"description": "JavaScript library to scan crypto wallets for liquefiable assets and perform cost-effective, auto-converted payments on-chain.",
"main": "dist/umd/index.solana.js",
"module": "dist/esm/index.solana.js",
Expand All @@ -28,7 +28,7 @@
"peerDependencies": {
"@depay/solana-web3.js": "^1.26.0",
"@depay/web3-assets-solana": "^7.4.0",
"@depay/web3-blockchains": "^9.6.5",
"@depay/web3-blockchains": "^9.6.9",
"@depay/web3-exchanges-solana": "^13.11.0",
"@depay/web3-tokens-solana": "^10.4.3",
"ethers": "^5.7.1",
Expand Down
5 changes: 4 additions & 1 deletion src/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ function route({ accept, from, whitelist, blacklist, drip }) {

// add native currency as priority if does not exist already
[...new Set(blockchains)].forEach((blockchain)=>{
if(!priority.find((priority)=>priority.blockchain === blockchain && priority.address === Blockchains[blockchain].currency.address)) {
if(
!priority.find((priority)=>priority.blockchain === blockchain && priority.address === Blockchains[blockchain].currency.address) &&
(!whitelist || (whitelist && whitelist[blockchain] && whitelist[blockchain].includes(Blockchains[blockchain].currency.address)))
) {
priority.push({ blockchain, address: Blockchains[blockchain].currency.address })
}
})
Expand Down

0 comments on commit 96d5a77

Please sign in to comment.