Skip to content

Commit

Permalink
update gasless examples to include sa 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahat-ch committed Sep 22, 2023
1 parent 61b066c commit d463348
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/apireference/webhookapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ When building out the `paymasterServiceData` object you can optionally pass your
```typescript
let paymasterServiceData: SponsorUserOperationDto = {
mode: PaymasterMode.SPONSORED,
smartAccountInfo: {
name: 'BICONOMY',
version: '2.0.0'
},
calculateGasLimits: true,
webhookData: {
num: 2
Expand Down
8 changes: 8 additions & 0 deletions docs/howtos/executinguserops/gaslessTransactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ We now need to construct the `paymasterAndData` field of our userOp. This is don
const biconomyPaymaster = smartAccount.paymaster as IHybridPaymaster<SponsorUserOperationDto>;
let paymasterServiceData: SponsorUserOperationDto = {
mode: PaymasterMode.SPONSORED,
smartAccountInfo: {
name: 'BICONOMY',
version: '2.0.0'
},
};
const paymasterAndDataResponse = await biconomyPaymaster.getPaymasterAndData(
userOp,
Expand Down Expand Up @@ -116,6 +120,10 @@ const userOpResponse = await smartAccount.sendUserOp(userOp);
smartAccount.paymaster as IHybridPaymaster<SponsorUserOperationDto>;
let paymasterServiceData: SponsorUserOperationDto = {
mode: PaymasterMode.SPONSORED,
smartAccountInfo: {
name: 'BICONOMY',
version: '2.0.0'
},
};
const paymasterAndDataResponse =
await biconomyPaymaster.getPaymasterAndData(
Expand Down
4 changes: 4 additions & 0 deletions docs/smartAccountv1/tutorials/nodejs/paywitherc20.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ async function mintNFT() {

let paymasterServiceData: SponsorUserOperationDto = {
mode: PaymasterMode.SPONSORED,
smartAccountInfo: {
name: 'BICONOMY',
version: '2.0.0'
},
};
console.log("getting paymaster and data");
try {
Expand Down
4 changes: 4 additions & 0 deletions docs/tutorials/React_vite/gasless-txn.md
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,10 @@ const Counter: React.FC<Props> = ({ smartAccount, provider }) => {

let paymasterServiceData: SponsorUserOperationDto = {
mode: PaymasterMode.SPONSORED,
smartAccountInfo: {
name: 'BICONOMY',
version: '2.0.0'
},
// optional params...
};

Expand Down
16 changes: 16 additions & 0 deletions docs/tutorials/nextjs/gaslesstransaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ We're going to need to pass three items to this component: the instance of the s
smartAccount.paymaster as IHybridPaymaster<SponsorUserOperationDto>;
let paymasterServiceData: SponsorUserOperationDto = {
mode: PaymasterMode.SPONSORED,
smartAccountInfo: {
name: 'BICONOMY',
version: '2.0.0'
},
};
const paymasterAndDataResponse =
await biconomyPaymaster.getPaymasterAndData(
Expand Down Expand Up @@ -132,6 +136,10 @@ The next few lines are important in making sure this becomes a gasless transacit

let paymasterServiceData: SponsorUserOperationDto = {
mode: PaymasterMode.SPONSORED,
smartAccountInfo: {
name: 'BICONOMY',
version: '2.0.0'
},
};
const paymasterAndDataResponse =
await biconomyPaymaster.getPaymasterAndData(
Expand Down Expand Up @@ -223,6 +231,10 @@ And make another update to the `handleMint` function:
smartAccount.paymaster as IHybridPaymaster<SponsorUserOperationDto>;
let paymasterServiceData: SponsorUserOperationDto = {
mode: PaymasterMode.SPONSORED,
smartAccountInfo: {
name: 'BICONOMY',
version: '2.0.0'
},
};
const paymasterAndDataResponse =
await biconomyPaymaster.getPaymasterAndData(
Expand Down Expand Up @@ -455,6 +467,10 @@ const Minter: React.FC<Props> = ({ smartAccount, address, provider }) => {
smartAccount.paymaster as IHybridPaymaster<SponsorUserOperationDto>;
let paymasterServiceData: SponsorUserOperationDto = {
mode: PaymasterMode.SPONSORED,
smartAccountInfo: {
name: 'BICONOMY',
version: '2.0.0'
},
};
const paymasterAndDataResponse =
await biconomyPaymaster.getPaymasterAndData(
Expand Down
4 changes: 4 additions & 0 deletions docs/tutorials/nodejs/batchingTransactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ async function mintNFT() {

let paymasterServiceData: SponsorUserOperationDto = {
mode: PaymasterMode.SPONSORED,
smartAccountInfo: {
name: 'BICONOMY',
version: '2.0.0'
},
};
console.log("getting paymaster and data")
try {
Expand Down
4 changes: 4 additions & 0 deletions docs/tutorials/nodejs/gaslessmint.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ async function mintNFT() {

let paymasterServiceData: SponsorUserOperationDto = {
mode: PaymasterMode.SPONSORED,
smartAccountInfo: {
name: 'BICONOMY',
version: '2.0.0'
},
};
console.log("getting paymaster and data");
try {
Expand Down
4 changes: 4 additions & 0 deletions docs/tutorials/nodejs/multichainmint.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ async function mintNFT() {

let paymasterServiceData: SponsorUserOperationDto = {
mode: PaymasterMode.SPONSORED,
smartAccountInfo: {
name: 'BICONOMY',
version: '2.0.0'
},
};
console.log("getting paymaster and data")
try {
Expand Down
4 changes: 4 additions & 0 deletions docs/tutorials/nodejs/paywitherc20.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ async function mintNFT() {

let paymasterServiceData: SponsorUserOperationDto = {
mode: PaymasterMode.SPONSORED,
smartAccountInfo: {
name: 'BICONOMY',
version: '2.0.0'
},
};
console.log("getting paymaster and data");
try {
Expand Down

0 comments on commit d463348

Please sign in to comment.