@infinex/wallet - Wallet App
iframe-hosted web wallet for ethereum
Usage
npx @infinex/wallet [serve|build] \
--output-directory=dist-wallet \
--identifier-strategy=jwt \
--identifier-strategy-jwt-claim=id \
--identifier-strategy-jwt-jwks={} \
--redirect-url=http://localhost
- Run
build
and upload the resulting HTML/JS output to a static web host. - Use
@infinex/wallet-sdk
to communicate with the wallet. - For security, both the wallet and the parent app must be on separate origins.
- These can be different ports and/or different domains or subdomains.
postMessage API
Unlock Wallet
{ "id": 1234, "method": "unlock", "args": { "identifier": "jwt_or_other_identifier..." } }
{ "id": 1234, "result": { "address": "0xabc123bef987" } }
{ "id": 1234, "error": { "message": "No wallet with the provided identifier" } }
Sign Message
{ "id": 5678, "method": "signMessage", "args": { "message": "my message" } }<
{ "id": 5678, "result": { "signature": "abc123bef987" } }
{ "id": 5678, "error": { "message": "Wallet is locked" } }
Sign Transaction
{
"id": 9012,
"method": "signTransaction",
"args": { "transaction": "raw-transaction" }
}
Lock Wallet
{ "id": 3456, "method": "lock" }
{ "id": 3456, "result": {} }
{ "id": 3456, "error": { "message": "Wallet is already locked" } }
Clear Wallet Storage
{ "id": 7890, "method": "clearStorage" }
{ "id": 7890, "result": {} }
{ "id": 7890, "error": { "message": "Wallet app is not initialised" } }