Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit

Permalink
fix: Update Paymaster URL environment variable. (#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcramer authored Jun 1, 2024
1 parent 6a727f4 commit 9508542
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-shirts-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@coinbase/build-onchain-apps': patch
---

- **fix**: Update Paymaster URL environment variable. By @cpcramer
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import { CallStatus } from './CallStatus';

// Use the local API URL to target the Paymaster directly without a proxy
// if running on localhost, otherwise use the Paymaster Proxy.
const paymasterURL = process.env.NEXT_PRIVATE_PAYMASTER_URL;
const paymasterURL = process.env.NEXT_PUBLIC_PAYMASTER_URL;
const isLocalEnv = isLocal();
const defaultUrl = isLocalEnv ? paymasterURL : `${document.location.origin}/api/paymaster-proxy`;

export default function PaymasterBundlerDemo() {
const { address } = useAccount();
const { data: transactionID, writeContracts } = useWriteContracts();
const { data: callID, writeContracts } = useWriteContracts();
const contract = usePaymasterBundlerContract();

if (contract.status !== 'ready') {
Expand Down Expand Up @@ -76,12 +76,7 @@ export default function PaymasterBundlerDemo() {
>
Mint NFT
</button>
{transactionID && <CallStatus id={transactionID} />}
{transactionID && (
<div className={clsx('mt-4 overflow-x-auto rounded-lg bg-gray-800 p-4 text-lg')}>
<strong>Transaction ID:</strong> <span className="break-all">{transactionID}</span>
</div>
)}
{callID && <CallStatus id={callID} />}
</section>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion template/web/src/utils/paymasterClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { paymasterActionsEip7677 } from 'permissionless/experimental';
import { createClient, http } from 'viem';
import { baseSepolia } from 'viem/chains';

const paymasterService = process.env.NEXT_PRIVATE_PAYMASTER_URL ?? '';
const paymasterService = process.env.NEXT_PUBLIC_PAYMASTER_URL ?? '';

export const paymasterClient = createClient({
chain: baseSepolia,
Expand Down

0 comments on commit 9508542

Please sign in to comment.