Update ABI files.
This commit is contained in:
parent
94cf97b858
commit
2699dc5bcc
@ -1,7 +1,7 @@
|
|||||||
import { environment } from '@src/environments/environment';
|
import { environment } from '@src/environments/environment';
|
||||||
import Web3 from 'web3';
|
import Web3 from 'web3';
|
||||||
|
|
||||||
const abi: Array<any> = require('@src/assets/js/block-sync/data/AccountRegistry.json');
|
const abi: Array<any> = require('@src/assets/js/block-sync/data/AccountsIndex.json');
|
||||||
const web3: Web3 = new Web3(environment.web3Provider);
|
const web3: Web3 = new Web3(environment.web3Provider);
|
||||||
|
|
||||||
export class AccountIndex {
|
export class AccountIndex {
|
||||||
@ -20,11 +20,11 @@ export class AccountIndex {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async totalAccounts(): Promise<number> {
|
public async totalAccounts(): Promise<number> {
|
||||||
return await this.contract.methods.count().call();
|
return await this.contract.methods.entryCount().call();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async haveAccount(address: string): Promise<boolean> {
|
public async haveAccount(address: string): Promise<boolean> {
|
||||||
return (await this.contract.methods.accountIndex(address).call()) !== 0;
|
return (await this.contract.methods.have(address).call()) !== 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async last(numberOfAccounts: number): Promise<Array<string>> {
|
public async last(numberOfAccounts: number): Promise<Array<string>> {
|
||||||
@ -35,7 +35,7 @@ export class AccountIndex {
|
|||||||
}
|
}
|
||||||
const accounts: Array<string> = [];
|
const accounts: Array<string> = [];
|
||||||
for (let i = count - 1; i > lowest; i--) {
|
for (let i = count - 1; i > lowest; i--) {
|
||||||
const account: string = await this.contract.methods.accounts(i).call();
|
const account: string = await this.contract.methods.entry(i).call();
|
||||||
accounts.push(account);
|
accounts.push(account);
|
||||||
}
|
}
|
||||||
return accounts;
|
return accounts;
|
||||||
|
@ -8,20 +8,6 @@
|
|||||||
"name": "AccountAdded",
|
"name": "AccountAdded",
|
||||||
"type": "event"
|
"type": "event"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"inputs": [{ "internalType": "uint256", "name": "_idx", "type": "uint256" }],
|
|
||||||
"name": "accounts",
|
|
||||||
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
||||||
"stateMutability": "view",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [{ "internalType": "address", "name": "_account", "type": "address" }],
|
|
||||||
"name": "accountsIndex",
|
|
||||||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
||||||
"stateMutability": "view",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"inputs": [{ "internalType": "address", "name": "_account", "type": "address" }],
|
"inputs": [{ "internalType": "address", "name": "_account", "type": "address" }],
|
||||||
"name": "add",
|
"name": "add",
|
||||||
@ -30,24 +16,17 @@
|
|||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [{ "internalType": "address", "name": "_writer", "type": "address" }],
|
"inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||||
"name": "addWriter",
|
"name": "entry",
|
||||||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
||||||
"stateMutability": "nonpayable",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [],
|
|
||||||
"name": "count",
|
|
||||||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
||||||
"stateMutability": "view",
|
"stateMutability": "view",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [{ "internalType": "address", "name": "_writer", "type": "address" }],
|
"inputs": [],
|
||||||
"name": "deleteWriter",
|
"name": "entryCount",
|
||||||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||||
"stateMutability": "nonpayable",
|
"stateMutability": "view",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
{
|
{
|
@ -1,18 +1,28 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
"anonymous": false,
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{ "internalType": "address", "name": "_address", "type": "address" },
|
{ "indexed": false, "internalType": "address", "name": "_declarator", "type": "address" },
|
||||||
|
{ "indexed": false, "internalType": "address", "name": "_subject", "type": "address" },
|
||||||
|
{ "indexed": false, "internalType": "bytes32", "name": "_proof", "type": "bytes32" }
|
||||||
|
],
|
||||||
|
"name": "DeclarationAdded",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{ "internalType": "address", "name": "_subject", "type": "address" },
|
||||||
{ "internalType": "bytes32", "name": "_proof", "type": "bytes32" }
|
{ "internalType": "bytes32", "name": "_proof", "type": "bytes32" }
|
||||||
],
|
],
|
||||||
"name": "addDeclaration",
|
"name": "addDeclaration",
|
||||||
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
||||||
"stateMutability": "nonpayable",
|
"stateMutability": "nonpayable",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{ "internalType": "address", "name": "_subjectAddress", "type": "address" },
|
{ "internalType": "address", "name": "_declarator", "type": "address" },
|
||||||
{ "internalType": "address", "name": "_objectAddress", "type": "address" }
|
{ "internalType": "address", "name": "_subject", "type": "address" }
|
||||||
],
|
],
|
||||||
"name": "declaration",
|
"name": "declaration",
|
||||||
"outputs": [{ "internalType": "bytes32[]", "name": "", "type": "bytes32[]" }],
|
"outputs": [{ "internalType": "bytes32[]", "name": "", "type": "bytes32[]" }],
|
||||||
@ -21,7 +31,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{ "internalType": "address", "name": "_subjectAddress", "type": "address" },
|
{ "internalType": "address", "name": "_declarator", "type": "address" },
|
||||||
{ "internalType": "uint256", "name": "_idx", "type": "uint256" }
|
{ "internalType": "uint256", "name": "_idx", "type": "uint256" }
|
||||||
],
|
],
|
||||||
"name": "declarationAddressAt",
|
"name": "declarationAddressAt",
|
||||||
@ -30,7 +40,7 @@
|
|||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [{ "internalType": "address", "name": "_subjectAddress", "type": "address" }],
|
"inputs": [{ "internalType": "address", "name": "_declarator", "type": "address" }],
|
||||||
"name": "declarationCount",
|
"name": "declarationCount",
|
||||||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||||
"stateMutability": "view",
|
"stateMutability": "view",
|
||||||
@ -38,7 +48,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{ "internalType": "address", "name": "_targetAddress", "type": "address" },
|
{ "internalType": "address", "name": "_subject", "type": "address" },
|
||||||
{ "internalType": "uint256", "name": "_idx", "type": "uint256" }
|
{ "internalType": "uint256", "name": "_idx", "type": "uint256" }
|
||||||
],
|
],
|
||||||
"name": "declaratorAddressAt",
|
"name": "declaratorAddressAt",
|
||||||
@ -47,7 +57,7 @@
|
|||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [{ "internalType": "address", "name": "_objectAddress", "type": "address" }],
|
"inputs": [{ "internalType": "address", "name": "_subject", "type": "address" }],
|
||||||
"name": "declaratorCount",
|
"name": "declaratorCount",
|
||||||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||||
"stateMutability": "view",
|
"stateMutability": "view",
|
@ -19,6 +19,17 @@
|
|||||||
"name": "Transfer",
|
"name": "Transfer",
|
||||||
"type": "event"
|
"type": "event"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [
|
||||||
|
{ "indexed": true, "internalType": "address", "name": "_from", "type": "address" },
|
||||||
|
{ "indexed": true, "internalType": "address", "name": "_to", "type": "address" },
|
||||||
|
{ "indexed": true, "internalType": "address", "name": "_spender", "type": "address" },
|
||||||
|
{ "indexed": false, "internalType": "uint256", "name": "_value", "type": "uint256" }
|
||||||
|
],
|
||||||
|
"name": "TransferFrom",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{ "internalType": "address", "name": "_owner", "type": "address" },
|
{ "internalType": "address", "name": "_owner", "type": "address" },
|
||||||
@ -39,17 +50,10 @@
|
|||||||
"stateMutability": "nonpayable",
|
"stateMutability": "nonpayable",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
||||||
"name": "balanceOf",
|
|
||||||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
||||||
"stateMutability": "view",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"inputs": [],
|
"inputs": [],
|
||||||
"name": "decimals",
|
"name": "decimals",
|
||||||
"outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }],
|
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||||
"stateMutability": "view",
|
"stateMutability": "view",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user