Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { RpcRequestInput } from './RpcRequestInput';

const baseRequestInfo: RpcRequestInput = {
method: 'base_requestInfo',
params: [
{
key: 'requests',
required: true,
}
],
format: (data: Record<string, string>) => [
{
requests: data.requests,
}
],
};

export const baseProfileMethods = [baseRequestInfo];
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { ShortcutType } from './ShortcutType';

const baseRequestInfoShortcut: ShortcutType = {
key: "Request Info",
data: {
requests: [
{
type: "email" as const,
optional: true,
},
{
type: "physicalAddress" as const,
optional: true,
},
{
type: "name" as const,
optional: false,
},
{
type: "phoneNumber" as const,
optional: false,
},

],
},
};

export const baseProfileShortcutsMap: Record<string, ShortcutType[]> = {
base_requestInfo: [baseRequestInfoShortcut],
};
7 changes: 7 additions & 0 deletions examples/testapp/src/pages/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import React, { useEffect } from 'react';
import { EventListenersCard } from '../components/EventListeners/EventListenersCard';
import { WIDTH_2XL } from '../components/Layout';
import { MethodsSection } from '../components/MethodsSection/MethodsSection';
import { baseProfileMethods } from '../components/RpcMethods/method/baseProfileMethods';
import { connectionMethods } from '../components/RpcMethods/method/connectionMethods';
import { ephemeralMethods } from '../components/RpcMethods/method/ephemeralMethods';
import { multiChainMethods } from '../components/RpcMethods/method/multiChainMethods';
import { readonlyJsonRpcMethods } from '../components/RpcMethods/method/readonlyJsonRpcMethods';
import { sendMethods } from '../components/RpcMethods/method/sendMethods';
import { signMessageMethods } from '../components/RpcMethods/method/signMessageMethods';
import { walletTxMethods } from '../components/RpcMethods/method/walletTxMethods';
import { baseProfileShortcutsMap } from '../components/RpcMethods/shortcut/baseProfileShortcuts';
import { connectionMethodShortcutsMap } from '../components/RpcMethods/shortcut/connectionMethodShortcuts';
import { ephemeralMethodShortcutsMap } from '../components/RpcMethods/shortcut/ephemeralMethodShortcuts';
import { multiChainShortcutsMap } from '../components/RpcMethods/shortcut/multipleChainShortcuts';
Expand Down Expand Up @@ -83,6 +85,11 @@ export default function Home() {
methods={ephemeralMethods}
shortcutsMap={ephemeralMethodShortcutsMap}
/>
<MethodsSection
title="Base Profile"
methods={baseProfileMethods}
shortcutsMap={baseProfileShortcutsMap}
/>
{shouldShowMethodsRequiringConnection && (
<>
<MethodsSection
Expand Down
2 changes: 2 additions & 0 deletions packages/account-sdk/src/sign/base-account/Signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ export class Signer {
);
return this.sendRequestToPopup(modifiedRequest);
}
case 'base_requestInfo':
case 'wallet_sendCalls':
case 'wallet_sign': {
return this.sendRequestToPopup(request);
Expand Down Expand Up @@ -254,6 +255,7 @@ export class Signer {
case 'wallet_sendCalls':
case 'wallet_showCallsStatus':
case 'wallet_grantPermissions':
case 'base_requestInfo':
return this.sendRequestToPopup(request);
case 'wallet_connect': {
// Wait for the popup to be loaded before making async calls
Expand Down
Loading