Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gas-v2.1.4-alpha.1]: Fix - Update gas package to contain main and browser entry points #1336

Merged
merged 3 commits into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/gas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/gas",
"version": "2.1.3",
"version": "2.1.4-alpha.1",
"description": "Estimate the gas prices needed to get a transaction in to the next block for Ethereum Mainnet and Polygon Matic Mainnet.",
"keywords": [
"gas",
Expand All @@ -16,6 +16,8 @@
"bugs": "/~https://github.com/blocknative/web3-onboard/issues",
"module": "dist/index.js",
"typings": "dist/index.d.ts",
"browser": "dist/index.js",
"main": "dist/index.js",
"files": [
"dist"
],
Expand Down
24 changes: 24 additions & 0 deletions packages/gnosis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,27 @@ const onboard = Onboard({
const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
```

## Customizing Gnosis Transaction Gas

If you are looking to set the `gasLimit` of a transaction within Gnosis, the gas properties within the transaction WILL BE IGNORED.
Instead you will need to use the `safeTxGas` prop AND the web3-onboard Gnosis instance that is exposed through the provider to send along the transaction.
The Gnosis sdk instance exposed by the web3-onboard must be used to set the `safeTxGas` prop and send the transaction.
Check [Gnosis docs](/~https://github.com/safe-global/safe-contracts/blob/a6504a9afdeac186a8cdb29ad68b189523c80eda/docs/safe_tx_gas.md) for full detail as it can be a bit confusing.
An example of accessing the Gnosis SDK instance and sending a transaction can be found below.

```typescript
const tx = {
to: toAddress,
value: 1000000000000000,
data: '0x',
}
const params = {
safeTxGas: 5000000,
};

// wallet is the provider exposed by web3-onboard after the Gnosis wallet is connected
let trans = await wallet.instance.txs.send({txs:[tx], params})
```

Note: With the `safeTxGas` you will see additional value on the `gasLimit` displayed in the Safe. Check [Gnosis docs](/~https://github.com/safe-global/safe-contracts/blob/a6504a9afdeac186a8cdb29ad68b189523c80eda/docs/safe_tx_gas.md) for full details on that computation.
2 changes: 1 addition & 1 deletion packages/gnosis/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/gnosis",
"version": "2.1.3",
"version": "2.1.4-alpha.1",
"description": "Gnosis Safe module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
"keywords": [
"Ethereum",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function App() {
<div>
<button
disabled={connecting}
onClick={() => (wallet ? disconnect() : connect())}
onClick={() => (wallet ? disconnect(wallet) : connect())}
>
{connecting ? 'connecting' : wallet ? 'disconnect' : 'connect'}
</button>
Expand Down
9 changes: 9 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2953,6 +2953,15 @@
dependencies:
"@walletconnect/window-getters" "^1.0.0"

"@web3-onboard/gas@^2.0.0", "@web3-onboard/gas@^2.1.3":
version "2.1.3"
resolved "https://registry.yarnpkg.com/@web3-onboard/gas/-/gas-2.1.3.tgz#1f4f2da8e758dba6bb2cdca8e552dcc801c4981d"
integrity sha512-5k3O5bX0hdJvGvi1w5ztUg8/muJeyPTuzcryCOnY1/PoSq/znUy3z1Qjl3V1zJtUhKydirPRzXEbUushjQ1VVQ==
dependencies:
"@web3-onboard/common" "^2.2.3"
joi "^17.6.1"
rxjs "^7.5.2"

"@web3auth/base-plugin@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@web3auth/base-plugin/-/base-plugin-1.0.1.tgz#1e2a87acf745299fdff6f92e6c46ee9bc38aa670"
Expand Down