diff --git a/CHANGELOG.md b/CHANGELOG.md
index 09d380e1..51882859 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,72 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+## [0.20.1](https://github.com/ERC725Alliance/erc725.js/compare/v0.20.0...v0.20.1) (2023-10-30)
+
+
+### Bug Fixes
+
+* incorrect permission value for `EXECUTE_RELAY_CALL` ([55b8f5e](https://github.com/ERC725Alliance/erc725.js/commit/55b8f5e64c29c5a85d872f605667c88c1546f6b3))
+
+## [0.20.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.19.0...v0.20.0) (2023-10-18)
+
+
+### Features
+
+* add permission `EXECUTE_RELAY_CALL` ([6db8835](https://github.com/ERC725Alliance/erc725.js/commit/6db8835ccd9d1082d9e8184bb2f14972760bea69))
+
+## [0.19.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.18.0...v0.19.0) (2023-10-05)
+
+
+### ⚠ BREAKING CHANGES
+
+* change LSP3 to SupportedStandards:LSP3Profile ([#307](https://github.com/ERC725Alliance/erc725.js/issues/307))
+* new encoding for static value types (not arrays `[]`) ([#288](https://github.com/ERC725Alliance/erc725.js/issues/288))
+* change `ArrayLength` value from `uint256` to `uint128` ([#287](https://github.com/ERC725Alliance/erc725.js/issues/287))
+
+### Features
+
+* add checkPermissions function ([17d2258](https://github.com/ERC725Alliance/erc725.js/commit/17d225843c236951ef1515a0ff91095b5ef27cd3))
+* add schemas for LSP8 + LSP17 ([#311](https://github.com/ERC725Alliance/erc725.js/issues/311)) ([1e8dbf7](https://github.com/ERC725Alliance/erc725.js/commit/1e8dbf765c6c5e250539b402e9bd5a395966a8c2))
+
+
+### Bug Fixes
+
+* decode any uint256 as number not string ([#289](https://github.com/ERC725Alliance/erc725.js/issues/289)) ([37203f1](https://github.com/ERC725Alliance/erc725.js/commit/37203f14d313a0caff75724dc74175c741c1b540))
+* dependencies & example ([#302](https://github.com/ERC725Alliance/erc725.js/issues/302)) ([9979e89](https://github.com/ERC725Alliance/erc725.js/commit/9979e89e438cd9f7cc586d7dc271de969f13b125))
+* incorrect value in schema for array length in `...Map` ([#310](https://github.com/ERC725Alliance/erc725.js/issues/310)) ([0d28b13](https://github.com/ERC725Alliance/erc725.js/commit/0d28b1317dc085078090a8babacf4db517d91a87))
+* Remove hardcoded require ([5279278](https://github.com/ERC725Alliance/erc725.js/commit/527927812b1a05b13f8dc6b14aecaa6d24e98d61))
+* variable naming ([44b4785](https://github.com/ERC725Alliance/erc725.js/commit/44b47851ed63b817edc21c63655d67bac13a7e7f))
+
+
+### Code Refactoring
+
+* change `ArrayLength` value from `uint256` to `uint128` ([#287](https://github.com/ERC725Alliance/erc725.js/issues/287)) ([c95ee8a](https://github.com/ERC725Alliance/erc725.js/commit/c95ee8a53bf25bcf47777054af27cae1fbad8b2f))
+* change LSP3 to SupportedStandards:LSP3Profile ([#307](https://github.com/ERC725Alliance/erc725.js/issues/307)) ([73f3481](https://github.com/ERC725Alliance/erc725.js/commit/73f34818fe152c3ab5299177adc0eddfed6886c5))
+* new encoding for static value types (not arrays `[]`) ([#288](https://github.com/ERC725Alliance/erc725.js/issues/288)) ([f0b04da](https://github.com/ERC725Alliance/erc725.js/commit/f0b04daa57a281c537a8f28594439573188f0dce))
+
+## [0.18.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.17.2...v0.18.0) (2023-08-03)
+
+### ⚠ BREAKING CHANGES
+
+- new encoding for static value types (not arrays `[]`) (#288)
+- change `ArrayLength` value from `uint256` to `uint128` (#287)
+
+### Features
+
+- add checkPermissions function ([17d2258](https://github.com/ERC725Alliance/erc725.js/commit/17d225843c236951ef1515a0ff91095b5ef27cd3))
+- Add new feature "Decode Mapping Key" ([8c1f1fc](https://github.com/ERC725Alliance/erc725.js/commit/8c1f1fcfb15fa43d1d3934b0b15f09d47902bb41))
+
+### Bug Fixes
+
+- decode any uint256 as number not string ([#289](https://github.com/ERC725Alliance/erc725.js/issues/289)) ([37203f1](https://github.com/ERC725Alliance/erc725.js/commit/37203f14d313a0caff75724dc74175c741c1b540))
+- variable naming ([44b4785](https://github.com/ERC725Alliance/erc725.js/commit/44b47851ed63b817edc21c63655d67bac13a7e7f))
+
+### improvement
+
+- change `ArrayLength` value from `uint256` to `uint128` ([#287](https://github.com/ERC725Alliance/erc725.js/issues/287)) ([c95ee8a](https://github.com/ERC725Alliance/erc725.js/commit/c95ee8a53bf25bcf47777054af27cae1fbad8b2f))
+- new encoding for static value types (not arrays `[]`) ([#288](https://github.com/ERC725Alliance/erc725.js/issues/288)) ([f0b04da](https://github.com/ERC725Alliance/erc725.js/commit/f0b04daa57a281c537a8f28594439573188f0dce))
+
### [0.17.2](https://github.com/ERC725Alliance/erc725.js/compare/v0.17.1...v0.17.2) (2023-03-14)
- removed ERC725JSONSchemaKeyType duplicate value ([060ee6c](https://github.com/ERC725Alliance/erc725.js/commit/060ee6ce23bda328f727140419de7590f48fc394))
@@ -103,7 +169,6 @@ Minor update to update the LSP-2 schemas.
### improvement
-- change fetchData output to non object ([1d4d570](https://github.com/ERC725Alliance/erc725.js/commit/1d4d57077a7766b3490477efb20f194fc4e00da4))
- fetchData as same output as decodeData ([59c3a87](https://github.com/ERC725Alliance/erc725.js/commit/59c3a879fefb2b9bfe46b9bea91ff6bd2a528df1))
- getData as same output as decodeData ([0f3b149](https://github.com/ERC725Alliance/erc725.js/commit/0f3b149f2280e6025a05e8e9ed306facfa63601a))
- use array for decodeData ([261d100](https://github.com/ERC725Alliance/erc725.js/commit/261d1007f4ff63abd9d794f4e64e5b408ce7c1a3))
diff --git a/docs/classes/ERC725.md b/docs/classes/ERC725.md
index c6a41019..02300358 100644
--- a/docs/classes/ERC725.md
+++ b/docs/classes/ERC725.md
@@ -454,37 +454,14 @@ myErc725.encodeData([
*/
```
-```javascript
-myErc725.encodeData([
- {
- keyName: 'LSP1UniversalReceiverDelegate',
- value: '0x1183790f29BE3cDfD0A102862fEA1a4a30b3AdAb',
- },
-]);
-/**
-{
- keys: ['0x0cfc51aec37c55a4d0b1a65c6255c4bf2fbdf6277f3cc0730c45b828b6db8b47'],
- values: ['0x1183790f29be3cdfd0a102862fea1a4a30b3adab'],
-}
-*/
-```
-
-
-
-
- Encode a JSONURL
with hash function, hash and uploaded URL
-
-```javascript title="Encode a JSONURL with hash function, hash and uploaded URL"
-myErc725.encodeData([
- {
- keyName: 'LSP3Profile',
- value: {
- hashFunction: 'keccak256(utf8)',
- hash: '0x820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361',
- url: 'ipfs://QmYr1VJLwerg6pEoscdhVGugo39pa6rycEZLjtRPDfW84UAx',
- },
+```javascript title="Encoding object with one key"
+const encodedDataOneKeyV2 = erc725.encodeData({
+ LSP3Profile: {
+ hashFunction: 'keccak256(utf8)',
+ hash: '0x820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361',
+ url: 'ifps://QmYr1VJLwerg6pEoscdhVGugo39pa6rycEZLjtRPDfW84UAx',
},
-]);
+});
/**
{
keys: ['0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5'],
@@ -554,33 +531,19 @@ myErc725.encodeData(
*/
```
-
-
-
- Encode multiple keys at once
-
-```javascript title="Encode multiple keys at once"
-myErc725.encodeData([
- {
- keyName: 'LSP3Profile',
- value: {
- hashFunction: 'keccak256(utf8)',
- hash: '0x820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361',
- url: 'ipfs://QmYr1VJLwerg6pEoscdhVGugo39pa6rycEZLjtRPDfW84UAx',
- },
- },
- {
- keyName: 'LSP12IssuedAssets[]',
- value: [
- '0xD94353D9B005B3c0A9Da169b768a31C57844e490',
- '0xDaea594E385Fc724449E3118B2Db7E86dFBa1826',
- ],
- },
- {
- keyName: 'LSP1UniversalReceiverDelegate',
- value: '0x1183790f29BE3cDfD0A102862fEA1a4a30b3AdAb',
+```javascript title="Encoding object with multiple keys"
+const encodedDataManyKeys = erc725.encodeData({
+ LSP3Profile: {
+ hashFunction: 'keccak256(utf8)',
+ hash: '0x820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361',
+ url: 'ifps://QmYr1VJLwerg6pEoscdhVGugo39pa6rycEZLjtRPDfW84UAx',
},
-]);
+ 'LSP3IssuedAssets[]': [
+ '0xD94353D9B005B3c0A9Da169b768a31C57844e490',
+ '0xDaea594E385Fc724449E3118B2Db7E86dFBa1826',
+ ],
+ LSP1UniversalReceiverDelegate: '0x1183790f29BE3cDfD0A102862fEA1a4a30b3AdAb',
+});
/**
{
keys: [
@@ -1446,6 +1409,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. |
#### Returns
@@ -1473,6 +1437,7 @@ myErc725.supportsInterface('LSP0ERC725Account');
ERC725.supportsInterface('LSP0ERC725Account', {
address: '0x0Dc07C77985fE31996Ed612F568eb441afe5768D',
rpcUrl: 'https://rpc.testnet.lukso.network',
+ gas: 20_000_000,
});
// true
```
diff --git a/docs/getting-started.md b/docs/getting-started.md
index cbe47702..71b05e92 100644
--- a/docs/getting-started.md
+++ b/docs/getting-started.md
@@ -61,6 +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
};
const erc725 = new ERC725(schemas, address, RPC_URL, config);
@@ -110,7 +111,7 @@ await erc725.fetchData('LSP3Profile'); // downloads and verifies the linked JSON
```
:::tip Try it out
-You can run the code snippit within your browser using the corresponding [StackBlitz example](https://stackblitz.com/edit/erc725js-instantiation?devtoolsheight=66&file=index.js).
+You can run the code snippet within your browser using the corresponding [StackBlitz example](https://stackblitz.com/edit/erc725js-instantiation?devtoolsheight=66&file=index.js).
:::note
Whenever you can you should import `ERC725` via the named export. However currently we are also providing a default export.
@@ -127,6 +128,7 @@ After the instance has been created, it is still possible to change settings thr
myERC725.options.schema = '' // change schema
myERC725.options.address '' // change address
myERC725.options.ipfsGateway = '' // used for fetchData(), default: 'https://cloudflare-ipfs.com/ipfs/'
+myERC725.options.gas = 20_000_000 // change gas setting
// NOTE: ERC725.provider can not be changed
```
diff --git a/package-lock.json b/package-lock.json
index 813b016f..c7997238 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@erc725/erc725.js",
- "version": "0.17.2",
+ "version": "0.20.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@erc725/erc725.js",
- "version": "0.17.2",
+ "version": "0.20.1",
"license": "Apache-2.0",
"dependencies": {
"ethereumjs-util": "^7.1.5",
diff --git a/package.json b/package.json
index 217f6c87..625e93ab 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@erc725/erc725.js",
- "version": "0.17.2",
+ "version": "0.20.1",
"description": "Library to interact with ERC725 smart contracts",
"main": "build/main/src/index.js",
"typings": "build/main/src/index.d.ts",
diff --git a/src/constants/constants.ts b/src/constants/constants.ts
index 4915183d..c9948fc9 100644
--- a/src/constants/constants.ts
+++ b/src/constants/constants.ts
@@ -58,47 +58,35 @@ export const METHODS: Record = {
[Method.GET_DATA_LEGACY]: {
// Legacy version of ERC725Y - before v0.3.0
sig: '0x54f6127f',
- gas: numberToHex(2000000),
- gasPrice: numberToHex(100000000),
value: numberToHex(0),
returnEncoding: Encoding.BYTES,
},
[Method.GET_DATA]: {
// https://github.com/ERC725Alliance/ERC725/blob/v4.0.0/docs/ERC-725.md#erc725y
sig: '0x4e3e6e9c',
- gas: numberToHex(2000000),
- gasPrice: numberToHex(100000000),
value: numberToHex(0),
returnEncoding: Encoding.BYTES_ARRAY,
},
[Method.GET_DATA_BATCH]: {
// https://github.com/ERC725Alliance/ERC725/blob/v5.1.0/docs/ERC-725.md#erc725y
sig: '0xdedff9c6',
- gas: numberToHex(2000000),
- gasPrice: numberToHex(100000000),
value: numberToHex(0),
returnEncoding: Encoding.BYTES_ARRAY,
},
[Method.OWNER]: {
sig: '0x8da5cb5b',
- gas: numberToHex(2000000),
- gasPrice: numberToHex(100000000),
value: numberToHex(0),
returnEncoding: Encoding.ADDRESS,
},
[Method.SUPPORTS_INTERFACE]: {
// https://eips.ethereum.org/EIPS/eip-165
sig: '0x01ffc9a7',
- gas: numberToHex(2000000),
- gasPrice: numberToHex(100000000),
value: numberToHex(0),
returnEncoding: Encoding.BOOL,
},
[Method.IS_VALID_SIGNATURE]: {
// https://eips.ethereum.org/EIPS/eip-1271
sig: '0x1626ba7e',
- gas: numberToHex(2000000),
- gasPrice: numberToHex(100000000),
value: numberToHex(0),
returnEncoding: Encoding.BYTES4,
},
@@ -183,3 +171,5 @@ export const LSP6_ALL_PERMISSIONS =
'0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff';
export const COMPACT_BYTES_ARRAY_STRING = '[CompactBytesArray]';
+
+export const DEFAULT_GAS_VALUE = 2_000_000;
diff --git a/src/index.ts b/src/index.ts
index 6a07e404..ec12ebbe 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -37,6 +37,7 @@ import { isValidSignature } from './lib/isValidSignature';
import {
LSP6_ALL_PERMISSIONS,
LSP6_DEFAULT_PERMISSIONS,
+ DEFAULT_GAS_VALUE,
} from './constants/constants';
import { encodeKeyName, isDynamicKeyName } from './lib/encodeKeyName';
@@ -105,15 +106,20 @@ export class ERC725 {
const defaultConfig = {
ipfsGateway: 'https://cloudflare-ipfs.com/ipfs/',
+ gas: DEFAULT_GAS_VALUE,
};
this.options = {
schemas: this.validateSchemas(schemas),
address,
- provider: ERC725.initializeProvider(provider),
+ provider: ERC725.initializeProvider(
+ provider,
+ config?.gas ? config?.gas : defaultConfig.gas,
+ ),
ipfsGateway: config?.ipfsGateway
? convertIPFSGatewayUrl(config?.ipfsGateway)
: defaultConfig.ipfsGateway,
+ gas: config?.gas ? config?.gas : defaultConfig.gas,
};
}
@@ -151,20 +157,20 @@ export class ERC725 {
});
}
- private static initializeProvider(providerOrRpcUrl) {
+ private static initializeProvider(providerOrRpcUrl, gasInfo) {
// do not fail on no-provider
if (!providerOrRpcUrl) return undefined;
// if provider is a string, assume it's a rpcUrl
if (typeof providerOrRpcUrl === 'string') {
- return new ProviderWrapper(new HttpProvider(providerOrRpcUrl));
+ return new ProviderWrapper(new HttpProvider(providerOrRpcUrl), gasInfo);
}
if (
typeof providerOrRpcUrl.request === 'function' ||
typeof providerOrRpcUrl.send === 'function'
)
- return new ProviderWrapper(providerOrRpcUrl);
+ return new ProviderWrapper(providerOrRpcUrl, gasInfo);
throw new Error(`Incorrect or unsupported provider ${providerOrRpcUrl}`);
}
@@ -593,12 +599,12 @@ export class ERC725 {
* supports a certain interface.
*
* @param {string} interfaceIdOrName Interface ID or supported interface name.
- * @param options Object of address and RPC URL.
+ * @param options Object of address, RPC URL and optional gas.
* @returns {Promise} if interface is supported.
*/
static async supportsInterface(
interfaceIdOrName: string,
- options: { address: string; rpcUrl: string },
+ options: { address: string; rpcUrl: string; gas?: number },
): Promise {
if (!isAddress(options.address)) {
throw new Error('Invalid address');
@@ -609,7 +615,10 @@ export class ERC725 {
return supportsInterface(interfaceIdOrName, {
address: options.address,
- provider: this.initializeProvider(options.rpcUrl),
+ provider: this.initializeProvider(
+ options.rpcUrl,
+ options?.gas ? options?.gas : DEFAULT_GAS_VALUE,
+ ),
});
}
diff --git a/src/lib/provider-wrapper-utils.ts b/src/lib/provider-wrapper-utils.ts
index 5f2adf67..0a0d52a0 100644
--- a/src/lib/provider-wrapper-utils.ts
+++ b/src/lib/provider-wrapper-utils.ts
@@ -13,6 +13,7 @@
*/
import * as abi from 'web3-eth-abi';
+import { numberToHex } from 'web3-utils';
import {
JsonRpc,
@@ -49,6 +50,7 @@ export function decodeResult(method: Method, hexString: string) {
const constructJSONRPCParams = (
address: string,
method: Method,
+ gasInfo: number,
methodParam?: string,
): JsonRpcEthereumProviderParamsWithLatest => {
const data = methodParam
@@ -59,7 +61,7 @@ const constructJSONRPCParams = (
{
to: address,
value: METHODS[method].value,
- gas: METHODS[method].gas,
+ gas: numberToHex(gasInfo),
data,
},
'latest',
@@ -69,13 +71,14 @@ const constructJSONRPCParams = (
export function constructJSONRPC(
address: string,
method: Method,
+ gasInfo: number,
methodParam?: string,
): JsonRpc {
idCount += 1;
return {
jsonrpc: '2.0',
method: 'eth_call',
- params: constructJSONRPCParams(address, method, methodParam),
+ params: constructJSONRPCParams(address, method, gasInfo, methodParam),
id: idCount,
};
}
diff --git a/src/provider/providerWrapper.test.ts b/src/provider/providerWrapper.test.ts
index 91748eb3..75e8ed94 100644
--- a/src/provider/providerWrapper.test.ts
+++ b/src/provider/providerWrapper.test.ts
@@ -3,6 +3,7 @@ import assert from 'assert';
import { ProviderWrapper } from './providerWrapper';
const erc725AccountAddress = '0x214be121bB52e6909c5158579b3458f8760f1b2f';
+const defaultGas = 2_000_000;
describe('ProviderWrapper', () => {
describe('#getOwner', () => {
@@ -15,7 +16,7 @@ describe('ProviderWrapper', () => {
});
},
};
- const ethSource = new ProviderWrapper(mockProvider);
+ const ethSource = new ProviderWrapper(mockProvider, defaultGas);
const owner = await ethSource.getOwner(erc725AccountAddress);
assert.deepStrictEqual(
@@ -30,7 +31,7 @@ describe('ProviderWrapper', () => {
cb(new Error('some error'));
},
};
- const ethSource = new ProviderWrapper(mockProvider);
+ const ethSource = new ProviderWrapper(mockProvider, defaultGas);
try {
await ethSource.getOwner(erc725AccountAddress);
@@ -47,7 +48,7 @@ describe('ProviderWrapper', () => {
});
},
};
- const ethSource = new ProviderWrapper(mockProvider);
+ const ethSource = new ProviderWrapper(mockProvider, defaultGas);
try {
await ethSource.getOwner(erc725AccountAddress);
diff --git a/src/provider/providerWrapper.ts b/src/provider/providerWrapper.ts
index 3f7026db..a3f235d1 100644
--- a/src/provider/providerWrapper.ts
+++ b/src/provider/providerWrapper.ts
@@ -40,18 +40,20 @@ interface GetDataReturn {
export class ProviderWrapper {
type: ProviderTypes;
provider: any;
- constructor(provider: any) {
+ gas: number;
+ constructor(provider: any, gasInfo: number) {
if (typeof provider.request === 'function') {
this.type = ProviderTypes.ETHEREUM;
} else {
this.type = ProviderTypes.WEB3;
}
this.provider = provider;
+ this.gas = gasInfo;
}
async getOwner(address: string) {
const result = await this.callContract(
- constructJSONRPC(address, Method.OWNER),
+ constructJSONRPC(address, Method.OWNER, this.gas),
);
if (result.error) {
throw result.error;
@@ -115,6 +117,7 @@ export class ProviderWrapper {
constructJSONRPC(
address,
Method.SUPPORTS_INTERFACE,
+ this.gas,
`${interfaceId}${'00000000000000000000000000000000000000000000000000000000'}`,
),
);
@@ -152,7 +155,12 @@ export class ProviderWrapper {
);
const result = await this.callContract(
- constructJSONRPC(address, Method.IS_VALID_SIGNATURE, encodedParams),
+ constructJSONRPC(
+ address,
+ Method.IS_VALID_SIGNATURE,
+ this.gas,
+ encodedParams,
+ ),
);
if (result.error) {
@@ -172,7 +180,12 @@ export class ProviderWrapper {
);
const results = await this.callContract([
- constructJSONRPC(address, Method.IS_VALID_SIGNATURE, encodedParams),
+ constructJSONRPC(
+ address,
+ Method.IS_VALID_SIGNATURE,
+ this.gas,
+ encodedParams,
+ ),
]);
if (results.error) {
throw results.error;
@@ -232,6 +245,7 @@ export class ProviderWrapper {
constructJSONRPC(
address,
method,
+ this.gas,
abiCoder.encodeParameter('bytes32[]', keyHashes),
),
);
@@ -248,6 +262,7 @@ export class ProviderWrapper {
constructJSONRPC(
address,
method,
+ this.gas,
abiCoder.encodeParameter('bytes32[]', keyHashes),
),
];
@@ -270,7 +285,7 @@ export class ProviderWrapper {
// But this is already legacy and it won't be used anymore..
const encodedResultsPromises = keyHashes.map((keyHash) =>
this.callContract(
- constructJSONRPC(address, Method.GET_DATA_LEGACY, keyHash),
+ constructJSONRPC(address, Method.GET_DATA_LEGACY, this.gas, keyHash),
),
);
@@ -287,7 +302,12 @@ export class ProviderWrapper {
// But this is already legacy and it won't be used anymore..
for (let index = 0; index < keyHashes.length; index++) {
payload.push(
- constructJSONRPC(address, Method.GET_DATA_LEGACY, keyHashes[index]),
+ constructJSONRPC(
+ address,
+ Method.GET_DATA_LEGACY,
+ this.gas,
+ keyHashes[index],
+ ),
);
}
diff --git a/src/types/Config.ts b/src/types/Config.ts
index 24e4ab33..15707591 100644
--- a/src/types/Config.ts
+++ b/src/types/Config.ts
@@ -5,12 +5,14 @@ export interface ERC725Config {
* ```js title=Example
* const config = {
* ipfsGateway: 'https://ipfs.lukso.network/ipfs/'
+ * gas: 20_000_000 // Optional, default 2_000_000
* };
* ```
* Make sure to use the following format: `/ipfs/`.
* Another example: `https://cloudflare-ipfs.com/ipfs/`
*/
ipfsGateway: string;
+ gas?: number;
}
export interface ERC725Options {
diff --git a/src/types/Method.ts b/src/types/Method.ts
index e28b49ab..1c794a67 100644
--- a/src/types/Method.ts
+++ b/src/types/Method.ts
@@ -19,8 +19,6 @@ export enum Encoding {
export interface MethodData {
sig: string;
- gas: string;
- gasPrice: string;
value: string;
returnEncoding: Encoding;
}