Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Zizzamia committed Mar 5, 2024
1 parent e2f5779 commit 1af52dc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
13 changes: 8 additions & 5 deletions site/docs/pages/frame/types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,11 @@ type FrameValidationResponse =
## `FrameTransactionResponse`

```ts
type ChainNamespace = 'eip155' | 'solana';
type ChainReference = string;

type FrameTransactionResponse = {
chainId: `eip155:${number}`; // A CAIP-2 chain ID to identify the tx network
chainId: `${ChainNamespace}:${ChainReference}`; // A CAIP-2 chain ID to identify the tx network
method: 'eth_sendTransaction'; // A method ID to identify the type of tx request.
params: FrameTransactionEthSendParams; // Specific parameters for chainId and method
};
Expand All @@ -122,10 +125,10 @@ type FrameTransactionResponse = {
## `FrameTransactionEthSendParams`

```ts
export type FrameTransactionEthSendParams = {
type FrameTransactionEthSendParams = {
abi: Abi; // The contract ABI for the contract to call.
data?: Hex; // The data to send with the transaction.
to: Hex; // The address of the contract to call.
value: string; // The amount of Ether to send with the transaction.
data?: Address; // The data to send with the transaction.
to: Address; // The address of the contract to call.
value: bigint; // The amount of Ether to send with the transaction.
};
```
12 changes: 7 additions & 5 deletions src/frame/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Abi, Hex } from 'viem';
import type { Abi, Address } from 'viem';
import { NeynarFrameValidationInternalModel } from '../utils/neynar/frame/types';

/**
Expand Down Expand Up @@ -136,8 +136,10 @@ export type FrameMetadataResponse = Record<string, string>;
/**
* Note: exported as public Type
*/
type ChainNamespace = 'eip155' | 'solana';
type ChainReference = string;
export type FrameTransactionResponse = {
chainId: `eip155:${number}`; // A CAIP-2 chain ID to identify the tx network
chainId: `${ChainNamespace}:${ChainReference}`; // A CAIP-2 chain ID to identify the tx network
method: 'eth_sendTransaction'; // A method ID to identify the type of tx request.
params: FrameTransactionEthSendParams; // Specific parameters for chainId and method
};
Expand All @@ -147,9 +149,9 @@ export type FrameTransactionResponse = {
*/
export type FrameTransactionEthSendParams = {
abi: Abi; // The contract ABI for the contract to call.
data?: Hex; // The data to send with the transaction.
to: Hex; // The address of the contract to call.
value: string; // The amount of Ether to send with the transaction.
data?: Address; // The data to send with the transaction.
to: Address; // The address of the contract to call.
value: bigint; // The amount of Ether to send with the transaction.
};

/**
Expand Down

0 comments on commit 1af52dc

Please sign in to comment.