@solana-mobile/mobile-wallet-adapter-protocol-kit 0.2.1 → 0.2.3

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.
@@ -1,47 +1,8 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var transactions = require('@solana/transactions');
6
4
  var mobileWalletAdapterProtocol = require('@solana-mobile/mobile-wallet-adapter-protocol');
7
5
 
8
- /******************************************************************************
9
- Copyright (c) Microsoft Corporation.
10
-
11
- Permission to use, copy, modify, and/or distribute this software for any
12
- purpose with or without fee is hereby granted.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
15
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
16
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
17
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
18
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
19
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20
- PERFORMANCE OF THIS SOFTWARE.
21
- ***************************************************************************** */
22
-
23
- function __rest(s, e) {
24
- var t = {};
25
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
26
- t[p] = s[p];
27
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
28
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
29
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
30
- t[p[i]] = s[p[i]];
31
- }
32
- return t;
33
- }
34
-
35
- function __awaiter(thisArg, _arguments, P, generator) {
36
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
- return new (P || (P = Promise))(function (resolve, reject) {
38
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
- step((generator = generator.apply(thisArg, _arguments || [])).next());
42
- });
43
- }
44
-
45
6
  function fromUint8Array(byteArray) {
46
7
  return window.btoa(String.fromCharCode.call(null, ...byteArray));
47
8
  }
@@ -68,22 +29,18 @@ function getTransactionFromWireMessage(byteArray) {
68
29
  const transactionDecoder = transactions.getTransactionDecoder();
69
30
  return transactionDecoder.decode(byteArray);
70
31
  }
71
- function transact(callback, config) {
72
- return __awaiter(this, void 0, void 0, function* () {
73
- const augmentedCallback = (wallet) => {
74
- return callback(augmentWalletAPI(wallet));
75
- };
76
- return yield mobileWalletAdapterProtocol.transact(augmentedCallback, config);
77
- });
32
+ async function transact(callback, config) {
33
+ const augmentedCallback = (wallet) => {
34
+ return callback(augmentWalletAPI(wallet));
35
+ };
36
+ return await mobileWalletAdapterProtocol.transact(augmentedCallback, config);
78
37
  }
79
- function startRemoteScenario(config) {
80
- return __awaiter(this, void 0, void 0, function* () {
81
- const { wallet, close, associationUrl } = yield mobileWalletAdapterProtocol.startRemoteScenario(config);
82
- const augmentedPromise = wallet.then((wallet) => {
83
- return augmentWalletAPI(wallet);
84
- });
85
- return { wallet: augmentedPromise, close, associationUrl };
38
+ async function startRemoteScenario(config) {
39
+ const { wallet, close, associationUrl } = await mobileWalletAdapterProtocol.startRemoteScenario(config);
40
+ const augmentedPromise = wallet.then((wallet) => {
41
+ return augmentWalletAPI(wallet);
86
42
  });
43
+ return { wallet: augmentedPromise, close, associationUrl };
87
44
  }
88
45
  function augmentWalletAPI(wallet) {
89
46
  return new Proxy({}, {
@@ -91,46 +48,47 @@ function augmentWalletAPI(wallet) {
91
48
  if (target[p] == null) {
92
49
  switch (p) {
93
50
  case 'signAndSendTransactions':
94
- target[p] = function (_a) {
95
- var { minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions } = _a, rest = __rest(_a, ["minContextSlot", "commitment", "skipPreflight", "maxRetries", "waitForCommitmentToSendNextTransaction", "transactions"]);
96
- return __awaiter(this, void 0, void 0, function* () {
97
- const payloads = transactions.map(getPayloadFromTransaction);
98
- const options = {
99
- min_context_slot: minContextSlot,
100
- commitment: commitment,
101
- skip_preflight: skipPreflight,
102
- max_retries: maxRetries,
103
- wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
104
- };
105
- const { signatures: base64EncodedSignatures } = yield wallet.signAndSendTransactions(Object.assign(Object.assign(Object.assign({}, rest), (Object.values(options).some(element => element != null)
51
+ target[p] = async function ({ minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions, ...rest }) {
52
+ const payloads = transactions.map(getPayloadFromTransaction);
53
+ const options = {
54
+ min_context_slot: minContextSlot,
55
+ commitment: commitment,
56
+ skip_preflight: skipPreflight,
57
+ max_retries: maxRetries,
58
+ wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
59
+ };
60
+ const { signatures: base64EncodedSignatures } = await wallet.signAndSendTransactions({
61
+ ...rest,
62
+ ...(Object.values(options).some(element => element != null)
106
63
  ? { options: options }
107
- : null)), { payloads }));
108
- const signatures = base64EncodedSignatures.map(toUint8Array);
109
- return signatures;
64
+ : null),
65
+ payloads,
110
66
  });
67
+ const signatures = base64EncodedSignatures.map(toUint8Array);
68
+ return signatures;
111
69
  };
112
70
  break;
113
71
  case 'signMessages':
114
- target[p] = function (_a) {
115
- var { payloads } = _a, rest = __rest(_a, ["payloads"]);
116
- return __awaiter(this, void 0, void 0, function* () {
117
- const base64EncodedPayloads = payloads.map(fromUint8Array);
118
- const { signed_payloads: base64EncodedSignedMessages } = yield wallet.signMessages(Object.assign(Object.assign({}, rest), { payloads: base64EncodedPayloads }));
119
- const signedMessages = base64EncodedSignedMessages.map(toUint8Array);
120
- return signedMessages;
72
+ target[p] = async function ({ payloads, ...rest }) {
73
+ const base64EncodedPayloads = payloads.map(fromUint8Array);
74
+ const { signed_payloads: base64EncodedSignedMessages } = await wallet.signMessages({
75
+ ...rest,
76
+ payloads: base64EncodedPayloads,
121
77
  });
78
+ const signedMessages = base64EncodedSignedMessages.map(toUint8Array);
79
+ return signedMessages;
122
80
  };
123
81
  break;
124
82
  case 'signTransactions':
125
- target[p] = function (_a) {
126
- var { transactions } = _a, rest = __rest(_a, ["transactions"]);
127
- return __awaiter(this, void 0, void 0, function* () {
128
- const payloads = transactions.map(getPayloadFromTransaction);
129
- const { signed_payloads: base64EncodedCompiledTransactions } = yield wallet.signTransactions(Object.assign(Object.assign({}, rest), { payloads }));
130
- const compiledTransactions = base64EncodedCompiledTransactions.map(toUint8Array);
131
- const signedTransactions = compiledTransactions.map(getTransactionFromWireMessage);
132
- return signedTransactions;
83
+ target[p] = async function ({ transactions, ...rest }) {
84
+ const payloads = transactions.map(getPayloadFromTransaction);
85
+ const { signed_payloads: base64EncodedCompiledTransactions } = await wallet.signTransactions({
86
+ ...rest,
87
+ payloads,
133
88
  });
89
+ const compiledTransactions = base64EncodedCompiledTransactions.map(toUint8Array);
90
+ const signedTransactions = compiledTransactions.map(getTransactionFromWireMessage);
91
+ return signedTransactions;
134
92
  };
135
93
  break;
136
94
  default: {
package/lib/cjs/index.js CHANGED
@@ -1,47 +1,8 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var transactions = require('@solana/transactions');
6
4
  var mobileWalletAdapterProtocol = require('@solana-mobile/mobile-wallet-adapter-protocol');
7
5
 
8
- /******************************************************************************
9
- Copyright (c) Microsoft Corporation.
10
-
11
- Permission to use, copy, modify, and/or distribute this software for any
12
- purpose with or without fee is hereby granted.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
15
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
16
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
17
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
18
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
19
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20
- PERFORMANCE OF THIS SOFTWARE.
21
- ***************************************************************************** */
22
-
23
- function __rest(s, e) {
24
- var t = {};
25
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
26
- t[p] = s[p];
27
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
28
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
29
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
30
- t[p[i]] = s[p[i]];
31
- }
32
- return t;
33
- }
34
-
35
- function __awaiter(thisArg, _arguments, P, generator) {
36
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
- return new (P || (P = Promise))(function (resolve, reject) {
38
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
- step((generator = generator.apply(thisArg, _arguments || [])).next());
42
- });
43
- }
44
-
45
6
  function fromUint8Array(byteArray) {
46
7
  return window.btoa(String.fromCharCode.call(null, ...byteArray));
47
8
  }
@@ -68,22 +29,18 @@ function getTransactionFromWireMessage(byteArray) {
68
29
  const transactionDecoder = transactions.getTransactionDecoder();
69
30
  return transactionDecoder.decode(byteArray);
70
31
  }
71
- function transact(callback, config) {
72
- return __awaiter(this, void 0, void 0, function* () {
73
- const augmentedCallback = (wallet) => {
74
- return callback(augmentWalletAPI(wallet));
75
- };
76
- return yield mobileWalletAdapterProtocol.transact(augmentedCallback, config);
77
- });
32
+ async function transact(callback, config) {
33
+ const augmentedCallback = (wallet) => {
34
+ return callback(augmentWalletAPI(wallet));
35
+ };
36
+ return await mobileWalletAdapterProtocol.transact(augmentedCallback, config);
78
37
  }
79
- function startRemoteScenario(config) {
80
- return __awaiter(this, void 0, void 0, function* () {
81
- const { wallet, close, associationUrl } = yield mobileWalletAdapterProtocol.startRemoteScenario(config);
82
- const augmentedPromise = wallet.then((wallet) => {
83
- return augmentWalletAPI(wallet);
84
- });
85
- return { wallet: augmentedPromise, close, associationUrl };
38
+ async function startRemoteScenario(config) {
39
+ const { wallet, close, associationUrl } = await mobileWalletAdapterProtocol.startRemoteScenario(config);
40
+ const augmentedPromise = wallet.then((wallet) => {
41
+ return augmentWalletAPI(wallet);
86
42
  });
43
+ return { wallet: augmentedPromise, close, associationUrl };
87
44
  }
88
45
  function augmentWalletAPI(wallet) {
89
46
  return new Proxy({}, {
@@ -91,46 +48,47 @@ function augmentWalletAPI(wallet) {
91
48
  if (target[p] == null) {
92
49
  switch (p) {
93
50
  case 'signAndSendTransactions':
94
- target[p] = function (_a) {
95
- var { minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions } = _a, rest = __rest(_a, ["minContextSlot", "commitment", "skipPreflight", "maxRetries", "waitForCommitmentToSendNextTransaction", "transactions"]);
96
- return __awaiter(this, void 0, void 0, function* () {
97
- const payloads = transactions.map(getPayloadFromTransaction);
98
- const options = {
99
- min_context_slot: minContextSlot,
100
- commitment: commitment,
101
- skip_preflight: skipPreflight,
102
- max_retries: maxRetries,
103
- wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
104
- };
105
- const { signatures: base64EncodedSignatures } = yield wallet.signAndSendTransactions(Object.assign(Object.assign(Object.assign({}, rest), (Object.values(options).some(element => element != null)
51
+ target[p] = async function ({ minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions, ...rest }) {
52
+ const payloads = transactions.map(getPayloadFromTransaction);
53
+ const options = {
54
+ min_context_slot: minContextSlot,
55
+ commitment: commitment,
56
+ skip_preflight: skipPreflight,
57
+ max_retries: maxRetries,
58
+ wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
59
+ };
60
+ const { signatures: base64EncodedSignatures } = await wallet.signAndSendTransactions({
61
+ ...rest,
62
+ ...(Object.values(options).some(element => element != null)
106
63
  ? { options: options }
107
- : null)), { payloads }));
108
- const signatures = base64EncodedSignatures.map(toUint8Array);
109
- return signatures;
64
+ : null),
65
+ payloads,
110
66
  });
67
+ const signatures = base64EncodedSignatures.map(toUint8Array);
68
+ return signatures;
111
69
  };
112
70
  break;
113
71
  case 'signMessages':
114
- target[p] = function (_a) {
115
- var { payloads } = _a, rest = __rest(_a, ["payloads"]);
116
- return __awaiter(this, void 0, void 0, function* () {
117
- const base64EncodedPayloads = payloads.map(fromUint8Array);
118
- const { signed_payloads: base64EncodedSignedMessages } = yield wallet.signMessages(Object.assign(Object.assign({}, rest), { payloads: base64EncodedPayloads }));
119
- const signedMessages = base64EncodedSignedMessages.map(toUint8Array);
120
- return signedMessages;
72
+ target[p] = async function ({ payloads, ...rest }) {
73
+ const base64EncodedPayloads = payloads.map(fromUint8Array);
74
+ const { signed_payloads: base64EncodedSignedMessages } = await wallet.signMessages({
75
+ ...rest,
76
+ payloads: base64EncodedPayloads,
121
77
  });
78
+ const signedMessages = base64EncodedSignedMessages.map(toUint8Array);
79
+ return signedMessages;
122
80
  };
123
81
  break;
124
82
  case 'signTransactions':
125
- target[p] = function (_a) {
126
- var { transactions } = _a, rest = __rest(_a, ["transactions"]);
127
- return __awaiter(this, void 0, void 0, function* () {
128
- const payloads = transactions.map(getPayloadFromTransaction);
129
- const { signed_payloads: base64EncodedCompiledTransactions } = yield wallet.signTransactions(Object.assign(Object.assign({}, rest), { payloads }));
130
- const compiledTransactions = base64EncodedCompiledTransactions.map(toUint8Array);
131
- const signedTransactions = compiledTransactions.map(getTransactionFromWireMessage);
132
- return signedTransactions;
83
+ target[p] = async function ({ transactions, ...rest }) {
84
+ const payloads = transactions.map(getPayloadFromTransaction);
85
+ const { signed_payloads: base64EncodedCompiledTransactions } = await wallet.signTransactions({
86
+ ...rest,
87
+ payloads,
133
88
  });
89
+ const compiledTransactions = base64EncodedCompiledTransactions.map(toUint8Array);
90
+ const signedTransactions = compiledTransactions.map(getTransactionFromWireMessage);
91
+ return signedTransactions;
134
92
  };
135
93
  break;
136
94
  default: {
@@ -1,48 +1,9 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var transactions = require('@solana/transactions');
6
4
  var mobileWalletAdapterProtocol = require('@solana-mobile/mobile-wallet-adapter-protocol');
7
5
  var jsBase64 = require('js-base64');
8
6
 
9
- /******************************************************************************
10
- Copyright (c) Microsoft Corporation.
11
-
12
- Permission to use, copy, modify, and/or distribute this software for any
13
- purpose with or without fee is hereby granted.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
16
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
17
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
18
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
19
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
20
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21
- PERFORMANCE OF THIS SOFTWARE.
22
- ***************************************************************************** */
23
-
24
- function __rest(s, e) {
25
- var t = {};
26
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
27
- t[p] = s[p];
28
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
29
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
30
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
31
- t[p[i]] = s[p[i]];
32
- }
33
- return t;
34
- }
35
-
36
- function __awaiter(thisArg, _arguments, P, generator) {
37
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
- return new (P || (P = Promise))(function (resolve, reject) {
39
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
- step((generator = generator.apply(thisArg, _arguments || [])).next());
43
- });
44
- }
45
-
46
7
  function getPayloadFromTransaction(transaction) {
47
8
  if ('messageBytes' in transaction) {
48
9
  return transactions.getBase64EncodedWireTransaction(transaction);
@@ -59,22 +20,18 @@ function getTransactionFromWireMessage(byteArray) {
59
20
  const transactionDecoder = transactions.getTransactionDecoder();
60
21
  return transactionDecoder.decode(byteArray);
61
22
  }
62
- function transact(callback, config) {
63
- return __awaiter(this, void 0, void 0, function* () {
64
- const augmentedCallback = (wallet) => {
65
- return callback(augmentWalletAPI(wallet));
66
- };
67
- return yield mobileWalletAdapterProtocol.transact(augmentedCallback, config);
68
- });
23
+ async function transact(callback, config) {
24
+ const augmentedCallback = (wallet) => {
25
+ return callback(augmentWalletAPI(wallet));
26
+ };
27
+ return await mobileWalletAdapterProtocol.transact(augmentedCallback, config);
69
28
  }
70
- function startRemoteScenario(config) {
71
- return __awaiter(this, void 0, void 0, function* () {
72
- const { wallet, close, associationUrl } = yield mobileWalletAdapterProtocol.startRemoteScenario(config);
73
- const augmentedPromise = wallet.then((wallet) => {
74
- return augmentWalletAPI(wallet);
75
- });
76
- return { wallet: augmentedPromise, close, associationUrl };
29
+ async function startRemoteScenario(config) {
30
+ const { wallet, close, associationUrl } = await mobileWalletAdapterProtocol.startRemoteScenario(config);
31
+ const augmentedPromise = wallet.then((wallet) => {
32
+ return augmentWalletAPI(wallet);
77
33
  });
34
+ return { wallet: augmentedPromise, close, associationUrl };
78
35
  }
79
36
  function augmentWalletAPI(wallet) {
80
37
  return new Proxy({}, {
@@ -82,46 +39,47 @@ function augmentWalletAPI(wallet) {
82
39
  if (target[p] == null) {
83
40
  switch (p) {
84
41
  case 'signAndSendTransactions':
85
- target[p] = function (_a) {
86
- var { minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions } = _a, rest = __rest(_a, ["minContextSlot", "commitment", "skipPreflight", "maxRetries", "waitForCommitmentToSendNextTransaction", "transactions"]);
87
- return __awaiter(this, void 0, void 0, function* () {
88
- const payloads = transactions.map(getPayloadFromTransaction);
89
- const options = {
90
- min_context_slot: minContextSlot,
91
- commitment: commitment,
92
- skip_preflight: skipPreflight,
93
- max_retries: maxRetries,
94
- wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
95
- };
96
- const { signatures: base64EncodedSignatures } = yield wallet.signAndSendTransactions(Object.assign(Object.assign(Object.assign({}, rest), (Object.values(options).some(element => element != null)
42
+ target[p] = async function ({ minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions, ...rest }) {
43
+ const payloads = transactions.map(getPayloadFromTransaction);
44
+ const options = {
45
+ min_context_slot: minContextSlot,
46
+ commitment: commitment,
47
+ skip_preflight: skipPreflight,
48
+ max_retries: maxRetries,
49
+ wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
50
+ };
51
+ const { signatures: base64EncodedSignatures } = await wallet.signAndSendTransactions({
52
+ ...rest,
53
+ ...(Object.values(options).some(element => element != null)
97
54
  ? { options: options }
98
- : null)), { payloads }));
99
- const signatures = base64EncodedSignatures.map(jsBase64.toUint8Array);
100
- return signatures;
55
+ : null),
56
+ payloads,
101
57
  });
58
+ const signatures = base64EncodedSignatures.map(jsBase64.toUint8Array);
59
+ return signatures;
102
60
  };
103
61
  break;
104
62
  case 'signMessages':
105
- target[p] = function (_a) {
106
- var { payloads } = _a, rest = __rest(_a, ["payloads"]);
107
- return __awaiter(this, void 0, void 0, function* () {
108
- const base64EncodedPayloads = payloads.map(jsBase64.fromUint8Array);
109
- const { signed_payloads: base64EncodedSignedMessages } = yield wallet.signMessages(Object.assign(Object.assign({}, rest), { payloads: base64EncodedPayloads }));
110
- const signedMessages = base64EncodedSignedMessages.map(jsBase64.toUint8Array);
111
- return signedMessages;
63
+ target[p] = async function ({ payloads, ...rest }) {
64
+ const base64EncodedPayloads = payloads.map(jsBase64.fromUint8Array);
65
+ const { signed_payloads: base64EncodedSignedMessages } = await wallet.signMessages({
66
+ ...rest,
67
+ payloads: base64EncodedPayloads,
112
68
  });
69
+ const signedMessages = base64EncodedSignedMessages.map(jsBase64.toUint8Array);
70
+ return signedMessages;
113
71
  };
114
72
  break;
115
73
  case 'signTransactions':
116
- target[p] = function (_a) {
117
- var { transactions } = _a, rest = __rest(_a, ["transactions"]);
118
- return __awaiter(this, void 0, void 0, function* () {
119
- const payloads = transactions.map(getPayloadFromTransaction);
120
- const { signed_payloads: base64EncodedCompiledTransactions } = yield wallet.signTransactions(Object.assign(Object.assign({}, rest), { payloads }));
121
- const compiledTransactions = base64EncodedCompiledTransactions.map(jsBase64.toUint8Array);
122
- const signedTransactions = compiledTransactions.map(getTransactionFromWireMessage);
123
- return signedTransactions;
74
+ target[p] = async function ({ transactions, ...rest }) {
75
+ const payloads = transactions.map(getPayloadFromTransaction);
76
+ const { signed_payloads: base64EncodedCompiledTransactions } = await wallet.signTransactions({
77
+ ...rest,
78
+ payloads,
124
79
  });
80
+ const compiledTransactions = base64EncodedCompiledTransactions.map(jsBase64.toUint8Array);
81
+ const signedTransactions = compiledTransactions.map(getTransactionFromWireMessage);
82
+ return signedTransactions;
125
83
  };
126
84
  break;
127
85
  default: {
@@ -1,42 +1,5 @@
1
1
  import { getBase64EncodedWireTransaction, compileTransaction, getTransactionDecoder } from '@solana/transactions';
2
- import { transact as transact$1, startRemoteScenario as startRemoteScenario$1 } from '@solana-mobile/mobile-wallet-adapter-protocol';
3
-
4
- /******************************************************************************
5
- Copyright (c) Microsoft Corporation.
6
-
7
- Permission to use, copy, modify, and/or distribute this software for any
8
- purpose with or without fee is hereby granted.
9
-
10
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16
- PERFORMANCE OF THIS SOFTWARE.
17
- ***************************************************************************** */
18
-
19
- function __rest(s, e) {
20
- var t = {};
21
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
22
- t[p] = s[p];
23
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
24
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
25
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
26
- t[p[i]] = s[p[i]];
27
- }
28
- return t;
29
- }
30
-
31
- function __awaiter(thisArg, _arguments, P, generator) {
32
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
33
- return new (P || (P = Promise))(function (resolve, reject) {
34
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
35
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
36
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
37
- step((generator = generator.apply(thisArg, _arguments || [])).next());
38
- });
39
- }
2
+ import { startRemoteScenario as startRemoteScenario$1, transact as transact$1 } from '@solana-mobile/mobile-wallet-adapter-protocol';
40
3
 
41
4
  function fromUint8Array(byteArray) {
42
5
  return window.btoa(String.fromCharCode.call(null, ...byteArray));
@@ -64,22 +27,18 @@ function getTransactionFromWireMessage(byteArray) {
64
27
  const transactionDecoder = getTransactionDecoder();
65
28
  return transactionDecoder.decode(byteArray);
66
29
  }
67
- function transact(callback, config) {
68
- return __awaiter(this, void 0, void 0, function* () {
69
- const augmentedCallback = (wallet) => {
70
- return callback(augmentWalletAPI(wallet));
71
- };
72
- return yield transact$1(augmentedCallback, config);
73
- });
30
+ async function transact(callback, config) {
31
+ const augmentedCallback = (wallet) => {
32
+ return callback(augmentWalletAPI(wallet));
33
+ };
34
+ return await transact$1(augmentedCallback, config);
74
35
  }
75
- function startRemoteScenario(config) {
76
- return __awaiter(this, void 0, void 0, function* () {
77
- const { wallet, close, associationUrl } = yield startRemoteScenario$1(config);
78
- const augmentedPromise = wallet.then((wallet) => {
79
- return augmentWalletAPI(wallet);
80
- });
81
- return { wallet: augmentedPromise, close, associationUrl };
36
+ async function startRemoteScenario(config) {
37
+ const { wallet, close, associationUrl } = await startRemoteScenario$1(config);
38
+ const augmentedPromise = wallet.then((wallet) => {
39
+ return augmentWalletAPI(wallet);
82
40
  });
41
+ return { wallet: augmentedPromise, close, associationUrl };
83
42
  }
84
43
  function augmentWalletAPI(wallet) {
85
44
  return new Proxy({}, {
@@ -87,46 +46,47 @@ function augmentWalletAPI(wallet) {
87
46
  if (target[p] == null) {
88
47
  switch (p) {
89
48
  case 'signAndSendTransactions':
90
- target[p] = function (_a) {
91
- var { minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions } = _a, rest = __rest(_a, ["minContextSlot", "commitment", "skipPreflight", "maxRetries", "waitForCommitmentToSendNextTransaction", "transactions"]);
92
- return __awaiter(this, void 0, void 0, function* () {
93
- const payloads = transactions.map(getPayloadFromTransaction);
94
- const options = {
95
- min_context_slot: minContextSlot,
96
- commitment: commitment,
97
- skip_preflight: skipPreflight,
98
- max_retries: maxRetries,
99
- wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
100
- };
101
- const { signatures: base64EncodedSignatures } = yield wallet.signAndSendTransactions(Object.assign(Object.assign(Object.assign({}, rest), (Object.values(options).some(element => element != null)
49
+ target[p] = async function ({ minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions, ...rest }) {
50
+ const payloads = transactions.map(getPayloadFromTransaction);
51
+ const options = {
52
+ min_context_slot: minContextSlot,
53
+ commitment: commitment,
54
+ skip_preflight: skipPreflight,
55
+ max_retries: maxRetries,
56
+ wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
57
+ };
58
+ const { signatures: base64EncodedSignatures } = await wallet.signAndSendTransactions({
59
+ ...rest,
60
+ ...(Object.values(options).some(element => element != null)
102
61
  ? { options: options }
103
- : null)), { payloads }));
104
- const signatures = base64EncodedSignatures.map(toUint8Array);
105
- return signatures;
62
+ : null),
63
+ payloads,
106
64
  });
65
+ const signatures = base64EncodedSignatures.map(toUint8Array);
66
+ return signatures;
107
67
  };
108
68
  break;
109
69
  case 'signMessages':
110
- target[p] = function (_a) {
111
- var { payloads } = _a, rest = __rest(_a, ["payloads"]);
112
- return __awaiter(this, void 0, void 0, function* () {
113
- const base64EncodedPayloads = payloads.map(fromUint8Array);
114
- const { signed_payloads: base64EncodedSignedMessages } = yield wallet.signMessages(Object.assign(Object.assign({}, rest), { payloads: base64EncodedPayloads }));
115
- const signedMessages = base64EncodedSignedMessages.map(toUint8Array);
116
- return signedMessages;
70
+ target[p] = async function ({ payloads, ...rest }) {
71
+ const base64EncodedPayloads = payloads.map(fromUint8Array);
72
+ const { signed_payloads: base64EncodedSignedMessages } = await wallet.signMessages({
73
+ ...rest,
74
+ payloads: base64EncodedPayloads,
117
75
  });
76
+ const signedMessages = base64EncodedSignedMessages.map(toUint8Array);
77
+ return signedMessages;
118
78
  };
119
79
  break;
120
80
  case 'signTransactions':
121
- target[p] = function (_a) {
122
- var { transactions } = _a, rest = __rest(_a, ["transactions"]);
123
- return __awaiter(this, void 0, void 0, function* () {
124
- const payloads = transactions.map(getPayloadFromTransaction);
125
- const { signed_payloads: base64EncodedCompiledTransactions } = yield wallet.signTransactions(Object.assign(Object.assign({}, rest), { payloads }));
126
- const compiledTransactions = base64EncodedCompiledTransactions.map(toUint8Array);
127
- const signedTransactions = compiledTransactions.map(getTransactionFromWireMessage);
128
- return signedTransactions;
81
+ target[p] = async function ({ transactions, ...rest }) {
82
+ const payloads = transactions.map(getPayloadFromTransaction);
83
+ const { signed_payloads: base64EncodedCompiledTransactions } = await wallet.signTransactions({
84
+ ...rest,
85
+ payloads,
129
86
  });
87
+ const compiledTransactions = base64EncodedCompiledTransactions.map(toUint8Array);
88
+ const signedTransactions = compiledTransactions.map(getTransactionFromWireMessage);
89
+ return signedTransactions;
130
90
  };
131
91
  break;
132
92
  default: {
package/lib/esm/index.js CHANGED
@@ -1,42 +1,5 @@
1
1
  import { getBase64EncodedWireTransaction, compileTransaction, getTransactionDecoder } from '@solana/transactions';
2
- import { transact as transact$1, startRemoteScenario as startRemoteScenario$1 } from '@solana-mobile/mobile-wallet-adapter-protocol';
3
-
4
- /******************************************************************************
5
- Copyright (c) Microsoft Corporation.
6
-
7
- Permission to use, copy, modify, and/or distribute this software for any
8
- purpose with or without fee is hereby granted.
9
-
10
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16
- PERFORMANCE OF THIS SOFTWARE.
17
- ***************************************************************************** */
18
-
19
- function __rest(s, e) {
20
- var t = {};
21
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
22
- t[p] = s[p];
23
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
24
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
25
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
26
- t[p[i]] = s[p[i]];
27
- }
28
- return t;
29
- }
30
-
31
- function __awaiter(thisArg, _arguments, P, generator) {
32
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
33
- return new (P || (P = Promise))(function (resolve, reject) {
34
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
35
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
36
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
37
- step((generator = generator.apply(thisArg, _arguments || [])).next());
38
- });
39
- }
2
+ import { startRemoteScenario as startRemoteScenario$1, transact as transact$1 } from '@solana-mobile/mobile-wallet-adapter-protocol';
40
3
 
41
4
  function fromUint8Array(byteArray) {
42
5
  return window.btoa(String.fromCharCode.call(null, ...byteArray));
@@ -64,22 +27,18 @@ function getTransactionFromWireMessage(byteArray) {
64
27
  const transactionDecoder = getTransactionDecoder();
65
28
  return transactionDecoder.decode(byteArray);
66
29
  }
67
- function transact(callback, config) {
68
- return __awaiter(this, void 0, void 0, function* () {
69
- const augmentedCallback = (wallet) => {
70
- return callback(augmentWalletAPI(wallet));
71
- };
72
- return yield transact$1(augmentedCallback, config);
73
- });
30
+ async function transact(callback, config) {
31
+ const augmentedCallback = (wallet) => {
32
+ return callback(augmentWalletAPI(wallet));
33
+ };
34
+ return await transact$1(augmentedCallback, config);
74
35
  }
75
- function startRemoteScenario(config) {
76
- return __awaiter(this, void 0, void 0, function* () {
77
- const { wallet, close, associationUrl } = yield startRemoteScenario$1(config);
78
- const augmentedPromise = wallet.then((wallet) => {
79
- return augmentWalletAPI(wallet);
80
- });
81
- return { wallet: augmentedPromise, close, associationUrl };
36
+ async function startRemoteScenario(config) {
37
+ const { wallet, close, associationUrl } = await startRemoteScenario$1(config);
38
+ const augmentedPromise = wallet.then((wallet) => {
39
+ return augmentWalletAPI(wallet);
82
40
  });
41
+ return { wallet: augmentedPromise, close, associationUrl };
83
42
  }
84
43
  function augmentWalletAPI(wallet) {
85
44
  return new Proxy({}, {
@@ -87,46 +46,47 @@ function augmentWalletAPI(wallet) {
87
46
  if (target[p] == null) {
88
47
  switch (p) {
89
48
  case 'signAndSendTransactions':
90
- target[p] = function (_a) {
91
- var { minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions } = _a, rest = __rest(_a, ["minContextSlot", "commitment", "skipPreflight", "maxRetries", "waitForCommitmentToSendNextTransaction", "transactions"]);
92
- return __awaiter(this, void 0, void 0, function* () {
93
- const payloads = transactions.map(getPayloadFromTransaction);
94
- const options = {
95
- min_context_slot: minContextSlot,
96
- commitment: commitment,
97
- skip_preflight: skipPreflight,
98
- max_retries: maxRetries,
99
- wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
100
- };
101
- const { signatures: base64EncodedSignatures } = yield wallet.signAndSendTransactions(Object.assign(Object.assign(Object.assign({}, rest), (Object.values(options).some(element => element != null)
49
+ target[p] = async function ({ minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions, ...rest }) {
50
+ const payloads = transactions.map(getPayloadFromTransaction);
51
+ const options = {
52
+ min_context_slot: minContextSlot,
53
+ commitment: commitment,
54
+ skip_preflight: skipPreflight,
55
+ max_retries: maxRetries,
56
+ wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
57
+ };
58
+ const { signatures: base64EncodedSignatures } = await wallet.signAndSendTransactions({
59
+ ...rest,
60
+ ...(Object.values(options).some(element => element != null)
102
61
  ? { options: options }
103
- : null)), { payloads }));
104
- const signatures = base64EncodedSignatures.map(toUint8Array);
105
- return signatures;
62
+ : null),
63
+ payloads,
106
64
  });
65
+ const signatures = base64EncodedSignatures.map(toUint8Array);
66
+ return signatures;
107
67
  };
108
68
  break;
109
69
  case 'signMessages':
110
- target[p] = function (_a) {
111
- var { payloads } = _a, rest = __rest(_a, ["payloads"]);
112
- return __awaiter(this, void 0, void 0, function* () {
113
- const base64EncodedPayloads = payloads.map(fromUint8Array);
114
- const { signed_payloads: base64EncodedSignedMessages } = yield wallet.signMessages(Object.assign(Object.assign({}, rest), { payloads: base64EncodedPayloads }));
115
- const signedMessages = base64EncodedSignedMessages.map(toUint8Array);
116
- return signedMessages;
70
+ target[p] = async function ({ payloads, ...rest }) {
71
+ const base64EncodedPayloads = payloads.map(fromUint8Array);
72
+ const { signed_payloads: base64EncodedSignedMessages } = await wallet.signMessages({
73
+ ...rest,
74
+ payloads: base64EncodedPayloads,
117
75
  });
76
+ const signedMessages = base64EncodedSignedMessages.map(toUint8Array);
77
+ return signedMessages;
118
78
  };
119
79
  break;
120
80
  case 'signTransactions':
121
- target[p] = function (_a) {
122
- var { transactions } = _a, rest = __rest(_a, ["transactions"]);
123
- return __awaiter(this, void 0, void 0, function* () {
124
- const payloads = transactions.map(getPayloadFromTransaction);
125
- const { signed_payloads: base64EncodedCompiledTransactions } = yield wallet.signTransactions(Object.assign(Object.assign({}, rest), { payloads }));
126
- const compiledTransactions = base64EncodedCompiledTransactions.map(toUint8Array);
127
- const signedTransactions = compiledTransactions.map(getTransactionFromWireMessage);
128
- return signedTransactions;
81
+ target[p] = async function ({ transactions, ...rest }) {
82
+ const payloads = transactions.map(getPayloadFromTransaction);
83
+ const { signed_payloads: base64EncodedCompiledTransactions } = await wallet.signTransactions({
84
+ ...rest,
85
+ payloads,
129
86
  });
87
+ const compiledTransactions = base64EncodedCompiledTransactions.map(toUint8Array);
88
+ const signedTransactions = compiledTransactions.map(getTransactionFromWireMessage);
89
+ return signedTransactions;
130
90
  };
131
91
  break;
132
92
  default: {
package/package.json CHANGED
@@ -1,70 +1,70 @@
1
1
  {
2
- "name": "@solana-mobile/mobile-wallet-adapter-protocol-kit",
3
- "description": "A convenience wrapper that enables you to call Solana Mobile Stack protocol methods using objects from @solana/kit",
4
- "version": "0.2.1",
5
- "author": "Marco Martinez <marco.martinez@solana.com>",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://github.com/solana-mobile/mobile-wallet-adapter.git"
2
+ "name": "@solana-mobile/mobile-wallet-adapter-protocol-kit",
3
+ "description": "A convenience wrapper that enables you to call Solana Mobile Stack protocol methods using objects from @solana/kit",
4
+ "version": "0.2.3",
5
+ "author": "Marco Martinez <marco.martinez@solana.com>",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/solana-mobile/mobile-wallet-adapter.git"
9
+ },
10
+ "license": "Apache-2.0",
11
+ "exports": {
12
+ "edge-light": {
13
+ "import": "./lib/esm/index.js",
14
+ "require": "./lib/cjs/index.js"
9
15
  },
10
- "license": "Apache-2.0",
11
- "exports": {
12
- "edge-light": {
13
- "import": "./lib/esm/index.js",
14
- "require": "./lib/cjs/index.js"
15
- },
16
- "workerd": {
17
- "import": "./lib/esm/index.js",
18
- "require": "./lib/cjs/index.js"
19
- },
20
- "browser": {
21
- "import": "./lib/esm/index.browser.js",
22
- "require": "./lib/cjs/index.browser.js"
23
- },
24
- "node": {
25
- "import": "./lib/esm/index.js",
26
- "require": "./lib/cjs/index.js"
27
- },
28
- "react-native": "./lib/cjs/index.native.js",
29
- "types": "./lib/types/index.d.ts"
16
+ "workerd": {
17
+ "import": "./lib/esm/index.js",
18
+ "require": "./lib/cjs/index.js"
30
19
  },
31
20
  "browser": {
32
- "./lib/cjs/index.js": "./lib/cjs/index.browser.js",
33
- "./lib/esm/index.js": "./lib/esm/index.browser.js"
21
+ "import": "./lib/esm/index.browser.js",
22
+ "require": "./lib/cjs/index.browser.js"
34
23
  },
35
- "main": "lib/cjs/index.js",
36
- "module": "lib/esm/index.js",
37
- "react-native": "lib/cjs/index.native.js",
38
- "types": "lib/types/index.d.ts",
39
- "type": "module",
40
- "files": [
41
- "lib",
42
- "LICENSE"
43
- ],
44
- "sideEffects": false,
45
- "publishConfig": {
46
- "access": "public"
24
+ "node": {
25
+ "import": "./lib/esm/index.js",
26
+ "require": "./lib/cjs/index.js"
47
27
  },
48
- "scripts": {
49
- "clean": "shx rm -rf lib/*",
50
- "build": "yarn clean && rollup --config ../../rollup.config.ts --configPlugin rollup-plugin-ts",
51
- "build:watch": "yarn clean && rollup --config ../../rollup.config.ts --configPlugin rollup-plugin-ts --watch",
52
- "postbuild": "cross-env echo {\\\"type\\\":\\\"commonjs\\\"} | npx json > lib/cjs/package.json && echo {\\\"type\\\":\\\"module\\\"} | npx json > lib/esm/package.json",
53
- "prepublishOnly": "agadoo"
54
- },
55
- "peerDependencies": {
56
- "@solana/kit": "^2.1.0"
57
- },
58
- "dependencies": {
59
- "@solana/transactions": "^2.1.0",
60
- "@solana-mobile/mobile-wallet-adapter-protocol": "^2.2.4",
61
- "bs58": "^5.0.0",
62
- "js-base64": "^3.7.7"
63
- },
64
- "devDependencies": {
65
- "@solana/keys": "^2.1.0",
66
- "agadoo": "^3.0.0",
67
- "cross-env": "^7.0.3",
68
- "shx": "^0.4.0"
69
- }
70
- }
28
+ "react-native": "./lib/cjs/index.native.js",
29
+ "types": "./lib/types/index.d.ts"
30
+ },
31
+ "browser": {
32
+ "./lib/cjs/index.js": "./lib/cjs/index.browser.js",
33
+ "./lib/esm/index.js": "./lib/esm/index.browser.js"
34
+ },
35
+ "main": "lib/cjs/index.js",
36
+ "module": "lib/esm/index.js",
37
+ "react-native": "lib/cjs/index.native.js",
38
+ "types": "lib/types/index.d.ts",
39
+ "type": "module",
40
+ "files": [
41
+ "lib",
42
+ "LICENSE"
43
+ ],
44
+ "sideEffects": false,
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "peerDependencies": {
49
+ "@solana/kit": "^2.1.0"
50
+ },
51
+ "dependencies": {
52
+ "@solana/transactions": "^2.1.0",
53
+ "@solana/transaction-messages": "^2.1.0",
54
+ "bs58": "^6.0.0",
55
+ "js-base64": "^3.7.7",
56
+ "@solana-mobile/mobile-wallet-adapter-protocol": "^2.2.6"
57
+ },
58
+ "devDependencies": {
59
+ "@solana/keys": "^2.1.0",
60
+ "agadoo": "^3.0.0",
61
+ "cross-env": "^10.1.0",
62
+ "shx": "^0.4.0"
63
+ },
64
+ "scripts": {
65
+ "clean": "shx rm -rf lib/*",
66
+ "build": "pnpm clean && rollup --config ../../rollup.config.ts --configPlugin rollup-plugin-ts",
67
+ "build:watch": "pnpm clean && rollup --config ../../rollup.config.ts --configPlugin rollup-plugin-ts --watch",
68
+ "postbuild": "cross-env echo {\\\"type\\\":\\\"commonjs\\\"} | npx json > lib/cjs/package.json && echo {\\\"type\\\":\\\"module\\\"} | npx json > lib/esm/package.json"
69
+ }
70
+ }