Mppx.restore
Restore the original global fetch
Choose a signing account
Create a server-only wallet.ts module, then import account wherever an example creates a local signing account.
wallet.ts
import { privateKeyToAccount } from 'viem/accounts'
export const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`)Restores the original fetch after Mppx.create() polyfilled it.
Usage
import { } from 'accounts'
import { , } from 'mppx/client'
const = .({ : false }) // Avoid double 402 handling; mppx is configured below.
await .({ : 'wallet_connect' })
.({
: [({
: .({ : true }),
: .,
})],
})
// ... use payment-aware fetch ...
.()import { , } from 'mppx/client'
import { } from 'viem/accounts'
const = ('0x...')
.({
: [({ })],
})
// ... use payment-aware fetch ...
.()Return type
voidParameters
None.