Hierarchy

  • Desmo

Constructors

Properties

_isConnected: boolean
_walletSigner: WalletSigner
abiInterface: Interface
callback: string = contractAddress
category: number
contract: Contract
dealId: string
iexec: any
taskId: string

Accessors

  • get isConnected(): boolean
  • Returns

    whether the wallet signer is connected to the contract

    Returns boolean

  • get provider(): Provider
  • Returns

    the provider used by the wallet signer

    Returns Provider

  • get wallet(): Signer
  • Returns

    the wallet used by the current user

    Returns Signer

Methods

  • This method is used to submit a query

    Example

    // Sign in with a RPC provider and a private key
    const walletSigner: WalletSignerJsonRpc = new WalletSignerJsonRpc(chainURL);
    walletSigner.signInWithPrivateKey(privateKEY);
    // Otherwise Sign in with MetaMask
    // const walletSigner = new WalletSignerMetamask(window.ethereum);
    const desmohub: DesmoHub = new DesmoHub(walletSigner);
    const desmoContract = new DesmoContract(walletSigner);
    const eventPromise = firstValueFrom(desmoHub.requestID$);
    await desmoHub.getNewRequestID();
    const event = await eventPromise;
    const query = {
    prefixList: [
    { abbreviation: 'desmo', completeURI: 'https://desmo.vaimee.it/' },
    { abbreviation: 'qudt', completeURI: 'http://qudt.org/schema/qudt/' },
    {
    abbreviation: 'xsd',
    completeURI: 'http://www.w3.org/2001/XMLSchema/',
    },
    {
    abbreviation: 'monas',
    completeURI: 'https://pod.dasibreaker.vaimee.it/monas/',
    },
    ],
    property: { identifier: 'value', unit: 'qudt:DEG_C', datatype: 1 },
    staticFilter: '$[?(@["type"]=="Sensor")]',
    };
    await desmoContract.buyQuery(
    event.requestID,
    JSON.stringify(query),
    iExecDAppAddress,
    );

    Parameters

    • requestID: Bytes
    • query: string
    • appAddress: string

    Returns Promise<void>

  • Returns

    the result of the query

    Returns Promise<{ requestId: string; result: string; taskId: string }>

  • Returns

    Parameters

    • callbackAddress: string

    Returns Promise<string>

Generated using TypeDoc