@portal-hq/utils 4.1.0 → 4.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,7 @@ var Events;
11
11
  Events["GetBackupShareMetadata"] = "Get Backup Share Metadata";
12
12
  Events["GetBalances"] = "Get Balances";
13
13
  Events["GetClient"] = "Get Client";
14
+ Events["GetClientCipherText"] = "Get Client Cipher Text";
14
15
  Events["GetEnabledDapps"] = "Get Enabled Dapps";
15
16
  Events["GetNFTs"] = "Get NFTs";
16
17
  Events["GetNetworks"] = "Get Networks";
@@ -18,10 +19,13 @@ var Events;
18
19
  Events["GetSigningShareMetadata"] = "Get Signing Share Metadata";
19
20
  Events["GetSources"] = "Get Sources";
20
21
  Events["GetTransactions"] = "Get Transactions";
22
+ Events["PrepareClientEject"] = "Prepare Client Eject";
21
23
  Events["SimulateTransaction"] = "Simulate Transaction";
24
+ Events["StoreClientCipherText"] = "Store Client Cipher Text";
22
25
  Events["StoredClientBackupShare"] = "Stored Client Backup Share";
23
26
  Events["StoredClientBackupShareKey"] = "Stored Client Backup Share Key";
24
27
  Events["StoredClientSigningShare"] = "Stored Client Signing Share";
25
28
  Events["EjectClient"] = "Eject Client";
29
+ Events["FundClient"] = "Fund Client";
26
30
  })(Events || (Events = {}));
27
31
  exports.default = Events;
@@ -1 +1 @@
1
- { "version": "4.1.0" }
1
+ { "version": "4.1.2" }
@@ -9,6 +9,7 @@ var Events;
9
9
  Events["GetBackupShareMetadata"] = "Get Backup Share Metadata";
10
10
  Events["GetBalances"] = "Get Balances";
11
11
  Events["GetClient"] = "Get Client";
12
+ Events["GetClientCipherText"] = "Get Client Cipher Text";
12
13
  Events["GetEnabledDapps"] = "Get Enabled Dapps";
13
14
  Events["GetNFTs"] = "Get NFTs";
14
15
  Events["GetNetworks"] = "Get Networks";
@@ -16,10 +17,13 @@ var Events;
16
17
  Events["GetSigningShareMetadata"] = "Get Signing Share Metadata";
17
18
  Events["GetSources"] = "Get Sources";
18
19
  Events["GetTransactions"] = "Get Transactions";
20
+ Events["PrepareClientEject"] = "Prepare Client Eject";
19
21
  Events["SimulateTransaction"] = "Simulate Transaction";
22
+ Events["StoreClientCipherText"] = "Store Client Cipher Text";
20
23
  Events["StoredClientBackupShare"] = "Stored Client Backup Share";
21
24
  Events["StoredClientBackupShareKey"] = "Stored Client Backup Share Key";
22
25
  Events["StoredClientSigningShare"] = "Stored Client Signing Share";
23
26
  Events["EjectClient"] = "Eject Client";
27
+ Events["FundClient"] = "Fund Client";
24
28
  })(Events || (Events = {}));
25
29
  export default Events;
@@ -1 +1 @@
1
- { "version": "4.1.0" }
1
+ { "version": "4.1.2" }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portal-hq/utils",
3
- "version": "4.1.0",
3
+ "version": "4.1.2",
4
4
  "main": "lib/commonjs/index",
5
5
  "module": "lib/esm/index",
6
6
  "source": "src/index",
@@ -26,5 +26,5 @@
26
26
  "ts-jest": "^29.0.3",
27
27
  "typescript": "^4.8.4"
28
28
  },
29
- "gitHead": "d53139e2dae6d0ede12d647ae4d11f4915b896f1"
29
+ "gitHead": "4504ed5bdfde36df2b9c1acab9916ad412ba6fd9"
30
30
  }
@@ -2,6 +2,8 @@ import PortalConnect from '@portal-hq/connect'
2
2
  import {
3
3
  BuildEip155TransactionResponse,
4
4
  BuildSolanaTransactionResponse,
5
+ FundParams,
6
+ FundResponse,
5
7
  } from '@portal-hq/core/types'
6
8
 
7
9
  import type {
@@ -26,6 +28,7 @@ import type {
26
28
  } from '../../types'
27
29
  import PortalRequests from '../PortalRequests'
28
30
  import { HttpRequester } from '../requesters'
31
+ import { BackupMethodsUpperCase } from '@portal-hq/core/src/mpc'
29
32
 
30
33
  export type EventHandler = (data: any) => void
31
34
 
@@ -55,16 +58,17 @@ export interface IPortalApi {
55
58
  apiKey: string
56
59
  apiUrl: string
57
60
  requests: HttpRequester
58
-
59
61
  buildTransaction(
60
62
  to: string,
61
63
  token: string,
62
64
  amount: string,
63
65
  chain?: string,
64
66
  ): Promise<BuildEip155TransactionResponse | BuildSolanaTransactionResponse>
67
+ fund(chainId: string, params: FundParams): Promise<FundResponse>
65
68
  getBackupSharesMetadata(chainId?: string): Promise<BackupSharePairMetadata[]>
66
69
  getBalances(chainId?: string): Promise<Balance[]>
67
70
  getClient(): Promise<ClientResponse>
71
+ getClientCipherText(backupSharePairId: string): Promise<string>
68
72
  getEnabledDapps(): Promise<Dapp[]>
69
73
  getNFTs(chainId?: string): Promise<NFT[]>
70
74
  getNetworks(): Promise<Network[]>
@@ -83,11 +87,19 @@ export interface IPortalApi {
83
87
  offset?: number,
84
88
  order?: GetTransactionsOrder,
85
89
  ): Promise<Transaction[]>
90
+ prepareClientEject(
91
+ walletId: string,
92
+ backupMethod: BackupMethodsUpperCase,
93
+ ): Promise<string>
86
94
  identify(traits?: Record<string, any>): Promise<{ success: boolean }>
87
95
  simulateTransaction(
88
96
  params: SimulateTransactionParam,
89
97
  chainId?: string,
90
98
  ): Promise<SimulatedTransaction>
99
+ storeClientCipherText(
100
+ backupSharePairId: string,
101
+ cipherText: string,
102
+ ): Promise<boolean>
91
103
  storedClientSigningShares(signingSharePairIds: string[]): Promise<void>
92
104
  storedClientBackupShares(backupSharePairIds: string[]): Promise<void>
93
105
  storedClientBackupSharesKey(backupSharePairIds: string[]): Promise<void>
@@ -9,6 +9,7 @@ enum Events {
9
9
  GetBackupShareMetadata = 'Get Backup Share Metadata',
10
10
  GetBalances = 'Get Balances',
11
11
  GetClient = 'Get Client',
12
+ GetClientCipherText = 'Get Client Cipher Text',
12
13
  GetEnabledDapps = 'Get Enabled Dapps',
13
14
  GetNFTs = 'Get NFTs',
14
15
  GetNetworks = 'Get Networks',
@@ -16,11 +17,14 @@ enum Events {
16
17
  GetSigningShareMetadata = 'Get Signing Share Metadata',
17
18
  GetSources = 'Get Sources',
18
19
  GetTransactions = 'Get Transactions',
20
+ PrepareClientEject = 'Prepare Client Eject',
19
21
  SimulateTransaction = 'Simulate Transaction',
22
+ StoreClientCipherText = 'Store Client Cipher Text',
20
23
  StoredClientBackupShare = 'Stored Client Backup Share',
21
24
  StoredClientBackupShareKey = 'Stored Client Backup Share Key',
22
25
  StoredClientSigningShare = 'Stored Client Signing Share',
23
26
  EjectClient = 'Eject Client',
27
+ FundClient = 'Fund Client',
24
28
  }
25
29
 
26
30
  export default Events
@@ -1 +1 @@
1
- { "version": "4.1.0" }
1
+ { "version": "4.1.2" }
package/types.d.ts CHANGED
@@ -46,6 +46,7 @@ interface ClientResponseCustodian {
46
46
  interface ClientResponseEnvironment {
47
47
  id: string
48
48
  name: string
49
+ backupWithPortalEnabled?: boolean
49
50
  }
50
51
 
51
52
  interface ClientResponseMetadata {