diff --git a/docs.wrm/api/providers/other.wrm b/docs.wrm/api/providers/other.wrm index 2105b310..4a541642 100644 --- a/docs.wrm/api/providers/other.wrm +++ b/docs.wrm/api/providers/other.wrm @@ -156,7 +156,7 @@ WebSockets are much more intensive on your server resourses, as they must manage and maintain the state for each client. For this reason, many services may also charge additional fees for using their WebSocket endpoints. -_property: new ethers.provider.WebSockerProvider([ url [ , network ] ]) +_property: new ethers.provider.WebSocketProvider([ url [ , network ] ]) Returns a new [[WebSocketProvider]] connected to //url// as the //network//. If //url// is unspecified, the default ``"ws:/\/localhost:8546"`` will be used. diff --git a/docs.wrm/config.js b/docs.wrm/config.js index b55f82fb..be246e08 100644 --- a/docs.wrm/config.js +++ b/docs.wrm/config.js @@ -175,14 +175,17 @@ module.exports = { "link-ens": { name: "ENS", url: "https:/\/ens.domains/" }, "link-ethereum": { name: "Ethereum", url: "https:/\/ethereumorg" }, "link-etherscan": { name: "Etherscan", url: "https:/\/etherscan.io" }, + "link-expo": { name: "Expo", url: "https:/\/expo.io" }, "link-etherscan-api": "https:/\/etherscan.io/apis", "link-flatworm": { name: "Flatworm", url: "https:/\/github.com/ricmoo/flatworm" }, "link-geth": { name: "Geth", url: "https:/\/geth.ethereum.org" }, "link-infura": { name: "INFURA", url: "https:/\/infura.io" }, + "link-javascriptcore": { name: "JavaScriptCore", url: "https:/\/developer.apple.com/documentation/javascriptcore?language=objc" }, "link-ledger": "https:/\/www.ledger.com", "link-metamask": { name: "Metamask", url: "https:/\/metamask.io/" }, "link-otto": "https:/\/github.com/robertkrimen/otto", "link-parity": { name: "Parity", url: "https:/\/www.parity.io" }, + "link-react-native": { name: "React Native", url: "https:/\/reactnative.dev" }, "link-rtd": "https:/\/github.com/readthedocs/sphinx_rtd_theme", "link-semver": { name: "semver", url: "https:/\/semver.org" }, "link-solidity": { name: "Solidity" , url: "https:/\/solidity.readthedocs.io/en/v0.6.2/" }, @@ -240,9 +243,11 @@ module.exports = { "link-bip-32": { name: "BIP-32", url: "https:/\/github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" }, "link-npm-elliptic": { name: "elliptic", url: "https:/\/www.npmjs.com/package/elliptic" }, + "link-npm-ethersproject-shims": { name: "Shims", url: "https:/\/www.npmjs.com/package/@ethersproject/shims" }, "link-npm-events": { name: "EventEmitter", url: "https:/\/nodejs.org/dist/latest-v13.x/docs/api/events.html#events_class_eventemitter" }, "link-npm-bnjs": { name: "BN.js", url: "https:/\/www.npmjs.com/package/bn.js" }, "link-npm-query-bignumber": "https:/\/www.npmjs.com/search?q=bignumber", + "link-npm-react-native-crypto": { name: "React Native Crypto", url: "https:/\/www.npmjs.com/package/react-native-crypto" }, "link-js-array": "https:/\/developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", "link-js-bigint": "https:/\/developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt", diff --git a/docs.wrm/cookbook/react-native.wrm b/docs.wrm/cookbook/react-native.wrm new file mode 100644 index 00000000..eb9b9837 --- /dev/null +++ b/docs.wrm/cookbook/react-native.wrm @@ -0,0 +1,47 @@ +_section: React Native (and ilk) @ + +The [[link-react-native]] framework has become quite popular and +has many popular forks, such as [[link-expo]]. + +React Native is based on [[link-javascriptcore]] (part of WebKit) and +does not use Node.js or the common Web and DOM APIs. As such, +there are many operations missing that a normal web environment +or Node.js instance would provide. + +For this reason, there is a [[link-npm-ethersproject-shims]] module +provided to fill in the holes. + + +_subsection: Installing @ + +To use ethers in React Native, you must either provide shims for the needed +missing functionality, or use the ethers.js shim. + +It is **HIGHLY RECOMMENDED** you check out the [security section](cookbook-reactnative-security> +below for instructions on installing pacakges which can affect the security +of your application. + +After installing packages, you may need to restart your packager and company. + +_code: Installing @lang + +/home/ricmoo/my-react-project> npm install @ethersproject/shims --save + +_code: Importing @lang