@solana-mobile/wallet-adapter-mobile 0.0.1-alpha.4 → 0.0.1-alpha.5
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.
- package/lib/cjs/index.browser.js +6 -10
- package/lib/cjs/index.js +6 -10
- package/lib/cjs/index.native.js +6 -10
- package/lib/esm/index.browser.mjs +6 -10
- package/lib/esm/index.mjs +6 -10
- package/package.json +3 -3
package/lib/cjs/index.browser.js
CHANGED
|
@@ -99,7 +99,7 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
|
|
|
99
99
|
}
|
|
100
100
|
try {
|
|
101
101
|
yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
102
|
-
const { auth_token, pub_key: base58PublicKey, wallet_uri_base, } = yield walletAPI(
|
|
102
|
+
const { auth_token, pub_key: base58PublicKey, wallet_uri_base, } = yield walletAPI('authorize', { identity: this._appIdentity });
|
|
103
103
|
try {
|
|
104
104
|
this._publicKey = new web3_js.PublicKey(base58PublicKey);
|
|
105
105
|
}
|
|
@@ -134,8 +134,7 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
|
|
|
134
134
|
performReauthorization(walletAPI, currentAuthorizationResult) {
|
|
135
135
|
return __awaiter(this, void 0, void 0, function* () {
|
|
136
136
|
try {
|
|
137
|
-
const { auth_token } = yield walletAPI({
|
|
138
|
-
method: 'reauthorize',
|
|
137
|
+
const { auth_token } = yield walletAPI('reauthorize', {
|
|
139
138
|
auth_token: currentAuthorizationResult.auth_token,
|
|
140
139
|
});
|
|
141
140
|
if (currentAuthorizationResult.auth_token !== auth_token) {
|
|
@@ -178,8 +177,7 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
|
|
|
178
177
|
try {
|
|
179
178
|
return yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
180
179
|
const freshAuthToken = yield this.performReauthorization(walletAPI, authorizationResult);
|
|
181
|
-
const signedTransactions = yield walletAPI({
|
|
182
|
-
method: 'sign_transaction',
|
|
180
|
+
const signedTransactions = yield walletAPI('sign_transaction', {
|
|
183
181
|
auth_token: freshAuthToken,
|
|
184
182
|
transactions,
|
|
185
183
|
});
|
|
@@ -203,8 +201,7 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
|
|
|
203
201
|
try {
|
|
204
202
|
return yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
205
203
|
const freshAuthToken = yield this.performReauthorization(walletAPI, authorizationResult);
|
|
206
|
-
const signatures = yield walletAPI({
|
|
207
|
-
method: 'sign_and_send_transaction',
|
|
204
|
+
const signatures = yield walletAPI('sign_and_send_transaction', {
|
|
208
205
|
auth_token: freshAuthToken,
|
|
209
206
|
fee_payer: this.publicKey || undefined,
|
|
210
207
|
connection,
|
|
@@ -242,10 +239,9 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
|
|
|
242
239
|
try {
|
|
243
240
|
return yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
244
241
|
const freshAuthToken = yield this.performReauthorization(walletAPI, authorizationResult);
|
|
245
|
-
const [signedMessage] = yield walletAPI({
|
|
246
|
-
method: 'sign_message',
|
|
242
|
+
const [signedMessage] = yield walletAPI('sign_message', {
|
|
247
243
|
auth_token: freshAuthToken,
|
|
248
|
-
|
|
244
|
+
payloads: [message],
|
|
249
245
|
});
|
|
250
246
|
const signature = signedMessage.slice(-SIGNATURE_LENGTH_IN_BYTES);
|
|
251
247
|
return signature;
|
package/lib/cjs/index.js
CHANGED
|
@@ -99,7 +99,7 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
|
|
|
99
99
|
}
|
|
100
100
|
try {
|
|
101
101
|
yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
102
|
-
const { auth_token, pub_key: base58PublicKey, wallet_uri_base, } = yield walletAPI(
|
|
102
|
+
const { auth_token, pub_key: base58PublicKey, wallet_uri_base, } = yield walletAPI('authorize', { identity: this._appIdentity });
|
|
103
103
|
try {
|
|
104
104
|
this._publicKey = new web3_js.PublicKey(base58PublicKey);
|
|
105
105
|
}
|
|
@@ -134,8 +134,7 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
|
|
|
134
134
|
performReauthorization(walletAPI, currentAuthorizationResult) {
|
|
135
135
|
return __awaiter(this, void 0, void 0, function* () {
|
|
136
136
|
try {
|
|
137
|
-
const { auth_token } = yield walletAPI({
|
|
138
|
-
method: 'reauthorize',
|
|
137
|
+
const { auth_token } = yield walletAPI('reauthorize', {
|
|
139
138
|
auth_token: currentAuthorizationResult.auth_token,
|
|
140
139
|
});
|
|
141
140
|
if (currentAuthorizationResult.auth_token !== auth_token) {
|
|
@@ -178,8 +177,7 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
|
|
|
178
177
|
try {
|
|
179
178
|
return yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
180
179
|
const freshAuthToken = yield this.performReauthorization(walletAPI, authorizationResult);
|
|
181
|
-
const signedTransactions = yield walletAPI({
|
|
182
|
-
method: 'sign_transaction',
|
|
180
|
+
const signedTransactions = yield walletAPI('sign_transaction', {
|
|
183
181
|
auth_token: freshAuthToken,
|
|
184
182
|
transactions,
|
|
185
183
|
});
|
|
@@ -203,8 +201,7 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
|
|
|
203
201
|
try {
|
|
204
202
|
return yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
205
203
|
const freshAuthToken = yield this.performReauthorization(walletAPI, authorizationResult);
|
|
206
|
-
const signatures = yield walletAPI({
|
|
207
|
-
method: 'sign_and_send_transaction',
|
|
204
|
+
const signatures = yield walletAPI('sign_and_send_transaction', {
|
|
208
205
|
auth_token: freshAuthToken,
|
|
209
206
|
fee_payer: this.publicKey || undefined,
|
|
210
207
|
connection,
|
|
@@ -242,10 +239,9 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
|
|
|
242
239
|
try {
|
|
243
240
|
return yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
244
241
|
const freshAuthToken = yield this.performReauthorization(walletAPI, authorizationResult);
|
|
245
|
-
const [signedMessage] = yield walletAPI({
|
|
246
|
-
method: 'sign_message',
|
|
242
|
+
const [signedMessage] = yield walletAPI('sign_message', {
|
|
247
243
|
auth_token: freshAuthToken,
|
|
248
|
-
|
|
244
|
+
payloads: [message],
|
|
249
245
|
});
|
|
250
246
|
const signature = signedMessage.slice(-SIGNATURE_LENGTH_IN_BYTES);
|
|
251
247
|
return signature;
|
package/lib/cjs/index.native.js
CHANGED
|
@@ -102,7 +102,7 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
|
|
|
102
102
|
}
|
|
103
103
|
try {
|
|
104
104
|
yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
105
|
-
const { auth_token, pub_key: base58PublicKey, wallet_uri_base, } = yield walletAPI(
|
|
105
|
+
const { auth_token, pub_key: base58PublicKey, wallet_uri_base, } = yield walletAPI('authorize', { identity: this._appIdentity });
|
|
106
106
|
try {
|
|
107
107
|
this._publicKey = new web3_js.PublicKey(base58PublicKey);
|
|
108
108
|
}
|
|
@@ -137,8 +137,7 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
|
|
|
137
137
|
performReauthorization(walletAPI, currentAuthorizationResult) {
|
|
138
138
|
return __awaiter(this, void 0, void 0, function* () {
|
|
139
139
|
try {
|
|
140
|
-
const { auth_token } = yield walletAPI({
|
|
141
|
-
method: 'reauthorize',
|
|
140
|
+
const { auth_token } = yield walletAPI('reauthorize', {
|
|
142
141
|
auth_token: currentAuthorizationResult.auth_token,
|
|
143
142
|
});
|
|
144
143
|
if (currentAuthorizationResult.auth_token !== auth_token) {
|
|
@@ -181,8 +180,7 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
|
|
|
181
180
|
try {
|
|
182
181
|
return yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
183
182
|
const freshAuthToken = yield this.performReauthorization(walletAPI, authorizationResult);
|
|
184
|
-
const signedTransactions = yield walletAPI({
|
|
185
|
-
method: 'sign_transaction',
|
|
183
|
+
const signedTransactions = yield walletAPI('sign_transaction', {
|
|
186
184
|
auth_token: freshAuthToken,
|
|
187
185
|
transactions,
|
|
188
186
|
});
|
|
@@ -206,8 +204,7 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
|
|
|
206
204
|
try {
|
|
207
205
|
return yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
208
206
|
const freshAuthToken = yield this.performReauthorization(walletAPI, authorizationResult);
|
|
209
|
-
const signatures = yield walletAPI({
|
|
210
|
-
method: 'sign_and_send_transaction',
|
|
207
|
+
const signatures = yield walletAPI('sign_and_send_transaction', {
|
|
211
208
|
auth_token: freshAuthToken,
|
|
212
209
|
fee_payer: this.publicKey || undefined,
|
|
213
210
|
connection,
|
|
@@ -245,10 +242,9 @@ class SolanaMobileWalletAdapter extends walletAdapterBase.BaseMessageSignerWalle
|
|
|
245
242
|
try {
|
|
246
243
|
return yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
247
244
|
const freshAuthToken = yield this.performReauthorization(walletAPI, authorizationResult);
|
|
248
|
-
const [signedMessage] = yield walletAPI({
|
|
249
|
-
method: 'sign_message',
|
|
245
|
+
const [signedMessage] = yield walletAPI('sign_message', {
|
|
250
246
|
auth_token: freshAuthToken,
|
|
251
|
-
|
|
247
|
+
payloads: [message],
|
|
252
248
|
});
|
|
253
249
|
const signature = signedMessage.slice(-SIGNATURE_LENGTH_IN_BYTES);
|
|
254
250
|
return signature;
|
|
@@ -95,7 +95,7 @@ class SolanaMobileWalletAdapter extends BaseMessageSignerWalletAdapter {
|
|
|
95
95
|
}
|
|
96
96
|
try {
|
|
97
97
|
yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
const { auth_token, pub_key: base58PublicKey, wallet_uri_base, } = yield walletAPI(
|
|
98
|
+
const { auth_token, pub_key: base58PublicKey, wallet_uri_base, } = yield walletAPI('authorize', { identity: this._appIdentity });
|
|
99
99
|
try {
|
|
100
100
|
this._publicKey = new PublicKey(base58PublicKey);
|
|
101
101
|
}
|
|
@@ -130,8 +130,7 @@ class SolanaMobileWalletAdapter extends BaseMessageSignerWalletAdapter {
|
|
|
130
130
|
performReauthorization(walletAPI, currentAuthorizationResult) {
|
|
131
131
|
return __awaiter(this, void 0, void 0, function* () {
|
|
132
132
|
try {
|
|
133
|
-
const { auth_token } = yield walletAPI({
|
|
134
|
-
method: 'reauthorize',
|
|
133
|
+
const { auth_token } = yield walletAPI('reauthorize', {
|
|
135
134
|
auth_token: currentAuthorizationResult.auth_token,
|
|
136
135
|
});
|
|
137
136
|
if (currentAuthorizationResult.auth_token !== auth_token) {
|
|
@@ -174,8 +173,7 @@ class SolanaMobileWalletAdapter extends BaseMessageSignerWalletAdapter {
|
|
|
174
173
|
try {
|
|
175
174
|
return yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
176
175
|
const freshAuthToken = yield this.performReauthorization(walletAPI, authorizationResult);
|
|
177
|
-
const signedTransactions = yield walletAPI({
|
|
178
|
-
method: 'sign_transaction',
|
|
176
|
+
const signedTransactions = yield walletAPI('sign_transaction', {
|
|
179
177
|
auth_token: freshAuthToken,
|
|
180
178
|
transactions,
|
|
181
179
|
});
|
|
@@ -199,8 +197,7 @@ class SolanaMobileWalletAdapter extends BaseMessageSignerWalletAdapter {
|
|
|
199
197
|
try {
|
|
200
198
|
return yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
201
199
|
const freshAuthToken = yield this.performReauthorization(walletAPI, authorizationResult);
|
|
202
|
-
const signatures = yield walletAPI({
|
|
203
|
-
method: 'sign_and_send_transaction',
|
|
200
|
+
const signatures = yield walletAPI('sign_and_send_transaction', {
|
|
204
201
|
auth_token: freshAuthToken,
|
|
205
202
|
fee_payer: this.publicKey || undefined,
|
|
206
203
|
connection,
|
|
@@ -238,10 +235,9 @@ class SolanaMobileWalletAdapter extends BaseMessageSignerWalletAdapter {
|
|
|
238
235
|
try {
|
|
239
236
|
return yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
240
237
|
const freshAuthToken = yield this.performReauthorization(walletAPI, authorizationResult);
|
|
241
|
-
const [signedMessage] = yield walletAPI({
|
|
242
|
-
method: 'sign_message',
|
|
238
|
+
const [signedMessage] = yield walletAPI('sign_message', {
|
|
243
239
|
auth_token: freshAuthToken,
|
|
244
|
-
|
|
240
|
+
payloads: [message],
|
|
245
241
|
});
|
|
246
242
|
const signature = signedMessage.slice(-SIGNATURE_LENGTH_IN_BYTES);
|
|
247
243
|
return signature;
|
package/lib/esm/index.mjs
CHANGED
|
@@ -95,7 +95,7 @@ class SolanaMobileWalletAdapter extends BaseMessageSignerWalletAdapter {
|
|
|
95
95
|
}
|
|
96
96
|
try {
|
|
97
97
|
yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
const { auth_token, pub_key: base58PublicKey, wallet_uri_base, } = yield walletAPI(
|
|
98
|
+
const { auth_token, pub_key: base58PublicKey, wallet_uri_base, } = yield walletAPI('authorize', { identity: this._appIdentity });
|
|
99
99
|
try {
|
|
100
100
|
this._publicKey = new PublicKey(base58PublicKey);
|
|
101
101
|
}
|
|
@@ -130,8 +130,7 @@ class SolanaMobileWalletAdapter extends BaseMessageSignerWalletAdapter {
|
|
|
130
130
|
performReauthorization(walletAPI, currentAuthorizationResult) {
|
|
131
131
|
return __awaiter(this, void 0, void 0, function* () {
|
|
132
132
|
try {
|
|
133
|
-
const { auth_token } = yield walletAPI({
|
|
134
|
-
method: 'reauthorize',
|
|
133
|
+
const { auth_token } = yield walletAPI('reauthorize', {
|
|
135
134
|
auth_token: currentAuthorizationResult.auth_token,
|
|
136
135
|
});
|
|
137
136
|
if (currentAuthorizationResult.auth_token !== auth_token) {
|
|
@@ -174,8 +173,7 @@ class SolanaMobileWalletAdapter extends BaseMessageSignerWalletAdapter {
|
|
|
174
173
|
try {
|
|
175
174
|
return yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
176
175
|
const freshAuthToken = yield this.performReauthorization(walletAPI, authorizationResult);
|
|
177
|
-
const signedTransactions = yield walletAPI({
|
|
178
|
-
method: 'sign_transaction',
|
|
176
|
+
const signedTransactions = yield walletAPI('sign_transaction', {
|
|
179
177
|
auth_token: freshAuthToken,
|
|
180
178
|
transactions,
|
|
181
179
|
});
|
|
@@ -199,8 +197,7 @@ class SolanaMobileWalletAdapter extends BaseMessageSignerWalletAdapter {
|
|
|
199
197
|
try {
|
|
200
198
|
return yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
201
199
|
const freshAuthToken = yield this.performReauthorization(walletAPI, authorizationResult);
|
|
202
|
-
const signatures = yield walletAPI({
|
|
203
|
-
method: 'sign_and_send_transaction',
|
|
200
|
+
const signatures = yield walletAPI('sign_and_send_transaction', {
|
|
204
201
|
auth_token: freshAuthToken,
|
|
205
202
|
fee_payer: this.publicKey || undefined,
|
|
206
203
|
connection,
|
|
@@ -238,10 +235,9 @@ class SolanaMobileWalletAdapter extends BaseMessageSignerWalletAdapter {
|
|
|
238
235
|
try {
|
|
239
236
|
return yield this.transact((walletAPI) => __awaiter(this, void 0, void 0, function* () {
|
|
240
237
|
const freshAuthToken = yield this.performReauthorization(walletAPI, authorizationResult);
|
|
241
|
-
const [signedMessage] = yield walletAPI({
|
|
242
|
-
method: 'sign_message',
|
|
238
|
+
const [signedMessage] = yield walletAPI('sign_message', {
|
|
243
239
|
auth_token: freshAuthToken,
|
|
244
|
-
|
|
240
|
+
payloads: [message],
|
|
245
241
|
});
|
|
246
242
|
const signature = signedMessage.slice(-SIGNATURE_LENGTH_IN_BYTES);
|
|
247
243
|
return signature;
|
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.
|
|
4
|
+
"version": "0.0.1-alpha.5",
|
|
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.
|
|
44
|
+
"@solana-mobile/mobile-wallet-adapter-protocol-web3js": "^0.0.1-alpha.5",
|
|
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": "
|
|
52
|
+
"gitHead": "7df380859bd4a3e6acc4f4b7385e9604919c76a8"
|
|
53
53
|
}
|