Skip to content

Commit

Permalink
v13.12.3: fix World App transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNe0x1 committed Oct 8, 2024
1 parent 3bb11b3 commit dfba92b
Show file tree
Hide file tree
Showing 13 changed files with 48 additions and 34 deletions.
10 changes: 6 additions & 4 deletions dist/esm/index.evm.js
Original file line number Diff line number Diff line change
Expand Up @@ -50690,7 +50690,7 @@ const transactionParams = async ({ paymentRoute, options })=> {
if(options && _optionalChain$1([options, 'optionalAccess', _9 => _9.wallet, 'optionalAccess', _10 => _10.name]) === 'World App' && paymentRoute.blockchain === 'worldchain'){

const permitDeadline = Math.floor(Date.now() / 1000) + 30 * 60;
const nonce = getPermit2SignatureTransferNonce({ blockchain: paymentRoute.blockchain, address: paymentRoute.fromAddress });
const nonce = await getPermit2SignatureTransferNonce({ blockchain: paymentRoute.blockchain, address: paymentRoute.fromAddress });

const permitTransfer = {
permitted: {
Expand Down Expand Up @@ -50798,9 +50798,9 @@ supported.solana = [];

let solanaGetTransaction = ()=>{};

const getTransaction$1 = ({ paymentRoute, fee })=>{
const getTransaction$1 = ({ paymentRoute, fee, options })=>{
if(supported.evm.includes(paymentRoute.blockchain)) {
return getTransaction$2({ paymentRoute, fee })
return getTransaction$2({ paymentRoute, fee, options })
} else if(supported.solana.includes(paymentRoute.blockchain)) {
return solanaGetTransaction()
} else {
Expand Down Expand Up @@ -50847,7 +50847,9 @@ class PaymentRoute {
this.approvalRequired = approvalRequired;
this.approvalTransaction = approvalTransaction;
this.directTransfer = directTransfer;
this.getTransaction = async (options)=> await getTransaction$1({ paymentRoute: this, options });
this.getTransaction = async (options)=> {
return await getTransaction$1({ paymentRoute: this, options })
};
}
}

Expand Down
12 changes: 7 additions & 5 deletions dist/esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2254,7 +2254,7 @@ const transactionParams = async ({ paymentRoute, options })=> {
if(options && _optionalChain$1([options, 'optionalAccess', _9 => _9.wallet, 'optionalAccess', _10 => _10.name]) === 'World App' && paymentRoute.blockchain === 'worldchain'){

const permitDeadline = Math.floor(Date.now() / 1000) + 30 * 60;
const nonce = getPermit2SignatureTransferNonce({ blockchain: paymentRoute.blockchain, address: paymentRoute.fromAddress });
const nonce = await getPermit2SignatureTransferNonce({ blockchain: paymentRoute.blockchain, address: paymentRoute.fromAddress });

const permitTransfer = {
permitted: {
Expand Down Expand Up @@ -2360,11 +2360,11 @@ let supported = ['ethereum', 'bsc', 'polygon', 'solana', 'fantom', 'arbitrum', '
supported.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain'];
supported.solana = ['solana'];

const getTransaction$1 = ({ paymentRoute, fee })=>{
const getTransaction$1 = ({ paymentRoute, fee, options })=>{
if(supported.evm.includes(paymentRoute.blockchain)) {
return getTransaction$2({ paymentRoute, fee })
return getTransaction$2({ paymentRoute, fee, options })
} else if(supported.solana.includes(paymentRoute.blockchain)) {
return getTransaction$3({ paymentRoute, fee })
return getTransaction$3({ paymentRoute, fee, options })
} else {
throw('Blockchain not supported!')
}
Expand Down Expand Up @@ -2409,7 +2409,9 @@ class PaymentRoute {
this.approvalRequired = approvalRequired;
this.approvalTransaction = approvalTransaction;
this.directTransfer = directTransfer;
this.getTransaction = async (options)=> await getTransaction$1({ paymentRoute: this, options });
this.getTransaction = async (options)=> {
return await getTransaction$1({ paymentRoute: this, options })
};
}
}

Expand Down
8 changes: 5 additions & 3 deletions dist/esm/index.solana.js
Original file line number Diff line number Diff line change
Expand Up @@ -3360,11 +3360,11 @@ supported.solana = ['solana'];

let evmGetTransaction = ()=>{};

const getTransaction$1 = ({ paymentRoute, fee })=>{
const getTransaction$1 = ({ paymentRoute, fee, options })=>{
if(supported.evm.includes(paymentRoute.blockchain)) {
return evmGetTransaction()
} else if(supported.solana.includes(paymentRoute.blockchain)) {
return getTransaction$2({ paymentRoute, fee })
return getTransaction$2({ paymentRoute, fee, options })
} else {
throw('Blockchain not supported!')
}
Expand Down Expand Up @@ -3409,7 +3409,9 @@ class PaymentRoute {
this.approvalRequired = approvalRequired;
this.approvalTransaction = approvalTransaction;
this.directTransfer = directTransfer;
this.getTransaction = async (options)=> await getTransaction$1({ paymentRoute: this, options });
this.getTransaction = async (options)=> {
return await getTransaction$1({ paymentRoute: this, options })
};
}
}

Expand Down
10 changes: 6 additions & 4 deletions dist/umd/index.evm.js
Original file line number Diff line number Diff line change
Expand Up @@ -50696,7 +50696,7 @@
if(options && _optionalChain$1([options, 'optionalAccess', _9 => _9.wallet, 'optionalAccess', _10 => _10.name]) === 'World App' && paymentRoute.blockchain === 'worldchain'){

const permitDeadline = Math.floor(Date.now() / 1000) + 30 * 60;
const nonce = getPermit2SignatureTransferNonce({ blockchain: paymentRoute.blockchain, address: paymentRoute.fromAddress });
const nonce = await getPermit2SignatureTransferNonce({ blockchain: paymentRoute.blockchain, address: paymentRoute.fromAddress });

const permitTransfer = {
permitted: {
Expand Down Expand Up @@ -50804,9 +50804,9 @@

let solanaGetTransaction = ()=>{};

const getTransaction$1 = ({ paymentRoute, fee })=>{
const getTransaction$1 = ({ paymentRoute, fee, options })=>{
if(supported.evm.includes(paymentRoute.blockchain)) {
return getTransaction$2({ paymentRoute, fee })
return getTransaction$2({ paymentRoute, fee, options })
} else if(supported.solana.includes(paymentRoute.blockchain)) {
return solanaGetTransaction()
} else {
Expand Down Expand Up @@ -50853,7 +50853,9 @@
this.approvalRequired = approvalRequired;
this.approvalTransaction = approvalTransaction;
this.directTransfer = directTransfer;
this.getTransaction = async (options)=> await getTransaction$1({ paymentRoute: this, options });
this.getTransaction = async (options)=> {
return await getTransaction$1({ paymentRoute: this, options })
};
}
}

Expand Down
12 changes: 7 additions & 5 deletions dist/umd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2259,7 +2259,7 @@
if(options && _optionalChain$1([options, 'optionalAccess', _9 => _9.wallet, 'optionalAccess', _10 => _10.name]) === 'World App' && paymentRoute.blockchain === 'worldchain'){

const permitDeadline = Math.floor(Date.now() / 1000) + 30 * 60;
const nonce = getPermit2SignatureTransferNonce({ blockchain: paymentRoute.blockchain, address: paymentRoute.fromAddress });
const nonce = await getPermit2SignatureTransferNonce({ blockchain: paymentRoute.blockchain, address: paymentRoute.fromAddress });

const permitTransfer = {
permitted: {
Expand Down Expand Up @@ -2365,11 +2365,11 @@
supported.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base', 'worldchain'];
supported.solana = ['solana'];

const getTransaction$1 = ({ paymentRoute, fee })=>{
const getTransaction$1 = ({ paymentRoute, fee, options })=>{
if(supported.evm.includes(paymentRoute.blockchain)) {
return getTransaction$2({ paymentRoute, fee })
return getTransaction$2({ paymentRoute, fee, options })
} else if(supported.solana.includes(paymentRoute.blockchain)) {
return getTransaction$3({ paymentRoute, fee })
return getTransaction$3({ paymentRoute, fee, options })
} else {
throw('Blockchain not supported!')
}
Expand Down Expand Up @@ -2414,7 +2414,9 @@
this.approvalRequired = approvalRequired;
this.approvalTransaction = approvalTransaction;
this.directTransfer = directTransfer;
this.getTransaction = async (options)=> await getTransaction$1({ paymentRoute: this, options });
this.getTransaction = async (options)=> {
return await getTransaction$1({ paymentRoute: this, options })
};
}
}

Expand Down
8 changes: 5 additions & 3 deletions dist/umd/index.solana.js
Original file line number Diff line number Diff line change
Expand Up @@ -3365,11 +3365,11 @@

let evmGetTransaction = ()=>{};

const getTransaction$1 = ({ paymentRoute, fee })=>{
const getTransaction$1 = ({ paymentRoute, fee, options })=>{
if(supported.evm.includes(paymentRoute.blockchain)) {
return evmGetTransaction()
} else if(supported.solana.includes(paymentRoute.blockchain)) {
return getTransaction$2({ paymentRoute, fee })
return getTransaction$2({ paymentRoute, fee, options })
} else {
throw('Blockchain not supported!')
}
Expand Down Expand Up @@ -3414,7 +3414,9 @@
this.approvalRequired = approvalRequired;
this.approvalTransaction = approvalTransaction;
this.directTransfer = directTransfer;
this.getTransaction = async (options)=> await getTransaction$1({ paymentRoute: this, options });
this.getTransaction = async (options)=> {
return await getTransaction$1({ paymentRoute: this, options })
};
}
}

Expand Down
4 changes: 2 additions & 2 deletions examples/worldchain.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ let routes = await Web3Payments.route({
}
})

let route = routes[1]
let transaction = await route.getTransaction()
let route = routes[0]
let transaction = await route.getTransaction({wallet: {name: 'World App'}})

const wallet = (await Web3Wallets.getWallets())[0]
wallet.sendTransaction(transaction)
Expand Down
2 changes: 1 addition & 1 deletion 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.2",
"version": "13.12.3",
"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 Down
2 changes: 1 addition & 1 deletion 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.2",
"version": "13.12.3",
"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
2 changes: 1 addition & 1 deletion 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.2",
"version": "13.12.3",
"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 Down
2 changes: 1 addition & 1 deletion src/platforms/evm/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ const transactionParams = async ({ paymentRoute, options })=> {
if(options && options?.wallet?.name === 'World App' && paymentRoute.blockchain === 'worldchain'){

const permitDeadline = Math.floor(Date.now() / 1000) + 30 * 60
const nonce = getPermit2SignatureTransferNonce({ blockchain: paymentRoute.blockchain, address: paymentRoute.fromAddress })
const nonce = await getPermit2SignatureTransferNonce({ blockchain: paymentRoute.blockchain, address: paymentRoute.fromAddress })

const permitTransfer = {
permitted: {
Expand Down
4 changes: 3 additions & 1 deletion src/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ class PaymentRoute {
this.approvalRequired = approvalRequired
this.approvalTransaction = approvalTransaction
this.directTransfer = directTransfer
this.getTransaction = async (options)=> await getTransaction({ paymentRoute: this, options })
this.getTransaction = async (options)=> {
return await getTransaction({ paymentRoute: this, options })
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import { getTransaction as solanaGetTransaction} from './platforms/solana/transa

import { supported } from './blockchains'

const getTransaction = ({ paymentRoute, fee })=>{
const getTransaction = ({ paymentRoute, fee, options })=>{
if(supported.evm.includes(paymentRoute.blockchain)) {
return evmGetTransaction({ paymentRoute, fee })
return evmGetTransaction({ paymentRoute, fee, options })
} else if(supported.solana.includes(paymentRoute.blockchain)) {
return solanaGetTransaction({ paymentRoute, fee })
return solanaGetTransaction({ paymentRoute, fee, options })
} else {
throw('Blockchain not supported!')
}
Expand Down

0 comments on commit dfba92b

Please sign in to comment.