@solana-mobile/wallet-adapter-mobile 0.0.1-alpha.3 → 0.0.1-alpha.4

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.
@@ -63,7 +63,7 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
63
63
  }
64
64
  get publicKey() {
65
65
  if (this._publicKey == null && this._authorizationResult != null) {
66
- this._publicKey = new web3_js.PublicKey(this._authorizationResult.publicKey);
66
+ this._publicKey = new web3_js.PublicKey(this._authorizationResult.pub_key);
67
67
  }
68
68
  return this._publicKey ? this._publicKey : null;
69
69
  }
@@ -107,9 +107,9 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
107
107
  throw new walletAdapterBase.WalletPublicKeyError((e instanceof Error && (e === null || e === void 0 ? void 0 : e.message)) || 'Unknown error', e);
108
108
  }
109
109
  this.handleAuthorizationResult({
110
- authToken: auth_token,
111
- publicKey: base58PublicKey,
112
- walletUriBase: wallet_uri_base,
110
+ auth_token,
111
+ pub_key: base58PublicKey,
112
+ wallet_uri_base: wallet_uri_base,
113
113
  }); // TODO: Evaluate whether there's any threat to not `awaiting` this expression
114
114
  this.emit('connect',
115
115
  // Having just set an `authorizationResult`, `this.publicKey` is definitely non-null
@@ -136,10 +136,10 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
136
136
  try {
137
137
  const { auth_token } = yield walletAPI({
138
138
  method: 'reauthorize',
139
- auth_token: currentAuthorizationResult.authToken,
139
+ auth_token: currentAuthorizationResult.auth_token,
140
140
  });
141
- if (currentAuthorizationResult.authToken !== auth_token) {
142
- this.handleAuthorizationResult(Object.assign(Object.assign({}, currentAuthorizationResult), { authToken: auth_token })); // TODO: Evaluate whether there's any threat to not `awaiting` this expression
141
+ if (currentAuthorizationResult.auth_token !== auth_token) {
142
+ this.handleAuthorizationResult(Object.assign(Object.assign({}, currentAuthorizationResult), { auth_token })); // TODO: Evaluate whether there's any threat to not `awaiting` this expression
143
143
  }
144
144
  return auth_token;
145
145
  }
@@ -160,7 +160,7 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
160
160
  transact(callback) {
161
161
  var _a;
162
162
  return __awaiter(this, void 0, void 0, function* () {
163
- const walletUriBase = (_a = this._authorizationResult) === null || _a === void 0 ? void 0 : _a.walletUriBase;
163
+ const walletUriBase = (_a = this._authorizationResult) === null || _a === void 0 ? void 0 : _a.wallet_uri_base;
164
164
  const config = walletUriBase ? { baseUri: walletUriBase } : undefined;
165
165
  return yield mobileWalletAdapterProtocolWeb3js.transact(callback, config);
166
166
  });
package/lib/cjs/index.js CHANGED
@@ -63,7 +63,7 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
63
63
  }
64
64
  get publicKey() {
65
65
  if (this._publicKey == null && this._authorizationResult != null) {
66
- this._publicKey = new web3_js.PublicKey(this._authorizationResult.publicKey);
66
+ this._publicKey = new web3_js.PublicKey(this._authorizationResult.pub_key);
67
67
  }
68
68
  return this._publicKey ? this._publicKey : null;
69
69
  }
@@ -107,9 +107,9 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
107
107
  throw new walletAdapterBase.WalletPublicKeyError((e instanceof Error && (e === null || e === void 0 ? void 0 : e.message)) || 'Unknown error', e);
108
108
  }
109
109
  this.handleAuthorizationResult({
110
- authToken: auth_token,
111
- publicKey: base58PublicKey,
112
- walletUriBase: wallet_uri_base,
110
+ auth_token,
111
+ pub_key: base58PublicKey,
112
+ wallet_uri_base: wallet_uri_base,
113
113
  }); // TODO: Evaluate whether there's any threat to not `awaiting` this expression
114
114
  this.emit('connect',
115
115
  // Having just set an `authorizationResult`, `this.publicKey` is definitely non-null
@@ -136,10 +136,10 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
136
136
  try {
137
137
  const { auth_token } = yield walletAPI({
138
138
  method: 'reauthorize',
139
- auth_token: currentAuthorizationResult.authToken,
139
+ auth_token: currentAuthorizationResult.auth_token,
140
140
  });
141
- if (currentAuthorizationResult.authToken !== auth_token) {
142
- this.handleAuthorizationResult(Object.assign(Object.assign({}, currentAuthorizationResult), { authToken: auth_token })); // TODO: Evaluate whether there's any threat to not `awaiting` this expression
141
+ if (currentAuthorizationResult.auth_token !== auth_token) {
142
+ this.handleAuthorizationResult(Object.assign(Object.assign({}, currentAuthorizationResult), { auth_token })); // TODO: Evaluate whether there's any threat to not `awaiting` this expression
143
143
  }
144
144
  return auth_token;
145
145
  }
@@ -160,7 +160,7 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
160
160
  transact(callback) {
161
161
  var _a;
162
162
  return __awaiter(this, void 0, void 0, function* () {
163
- const walletUriBase = (_a = this._authorizationResult) === null || _a === void 0 ? void 0 : _a.walletUriBase;
163
+ const walletUriBase = (_a = this._authorizationResult) === null || _a === void 0 ? void 0 : _a.wallet_uri_base;
164
164
  const config = walletUriBase ? { baseUri: walletUriBase } : undefined;
165
165
  return yield mobileWalletAdapterProtocolWeb3js.transact(callback, config);
166
166
  });
@@ -66,7 +66,7 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
66
66
  }
67
67
  get publicKey() {
68
68
  if (this._publicKey == null && this._authorizationResult != null) {
69
- this._publicKey = new web3_js.PublicKey(this._authorizationResult.publicKey);
69
+ this._publicKey = new web3_js.PublicKey(this._authorizationResult.pub_key);
70
70
  }
71
71
  return this._publicKey ? this._publicKey : null;
72
72
  }
@@ -110,9 +110,9 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
110
110
  throw new walletAdapterBase.WalletPublicKeyError((e instanceof Error && (e === null || e === void 0 ? void 0 : e.message)) || 'Unknown error', e);
111
111
  }
112
112
  this.handleAuthorizationResult({
113
- authToken: auth_token,
114
- publicKey: base58PublicKey,
115
- walletUriBase: wallet_uri_base,
113
+ auth_token,
114
+ pub_key: base58PublicKey,
115
+ wallet_uri_base: wallet_uri_base,
116
116
  }); // TODO: Evaluate whether there's any threat to not `awaiting` this expression
117
117
  this.emit('connect',
118
118
  // Having just set an `authorizationResult`, `this.publicKey` is definitely non-null
@@ -139,10 +139,10 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
139
139
  try {
140
140
  const { auth_token } = yield walletAPI({
141
141
  method: 'reauthorize',
142
- auth_token: currentAuthorizationResult.authToken,
142
+ auth_token: currentAuthorizationResult.auth_token,
143
143
  });
144
- if (currentAuthorizationResult.authToken !== auth_token) {
145
- this.handleAuthorizationResult(Object.assign(Object.assign({}, currentAuthorizationResult), { authToken: auth_token })); // TODO: Evaluate whether there's any threat to not `awaiting` this expression
144
+ if (currentAuthorizationResult.auth_token !== auth_token) {
145
+ this.handleAuthorizationResult(Object.assign(Object.assign({}, currentAuthorizationResult), { auth_token })); // TODO: Evaluate whether there's any threat to not `awaiting` this expression
146
146
  }
147
147
  return auth_token;
148
148
  }
@@ -163,7 +163,7 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
163
163
  transact(callback) {
164
164
  var _a;
165
165
  return __awaiter(this, void 0, void 0, function* () {
166
- const walletUriBase = (_a = this._authorizationResult) === null || _a === void 0 ? void 0 : _a.walletUriBase;
166
+ const walletUriBase = (_a = this._authorizationResult) === null || _a === void 0 ? void 0 : _a.wallet_uri_base;
167
167
  const config = walletUriBase ? { baseUri: walletUriBase } : undefined;
168
168
  return yield mobileWalletAdapterProtocolWeb3js.transact(callback, config);
169
169
  });
@@ -59,7 +59,7 @@ class SolanaMobileWalletAdapter extends BaseMessageSignerWalletAdapter {
59
59
  }
60
60
  get publicKey() {
61
61
  if (this._publicKey == null && this._authorizationResult != null) {
62
- this._publicKey = new PublicKey(this._authorizationResult.publicKey);
62
+ this._publicKey = new PublicKey(this._authorizationResult.pub_key);
63
63
  }
64
64
  return this._publicKey ? this._publicKey : null;
65
65
  }
@@ -103,9 +103,9 @@ class SolanaMobileWalletAdapter extends BaseMessageSignerWalletAdapter {
103
103
  throw new WalletPublicKeyError((e instanceof Error && (e === null || e === void 0 ? void 0 : e.message)) || 'Unknown error', e);
104
104
  }
105
105
  this.handleAuthorizationResult({
106
- authToken: auth_token,
107
- publicKey: base58PublicKey,
108
- walletUriBase: wallet_uri_base,
106
+ auth_token,
107
+ pub_key: base58PublicKey,
108
+ wallet_uri_base: wallet_uri_base,
109
109
  }); // TODO: Evaluate whether there's any threat to not `awaiting` this expression
110
110
  this.emit('connect',
111
111
  // Having just set an `authorizationResult`, `this.publicKey` is definitely non-null
@@ -132,10 +132,10 @@ class SolanaMobileWalletAdapter extends BaseMessageSignerWalletAdapter {
132
132
  try {
133
133
  const { auth_token } = yield walletAPI({
134
134
  method: 'reauthorize',
135
- auth_token: currentAuthorizationResult.authToken,
135
+ auth_token: currentAuthorizationResult.auth_token,
136
136
  });
137
- if (currentAuthorizationResult.authToken !== auth_token) {
138
- this.handleAuthorizationResult(Object.assign(Object.assign({}, currentAuthorizationResult), { authToken: auth_token })); // TODO: Evaluate whether there's any threat to not `awaiting` this expression
137
+ if (currentAuthorizationResult.auth_token !== auth_token) {
138
+ this.handleAuthorizationResult(Object.assign(Object.assign({}, currentAuthorizationResult), { auth_token })); // TODO: Evaluate whether there's any threat to not `awaiting` this expression
139
139
  }
140
140
  return auth_token;
141
141
  }
@@ -156,7 +156,7 @@ class SolanaMobileWalletAdapter extends BaseMessageSignerWalletAdapter {
156
156
  transact(callback) {
157
157
  var _a;
158
158
  return __awaiter(this, void 0, void 0, function* () {
159
- const walletUriBase = (_a = this._authorizationResult) === null || _a === void 0 ? void 0 : _a.walletUriBase;
159
+ const walletUriBase = (_a = this._authorizationResult) === null || _a === void 0 ? void 0 : _a.wallet_uri_base;
160
160
  const config = walletUriBase ? { baseUri: walletUriBase } : undefined;
161
161
  return yield transact(callback, config);
162
162
  });
package/lib/esm/index.mjs CHANGED
@@ -59,7 +59,7 @@ class SolanaMobileWalletAdapter extends BaseMessageSignerWalletAdapter {
59
59
  }
60
60
  get publicKey() {
61
61
  if (this._publicKey == null && this._authorizationResult != null) {
62
- this._publicKey = new PublicKey(this._authorizationResult.publicKey);
62
+ this._publicKey = new PublicKey(this._authorizationResult.pub_key);
63
63
  }
64
64
  return this._publicKey ? this._publicKey : null;
65
65
  }
@@ -103,9 +103,9 @@ class SolanaMobileWalletAdapter extends BaseMessageSignerWalletAdapter {
103
103
  throw new WalletPublicKeyError((e instanceof Error && (e === null || e === void 0 ? void 0 : e.message)) || 'Unknown error', e);
104
104
  }
105
105
  this.handleAuthorizationResult({
106
- authToken: auth_token,
107
- publicKey: base58PublicKey,
108
- walletUriBase: wallet_uri_base,
106
+ auth_token,
107
+ pub_key: base58PublicKey,
108
+ wallet_uri_base: wallet_uri_base,
109
109
  }); // TODO: Evaluate whether there's any threat to not `awaiting` this expression
110
110
  this.emit('connect',
111
111
  // Having just set an `authorizationResult`, `this.publicKey` is definitely non-null
@@ -132,10 +132,10 @@ class SolanaMobileWalletAdapter extends BaseMessageSignerWalletAdapter {
132
132
  try {
133
133
  const { auth_token } = yield walletAPI({
134
134
  method: 'reauthorize',
135
- auth_token: currentAuthorizationResult.authToken,
135
+ auth_token: currentAuthorizationResult.auth_token,
136
136
  });
137
- if (currentAuthorizationResult.authToken !== auth_token) {
138
- this.handleAuthorizationResult(Object.assign(Object.assign({}, currentAuthorizationResult), { authToken: auth_token })); // TODO: Evaluate whether there's any threat to not `awaiting` this expression
137
+ if (currentAuthorizationResult.auth_token !== auth_token) {
138
+ this.handleAuthorizationResult(Object.assign(Object.assign({}, currentAuthorizationResult), { auth_token })); // TODO: Evaluate whether there's any threat to not `awaiting` this expression
139
139
  }
140
140
  return auth_token;
141
141
  }
@@ -156,7 +156,7 @@ class SolanaMobileWalletAdapter extends BaseMessageSignerWalletAdapter {
156
156
  transact(callback) {
157
157
  var _a;
158
158
  return __awaiter(this, void 0, void 0, function* () {
159
- const walletUriBase = (_a = this._authorizationResult) === null || _a === void 0 ? void 0 : _a.walletUriBase;
159
+ const walletUriBase = (_a = this._authorizationResult) === null || _a === void 0 ? void 0 : _a.wallet_uri_base;
160
160
  const config = walletUriBase ? { baseUri: walletUriBase } : undefined;
161
161
  return yield transact(callback, config);
162
162
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@solana-mobile/wallet-adapter-mobile",
3
3
  "description": "An adapter for mobile wallet apps that conform to the Solana Mobile Wallet Adapter protocol",
4
- "version": "0.0.1-alpha.3",
4
+ "version": "0.0.1-alpha.4",
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",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@react-native-async-storage/async-storage": "^1.17.7",
44
- "@solana-mobile/mobile-wallet-adapter-protocol-web3js": "^0.0.1-alpha.3",
44
+ "@solana-mobile/mobile-wallet-adapter-protocol-web3js": "^0.0.1-alpha.4",
45
45
  "@solana/wallet-adapter-base": "^0.9.8",
46
46
  "@solana/web3.js": "^1.20.0"
47
47
  },
@@ -49,5 +49,5 @@
49
49
  "agadoo": "^2.0.0",
50
50
  "shx": "^0.3.4"
51
51
  },
52
- "gitHead": "33b0d8a9bdac3960a95bde4012b66a2ee0f02695"
52
+ "gitHead": "d8a5244c5535b02f3dcf8144554a474ddac43f32"
53
53
  }