Skip to content

Commit

Permalink
change default gas value to 1_000_000 & update interface
Browse files Browse the repository at this point in the history
  • Loading branch information
kalote committed Nov 2, 2023
1 parent 0d0f725 commit ca39593
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/classes/ERC725.md
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,7 @@ On non instantiated class, you should provide an `options` object.
| :-------- | :----- | :------------------------------------------------------------------- |
| `address` | string | Address of the smart contract to check against a certain interface. |
| `rpcUrl` | string | RPC URL to connect to the network the smart contract is deployed to. |
| `gas` | number | Optional: gas parameter to use. Default: 2_000_000. |
| `gas` | number | Optional: gas parameter to use. Default: 1_000_000. |

#### Returns

Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const address = '0x0Dc07C77985fE31996Ed612F568eb441afe5768D';
const RPC_URL = 'https://rpc.testnet.lukso.network';
const config = {
ipfsGateway: 'https://YOUR-IPFS-GATEWAY/ipfs/',
gas: 20_000_000, // optional, default is 2_000_000
gas: 20_000_000, // optional, default is 1_000_000
};

const erc725 = new ERC725(schemas, address, RPC_URL, config);
Expand Down
2 changes: 1 addition & 1 deletion src/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@ export const LSP6_ALL_PERMISSIONS =

export const COMPACT_BYTES_ARRAY_STRING = '[CompactBytesArray]';

export const DEFAULT_GAS_VALUE = 2_000_000;
export const DEFAULT_GAS_VALUE = 1_000_000;
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export { encodeData } from './lib/utils';
*
*/
export class ERC725 {
options: ERC725Options & ERC725Config;
options: ERC725Options;

/**
* Creates an instance of ERC725.
Expand Down
2 changes: 1 addition & 1 deletion src/provider/providerWrapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import assert from 'assert';
import { ProviderWrapper } from './providerWrapper';

const erc725AccountAddress = '0x214be121bB52e6909c5158579b3458f8760f1b2f';
const defaultGas = 2_000_000;
const defaultGas = 1_000_000;

describe('ProviderWrapper', () => {
describe('#getOwner', () => {
Expand Down
6 changes: 4 additions & 2 deletions src/types/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ export interface ERC725Config {
* ```js title=Example
* const config = {
* ipfsGateway: 'https://ipfs.lukso.network/ipfs/'
* gas: 20_000_000 // Optional, default 2_000_000
* gas: 20_000_000 // Optional, default 0
* };
* ```
* Make sure to use the following format: `<url>/ipfs/`.<br/>
* Another example: `https://cloudflare-ipfs.com/ipfs/`
*/
ipfsGateway: string;
ipfsGateway?: string;
gas?: number;
}

export interface ERC725Options {
schemas: ERC725JSONSchema[];
address?: string;
provider?;
ipfsGateway: string;
gas: number;
}

0 comments on commit ca39593

Please sign in to comment.