@portal-hq/utils
Advanced tools
Comparing version 2.1.2 to 3.0.0
@@ -11,15 +11,17 @@ "use strict"; | ||
// API Method events | ||
Events["GetBackupShareMetadata"] = "Get Backup Share Metadata"; | ||
Events["GetBalances"] = "Get Balances"; | ||
Events["GetClient"] = "Get Client"; | ||
Events["GetEnabledDapps"] = "Get Enabled Dapps"; | ||
Events["GetNFTs"] = "Get NFTs"; | ||
Events["GetNetworks"] = "Get Networks"; | ||
Events["GetQuote"] = "Get Quote"; | ||
Events["GetSigningSharePairs"] = "Get Signing Share Pairs"; | ||
Events["GetSources"] = "Get Sources"; | ||
Events["GetNFTs"] = "Get NFTs"; | ||
Events["GetTransactions"] = "Get Transactions"; | ||
Events["GetBalances"] = "Get Balances"; | ||
Events["SimulateTransaction"] = "Simulate Transaction"; | ||
Events["StoredClientBackupShare"] = "Stored Client Backup Share"; | ||
Events["StoredClientBackupShareKey"] = "Stored Client Backup Share Key"; | ||
Events["StoredClientSigningShare"] = "Stored Client Signing Share"; | ||
Events["StoredClientBackupShareKey"] = "Stored Client Backup Share Key"; | ||
Events["StoredClientBackupShare"] = "Stored Client Backup Share"; | ||
})(Events || (Events = {})); | ||
exports.default = Events; |
@@ -9,15 +9,17 @@ var Events; | ||
// API Method events | ||
Events["GetBackupShareMetadata"] = "Get Backup Share Metadata"; | ||
Events["GetBalances"] = "Get Balances"; | ||
Events["GetClient"] = "Get Client"; | ||
Events["GetEnabledDapps"] = "Get Enabled Dapps"; | ||
Events["GetNFTs"] = "Get NFTs"; | ||
Events["GetNetworks"] = "Get Networks"; | ||
Events["GetQuote"] = "Get Quote"; | ||
Events["GetSigningSharePairs"] = "Get Signing Share Pairs"; | ||
Events["GetSources"] = "Get Sources"; | ||
Events["GetNFTs"] = "Get NFTs"; | ||
Events["GetTransactions"] = "Get Transactions"; | ||
Events["GetBalances"] = "Get Balances"; | ||
Events["SimulateTransaction"] = "Simulate Transaction"; | ||
Events["StoredClientBackupShare"] = "Stored Client Backup Share"; | ||
Events["StoredClientBackupShareKey"] = "Stored Client Backup Share Key"; | ||
Events["StoredClientSigningShare"] = "Stored Client Signing Share"; | ||
Events["StoredClientBackupShareKey"] = "Stored Client Backup Share Key"; | ||
Events["StoredClientBackupShare"] = "Stored Client Backup Share"; | ||
})(Events || (Events = {})); | ||
export default Events; |
{ | ||
"name": "@portal-hq/utils", | ||
"version": "2.1.2", | ||
"version": "3.0.0", | ||
"main": "lib/commonjs/index", | ||
@@ -29,3 +29,3 @@ "module": "lib/esm/index", | ||
}, | ||
"gitHead": "17a0445191c1399577154042e09fa8759edf194f" | ||
"gitHead": "1f49bc43f0778a40089e1d736fbb63eb952b6001" | ||
} |
import { HttpRequester } from '../requesters' | ||
import type { | ||
BackupSharePairMetadata, | ||
Balance, | ||
@@ -13,2 +14,3 @@ ClientWithCustodianData, | ||
QuoteResponse, | ||
SigningSharePairMetadata, | ||
SimulateTransactionParam, | ||
@@ -49,6 +51,11 @@ SimulatedTransaction, | ||
getBackupShareMetadata(): Promise<BackupSharePairMetadata[]> | ||
getBalances(): Promise<Balance[]> | ||
getClient(): Promise<ClientWithCustodianData> | ||
getEnabledDapps(): Promise<Dapp[]> | ||
getNFTs(): Promise<NFT[]> | ||
getNetworks(): Promise<Network[]> | ||
getNFTs(): Promise<NFT[]> | ||
getQuote(apiKey: string, args: QuoteArgs): Promise<QuoteResponse> | ||
getSigningSharePairs(): Promise<SigningSharePairMetadata[]> | ||
getSources(apiKey: string): Promise<Record<string, string>> | ||
getTransactions( | ||
@@ -58,20 +65,32 @@ limit?: number, | ||
order?: GetTransactionsOrder, | ||
chainId?: number | ||
chainId?: number, | ||
): Promise<Transaction[]> | ||
getBalances(): Promise<Balance[]> | ||
identify(traits?: Record<string, any>): Promise<{ success: boolean }> | ||
simulateTransaction( | ||
params: SimulateTransactionParam | ||
params: SimulateTransactionParam, | ||
): Promise<SimulatedTransaction> | ||
getQuote(apiKey: string, args: QuoteArgs): Promise<QuoteResponse> | ||
getSources(apiKey: string): Promise<Record<string, string>> | ||
storedClientSigningShare(signingSharePairId: string): Promise<void> | ||
storedClientBackupShareKey(backupMethod?: string): Promise<void> | ||
storedClientBackupShare( | ||
success: boolean, | ||
backupMethod?: string | ||
backupMethod: | ||
| 'CUSTOM' | ||
| 'GDRIVE' | ||
| 'ICLOUD' | ||
| 'PASSKEY' | ||
| 'PASSWORD' | ||
| 'UNKNOWN', | ||
): Promise<void> | ||
identify(traits?: Record<string, any>): Promise<{ success: boolean }> | ||
storedClientBackupShareKey( | ||
success: boolean, | ||
backupMethod: | ||
| 'CUSTOM' | ||
| 'GDRIVE' | ||
| 'ICLOUD' | ||
| 'PASSKEY' | ||
| 'PASSWORD' | ||
| 'UNKNOWN', | ||
): Promise<void> | ||
storedClientSigningShare(signingSharePairId: string): Promise<void> | ||
track( | ||
event: string, | ||
properties?: Record<string, any> | ||
properties?: Record<string, any>, | ||
): Promise<{ success: boolean }> | ||
@@ -116,3 +135,3 @@ } | ||
throw new Error( | ||
'[Portal] KeychainAdapter method deleteAddress cannot be called directly. Please extend KeychainAdapter.' | ||
'[Portal] KeychainAdapter method deleteAddress cannot be called directly. Please extend KeychainAdapter.', | ||
) | ||
@@ -122,3 +141,3 @@ } | ||
throw new Error( | ||
'[Portal] KeychainAdapter method deleteDkgResult cannot be called directly. Please extend KeychainAdapter.' | ||
'[Portal] KeychainAdapter method deleteDkgResult cannot be called directly. Please extend KeychainAdapter.', | ||
) | ||
@@ -128,3 +147,3 @@ } | ||
throw new Error( | ||
`[Portal] KeychainAdapter method getAddress(${isSim}) cannot be called directly. Please extend KeychainAdapter.` | ||
`[Portal] KeychainAdapter method getAddress(${isSim}) cannot be called directly. Please extend KeychainAdapter.`, | ||
) | ||
@@ -136,6 +155,6 @@ } | ||
// Noop | ||
} | ||
}, | ||
): Promise<string> { | ||
throw new Error( | ||
`[Portal] KeychainAdapter method getDkgResult(${isSim}) cannot be called directly. Please extend KeychainAdapter.` | ||
`[Portal] KeychainAdapter method getDkgResult(${isSim}) cannot be called directly. Please extend KeychainAdapter.`, | ||
) | ||
@@ -145,3 +164,3 @@ } | ||
throw new Error( | ||
`[Portal] KeychainAdapter method storeAddress(${address}, ${isSim}) cannot be called directly. Please extend KeychainAdapter.` | ||
`[Portal] KeychainAdapter method storeAddress(${address}, ${isSim}) cannot be called directly. Please extend KeychainAdapter.`, | ||
) | ||
@@ -154,6 +173,6 @@ } | ||
// Noop | ||
} | ||
}, | ||
): Promise<void> { | ||
throw new Error( | ||
`[Portal] KeychainAdapter method storeDkgResult(${result}, ${isSim}) cannot be called directly. Please extend KeychainAdapter.` | ||
`[Portal] KeychainAdapter method storeDkgResult(${result}, ${isSim}) cannot be called directly. Please extend KeychainAdapter.`, | ||
) | ||
@@ -163,3 +182,3 @@ } | ||
throw new Error( | ||
`[Portal] KeychainAdapter method validateOperations() cannot be called directly. Please extend KeychainAdapter.` | ||
`[Portal] KeychainAdapter method validateOperations() cannot be called directly. Please extend KeychainAdapter.`, | ||
) | ||
@@ -186,3 +205,3 @@ } | ||
throw new Error( | ||
'[Portal] Storage method delete cannot be called directly. Please extend Storage.' | ||
'[Portal] Storage method delete cannot be called directly. Please extend Storage.', | ||
) | ||
@@ -193,3 +212,3 @@ } | ||
throw new Error( | ||
'[Portal] Storage method read cannot be called directly. Please extend Storage.' | ||
'[Portal] Storage method read cannot be called directly. Please extend Storage.', | ||
) | ||
@@ -200,3 +219,3 @@ } | ||
throw new Error( | ||
`[Portal] Storage method write(${privateKey}) cannot be called directly. Please extend Storage.` | ||
`[Portal] Storage method write(${privateKey}) cannot be called directly. Please extend Storage.`, | ||
) | ||
@@ -207,3 +226,3 @@ } | ||
throw new Error( | ||
`[Portal] Storage method validateOperations() cannot be called directly. Please extend Storage.` | ||
`[Portal] Storage method validateOperations() cannot be called directly. Please extend Storage.`, | ||
) | ||
@@ -210,0 +229,0 @@ } |
@@ -9,16 +9,18 @@ enum Events { | ||
// API Method events | ||
GetBackupShareMetadata = 'Get Backup Share Metadata', | ||
GetBalances = 'Get Balances', | ||
GetClient = 'Get Client', | ||
GetEnabledDapps = 'Get Enabled Dapps', | ||
GetNFTs = 'Get NFTs', | ||
GetNetworks = 'Get Networks', | ||
GetQuote = 'Get Quote', | ||
GetSigningSharePairs = 'Get Signing Share Pairs', | ||
GetSources = 'Get Sources', | ||
GetNFTs = 'Get NFTs', | ||
GetTransactions = 'Get Transactions', | ||
GetBalances = 'Get Balances', | ||
SimulateTransaction = 'Simulate Transaction', | ||
StoredClientBackupShare = 'Stored Client Backup Share', | ||
StoredClientBackupShareKey = 'Stored Client Backup Share Key', | ||
StoredClientSigningShare = 'Stored Client Signing Share', | ||
StoredClientBackupShareKey = 'Stored Client Backup Share Key', | ||
StoredClientBackupShare = 'Stored Client Backup Share', | ||
} | ||
export default Events |
@@ -0,1 +1,2 @@ | ||
import { BackupMethods } from '@portal-hq/core' | ||
import { MpcStatuses } from './src/definitions' | ||
@@ -267,2 +268,13 @@ | ||
export interface SigningSharePairMetadata { | ||
createdAt: string | ||
id: string | ||
} | ||
export interface BackupSharePairMetadata { | ||
backupMethod: BackupMethods | ||
createdAt: string | ||
id: string | ||
} | ||
export interface Balance { | ||
@@ -269,0 +281,0 @@ contractAddress: string |
136128
4016