@solana/errors 2.0.0-experimental.f054d90 → 2.0.0-experimental.f4436f4
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/README.md +4 -4
- package/dist/cli.js +362 -302
- package/dist/index.browser.cjs +561 -460
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +382 -311
- package/dist/index.browser.js.map +1 -1
- package/dist/index.native.js +382 -311
- package/dist/index.native.js.map +1 -1
- package/dist/index.node.cjs +561 -460
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.js +382 -311
- package/dist/index.node.js.map +1 -1
- package/dist/types/codes.d.ts +200 -153
- package/dist/types/codes.d.ts.map +1 -1
- package/dist/types/context.d.ts +123 -44
- package/dist/types/context.d.ts.map +1 -1
- package/dist/types/error.d.ts +1 -1
- package/dist/types/error.d.ts.map +1 -1
- package/dist/types/messages.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -59,8 +59,8 @@ When you catch a `SolanaError` and assert its error code using `isSolanaError()`
|
|
|
59
59
|
|
|
60
60
|
```ts
|
|
61
61
|
import {
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
SOLANA_ERROR__TRANSACTION__MISSING_SIGNATURE,
|
|
63
|
+
SOLANA_ERROR__TRANSACTION__FEE_PAYER_SIGNATURE_MISSING,
|
|
64
64
|
isSolanaError,
|
|
65
65
|
} from '@solana/errors';
|
|
66
66
|
import { assertTransactionIsFullySigned, getSignatureFromTransaction } from '@solana/transactions';
|
|
@@ -70,14 +70,14 @@ try {
|
|
|
70
70
|
assertTransactionIsFullySigned(tx);
|
|
71
71
|
/* ... */
|
|
72
72
|
} catch (e) {
|
|
73
|
-
if (isSolanaError(e,
|
|
73
|
+
if (isSolanaError(e, SOLANA_ERROR__TRANSACTION__SIGNATURES_MISSING)) {
|
|
74
74
|
displayError(
|
|
75
75
|
"We can't send this transaction without signatures for these addresses:\n- %s",
|
|
76
76
|
// The type of the `context` object is now refined to contain `addresses`.
|
|
77
77
|
e.context.addresses.join('\n- '),
|
|
78
78
|
);
|
|
79
79
|
return;
|
|
80
|
-
} else if (isSolanaError(e,
|
|
80
|
+
} else if (isSolanaError(e, SOLANA_ERROR__TRANSACTION__FEE_PAYER_SIGNATURE_MISSING)) {
|
|
81
81
|
if (!tx.feePayer) {
|
|
82
82
|
displayError('Choose a fee payer for this transaction before sending it');
|
|
83
83
|
} else {
|