@solana-mobile/mobile-wallet-adapter-protocol 0.9.4 → 0.9.6

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.
@@ -8,6 +8,7 @@ const SolanaMobileWalletAdapterErrorCode = {
8
8
  ERROR_FORBIDDEN_WALLET_BASE_URL: 'ERROR_FORBIDDEN_WALLET_BASE_URL',
9
9
  ERROR_SECURE_CONTEXT_REQUIRED: 'ERROR_SECURE_CONTEXT_REQUIRED',
10
10
  ERROR_SESSION_CLOSED: 'ERROR_SESSION_CLOSED',
11
+ ERROR_SESSION_TIMEOUT: 'ERROR_SESSION_TIMEOUT',
11
12
  ERROR_WALLET_NOT_FOUND: 'ERROR_WALLET_NOT_FOUND',
12
13
  };
13
14
  class SolanaMobileWalletAdapterError extends Error {
@@ -398,7 +399,7 @@ function transact(callback, config) {
398
399
  const handleError = (_evt) => __awaiter(this, void 0, void 0, function* () {
399
400
  disposeSocket();
400
401
  if (Date.now() - connectionStartTime >= WEBSOCKET_CONNECTION_CONFIG.timeoutMs) {
401
- reject(new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_WALLET_NOT_FOUND, `Failed to connect to the wallet websocket on port ${sessionPort}.`));
402
+ reject(new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_TIMEOUT, `Failed to connect to the wallet websocket on port ${sessionPort}.`));
402
403
  }
403
404
  else {
404
405
  yield new Promise((resolve) => {
@@ -452,7 +453,7 @@ function transact(callback, config) {
452
453
  id,
453
454
  jsonrpc: '2.0',
454
455
  method,
455
- params,
456
+ params: params !== null && params !== void 0 ? params : {},
456
457
  }, sharedSecret));
457
458
  return new Promise((resolve, reject) => {
458
459
  jsonRpcResponsePromises[id] = {
package/lib/cjs/index.js CHANGED
@@ -8,6 +8,7 @@ const SolanaMobileWalletAdapterErrorCode = {
8
8
  ERROR_FORBIDDEN_WALLET_BASE_URL: 'ERROR_FORBIDDEN_WALLET_BASE_URL',
9
9
  ERROR_SECURE_CONTEXT_REQUIRED: 'ERROR_SECURE_CONTEXT_REQUIRED',
10
10
  ERROR_SESSION_CLOSED: 'ERROR_SESSION_CLOSED',
11
+ ERROR_SESSION_TIMEOUT: 'ERROR_SESSION_TIMEOUT',
11
12
  ERROR_WALLET_NOT_FOUND: 'ERROR_WALLET_NOT_FOUND',
12
13
  };
13
14
  class SolanaMobileWalletAdapterError extends Error {
@@ -398,7 +399,7 @@ function transact(callback, config) {
398
399
  const handleError = (_evt) => __awaiter(this, void 0, void 0, function* () {
399
400
  disposeSocket();
400
401
  if (Date.now() - connectionStartTime >= WEBSOCKET_CONNECTION_CONFIG.timeoutMs) {
401
- reject(new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_WALLET_NOT_FOUND, `Failed to connect to the wallet websocket on port ${sessionPort}.`));
402
+ reject(new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_TIMEOUT, `Failed to connect to the wallet websocket on port ${sessionPort}.`));
402
403
  }
403
404
  else {
404
405
  yield new Promise((resolve) => {
@@ -452,7 +453,7 @@ function transact(callback, config) {
452
453
  id,
453
454
  jsonrpc: '2.0',
454
455
  method,
455
- params,
456
+ params: params !== null && params !== void 0 ? params : {},
456
457
  }, sharedSecret));
457
458
  return new Promise((resolve, reject) => {
458
459
  jsonRpcResponsePromises[id] = {
@@ -10,6 +10,7 @@ const SolanaMobileWalletAdapterErrorCode = {
10
10
  ERROR_FORBIDDEN_WALLET_BASE_URL: 'ERROR_FORBIDDEN_WALLET_BASE_URL',
11
11
  ERROR_SECURE_CONTEXT_REQUIRED: 'ERROR_SECURE_CONTEXT_REQUIRED',
12
12
  ERROR_SESSION_CLOSED: 'ERROR_SESSION_CLOSED',
13
+ ERROR_SESSION_TIMEOUT: 'ERROR_SESSION_TIMEOUT',
13
14
  ERROR_WALLET_NOT_FOUND: 'ERROR_WALLET_NOT_FOUND',
14
15
  };
15
16
  class SolanaMobileWalletAdapterError extends Error {
@@ -4,6 +4,7 @@ const SolanaMobileWalletAdapterErrorCode = {
4
4
  ERROR_FORBIDDEN_WALLET_BASE_URL: 'ERROR_FORBIDDEN_WALLET_BASE_URL',
5
5
  ERROR_SECURE_CONTEXT_REQUIRED: 'ERROR_SECURE_CONTEXT_REQUIRED',
6
6
  ERROR_SESSION_CLOSED: 'ERROR_SESSION_CLOSED',
7
+ ERROR_SESSION_TIMEOUT: 'ERROR_SESSION_TIMEOUT',
7
8
  ERROR_WALLET_NOT_FOUND: 'ERROR_WALLET_NOT_FOUND',
8
9
  };
9
10
  class SolanaMobileWalletAdapterError extends Error {
@@ -394,7 +395,7 @@ function transact(callback, config) {
394
395
  const handleError = (_evt) => __awaiter(this, void 0, void 0, function* () {
395
396
  disposeSocket();
396
397
  if (Date.now() - connectionStartTime >= WEBSOCKET_CONNECTION_CONFIG.timeoutMs) {
397
- reject(new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_WALLET_NOT_FOUND, `Failed to connect to the wallet websocket on port ${sessionPort}.`));
398
+ reject(new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_TIMEOUT, `Failed to connect to the wallet websocket on port ${sessionPort}.`));
398
399
  }
399
400
  else {
400
401
  yield new Promise((resolve) => {
@@ -448,7 +449,7 @@ function transact(callback, config) {
448
449
  id,
449
450
  jsonrpc: '2.0',
450
451
  method,
451
- params,
452
+ params: params !== null && params !== void 0 ? params : {},
452
453
  }, sharedSecret));
453
454
  return new Promise((resolve, reject) => {
454
455
  jsonRpcResponsePromises[id] = {
package/lib/esm/index.mjs CHANGED
@@ -4,6 +4,7 @@ const SolanaMobileWalletAdapterErrorCode = {
4
4
  ERROR_FORBIDDEN_WALLET_BASE_URL: 'ERROR_FORBIDDEN_WALLET_BASE_URL',
5
5
  ERROR_SECURE_CONTEXT_REQUIRED: 'ERROR_SECURE_CONTEXT_REQUIRED',
6
6
  ERROR_SESSION_CLOSED: 'ERROR_SESSION_CLOSED',
7
+ ERROR_SESSION_TIMEOUT: 'ERROR_SESSION_TIMEOUT',
7
8
  ERROR_WALLET_NOT_FOUND: 'ERROR_WALLET_NOT_FOUND',
8
9
  };
9
10
  class SolanaMobileWalletAdapterError extends Error {
@@ -394,7 +395,7 @@ function transact(callback, config) {
394
395
  const handleError = (_evt) => __awaiter(this, void 0, void 0, function* () {
395
396
  disposeSocket();
396
397
  if (Date.now() - connectionStartTime >= WEBSOCKET_CONNECTION_CONFIG.timeoutMs) {
397
- reject(new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_WALLET_NOT_FOUND, `Failed to connect to the wallet websocket on port ${sessionPort}.`));
398
+ reject(new SolanaMobileWalletAdapterError(SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_TIMEOUT, `Failed to connect to the wallet websocket on port ${sessionPort}.`));
398
399
  }
399
400
  else {
400
401
  yield new Promise((resolve) => {
@@ -448,7 +449,7 @@ function transact(callback, config) {
448
449
  id,
449
450
  jsonrpc: '2.0',
450
451
  method,
451
- params,
452
+ params: params !== null && params !== void 0 ? params : {},
452
453
  }, sharedSecret));
453
454
  return new Promise((resolve, reject) => {
454
455
  jsonRpcResponsePromises[id] = {
@@ -1,9 +1,11 @@
1
+ import { TransactionVersion } from "@solana/web3.js";
1
2
  // Typescript `enums` thwart tree-shaking. See https://bargsten.org/jsts/enums/
2
3
  declare const SolanaMobileWalletAdapterErrorCode: {
3
4
  readonly ERROR_ASSOCIATION_PORT_OUT_OF_RANGE: "ERROR_ASSOCIATION_PORT_OUT_OF_RANGE";
4
5
  readonly ERROR_FORBIDDEN_WALLET_BASE_URL: "ERROR_FORBIDDEN_WALLET_BASE_URL";
5
6
  readonly ERROR_SECURE_CONTEXT_REQUIRED: "ERROR_SECURE_CONTEXT_REQUIRED";
6
7
  readonly ERROR_SESSION_CLOSED: "ERROR_SESSION_CLOSED";
8
+ readonly ERROR_SESSION_TIMEOUT: "ERROR_SESSION_TIMEOUT";
7
9
  readonly ERROR_WALLET_NOT_FOUND: "ERROR_WALLET_NOT_FOUND";
8
10
  };
9
11
  type SolanaMobileWalletAdapterErrorCodeEnum = (typeof SolanaMobileWalletAdapterErrorCode)[keyof typeof SolanaMobileWalletAdapterErrorCode];
@@ -16,6 +18,7 @@ type ErrorDataTypeMap = {
16
18
  [SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_CLOSED]: {
17
19
  closeEvent: CloseEvent;
18
20
  };
21
+ [SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_TIMEOUT]: undefined;
19
22
  [SolanaMobileWalletAdapterErrorCode.ERROR_WALLET_NOT_FOUND]: undefined;
20
23
  };
21
24
  declare class SolanaMobileWalletAdapterError<TErrorCode extends SolanaMobileWalletAdapterErrorCodeEnum> extends Error {
@@ -128,6 +131,15 @@ interface DeauthorizeAPI {
128
131
  auth_token: AuthToken;
129
132
  }): Promise<Readonly<Record<string, never>>>;
130
133
  }
134
+ interface GetCapabilitiesAPI {
135
+ getCapabilities(): Promise<Readonly<{
136
+ supports_clone_authorization: boolean;
137
+ supports_sign_and_send_transactions: boolean;
138
+ max_transactions_per_request: boolean;
139
+ max_messages_per_request: boolean;
140
+ supported_transaction_versions: ReadonlyArray<TransactionVersion>;
141
+ }>>;
142
+ }
131
143
  interface ReauthorizeAPI {
132
144
  reauthorize(params: {
133
145
  auth_token: AuthToken;
@@ -158,8 +170,8 @@ interface SignAndSendTransactionsAPI {
158
170
  signatures: Base64EncodedSignature[];
159
171
  }>>;
160
172
  }
161
- interface MobileWallet extends AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI {
173
+ interface MobileWallet extends AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, GetCapabilitiesAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI {
162
174
  }
163
175
  declare function transact<TReturn>(callback: (wallet: MobileWallet) => TReturn, config?: WalletAssociationConfig): Promise<TReturn>;
164
- export { SolanaMobileWalletAdapterErrorCode, SolanaMobileWalletAdapterError, SolanaMobileWalletAdapterProtocolErrorCode, SolanaMobileWalletAdapterProtocolError, transact, Account, AppIdentity, AssociationKeypair, AuthorizationResult, AuthToken, Base64EncodedAddress, Base64EncodedTransaction, Cluster, Finality, WalletAssociationConfig, AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI, MobileWallet };
176
+ export { SolanaMobileWalletAdapterErrorCode, SolanaMobileWalletAdapterError, SolanaMobileWalletAdapterProtocolErrorCode, SolanaMobileWalletAdapterProtocolError, transact, Account, AppIdentity, AssociationKeypair, AuthorizationResult, AuthToken, Base64EncodedAddress, Base64EncodedTransaction, Cluster, Finality, WalletAssociationConfig, AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, GetCapabilitiesAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI, MobileWallet };
165
177
  //# sourceMappingURL=index.browser.d.mts.map
@@ -1,9 +1,11 @@
1
+ import { TransactionVersion } from "@solana/web3.js";
1
2
  // Typescript `enums` thwart tree-shaking. See https://bargsten.org/jsts/enums/
2
3
  declare const SolanaMobileWalletAdapterErrorCode: {
3
4
  readonly ERROR_ASSOCIATION_PORT_OUT_OF_RANGE: "ERROR_ASSOCIATION_PORT_OUT_OF_RANGE";
4
5
  readonly ERROR_FORBIDDEN_WALLET_BASE_URL: "ERROR_FORBIDDEN_WALLET_BASE_URL";
5
6
  readonly ERROR_SECURE_CONTEXT_REQUIRED: "ERROR_SECURE_CONTEXT_REQUIRED";
6
7
  readonly ERROR_SESSION_CLOSED: "ERROR_SESSION_CLOSED";
8
+ readonly ERROR_SESSION_TIMEOUT: "ERROR_SESSION_TIMEOUT";
7
9
  readonly ERROR_WALLET_NOT_FOUND: "ERROR_WALLET_NOT_FOUND";
8
10
  };
9
11
  type SolanaMobileWalletAdapterErrorCodeEnum = (typeof SolanaMobileWalletAdapterErrorCode)[keyof typeof SolanaMobileWalletAdapterErrorCode];
@@ -16,6 +18,7 @@ type ErrorDataTypeMap = {
16
18
  [SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_CLOSED]: {
17
19
  closeEvent: CloseEvent;
18
20
  };
21
+ [SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_TIMEOUT]: undefined;
19
22
  [SolanaMobileWalletAdapterErrorCode.ERROR_WALLET_NOT_FOUND]: undefined;
20
23
  };
21
24
  declare class SolanaMobileWalletAdapterError<TErrorCode extends SolanaMobileWalletAdapterErrorCodeEnum> extends Error {
@@ -128,6 +131,15 @@ interface DeauthorizeAPI {
128
131
  auth_token: AuthToken;
129
132
  }): Promise<Readonly<Record<string, never>>>;
130
133
  }
134
+ interface GetCapabilitiesAPI {
135
+ getCapabilities(): Promise<Readonly<{
136
+ supports_clone_authorization: boolean;
137
+ supports_sign_and_send_transactions: boolean;
138
+ max_transactions_per_request: boolean;
139
+ max_messages_per_request: boolean;
140
+ supported_transaction_versions: ReadonlyArray<TransactionVersion>;
141
+ }>>;
142
+ }
131
143
  interface ReauthorizeAPI {
132
144
  reauthorize(params: {
133
145
  auth_token: AuthToken;
@@ -158,8 +170,8 @@ interface SignAndSendTransactionsAPI {
158
170
  signatures: Base64EncodedSignature[];
159
171
  }>>;
160
172
  }
161
- interface MobileWallet extends AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI {
173
+ interface MobileWallet extends AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, GetCapabilitiesAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI {
162
174
  }
163
175
  declare function transact<TReturn>(callback: (wallet: MobileWallet) => TReturn, config?: WalletAssociationConfig): Promise<TReturn>;
164
- export { SolanaMobileWalletAdapterErrorCode, SolanaMobileWalletAdapterError, SolanaMobileWalletAdapterProtocolErrorCode, SolanaMobileWalletAdapterProtocolError, transact, Account, AppIdentity, AssociationKeypair, AuthorizationResult, AuthToken, Base64EncodedAddress, Base64EncodedTransaction, Cluster, Finality, WalletAssociationConfig, AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI, MobileWallet };
176
+ export { SolanaMobileWalletAdapterErrorCode, SolanaMobileWalletAdapterError, SolanaMobileWalletAdapterProtocolErrorCode, SolanaMobileWalletAdapterProtocolError, transact, Account, AppIdentity, AssociationKeypair, AuthorizationResult, AuthToken, Base64EncodedAddress, Base64EncodedTransaction, Cluster, Finality, WalletAssociationConfig, AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, GetCapabilitiesAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI, MobileWallet };
165
177
  //# sourceMappingURL=index.browser.d.ts.map
@@ -1,9 +1,11 @@
1
+ import { TransactionVersion } from "@solana/web3.js";
1
2
  // Typescript `enums` thwart tree-shaking. See https://bargsten.org/jsts/enums/
2
3
  declare const SolanaMobileWalletAdapterErrorCode: {
3
4
  readonly ERROR_ASSOCIATION_PORT_OUT_OF_RANGE: "ERROR_ASSOCIATION_PORT_OUT_OF_RANGE";
4
5
  readonly ERROR_FORBIDDEN_WALLET_BASE_URL: "ERROR_FORBIDDEN_WALLET_BASE_URL";
5
6
  readonly ERROR_SECURE_CONTEXT_REQUIRED: "ERROR_SECURE_CONTEXT_REQUIRED";
6
7
  readonly ERROR_SESSION_CLOSED: "ERROR_SESSION_CLOSED";
8
+ readonly ERROR_SESSION_TIMEOUT: "ERROR_SESSION_TIMEOUT";
7
9
  readonly ERROR_WALLET_NOT_FOUND: "ERROR_WALLET_NOT_FOUND";
8
10
  };
9
11
  type SolanaMobileWalletAdapterErrorCodeEnum = (typeof SolanaMobileWalletAdapterErrorCode)[keyof typeof SolanaMobileWalletAdapterErrorCode];
@@ -16,6 +18,7 @@ type ErrorDataTypeMap = {
16
18
  [SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_CLOSED]: {
17
19
  closeEvent: CloseEvent;
18
20
  };
21
+ [SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_TIMEOUT]: undefined;
19
22
  [SolanaMobileWalletAdapterErrorCode.ERROR_WALLET_NOT_FOUND]: undefined;
20
23
  };
21
24
  declare class SolanaMobileWalletAdapterError<TErrorCode extends SolanaMobileWalletAdapterErrorCodeEnum> extends Error {
@@ -128,6 +131,15 @@ interface DeauthorizeAPI {
128
131
  auth_token: AuthToken;
129
132
  }): Promise<Readonly<Record<string, never>>>;
130
133
  }
134
+ interface GetCapabilitiesAPI {
135
+ getCapabilities(): Promise<Readonly<{
136
+ supports_clone_authorization: boolean;
137
+ supports_sign_and_send_transactions: boolean;
138
+ max_transactions_per_request: boolean;
139
+ max_messages_per_request: boolean;
140
+ supported_transaction_versions: ReadonlyArray<TransactionVersion>;
141
+ }>>;
142
+ }
131
143
  interface ReauthorizeAPI {
132
144
  reauthorize(params: {
133
145
  auth_token: AuthToken;
@@ -158,8 +170,8 @@ interface SignAndSendTransactionsAPI {
158
170
  signatures: Base64EncodedSignature[];
159
171
  }>>;
160
172
  }
161
- interface MobileWallet extends AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI {
173
+ interface MobileWallet extends AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, GetCapabilitiesAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI {
162
174
  }
163
175
  declare function transact<TReturn>(callback: (wallet: MobileWallet) => TReturn, config?: WalletAssociationConfig): Promise<TReturn>;
164
- export { SolanaMobileWalletAdapterErrorCode, SolanaMobileWalletAdapterError, SolanaMobileWalletAdapterProtocolErrorCode, SolanaMobileWalletAdapterProtocolError, transact, Account, AppIdentity, AssociationKeypair, AuthorizationResult, AuthToken, Base64EncodedAddress, Base64EncodedTransaction, Cluster, Finality, WalletAssociationConfig, AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI, MobileWallet };
176
+ export { SolanaMobileWalletAdapterErrorCode, SolanaMobileWalletAdapterError, SolanaMobileWalletAdapterProtocolErrorCode, SolanaMobileWalletAdapterProtocolError, transact, Account, AppIdentity, AssociationKeypair, AuthorizationResult, AuthToken, Base64EncodedAddress, Base64EncodedTransaction, Cluster, Finality, WalletAssociationConfig, AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, GetCapabilitiesAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI, MobileWallet };
165
177
  //# sourceMappingURL=index.d.mts.map
@@ -1,9 +1,11 @@
1
+ import { TransactionVersion } from "@solana/web3.js";
1
2
  // Typescript `enums` thwart tree-shaking. See https://bargsten.org/jsts/enums/
2
3
  declare const SolanaMobileWalletAdapterErrorCode: {
3
4
  readonly ERROR_ASSOCIATION_PORT_OUT_OF_RANGE: "ERROR_ASSOCIATION_PORT_OUT_OF_RANGE";
4
5
  readonly ERROR_FORBIDDEN_WALLET_BASE_URL: "ERROR_FORBIDDEN_WALLET_BASE_URL";
5
6
  readonly ERROR_SECURE_CONTEXT_REQUIRED: "ERROR_SECURE_CONTEXT_REQUIRED";
6
7
  readonly ERROR_SESSION_CLOSED: "ERROR_SESSION_CLOSED";
8
+ readonly ERROR_SESSION_TIMEOUT: "ERROR_SESSION_TIMEOUT";
7
9
  readonly ERROR_WALLET_NOT_FOUND: "ERROR_WALLET_NOT_FOUND";
8
10
  };
9
11
  type SolanaMobileWalletAdapterErrorCodeEnum = (typeof SolanaMobileWalletAdapterErrorCode)[keyof typeof SolanaMobileWalletAdapterErrorCode];
@@ -16,6 +18,7 @@ type ErrorDataTypeMap = {
16
18
  [SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_CLOSED]: {
17
19
  closeEvent: CloseEvent;
18
20
  };
21
+ [SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_TIMEOUT]: undefined;
19
22
  [SolanaMobileWalletAdapterErrorCode.ERROR_WALLET_NOT_FOUND]: undefined;
20
23
  };
21
24
  declare class SolanaMobileWalletAdapterError<TErrorCode extends SolanaMobileWalletAdapterErrorCodeEnum> extends Error {
@@ -128,6 +131,15 @@ interface DeauthorizeAPI {
128
131
  auth_token: AuthToken;
129
132
  }): Promise<Readonly<Record<string, never>>>;
130
133
  }
134
+ interface GetCapabilitiesAPI {
135
+ getCapabilities(): Promise<Readonly<{
136
+ supports_clone_authorization: boolean;
137
+ supports_sign_and_send_transactions: boolean;
138
+ max_transactions_per_request: boolean;
139
+ max_messages_per_request: boolean;
140
+ supported_transaction_versions: ReadonlyArray<TransactionVersion>;
141
+ }>>;
142
+ }
131
143
  interface ReauthorizeAPI {
132
144
  reauthorize(params: {
133
145
  auth_token: AuthToken;
@@ -158,8 +170,8 @@ interface SignAndSendTransactionsAPI {
158
170
  signatures: Base64EncodedSignature[];
159
171
  }>>;
160
172
  }
161
- interface MobileWallet extends AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI {
173
+ interface MobileWallet extends AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, GetCapabilitiesAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI {
162
174
  }
163
175
  declare function transact<TReturn>(callback: (wallet: MobileWallet) => TReturn, config?: WalletAssociationConfig): Promise<TReturn>;
164
- export { SolanaMobileWalletAdapterErrorCode, SolanaMobileWalletAdapterError, SolanaMobileWalletAdapterProtocolErrorCode, SolanaMobileWalletAdapterProtocolError, transact, Account, AppIdentity, AssociationKeypair, AuthorizationResult, AuthToken, Base64EncodedAddress, Base64EncodedTransaction, Cluster, Finality, WalletAssociationConfig, AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI, MobileWallet };
176
+ export { SolanaMobileWalletAdapterErrorCode, SolanaMobileWalletAdapterError, SolanaMobileWalletAdapterProtocolErrorCode, SolanaMobileWalletAdapterProtocolError, transact, Account, AppIdentity, AssociationKeypair, AuthorizationResult, AuthToken, Base64EncodedAddress, Base64EncodedTransaction, Cluster, Finality, WalletAssociationConfig, AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, GetCapabilitiesAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI, MobileWallet };
165
177
  //# sourceMappingURL=index.d.ts.map
@@ -1,9 +1,11 @@
1
+ import { TransactionVersion } from "@solana/web3.js";
1
2
  // Typescript `enums` thwart tree-shaking. See https://bargsten.org/jsts/enums/
2
3
  declare const SolanaMobileWalletAdapterErrorCode: {
3
4
  readonly ERROR_ASSOCIATION_PORT_OUT_OF_RANGE: "ERROR_ASSOCIATION_PORT_OUT_OF_RANGE";
4
5
  readonly ERROR_FORBIDDEN_WALLET_BASE_URL: "ERROR_FORBIDDEN_WALLET_BASE_URL";
5
6
  readonly ERROR_SECURE_CONTEXT_REQUIRED: "ERROR_SECURE_CONTEXT_REQUIRED";
6
7
  readonly ERROR_SESSION_CLOSED: "ERROR_SESSION_CLOSED";
8
+ readonly ERROR_SESSION_TIMEOUT: "ERROR_SESSION_TIMEOUT";
7
9
  readonly ERROR_WALLET_NOT_FOUND: "ERROR_WALLET_NOT_FOUND";
8
10
  };
9
11
  type SolanaMobileWalletAdapterErrorCodeEnum = (typeof SolanaMobileWalletAdapterErrorCode)[keyof typeof SolanaMobileWalletAdapterErrorCode];
@@ -16,6 +18,7 @@ type ErrorDataTypeMap = {
16
18
  [SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_CLOSED]: {
17
19
  closeEvent: CloseEvent;
18
20
  };
21
+ [SolanaMobileWalletAdapterErrorCode.ERROR_SESSION_TIMEOUT]: undefined;
19
22
  [SolanaMobileWalletAdapterErrorCode.ERROR_WALLET_NOT_FOUND]: undefined;
20
23
  };
21
24
  declare class SolanaMobileWalletAdapterError<TErrorCode extends SolanaMobileWalletAdapterErrorCodeEnum> extends Error {
@@ -128,6 +131,15 @@ interface DeauthorizeAPI {
128
131
  auth_token: AuthToken;
129
132
  }): Promise<Readonly<Record<string, never>>>;
130
133
  }
134
+ interface GetCapabilitiesAPI {
135
+ getCapabilities(): Promise<Readonly<{
136
+ supports_clone_authorization: boolean;
137
+ supports_sign_and_send_transactions: boolean;
138
+ max_transactions_per_request: boolean;
139
+ max_messages_per_request: boolean;
140
+ supported_transaction_versions: ReadonlyArray<TransactionVersion>;
141
+ }>>;
142
+ }
131
143
  interface ReauthorizeAPI {
132
144
  reauthorize(params: {
133
145
  auth_token: AuthToken;
@@ -158,8 +170,8 @@ interface SignAndSendTransactionsAPI {
158
170
  signatures: Base64EncodedSignature[];
159
171
  }>>;
160
172
  }
161
- interface MobileWallet extends AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI {
173
+ interface MobileWallet extends AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, GetCapabilitiesAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI {
162
174
  }
163
175
  declare function transact<TReturn>(callback: (wallet: MobileWallet) => TReturn, config?: WalletAssociationConfig): Promise<TReturn>;
164
- export { SolanaMobileWalletAdapterErrorCode, SolanaMobileWalletAdapterError, SolanaMobileWalletAdapterProtocolErrorCode, SolanaMobileWalletAdapterProtocolError, transact, Account, AppIdentity, AssociationKeypair, AuthorizationResult, AuthToken, Base64EncodedAddress, Base64EncodedTransaction, Cluster, Finality, WalletAssociationConfig, AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI, MobileWallet };
176
+ export { SolanaMobileWalletAdapterErrorCode, SolanaMobileWalletAdapterError, SolanaMobileWalletAdapterProtocolErrorCode, SolanaMobileWalletAdapterProtocolError, transact, Account, AppIdentity, AssociationKeypair, AuthorizationResult, AuthToken, Base64EncodedAddress, Base64EncodedTransaction, Cluster, Finality, WalletAssociationConfig, AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, GetCapabilitiesAPI, ReauthorizeAPI, SignMessagesAPI, SignTransactionsAPI, SignAndSendTransactionsAPI, MobileWallet };
165
177
  //# sourceMappingURL=index.native.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@solana-mobile/mobile-wallet-adapter-protocol",
3
3
  "description": "An implementation of the Solana Mobile Mobile Wallet Adapter protocol. Use this to open a session with a mobile wallet app, and to issue API calls to it.",
4
- "version": "0.9.4",
4
+ "version": "0.9.6",
5
5
  "author": "Steven Luscher <steven.luscher@solanamobile.com>",
6
6
  "repository": "https://github.com/solana-mobile/mobile-wallet-adapter",
7
7
  "license": "Apache-2.0",
@@ -39,6 +39,7 @@
39
39
  "prepublishOnly": "agadoo"
40
40
  },
41
41
  "devDependencies": {
42
+ "@solana/web3.js": "^1.58.0",
42
43
  "@types/react-native": "^0.69.3",
43
44
  "agadoo": "^2.0.0",
44
45
  "cross-env": "^7.0.3"
@@ -46,5 +47,5 @@
46
47
  "peerDependencies": {
47
48
  "react-native": ">0.69"
48
49
  },
49
- "gitHead": "83d9987d68083fe62de95a094bea10faa1bce5ea"
50
+ "gitHead": "a5baca70e3ab481bf85dbd29aac13b769e317045"
50
51
  }