@solana-mobile/mobile-wallet-adapter-protocol-web3js 2.1.2 → 2.1.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.
- package/lib/cjs/index.browser.js +71 -0
- package/lib/cjs/index.js +71 -0
- package/lib/cjs/index.native.js +71 -0
- package/lib/esm/index.browser.js +72 -2
- package/lib/esm/index.js +72 -2
- package/lib/types/index.browser.d.ts +8 -2
- package/lib/types/index.d.ts +8 -2
- package/lib/types/index.native.d.ts +8 -2
- package/package.json +4 -4
package/lib/cjs/index.browser.js
CHANGED
|
@@ -148,5 +148,76 @@ function transact(callback, config) {
|
|
|
148
148
|
return yield mobileWalletAdapterProtocol.transact(augmentedCallback, config);
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
|
+
function transactRemote(callback, config) {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
const augmentedCallback = (wallet) => {
|
|
154
|
+
const augmentedAPI = new Proxy({}, {
|
|
155
|
+
get(target, p) {
|
|
156
|
+
if (target[p] == null) {
|
|
157
|
+
switch (p) {
|
|
158
|
+
case 'signAndSendTransactions':
|
|
159
|
+
target[p] = function (_a) {
|
|
160
|
+
var { minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions } = _a, rest = __rest(_a, ["minContextSlot", "commitment", "skipPreflight", "maxRetries", "waitForCommitmentToSendNextTransaction", "transactions"]);
|
|
161
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
+
const payloads = transactions.map(getPayloadFromTransaction);
|
|
163
|
+
const options = {
|
|
164
|
+
min_context_slot: minContextSlot,
|
|
165
|
+
commitment: commitment,
|
|
166
|
+
skip_preflight: skipPreflight,
|
|
167
|
+
max_retries: maxRetries,
|
|
168
|
+
wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
|
|
169
|
+
};
|
|
170
|
+
const { signatures: base64EncodedSignatures } = yield wallet.signAndSendTransactions(Object.assign(Object.assign(Object.assign({}, rest), (Object.values(options).some(element => element != null)
|
|
171
|
+
? { options: options }
|
|
172
|
+
: null)), { payloads }));
|
|
173
|
+
const signatures = base64EncodedSignatures.map(toUint8Array).map(bs58__default["default"].encode);
|
|
174
|
+
return signatures;
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
break;
|
|
178
|
+
case 'signMessages':
|
|
179
|
+
target[p] = function (_a) {
|
|
180
|
+
var { payloads } = _a, rest = __rest(_a, ["payloads"]);
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
const base64EncodedPayloads = payloads.map(fromUint8Array);
|
|
183
|
+
const { signed_payloads: base64EncodedSignedMessages } = yield wallet.signMessages(Object.assign(Object.assign({}, rest), { payloads: base64EncodedPayloads }));
|
|
184
|
+
const signedMessages = base64EncodedSignedMessages.map(toUint8Array);
|
|
185
|
+
return signedMessages;
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
break;
|
|
189
|
+
case 'signTransactions':
|
|
190
|
+
target[p] = function (_a) {
|
|
191
|
+
var { transactions } = _a, rest = __rest(_a, ["transactions"]);
|
|
192
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
193
|
+
const payloads = transactions.map(getPayloadFromTransaction);
|
|
194
|
+
const { signed_payloads: base64EncodedCompiledTransactions } = yield wallet.signTransactions(Object.assign(Object.assign({}, rest), { payloads }));
|
|
195
|
+
const compiledTransactions = base64EncodedCompiledTransactions.map(toUint8Array);
|
|
196
|
+
const signedTransactions = compiledTransactions.map(getTransactionFromWireMessage);
|
|
197
|
+
return signedTransactions;
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
break;
|
|
201
|
+
default: {
|
|
202
|
+
target[p] = wallet[p];
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return target[p];
|
|
208
|
+
},
|
|
209
|
+
defineProperty() {
|
|
210
|
+
return false;
|
|
211
|
+
},
|
|
212
|
+
deleteProperty() {
|
|
213
|
+
return false;
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
return callback(augmentedAPI);
|
|
217
|
+
};
|
|
218
|
+
return yield mobileWalletAdapterProtocol.transactRemote(augmentedCallback, config);
|
|
219
|
+
});
|
|
220
|
+
}
|
|
151
221
|
|
|
152
222
|
exports.transact = transact;
|
|
223
|
+
exports.transactRemote = transactRemote;
|
package/lib/cjs/index.js
CHANGED
|
@@ -148,5 +148,76 @@ function transact(callback, config) {
|
|
|
148
148
|
return yield mobileWalletAdapterProtocol.transact(augmentedCallback, config);
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
|
+
function transactRemote(callback, config) {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
const augmentedCallback = (wallet) => {
|
|
154
|
+
const augmentedAPI = new Proxy({}, {
|
|
155
|
+
get(target, p) {
|
|
156
|
+
if (target[p] == null) {
|
|
157
|
+
switch (p) {
|
|
158
|
+
case 'signAndSendTransactions':
|
|
159
|
+
target[p] = function (_a) {
|
|
160
|
+
var { minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions } = _a, rest = __rest(_a, ["minContextSlot", "commitment", "skipPreflight", "maxRetries", "waitForCommitmentToSendNextTransaction", "transactions"]);
|
|
161
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
+
const payloads = transactions.map(getPayloadFromTransaction);
|
|
163
|
+
const options = {
|
|
164
|
+
min_context_slot: minContextSlot,
|
|
165
|
+
commitment: commitment,
|
|
166
|
+
skip_preflight: skipPreflight,
|
|
167
|
+
max_retries: maxRetries,
|
|
168
|
+
wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
|
|
169
|
+
};
|
|
170
|
+
const { signatures: base64EncodedSignatures } = yield wallet.signAndSendTransactions(Object.assign(Object.assign(Object.assign({}, rest), (Object.values(options).some(element => element != null)
|
|
171
|
+
? { options: options }
|
|
172
|
+
: null)), { payloads }));
|
|
173
|
+
const signatures = base64EncodedSignatures.map(toUint8Array).map(bs58__default["default"].encode);
|
|
174
|
+
return signatures;
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
break;
|
|
178
|
+
case 'signMessages':
|
|
179
|
+
target[p] = function (_a) {
|
|
180
|
+
var { payloads } = _a, rest = __rest(_a, ["payloads"]);
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
const base64EncodedPayloads = payloads.map(fromUint8Array);
|
|
183
|
+
const { signed_payloads: base64EncodedSignedMessages } = yield wallet.signMessages(Object.assign(Object.assign({}, rest), { payloads: base64EncodedPayloads }));
|
|
184
|
+
const signedMessages = base64EncodedSignedMessages.map(toUint8Array);
|
|
185
|
+
return signedMessages;
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
break;
|
|
189
|
+
case 'signTransactions':
|
|
190
|
+
target[p] = function (_a) {
|
|
191
|
+
var { transactions } = _a, rest = __rest(_a, ["transactions"]);
|
|
192
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
193
|
+
const payloads = transactions.map(getPayloadFromTransaction);
|
|
194
|
+
const { signed_payloads: base64EncodedCompiledTransactions } = yield wallet.signTransactions(Object.assign(Object.assign({}, rest), { payloads }));
|
|
195
|
+
const compiledTransactions = base64EncodedCompiledTransactions.map(toUint8Array);
|
|
196
|
+
const signedTransactions = compiledTransactions.map(getTransactionFromWireMessage);
|
|
197
|
+
return signedTransactions;
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
break;
|
|
201
|
+
default: {
|
|
202
|
+
target[p] = wallet[p];
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return target[p];
|
|
208
|
+
},
|
|
209
|
+
defineProperty() {
|
|
210
|
+
return false;
|
|
211
|
+
},
|
|
212
|
+
deleteProperty() {
|
|
213
|
+
return false;
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
return callback(augmentedAPI);
|
|
217
|
+
};
|
|
218
|
+
return yield mobileWalletAdapterProtocol.transactRemote(augmentedCallback, config);
|
|
219
|
+
});
|
|
220
|
+
}
|
|
151
221
|
|
|
152
222
|
exports.transact = transact;
|
|
223
|
+
exports.transactRemote = transactRemote;
|
package/lib/cjs/index.native.js
CHANGED
|
@@ -139,5 +139,76 @@ function transact(callback, config) {
|
|
|
139
139
|
return yield mobileWalletAdapterProtocol.transact(augmentedCallback, config);
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
+
function transactRemote(callback, config) {
|
|
143
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
const augmentedCallback = (wallet) => {
|
|
145
|
+
const augmentedAPI = new Proxy({}, {
|
|
146
|
+
get(target, p) {
|
|
147
|
+
if (target[p] == null) {
|
|
148
|
+
switch (p) {
|
|
149
|
+
case 'signAndSendTransactions':
|
|
150
|
+
target[p] = function (_a) {
|
|
151
|
+
var { minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions } = _a, rest = __rest(_a, ["minContextSlot", "commitment", "skipPreflight", "maxRetries", "waitForCommitmentToSendNextTransaction", "transactions"]);
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
const payloads = transactions.map(getPayloadFromTransaction);
|
|
154
|
+
const options = {
|
|
155
|
+
min_context_slot: minContextSlot,
|
|
156
|
+
commitment: commitment,
|
|
157
|
+
skip_preflight: skipPreflight,
|
|
158
|
+
max_retries: maxRetries,
|
|
159
|
+
wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
|
|
160
|
+
};
|
|
161
|
+
const { signatures: base64EncodedSignatures } = yield wallet.signAndSendTransactions(Object.assign(Object.assign(Object.assign({}, rest), (Object.values(options).some(element => element != null)
|
|
162
|
+
? { options: options }
|
|
163
|
+
: null)), { payloads }));
|
|
164
|
+
const signatures = base64EncodedSignatures.map(jsBase64.toUint8Array).map(bs58__default["default"].encode);
|
|
165
|
+
return signatures;
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
break;
|
|
169
|
+
case 'signMessages':
|
|
170
|
+
target[p] = function (_a) {
|
|
171
|
+
var { payloads } = _a, rest = __rest(_a, ["payloads"]);
|
|
172
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
173
|
+
const base64EncodedPayloads = payloads.map(jsBase64.fromUint8Array);
|
|
174
|
+
const { signed_payloads: base64EncodedSignedMessages } = yield wallet.signMessages(Object.assign(Object.assign({}, rest), { payloads: base64EncodedPayloads }));
|
|
175
|
+
const signedMessages = base64EncodedSignedMessages.map(jsBase64.toUint8Array);
|
|
176
|
+
return signedMessages;
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
break;
|
|
180
|
+
case 'signTransactions':
|
|
181
|
+
target[p] = function (_a) {
|
|
182
|
+
var { transactions } = _a, rest = __rest(_a, ["transactions"]);
|
|
183
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
184
|
+
const payloads = transactions.map(getPayloadFromTransaction);
|
|
185
|
+
const { signed_payloads: base64EncodedCompiledTransactions } = yield wallet.signTransactions(Object.assign(Object.assign({}, rest), { payloads }));
|
|
186
|
+
const compiledTransactions = base64EncodedCompiledTransactions.map(jsBase64.toUint8Array);
|
|
187
|
+
const signedTransactions = compiledTransactions.map(getTransactionFromWireMessage);
|
|
188
|
+
return signedTransactions;
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
break;
|
|
192
|
+
default: {
|
|
193
|
+
target[p] = wallet[p];
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return target[p];
|
|
199
|
+
},
|
|
200
|
+
defineProperty() {
|
|
201
|
+
return false;
|
|
202
|
+
},
|
|
203
|
+
deleteProperty() {
|
|
204
|
+
return false;
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
return callback(augmentedAPI);
|
|
208
|
+
};
|
|
209
|
+
return yield mobileWalletAdapterProtocol.transactRemote(augmentedCallback, config);
|
|
210
|
+
});
|
|
211
|
+
}
|
|
142
212
|
|
|
143
213
|
exports.transact = transact;
|
|
214
|
+
exports.transactRemote = transactRemote;
|
package/lib/esm/index.browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VersionedMessage, Transaction, VersionedTransaction, SIGNATURE_LENGTH_IN_BYTES } from '@solana/web3.js';
|
|
2
|
-
import { transact as transact$1 } from '@solana-mobile/mobile-wallet-adapter-protocol';
|
|
2
|
+
import { transact as transact$1, transactRemote as transactRemote$1 } from '@solana-mobile/mobile-wallet-adapter-protocol';
|
|
3
3
|
import bs58 from 'bs58';
|
|
4
4
|
|
|
5
5
|
/******************************************************************************
|
|
@@ -140,5 +140,75 @@ function transact(callback, config) {
|
|
|
140
140
|
return yield transact$1(augmentedCallback, config);
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
|
+
function transactRemote(callback, config) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
const augmentedCallback = (wallet) => {
|
|
146
|
+
const augmentedAPI = new Proxy({}, {
|
|
147
|
+
get(target, p) {
|
|
148
|
+
if (target[p] == null) {
|
|
149
|
+
switch (p) {
|
|
150
|
+
case 'signAndSendTransactions':
|
|
151
|
+
target[p] = function (_a) {
|
|
152
|
+
var { minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions } = _a, rest = __rest(_a, ["minContextSlot", "commitment", "skipPreflight", "maxRetries", "waitForCommitmentToSendNextTransaction", "transactions"]);
|
|
153
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
154
|
+
const payloads = transactions.map(getPayloadFromTransaction);
|
|
155
|
+
const options = {
|
|
156
|
+
min_context_slot: minContextSlot,
|
|
157
|
+
commitment: commitment,
|
|
158
|
+
skip_preflight: skipPreflight,
|
|
159
|
+
max_retries: maxRetries,
|
|
160
|
+
wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
|
|
161
|
+
};
|
|
162
|
+
const { signatures: base64EncodedSignatures } = yield wallet.signAndSendTransactions(Object.assign(Object.assign(Object.assign({}, rest), (Object.values(options).some(element => element != null)
|
|
163
|
+
? { options: options }
|
|
164
|
+
: null)), { payloads }));
|
|
165
|
+
const signatures = base64EncodedSignatures.map(toUint8Array).map(bs58.encode);
|
|
166
|
+
return signatures;
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
break;
|
|
170
|
+
case 'signMessages':
|
|
171
|
+
target[p] = function (_a) {
|
|
172
|
+
var { payloads } = _a, rest = __rest(_a, ["payloads"]);
|
|
173
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
174
|
+
const base64EncodedPayloads = payloads.map(fromUint8Array);
|
|
175
|
+
const { signed_payloads: base64EncodedSignedMessages } = yield wallet.signMessages(Object.assign(Object.assign({}, rest), { payloads: base64EncodedPayloads }));
|
|
176
|
+
const signedMessages = base64EncodedSignedMessages.map(toUint8Array);
|
|
177
|
+
return signedMessages;
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
break;
|
|
181
|
+
case 'signTransactions':
|
|
182
|
+
target[p] = function (_a) {
|
|
183
|
+
var { transactions } = _a, rest = __rest(_a, ["transactions"]);
|
|
184
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
+
const payloads = transactions.map(getPayloadFromTransaction);
|
|
186
|
+
const { signed_payloads: base64EncodedCompiledTransactions } = yield wallet.signTransactions(Object.assign(Object.assign({}, rest), { payloads }));
|
|
187
|
+
const compiledTransactions = base64EncodedCompiledTransactions.map(toUint8Array);
|
|
188
|
+
const signedTransactions = compiledTransactions.map(getTransactionFromWireMessage);
|
|
189
|
+
return signedTransactions;
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
break;
|
|
193
|
+
default: {
|
|
194
|
+
target[p] = wallet[p];
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return target[p];
|
|
200
|
+
},
|
|
201
|
+
defineProperty() {
|
|
202
|
+
return false;
|
|
203
|
+
},
|
|
204
|
+
deleteProperty() {
|
|
205
|
+
return false;
|
|
206
|
+
},
|
|
207
|
+
});
|
|
208
|
+
return callback(augmentedAPI);
|
|
209
|
+
};
|
|
210
|
+
return yield transactRemote$1(augmentedCallback, config);
|
|
211
|
+
});
|
|
212
|
+
}
|
|
143
213
|
|
|
144
|
-
export { transact };
|
|
214
|
+
export { transact, transactRemote };
|
package/lib/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VersionedMessage, Transaction, VersionedTransaction, SIGNATURE_LENGTH_IN_BYTES } from '@solana/web3.js';
|
|
2
|
-
import { transact as transact$1 } from '@solana-mobile/mobile-wallet-adapter-protocol';
|
|
2
|
+
import { transact as transact$1, transactRemote as transactRemote$1 } from '@solana-mobile/mobile-wallet-adapter-protocol';
|
|
3
3
|
import bs58 from 'bs58';
|
|
4
4
|
|
|
5
5
|
/******************************************************************************
|
|
@@ -140,5 +140,75 @@ function transact(callback, config) {
|
|
|
140
140
|
return yield transact$1(augmentedCallback, config);
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
|
+
function transactRemote(callback, config) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
const augmentedCallback = (wallet) => {
|
|
146
|
+
const augmentedAPI = new Proxy({}, {
|
|
147
|
+
get(target, p) {
|
|
148
|
+
if (target[p] == null) {
|
|
149
|
+
switch (p) {
|
|
150
|
+
case 'signAndSendTransactions':
|
|
151
|
+
target[p] = function (_a) {
|
|
152
|
+
var { minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions } = _a, rest = __rest(_a, ["minContextSlot", "commitment", "skipPreflight", "maxRetries", "waitForCommitmentToSendNextTransaction", "transactions"]);
|
|
153
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
154
|
+
const payloads = transactions.map(getPayloadFromTransaction);
|
|
155
|
+
const options = {
|
|
156
|
+
min_context_slot: minContextSlot,
|
|
157
|
+
commitment: commitment,
|
|
158
|
+
skip_preflight: skipPreflight,
|
|
159
|
+
max_retries: maxRetries,
|
|
160
|
+
wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
|
|
161
|
+
};
|
|
162
|
+
const { signatures: base64EncodedSignatures } = yield wallet.signAndSendTransactions(Object.assign(Object.assign(Object.assign({}, rest), (Object.values(options).some(element => element != null)
|
|
163
|
+
? { options: options }
|
|
164
|
+
: null)), { payloads }));
|
|
165
|
+
const signatures = base64EncodedSignatures.map(toUint8Array).map(bs58.encode);
|
|
166
|
+
return signatures;
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
break;
|
|
170
|
+
case 'signMessages':
|
|
171
|
+
target[p] = function (_a) {
|
|
172
|
+
var { payloads } = _a, rest = __rest(_a, ["payloads"]);
|
|
173
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
174
|
+
const base64EncodedPayloads = payloads.map(fromUint8Array);
|
|
175
|
+
const { signed_payloads: base64EncodedSignedMessages } = yield wallet.signMessages(Object.assign(Object.assign({}, rest), { payloads: base64EncodedPayloads }));
|
|
176
|
+
const signedMessages = base64EncodedSignedMessages.map(toUint8Array);
|
|
177
|
+
return signedMessages;
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
break;
|
|
181
|
+
case 'signTransactions':
|
|
182
|
+
target[p] = function (_a) {
|
|
183
|
+
var { transactions } = _a, rest = __rest(_a, ["transactions"]);
|
|
184
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
+
const payloads = transactions.map(getPayloadFromTransaction);
|
|
186
|
+
const { signed_payloads: base64EncodedCompiledTransactions } = yield wallet.signTransactions(Object.assign(Object.assign({}, rest), { payloads }));
|
|
187
|
+
const compiledTransactions = base64EncodedCompiledTransactions.map(toUint8Array);
|
|
188
|
+
const signedTransactions = compiledTransactions.map(getTransactionFromWireMessage);
|
|
189
|
+
return signedTransactions;
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
break;
|
|
193
|
+
default: {
|
|
194
|
+
target[p] = wallet[p];
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return target[p];
|
|
200
|
+
},
|
|
201
|
+
defineProperty() {
|
|
202
|
+
return false;
|
|
203
|
+
},
|
|
204
|
+
deleteProperty() {
|
|
205
|
+
return false;
|
|
206
|
+
},
|
|
207
|
+
});
|
|
208
|
+
return callback(augmentedAPI);
|
|
209
|
+
};
|
|
210
|
+
return yield transactRemote$1(augmentedCallback, config);
|
|
211
|
+
});
|
|
212
|
+
}
|
|
143
213
|
|
|
144
|
-
export { transact };
|
|
214
|
+
export { transact, transactRemote };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TransactionSignature, VersionedTransaction } from "@solana/web3.js";
|
|
2
2
|
import { Transaction as LegacyTransaction } from "@solana/web3.js";
|
|
3
|
-
import { AuthorizeAPI, Base64EncodedAddress, CloneAuthorizationAPI, DeauthorizeAPI, GetCapabilitiesAPI, ReauthorizeAPI, WalletAssociationConfig } from "@solana-mobile/mobile-wallet-adapter-protocol";
|
|
3
|
+
import { AuthorizeAPI, Base64EncodedAddress, CloneAuthorizationAPI, DeauthorizeAPI, GetCapabilitiesAPI, ReauthorizeAPI, TerminateSessionAPI, WalletAssociationConfig, RemoteWalletAssociationConfig } from "@solana-mobile/mobile-wallet-adapter-protocol";
|
|
4
4
|
interface Web3SignAndSendTransactionsAPI {
|
|
5
5
|
signAndSendTransactions<T extends LegacyTransaction | VersionedTransaction>(params: {
|
|
6
6
|
minContextSlot?: number;
|
|
@@ -24,6 +24,12 @@ interface Web3SignMessagesAPI {
|
|
|
24
24
|
}
|
|
25
25
|
interface Web3MobileWallet extends AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, GetCapabilitiesAPI, ReauthorizeAPI, Web3SignAndSendTransactionsAPI, Web3SignTransactionsAPI, Web3SignMessagesAPI {
|
|
26
26
|
}
|
|
27
|
+
interface Web3RemoteMobileWallet extends Web3MobileWallet, TerminateSessionAPI {
|
|
28
|
+
}
|
|
27
29
|
declare function transact<TReturn>(callback: (wallet: Web3MobileWallet) => TReturn, config?: WalletAssociationConfig): Promise<TReturn>;
|
|
28
|
-
|
|
30
|
+
declare function transactRemote<TReturn>(callback: (wallet: Web3RemoteMobileWallet) => TReturn, config: RemoteWalletAssociationConfig): Promise<{
|
|
31
|
+
associationUrl: URL;
|
|
32
|
+
result: Promise<TReturn>;
|
|
33
|
+
}>;
|
|
34
|
+
export { Web3MobileWallet, Web3RemoteMobileWallet, transact, transactRemote };
|
|
29
35
|
//# sourceMappingURL=index.browser.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TransactionSignature, VersionedTransaction } from "@solana/web3.js";
|
|
2
2
|
import { Transaction as LegacyTransaction } from "@solana/web3.js";
|
|
3
|
-
import { AuthorizeAPI, Base64EncodedAddress, CloneAuthorizationAPI, DeauthorizeAPI, GetCapabilitiesAPI, ReauthorizeAPI, WalletAssociationConfig } from "@solana-mobile/mobile-wallet-adapter-protocol";
|
|
3
|
+
import { AuthorizeAPI, Base64EncodedAddress, CloneAuthorizationAPI, DeauthorizeAPI, GetCapabilitiesAPI, ReauthorizeAPI, TerminateSessionAPI, WalletAssociationConfig, RemoteWalletAssociationConfig } from "@solana-mobile/mobile-wallet-adapter-protocol";
|
|
4
4
|
interface Web3SignAndSendTransactionsAPI {
|
|
5
5
|
signAndSendTransactions<T extends LegacyTransaction | VersionedTransaction>(params: {
|
|
6
6
|
minContextSlot?: number;
|
|
@@ -24,6 +24,12 @@ interface Web3SignMessagesAPI {
|
|
|
24
24
|
}
|
|
25
25
|
interface Web3MobileWallet extends AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, GetCapabilitiesAPI, ReauthorizeAPI, Web3SignAndSendTransactionsAPI, Web3SignTransactionsAPI, Web3SignMessagesAPI {
|
|
26
26
|
}
|
|
27
|
+
interface Web3RemoteMobileWallet extends Web3MobileWallet, TerminateSessionAPI {
|
|
28
|
+
}
|
|
27
29
|
declare function transact<TReturn>(callback: (wallet: Web3MobileWallet) => TReturn, config?: WalletAssociationConfig): Promise<TReturn>;
|
|
28
|
-
|
|
30
|
+
declare function transactRemote<TReturn>(callback: (wallet: Web3RemoteMobileWallet) => TReturn, config: RemoteWalletAssociationConfig): Promise<{
|
|
31
|
+
associationUrl: URL;
|
|
32
|
+
result: Promise<TReturn>;
|
|
33
|
+
}>;
|
|
34
|
+
export { Web3MobileWallet, Web3RemoteMobileWallet, transact, transactRemote };
|
|
29
35
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TransactionSignature, VersionedTransaction } from "@solana/web3.js";
|
|
2
2
|
import { Transaction as LegacyTransaction } from "@solana/web3.js";
|
|
3
|
-
import { AuthorizeAPI, Base64EncodedAddress, CloneAuthorizationAPI, DeauthorizeAPI, GetCapabilitiesAPI, ReauthorizeAPI, WalletAssociationConfig } from "@solana-mobile/mobile-wallet-adapter-protocol";
|
|
3
|
+
import { AuthorizeAPI, Base64EncodedAddress, CloneAuthorizationAPI, DeauthorizeAPI, GetCapabilitiesAPI, ReauthorizeAPI, TerminateSessionAPI, WalletAssociationConfig, RemoteWalletAssociationConfig } from "@solana-mobile/mobile-wallet-adapter-protocol";
|
|
4
4
|
interface Web3SignAndSendTransactionsAPI {
|
|
5
5
|
signAndSendTransactions<T extends LegacyTransaction | VersionedTransaction>(params: {
|
|
6
6
|
minContextSlot?: number;
|
|
@@ -24,6 +24,12 @@ interface Web3SignMessagesAPI {
|
|
|
24
24
|
}
|
|
25
25
|
interface Web3MobileWallet extends AuthorizeAPI, CloneAuthorizationAPI, DeauthorizeAPI, GetCapabilitiesAPI, ReauthorizeAPI, Web3SignAndSendTransactionsAPI, Web3SignTransactionsAPI, Web3SignMessagesAPI {
|
|
26
26
|
}
|
|
27
|
+
interface Web3RemoteMobileWallet extends Web3MobileWallet, TerminateSessionAPI {
|
|
28
|
+
}
|
|
27
29
|
declare function transact<TReturn>(callback: (wallet: Web3MobileWallet) => TReturn, config?: WalletAssociationConfig): Promise<TReturn>;
|
|
28
|
-
|
|
30
|
+
declare function transactRemote<TReturn>(callback: (wallet: Web3RemoteMobileWallet) => TReturn, config: RemoteWalletAssociationConfig): Promise<{
|
|
31
|
+
associationUrl: URL;
|
|
32
|
+
result: Promise<TReturn>;
|
|
33
|
+
}>;
|
|
34
|
+
export { Web3MobileWallet, Web3RemoteMobileWallet, transact, transactRemote };
|
|
29
35
|
//# 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-web3js",
|
|
3
3
|
"description": "A convenience wrapper that enables you to call Solana Mobile Stack protocol methods using objects from @solana/web3.js",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.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",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"@solana/web3.js": "^1.58.0"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@solana-mobile/mobile-wallet-adapter-protocol": "^2.1.
|
|
43
|
+
"@solana-mobile/mobile-wallet-adapter-protocol": "^2.1.4",
|
|
44
44
|
"bs58": "^5.0.0",
|
|
45
45
|
"js-base64": "^3.7.5"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@solana/web3.js": "^1.
|
|
49
|
-
"agadoo": "^
|
|
48
|
+
"@solana/web3.js": "^1.91.7",
|
|
49
|
+
"agadoo": "^3.0.0",
|
|
50
50
|
"cross-env": "^7.0.3",
|
|
51
51
|
"shx": "^0.3.4"
|
|
52
52
|
}
|