Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@portal-hq/utils

Package Overview
Dependencies
Maintainers
6
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@portal-hq/utils - npm Package Compare versions

Comparing version 0.2.8 to 0.2.9

lib/currency/countries/country-codes.js

2

package.json
{
"name": "@portal-hq/utils",
"version": "0.2.8",
"version": "0.2.9",
"main": "lib/commonjs/index",

@@ -5,0 +5,0 @@ "module": "lib/esm/index",

@@ -166,3 +166,2 @@ const currencyCodes: Record<string, string> = {

Palau: 'USD',
Palestine: null,
Panama: 'PAB',

@@ -169,0 +168,0 @@ 'Papua New Guinea': 'PGK',

import { ClientWithCustodianData, Dapp, DkgData, Network } from '../../types'
export abstract class KeychainAdapter {
deleteAddress: () => Promise<boolean>
deleteDkgResult: () => Promise<boolean>
getAddress: (isSim?: boolean) => Promise<string>
getDkgResult: (isSim?: boolean) => Promise<string>
storeAddress: (address: string, isSim?: boolean) => Promise<void>
storeDkgResult: (result: DkgData, isSim?: boolean) => Promise<void>
deleteAddress(): Promise<boolean> {
throw new Error(
'[Portal] KeychainAdapter method deleteAddress cannot be called directly. Please extend KeychainAdapter.',
)
}
deleteDkgResult(): Promise<boolean> {
throw new Error(
'[Portal] KeychainAdapter method deleteDkgResult cannot be called directly. Please extend KeychainAdapter.',
)
}
getAddress(isSim?: boolean): Promise<string> {
throw new Error(
`[Portal] KeychainAdapter method getAddress(${isSim}) cannot be called directly. Please extend KeychainAdapter.`,
)
}
getDkgResult(isSim?: boolean): Promise<string> {
throw new Error(
`[Portal] KeychainAdapter method getDkgResult(${isSim}) cannot be called directly. Please extend KeychainAdapter.`,
)
}
storeAddress(address: string, isSim?: boolean): Promise<void> {
throw new Error(
`[Portal] KeychainAdapter method storeAddress(${address}, ${isSim}) cannot be called directly. Please extend KeychainAdapter.`,
)
}
storeDkgResult(result: DkgData, isSim?: boolean): Promise<void> {
throw new Error(
`[Portal] KeychainAdapter method storeDkgResult(${result}, ${isSim}) cannot be called directly. Please extend KeychainAdapter.`,
)
}
}

@@ -19,6 +43,14 @@

export abstract class Storage {
public api: PortalApi
public api?: PortalApi
read: () => Promise<string>
write: (privateKey: string) => Promise<string>
read(): Promise<string> {
throw new Error(
'[Portal] Storage method read cannot be called directly. Please extend Storage.',
)
}
write(privateKey: string): Promise<string> {
throw new Error(
`[Portal] Storage method write(${privateKey}) cannot be called directly. Please extend Storage.`,
)
}
}

@@ -46,3 +46,3 @@ import {

const log = console
const definition = providerErrors[code]
const definition = providerErrors[code as ValidRpcErrorCodes]

@@ -49,0 +49,0 @@ if (!definition) {

@@ -77,3 +77,2 @@ import { convert } from '../currency'

const txParam0 = Array.isArray(params) ? params[0] : params
const txParam1 = Array.isArray(params) ? params[1] : null

@@ -94,4 +93,6 @@ switch (method) {

console.log(`requestData: `, requestData)
break
return {
method,
data: requestData,
}
case 'eth_sign':

@@ -102,11 +103,15 @@ case 'personal_sign':

} as MessageData
break
return {
method,
data: requestData,
}
default:
return {
method,
data: {
message: 'NO_DATA_PROVIDED',
},
}
break
}
return {
method,
data: requestData,
}
}

@@ -37,2 +37,4 @@ export { convert } from './currency'

type SignableTransactionData,
type SigningRequestArguments,
type SigningResponse,
} from '../types'

@@ -114,1 +114,13 @@ export type OutgoingRequestData = MessageData | SignableTransactionData

}
export interface SigningRequestArguments {
readonly chainId?: number
readonly method: string
readonly params?: unknown[] | SigningRequestParams
}
export interface SigningResponse {
method: string
params?: unknown[] | SigningRequestParams
signature?: any
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc