@corpus-core/colibri-stateless 0.2.4 → 0.2.6

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 CHANGED
@@ -203,6 +203,30 @@ The constructor of the colibri client accepts a configuration-object, which may
203
203
  new Colibri({ verify: (method, args) => method != 'eth_blockNumber' })
204
204
  ```
205
205
 
206
+ - `proofStrategy`- a strategy function used to determine how to handle proofs. Currently there are 3 default-implementations.
207
+
208
+ - `Strategy.VerifiedOnly` - throws an exception if verifaction fails or a non verifieable function is called.
209
+ - `Strategy.VerifyIfPossible` - Verifies only verifiable rpc methods and uses the fallbackhandler or rpcs if the method is not verifiable, but throws an exception if verifaction fails.
210
+ - `Strategy.WarningWithFallback` - Always use the defaultprovider or rpcs to fetch the response and in parallel verifiy the response if possible. If the Verification fails, the warningHandler is called ( which still could throw an exception ). If it fails the response from the rpc-provider is used.
211
+
212
+
213
+ ```js
214
+ new Colibri({ proofStrategy: Strategy.VerifyIfPossible })
215
+ ```
216
+
217
+
218
+
219
+ - `warningHandler`- a function to be called in case the warning-strategy is used and a verification-error happens. If not set, the default will simply use console.warn to log the error.
220
+ ```js
221
+ new Colibri({ warningHandler: (req, error) => console.warn(`Verification Error: ${error}`) })
222
+ ```
223
+
224
+
225
+ - `fallback_provider`- a EIP 1193 Provider used as fallback for all requests which are not verifieable, like eth_sendTransaction.
226
+ ```js
227
+ new Colibri({ fallback_provider: window.ethereum })
228
+ ```
229
+
206
230
 
207
231
 
208
232
  ## Building