@solana-mobile/mobile-wallet-adapter-protocol-web3js 2.0.2 → 2.1.0-alpha1
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 +10 -3
- package/lib/cjs/index.js +10 -3
- package/lib/cjs/index.native.js +10 -3
- package/lib/esm/index.browser.js +10 -3
- package/lib/esm/index.js +10 -3
- package/lib/types/index.browser.d.ts +4 -0
- package/lib/types/index.d.ts +4 -0
- package/lib/types/index.native.d.ts +4 -0
- package/package.json +53 -51
package/lib/cjs/index.browser.js
CHANGED
|
@@ -87,11 +87,18 @@ function transact(callback, config) {
|
|
|
87
87
|
switch (p) {
|
|
88
88
|
case 'signAndSendTransactions':
|
|
89
89
|
target[p] = function (_a) {
|
|
90
|
-
var { minContextSlot, transactions } = _a, rest = __rest(_a, ["minContextSlot", "transactions"]);
|
|
90
|
+
var { minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions } = _a, rest = __rest(_a, ["minContextSlot", "commitment", "skipPreflight", "maxRetries", "waitForCommitmentToSendNextTransaction", "transactions"]);
|
|
91
91
|
return __awaiter(this, void 0, void 0, function* () {
|
|
92
92
|
const payloads = transactions.map(getPayloadFromTransaction);
|
|
93
|
-
const
|
|
94
|
-
|
|
93
|
+
const options = {
|
|
94
|
+
min_context_slot: minContextSlot,
|
|
95
|
+
commitment: commitment,
|
|
96
|
+
skip_preflight: skipPreflight,
|
|
97
|
+
max_retries: maxRetries,
|
|
98
|
+
wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
|
|
99
|
+
};
|
|
100
|
+
const { signatures: base64EncodedSignatures } = yield wallet.signAndSendTransactions(Object.assign(Object.assign(Object.assign({}, rest), (Object.values(options).some(element => element != null)
|
|
101
|
+
? { options: options }
|
|
95
102
|
: null)), { payloads }));
|
|
96
103
|
const signatures = base64EncodedSignatures.map(toUint8Array).map(bs58__default["default"].encode);
|
|
97
104
|
return signatures;
|
package/lib/cjs/index.js
CHANGED
|
@@ -87,11 +87,18 @@ function transact(callback, config) {
|
|
|
87
87
|
switch (p) {
|
|
88
88
|
case 'signAndSendTransactions':
|
|
89
89
|
target[p] = function (_a) {
|
|
90
|
-
var { minContextSlot, transactions } = _a, rest = __rest(_a, ["minContextSlot", "transactions"]);
|
|
90
|
+
var { minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions } = _a, rest = __rest(_a, ["minContextSlot", "commitment", "skipPreflight", "maxRetries", "waitForCommitmentToSendNextTransaction", "transactions"]);
|
|
91
91
|
return __awaiter(this, void 0, void 0, function* () {
|
|
92
92
|
const payloads = transactions.map(getPayloadFromTransaction);
|
|
93
|
-
const
|
|
94
|
-
|
|
93
|
+
const options = {
|
|
94
|
+
min_context_slot: minContextSlot,
|
|
95
|
+
commitment: commitment,
|
|
96
|
+
skip_preflight: skipPreflight,
|
|
97
|
+
max_retries: maxRetries,
|
|
98
|
+
wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
|
|
99
|
+
};
|
|
100
|
+
const { signatures: base64EncodedSignatures } = yield wallet.signAndSendTransactions(Object.assign(Object.assign(Object.assign({}, rest), (Object.values(options).some(element => element != null)
|
|
101
|
+
? { options: options }
|
|
95
102
|
: null)), { payloads }));
|
|
96
103
|
const signatures = base64EncodedSignatures.map(toUint8Array).map(bs58__default["default"].encode);
|
|
97
104
|
return signatures;
|
package/lib/cjs/index.native.js
CHANGED
|
@@ -78,11 +78,18 @@ function transact(callback, config) {
|
|
|
78
78
|
switch (p) {
|
|
79
79
|
case 'signAndSendTransactions':
|
|
80
80
|
target[p] = function (_a) {
|
|
81
|
-
var { minContextSlot, transactions } = _a, rest = __rest(_a, ["minContextSlot", "transactions"]);
|
|
81
|
+
var { minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions } = _a, rest = __rest(_a, ["minContextSlot", "commitment", "skipPreflight", "maxRetries", "waitForCommitmentToSendNextTransaction", "transactions"]);
|
|
82
82
|
return __awaiter(this, void 0, void 0, function* () {
|
|
83
83
|
const payloads = transactions.map(getPayloadFromTransaction);
|
|
84
|
-
const
|
|
85
|
-
|
|
84
|
+
const options = {
|
|
85
|
+
min_context_slot: minContextSlot,
|
|
86
|
+
commitment: commitment,
|
|
87
|
+
skip_preflight: skipPreflight,
|
|
88
|
+
max_retries: maxRetries,
|
|
89
|
+
wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
|
|
90
|
+
};
|
|
91
|
+
const { signatures: base64EncodedSignatures } = yield wallet.signAndSendTransactions(Object.assign(Object.assign(Object.assign({}, rest), (Object.values(options).some(element => element != null)
|
|
92
|
+
? { options: options }
|
|
86
93
|
: null)), { payloads }));
|
|
87
94
|
const signatures = base64EncodedSignatures.map(jsBase64.toUint8Array).map(bs58__default["default"].encode);
|
|
88
95
|
return signatures;
|
package/lib/esm/index.browser.js
CHANGED
|
@@ -79,11 +79,18 @@ function transact(callback, config) {
|
|
|
79
79
|
switch (p) {
|
|
80
80
|
case 'signAndSendTransactions':
|
|
81
81
|
target[p] = function (_a) {
|
|
82
|
-
var { minContextSlot, transactions } = _a, rest = __rest(_a, ["minContextSlot", "transactions"]);
|
|
82
|
+
var { minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions } = _a, rest = __rest(_a, ["minContextSlot", "commitment", "skipPreflight", "maxRetries", "waitForCommitmentToSendNextTransaction", "transactions"]);
|
|
83
83
|
return __awaiter(this, void 0, void 0, function* () {
|
|
84
84
|
const payloads = transactions.map(getPayloadFromTransaction);
|
|
85
|
-
const
|
|
86
|
-
|
|
85
|
+
const options = {
|
|
86
|
+
min_context_slot: minContextSlot,
|
|
87
|
+
commitment: commitment,
|
|
88
|
+
skip_preflight: skipPreflight,
|
|
89
|
+
max_retries: maxRetries,
|
|
90
|
+
wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
|
|
91
|
+
};
|
|
92
|
+
const { signatures: base64EncodedSignatures } = yield wallet.signAndSendTransactions(Object.assign(Object.assign(Object.assign({}, rest), (Object.values(options).some(element => element != null)
|
|
93
|
+
? { options: options }
|
|
87
94
|
: null)), { payloads }));
|
|
88
95
|
const signatures = base64EncodedSignatures.map(toUint8Array).map(bs58.encode);
|
|
89
96
|
return signatures;
|
package/lib/esm/index.js
CHANGED
|
@@ -79,11 +79,18 @@ function transact(callback, config) {
|
|
|
79
79
|
switch (p) {
|
|
80
80
|
case 'signAndSendTransactions':
|
|
81
81
|
target[p] = function (_a) {
|
|
82
|
-
var { minContextSlot, transactions } = _a, rest = __rest(_a, ["minContextSlot", "transactions"]);
|
|
82
|
+
var { minContextSlot, commitment, skipPreflight, maxRetries, waitForCommitmentToSendNextTransaction, transactions } = _a, rest = __rest(_a, ["minContextSlot", "commitment", "skipPreflight", "maxRetries", "waitForCommitmentToSendNextTransaction", "transactions"]);
|
|
83
83
|
return __awaiter(this, void 0, void 0, function* () {
|
|
84
84
|
const payloads = transactions.map(getPayloadFromTransaction);
|
|
85
|
-
const
|
|
86
|
-
|
|
85
|
+
const options = {
|
|
86
|
+
min_context_slot: minContextSlot,
|
|
87
|
+
commitment: commitment,
|
|
88
|
+
skip_preflight: skipPreflight,
|
|
89
|
+
max_retries: maxRetries,
|
|
90
|
+
wait_for_commitment_to_send_next_transaction: waitForCommitmentToSendNextTransaction
|
|
91
|
+
};
|
|
92
|
+
const { signatures: base64EncodedSignatures } = yield wallet.signAndSendTransactions(Object.assign(Object.assign(Object.assign({}, rest), (Object.values(options).some(element => element != null)
|
|
93
|
+
? { options: options }
|
|
87
94
|
: null)), { payloads }));
|
|
88
95
|
const signatures = base64EncodedSignatures.map(toUint8Array).map(bs58.encode);
|
|
89
96
|
return signatures;
|
|
@@ -4,6 +4,10 @@ import { AuthorizeAPI, Base64EncodedAddress, CloneAuthorizationAPI, DeauthorizeA
|
|
|
4
4
|
interface Web3SignAndSendTransactionsAPI {
|
|
5
5
|
signAndSendTransactions<T extends LegacyTransaction | VersionedTransaction>(params: {
|
|
6
6
|
minContextSlot?: number;
|
|
7
|
+
commitment?: string;
|
|
8
|
+
skipPreflight?: boolean;
|
|
9
|
+
maxRetries?: number;
|
|
10
|
+
waitForCommitmentToSendNextTransaction?: boolean;
|
|
7
11
|
transactions: T[];
|
|
8
12
|
}): Promise<TransactionSignature[]>;
|
|
9
13
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -4,6 +4,10 @@ import { AuthorizeAPI, Base64EncodedAddress, CloneAuthorizationAPI, DeauthorizeA
|
|
|
4
4
|
interface Web3SignAndSendTransactionsAPI {
|
|
5
5
|
signAndSendTransactions<T extends LegacyTransaction | VersionedTransaction>(params: {
|
|
6
6
|
minContextSlot?: number;
|
|
7
|
+
commitment?: string;
|
|
8
|
+
skipPreflight?: boolean;
|
|
9
|
+
maxRetries?: number;
|
|
10
|
+
waitForCommitmentToSendNextTransaction?: boolean;
|
|
7
11
|
transactions: T[];
|
|
8
12
|
}): Promise<TransactionSignature[]>;
|
|
9
13
|
}
|
|
@@ -4,6 +4,10 @@ import { AuthorizeAPI, Base64EncodedAddress, CloneAuthorizationAPI, DeauthorizeA
|
|
|
4
4
|
interface Web3SignAndSendTransactionsAPI {
|
|
5
5
|
signAndSendTransactions<T extends LegacyTransaction | VersionedTransaction>(params: {
|
|
6
6
|
minContextSlot?: number;
|
|
7
|
+
commitment?: string;
|
|
8
|
+
skipPreflight?: boolean;
|
|
9
|
+
maxRetries?: number;
|
|
10
|
+
waitForCommitmentToSendNextTransaction?: boolean;
|
|
7
11
|
transactions: T[];
|
|
8
12
|
}): Promise<TransactionSignature[]>;
|
|
9
13
|
}
|
package/package.json
CHANGED
|
@@ -1,51 +1,53 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@solana-mobile/mobile-wallet-adapter-protocol-web3js",
|
|
3
|
-
"description": "A convenience wrapper that enables you to call Solana Mobile Stack protocol methods using objects from @solana/web3.js",
|
|
4
|
-
"version": "2.0
|
|
5
|
-
"author": "Steven Luscher <steven.luscher@solanamobile.com>",
|
|
6
|
-
"repository": "https://github.com/solana-mobile/mobile-wallet-adapter",
|
|
7
|
-
"license": "Apache-2.0",
|
|
8
|
-
"type": "module",
|
|
9
|
-
"sideEffects": false,
|
|
10
|
-
"main": "lib/cjs/index.js",
|
|
11
|
-
"react-native": "lib/cjs/index.native.js",
|
|
12
|
-
"module": "lib/esm/index.js",
|
|
13
|
-
"types": "lib/types/index.d.ts",
|
|
14
|
-
"browser": {
|
|
15
|
-
"./lib/cjs/index.js": "./lib/cjs/index.browser.js",
|
|
16
|
-
"./lib/esm/index.js": "./lib/esm/index.browser.js"
|
|
17
|
-
},
|
|
18
|
-
"exports": {
|
|
19
|
-
"./package.json": "./package.json",
|
|
20
|
-
".": {
|
|
21
|
-
"import": "./lib/esm/index.js",
|
|
22
|
-
"require": "./lib/cjs/index.js"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"files": [
|
|
26
|
-
"lib",
|
|
27
|
-
"LICENSE"
|
|
28
|
-
],
|
|
29
|
-
"publishConfig": {
|
|
30
|
-
"access": "public"
|
|
31
|
-
},
|
|
32
|
-
"scripts": {
|
|
33
|
-
"clean": "shx rm -rf lib/*",
|
|
34
|
-
"build": "yarn clean && rollup --config ../../rollup.config.ts --configPlugin rollup-plugin-ts",
|
|
35
|
-
"build:watch": "yarn clean && rollup --config ../../rollup.config.ts --configPlugin rollup-plugin-ts --watch",
|
|
36
|
-
"postbuild": "cross-env echo {\\\"type\\\":\\\"commonjs\\\"} | npx json > lib/cjs/package.json && echo {\\\"type\\\":\\\"module\\\"} | npx json > lib/esm/package.json",
|
|
37
|
-
"prepublishOnly": "agadoo"
|
|
38
|
-
},
|
|
39
|
-
"peerDependencies": {
|
|
40
|
-
"@solana/web3.js": "^1.58.0"
|
|
41
|
-
},
|
|
42
|
-
"dependencies": {
|
|
43
|
-
"@solana-mobile/mobile-wallet-adapter-protocol": "^2.0
|
|
44
|
-
"bs58": "^5.0.0",
|
|
45
|
-
"js-base64": "^3.7.
|
|
46
|
-
},
|
|
47
|
-
"devDependencies": {
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@solana-mobile/mobile-wallet-adapter-protocol-web3js",
|
|
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.0-alpha1",
|
|
5
|
+
"author": "Steven Luscher <steven.luscher@solanamobile.com>",
|
|
6
|
+
"repository": "https://github.com/solana-mobile/mobile-wallet-adapter",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"main": "lib/cjs/index.js",
|
|
11
|
+
"react-native": "lib/cjs/index.native.js",
|
|
12
|
+
"module": "lib/esm/index.js",
|
|
13
|
+
"types": "lib/types/index.d.ts",
|
|
14
|
+
"browser": {
|
|
15
|
+
"./lib/cjs/index.js": "./lib/cjs/index.browser.js",
|
|
16
|
+
"./lib/esm/index.js": "./lib/esm/index.browser.js"
|
|
17
|
+
},
|
|
18
|
+
"exports": {
|
|
19
|
+
"./package.json": "./package.json",
|
|
20
|
+
".": {
|
|
21
|
+
"import": "./lib/esm/index.js",
|
|
22
|
+
"require": "./lib/cjs/index.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"lib",
|
|
27
|
+
"LICENSE"
|
|
28
|
+
],
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"clean": "shx rm -rf lib/*",
|
|
34
|
+
"build": "yarn clean && rollup --config ../../rollup.config.ts --configPlugin rollup-plugin-ts",
|
|
35
|
+
"build:watch": "yarn clean && rollup --config ../../rollup.config.ts --configPlugin rollup-plugin-ts --watch",
|
|
36
|
+
"postbuild": "cross-env echo {\\\"type\\\":\\\"commonjs\\\"} | npx json > lib/cjs/package.json && echo {\\\"type\\\":\\\"module\\\"} | npx json > lib/esm/package.json",
|
|
37
|
+
"prepublishOnly": "agadoo"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@solana/web3.js": "^1.58.0"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@solana-mobile/mobile-wallet-adapter-protocol": "^2.1.0-alpha1",
|
|
44
|
+
"bs58": "^5.0.0",
|
|
45
|
+
"js-base64": "^3.7.5"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@solana/web3.js": "^1.58.0",
|
|
49
|
+
"agadoo": "^2.0.0",
|
|
50
|
+
"cross-env": "^7.0.3",
|
|
51
|
+
"shx": "^0.3.4"
|
|
52
|
+
}
|
|
53
|
+
}
|