Skip to content

Commit

Permalink
fix: provider request typings
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenixVS committed Feb 28, 2024
1 parent 2fbc33a commit 63350b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 1 addition & 3 deletions packages/scaffold-utils/src/SolanaHelpersUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,12 @@ export const SolHelpersUtil = {

return number
},
numberToHexString(value: number | string) {
return `0x${value.toString(16)}`
},
async getAddress(provider: Provider) {
const [address] = await provider.request<string[]>({ method: 'getAccountInfo' })

return address
},

async addSolanaChain(provider: Provider, chain: Chain) {
await provider.request({
method: 'wallet_addSolanaChain',
Expand Down
5 changes: 4 additions & 1 deletion packages/scaffold-utils/src/SolanaTypesUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ export interface Provider {
emit: (event: string) => void
connect: () => Promise<void>
disconnect: () => Promise<void>
request: () => void
request: <T>(config: {
method: string,
params?: object
}) => Promise<T>
signAllTransactions: (transactions: SolanaWeb3Transaction[]) => Promise<SolanaWeb3Transaction[]>
signAndSendAllTransactions: (transactions: SolanaWeb3Transaction[]) => Promise<TransactionSignature[]>
signAndSendTransaction: (transaction: SolanaWeb3Transaction, connection: Connection, options?: SendTransactionOptions) => Promise<TransactionSignature>
Expand Down

0 comments on commit 63350b9

Please sign in to comment.