• Preparing search index...
  • The search index is not available
@kynesyslabs/demosdk
  • @kynesyslabs/demosdk
  • websdk
  • createProgrammaticTx

Function createProgrammaticTx

  • createProgrammaticTx(demos): {
        attest: {
            dahr: ((params: IStartProxyParams) => Promise<IWeb2Result>);
            discord: ((proof: DiscordProof, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            domain: ((hostname: string, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            ethos: ((payload: EthosWalletIdentity, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            github: ((proof: GithubProof, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            humanpassport: ((payload: HumanPassportIdentityData, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            nomis: ((payload: NomisWalletIdentity, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            pqc: ((algorithms?: PQCAlgorithm[] | "all", opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            removeEthos: ((payload: EthosIdentityRemoveData, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            removeHumanpassport: ((address: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            removeNomis: ((payload: NomisWalletIdentity, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            removePqc: ((algorithms?: PQCAlgorithm[] | "all", opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            removeTlsn: ((context: TLSNIdentityContext, username: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            removeUd: ((domain: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            removeWeb2: ((payload: {
                context: string;
                username: string;
            }, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            removeXm: ((payload: XMCoreTargetIdentityPayload, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            telegram: ((attestation: TelegramSignedAttestation, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            tlsn: ((context: TLSNIdentityContext, proof: TLSNotaryPresentation, recvHash: string, proofRanges: TLSNProofRanges, revealedRecv: number[], username: string, userId: string | number, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            twitter: ((proof: `https://x.com/${string}/${string}`, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            ud: ((signingAddress: string, signature: string, challenge: string, resolutionData: UnifiedDomainResolution, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            xm: ((payload: InferFromSignaturePayload, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        bridge: {
            submit: ((compiled: NativeBridgeOperationCompiled, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        contracts: {
            at: (<T>(address: string, abi?: ContractABI) => Promise<ContractInstance<T>>);
            batch: (() => BatchBuilder);
            call: (<T>(contractAddress: string, method: string, args?: unknown[], options?: ContractCallOptions) => Promise<ContractCallResult<T>>);
            deploy: ((source: string, constructorArgs?: unknown[], options?: ContractDeployOptions) => Promise<ContractInstance<any>>);
            deployTemplate: ((templateName: string, params?: Record<string, unknown>) => Promise<ContractInstance<any>>);
            estimateGas: ((contractAddress: string, method: string, args?: unknown[]) => Promise<bigint>);
            getAvailableTemplates: (() => string[]);
        };
        d402: {
            pay: ((requirement: D402PaymentRequirement, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        demoswork: {
            submit: ((work: DemosWork, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        escrow: {
            claim: ((platform: "github" | "twitter" | "telegram", username: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            refund: ((platform: "github" | "twitter" | "telegram", username: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            send: ((platform: "github" | "twitter" | "telegram", username: string, amount: number | bigint, options?: {
                expiryDays?: number;
                message?: string;
            }, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        governance: {
            propose: ((params: ProposeNetworkUpgradeParams, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            vote: ((proposalId: string, approve: boolean, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        ipfs: {
            add: ((content: string | Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>, addOptions?: AddOptionsWithCharges, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            pin: ((cid: string, pinOptions?: PinOptionsWithCharges, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            unpin: ((cid: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        pay: ((to: string, amount: number | bigint, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        storage: {
            program: ((payload: StorageProgramPayload, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            store: ((bytes: Uint8Array<ArrayBufferLike>, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        tokens: {
            approve: ((tokenAddress: string, spender: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            burn: ((tokenAddress: string, from: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            callMethod: ((tokenAddress: string, method: string, params: unknown[], opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            create: ((params: TokenCreationParams, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            grantPermissions: ((tokenAddress: string, address: string, permissions: string[], opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            mint: ((tokenAddress: string, to: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            pause: ((tokenAddress: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            revokePermissions: ((tokenAddress: string, address: string, permissions: string[], opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            transfer: ((tokenAddress: string, to: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            transferFrom: ((tokenAddress: string, from: string, to: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            transferOwnership: ((tokenAddress: string, newOwner: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            unpause: ((tokenAddress: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            upgradeScript: ((tokenAddress: string, newCode: string, newMethods: TokenScriptMethod[], newHooks: TokenHookType[], opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        transfer: ((to: string, amount: number | bigint, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        validator: {
            exit: ((opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            stake: ((amount: string, connectionUrl: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            unstake: ((opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        xm: {
            submit: ((xmScript: XMScript, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
    }
  • Build the demos.run programmatic-transaction facade for a Demos instance.

    Composes the typed one-call namespaces (pay/transfer, attest.*, tokens.*) over a single shared context, so every method routes through the same confirm → broadcast runner with uniform fee-cap policy and result shape. Additive — the classic demos.pay/confirm/broadcast methods are untouched.

    Parameters

    • demos: Demos

      The Demos instance the facade is bound to.

    Returns {
        attest: {
            dahr: ((params: IStartProxyParams) => Promise<IWeb2Result>);
            discord: ((proof: DiscordProof, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            domain: ((hostname: string, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            ethos: ((payload: EthosWalletIdentity, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            github: ((proof: GithubProof, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            humanpassport: ((payload: HumanPassportIdentityData, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            nomis: ((payload: NomisWalletIdentity, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            pqc: ((algorithms?: PQCAlgorithm[] | "all", opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            removeEthos: ((payload: EthosIdentityRemoveData, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            removeHumanpassport: ((address: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            removeNomis: ((payload: NomisWalletIdentity, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            removePqc: ((algorithms?: PQCAlgorithm[] | "all", opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            removeTlsn: ((context: TLSNIdentityContext, username: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            removeUd: ((domain: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            removeWeb2: ((payload: {
                context: string;
                username: string;
            }, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            removeXm: ((payload: XMCoreTargetIdentityPayload, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            telegram: ((attestation: TelegramSignedAttestation, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            tlsn: ((context: TLSNIdentityContext, proof: TLSNotaryPresentation, recvHash: string, proofRanges: TLSNProofRanges, revealedRecv: number[], username: string, userId: string | number, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            twitter: ((proof: `https://x.com/${string}/${string}`, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            ud: ((signingAddress: string, signature: string, challenge: string, resolutionData: UnifiedDomainResolution, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            xm: ((payload: InferFromSignaturePayload, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        bridge: {
            submit: ((compiled: NativeBridgeOperationCompiled, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        contracts: {
            at: (<T>(address: string, abi?: ContractABI) => Promise<ContractInstance<T>>);
            batch: (() => BatchBuilder);
            call: (<T>(contractAddress: string, method: string, args?: unknown[], options?: ContractCallOptions) => Promise<ContractCallResult<T>>);
            deploy: ((source: string, constructorArgs?: unknown[], options?: ContractDeployOptions) => Promise<ContractInstance<any>>);
            deployTemplate: ((templateName: string, params?: Record<string, unknown>) => Promise<ContractInstance<any>>);
            estimateGas: ((contractAddress: string, method: string, args?: unknown[]) => Promise<bigint>);
            getAvailableTemplates: (() => string[]);
        };
        d402: {
            pay: ((requirement: D402PaymentRequirement, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        demoswork: {
            submit: ((work: DemosWork, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        escrow: {
            claim: ((platform: "github" | "twitter" | "telegram", username: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            refund: ((platform: "github" | "twitter" | "telegram", username: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            send: ((platform: "github" | "twitter" | "telegram", username: string, amount: number | bigint, options?: {
                expiryDays?: number;
                message?: string;
            }, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        governance: {
            propose: ((params: ProposeNetworkUpgradeParams, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            vote: ((proposalId: string, approve: boolean, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        ipfs: {
            add: ((content: string | Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>, addOptions?: AddOptionsWithCharges, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            pin: ((cid: string, pinOptions?: PinOptionsWithCharges, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            unpin: ((cid: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        pay: ((to: string, amount: number | bigint, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        storage: {
            program: ((payload: StorageProgramPayload, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            store: ((bytes: Uint8Array<ArrayBufferLike>, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        tokens: {
            approve: ((tokenAddress: string, spender: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            burn: ((tokenAddress: string, from: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            callMethod: ((tokenAddress: string, method: string, params: unknown[], opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            create: ((params: TokenCreationParams, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            grantPermissions: ((tokenAddress: string, address: string, permissions: string[], opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            mint: ((tokenAddress: string, to: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            pause: ((tokenAddress: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            revokePermissions: ((tokenAddress: string, address: string, permissions: string[], opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            transfer: ((tokenAddress: string, to: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            transferFrom: ((tokenAddress: string, from: string, to: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            transferOwnership: ((tokenAddress: string, newOwner: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            unpause: ((tokenAddress: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            upgradeScript: ((tokenAddress: string, newCode: string, newMethods: TokenScriptMethod[], newHooks: TokenHookType[], opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        transfer: ((to: string, amount: number | bigint, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        validator: {
            exit: ((opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            stake: ((amount: string, connectionUrl: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
            unstake: ((opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
        xm: {
            submit: ((xmScript: XMScript, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
        };
    }

    • attest: {
          dahr: ((params: IStartProxyParams) => Promise<IWeb2Result>);
          discord: ((proof: DiscordProof, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          domain: ((hostname: string, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          ethos: ((payload: EthosWalletIdentity, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          github: ((proof: GithubProof, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          humanpassport: ((payload: HumanPassportIdentityData, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          nomis: ((payload: NomisWalletIdentity, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          pqc: ((algorithms?: PQCAlgorithm[] | "all", opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          removeEthos: ((payload: EthosIdentityRemoveData, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          removeHumanpassport: ((address: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          removeNomis: ((payload: NomisWalletIdentity, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          removePqc: ((algorithms?: PQCAlgorithm[] | "all", opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          removeTlsn: ((context: TLSNIdentityContext, username: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          removeUd: ((domain: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          removeWeb2: ((payload: {
              context: string;
              username: string;
          }, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          removeXm: ((payload: XMCoreTargetIdentityPayload, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          telegram: ((attestation: TelegramSignedAttestation, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          tlsn: ((context: TLSNIdentityContext, proof: TLSNotaryPresentation, recvHash: string, proofRanges: TLSNProofRanges, revealedRecv: number[], username: string, userId: string | number, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          twitter: ((proof: `https://x.com/${string}/${string}`, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          ud: ((signingAddress: string, signature: string, challenge: string, resolutionData: UnifiedDomainResolution, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          xm: ((payload: InferFromSignaturePayload, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
      }

      Identity attestations (web2 proofs) + the DAHR web2-proxy.

      • dahr: ((params: IStartProxyParams) => Promise<IWeb2Result>)

        Run a DAHR web2-proxy attestation.

        Unlike the identity builders above, DAHR does not go through ctx.run: the web2 proxy performs its own sign + confirm + broadcast lifecycle server-side. As a result ProgrammaticTxOptions (e.g. maxFee, confirm) do not apply here — there is no local confirm/broadcast stage to govern.

        Example

        const result = await demos.run.attest.dahr({
        url: "https://api.example.com/me",
        method: "GET",
        })
          • (params): Promise<IWeb2Result>
          • Parameters

            • params: IStartProxyParams

              The proxy request parameters (url, method, options).

            Returns Promise<IWeb2Result>

            The web2 proxy result, including the attested response.

      • discord: ((proof: DiscordProof, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Link a Discord identity to the connected wallet, end to end.

        Example

        await demos.run.attest.discord(
        "https://discord.com/channels/guild/chan/msg",
        )
          • (proof, referralCode?, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • proof: DiscordProof

              The Discord message proof URL.

            • OptionalreferralCode: string

              Optional referral code for incentive points.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • domain: ((hostname: string, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Link a domain identity (CCI) to the connected wallet, end to end.

        Requires the proof payload from Identities.createDomainProofPayload to already be hosted at https://<host>/.well-known/demos-cci.txt.

        Example

        await demos.run.attest.domain("example.com")
        
          • (hostname, referralCode?, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • hostname: string

              The domain being claimed (e.g. "example.com"). A full URL is also accepted; only the host is used.

            • OptionalreferralCode: string

              Optional referral code for incentive points.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • ethos: ((payload: EthosWalletIdentity, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Link an Ethos wallet identity to the connected wallet, end to end.

        Example

        await demos.run.attest.ethos({
        chain: "evm",
        subchain: "mainnet",
        address: "0x...",
        score: 1600,
        lastSyncedAt: new Date().toISOString(),
        })
          • (payload, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • payload: EthosWalletIdentity

              The Ethos wallet identity data to link.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • github: ((proof: GithubProof, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Link a GitHub identity to the connected wallet, end to end.

        Example

        await demos.run.attest.github(
        "https://gist.github.com/user/abc123",
        )
          • (proof, referralCode?, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • proof: GithubProof

              The GitHub gist/raw proof URL.

            • OptionalreferralCode: string

              Optional referral code for incentive points.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • humanpassport: ((payload: HumanPassportIdentityData, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Link a Human Passport identity to the connected wallet, end to end.

        Example

        await demos.run.attest.humanpassport({
        address: "0x...",
        verificationMethod: "api",
        })
          • (payload, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • payload: HumanPassportIdentityData

              The Human Passport identity data to link.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • nomis: ((payload: NomisWalletIdentity, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Link a Nomis wallet identity to the connected wallet, end to end.

        Example

        await demos.run.attest.nomis({
        walletAddress: "0x...",
        chain: "evm",
        subchain: "mainnet",
        score: 42,
        })
          • (payload, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • payload: NomisWalletIdentity

              The Nomis wallet identity data to link.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • pqc: ((algorithms?: PQCAlgorithm[] | "all", opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Bind post-quantum (PQC) identities to the connected wallet, end to end.

        Generates the requested PQC keypairs, signs each address with the wallet's ed25519 key, and links them on the GCR.

        Example

        // Bind every supported PQC algorithm:
        await demos.run.attest.pqc()
        // Or a specific subset:
        await demos.run.attest.pqc(["ml-dsa-65"])
          • (algorithms?, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • algorithms: PQCAlgorithm[] | "all" = "all"

              The PQC algorithms to bind, or "all" (default) to bind every supported algorithm.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • removeEthos: ((payload: EthosIdentityRemoveData, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Remove an Ethos wallet identity from the connected wallet, end to end.

        Example

        await demos.run.attest.removeEthos({
        chain: "evm",
        subchain: "mainnet",
        address: "0x...",
        })
          • (payload, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • payload: EthosIdentityRemoveData

              The identifying data (chain, subchain, address) for the Ethos identity to remove.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • removeHumanpassport: ((address: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Remove a Human Passport identity from the connected wallet, end to end.

        Example

        await demos.run.attest.removeHumanpassport("0x...")
        
          • (address, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • address: string

              The EVM address of the Human Passport identity to remove.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • removeNomis: ((payload: NomisWalletIdentity, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Remove a Nomis wallet identity from the connected wallet, end to end.

        Example

        await demos.run.attest.removeNomis({
        walletAddress: "0x...",
        chain: "evm",
        subchain: "mainnet",
        })
          • (payload, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • payload: NomisWalletIdentity

              The Nomis wallet identity data identifying the identity to remove.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • removePqc: ((algorithms?: PQCAlgorithm[] | "all", opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Remove post-quantum (PQC) identities from the connected wallet, end to end.

        Example

        await demos.run.attest.removePqc()
        
          • (algorithms?, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • algorithms: PQCAlgorithm[] | "all" = "all"

              The PQC algorithms to remove, or "all" (default) to remove every supported algorithm.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • removeTlsn: ((context: TLSNIdentityContext, username: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Remove a web2 identity that was added via TLSNotary, end to end.

        Example

        await demos.run.attest.removeTlsn("github", "octocat")
        
          • (context, username, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • context: TLSNIdentityContext

              The platform context ("github", "discord", or "telegram").

            • username: string

              The username to remove.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • removeUd: ((domain: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Remove an Unstoppable Domain identity from the connected wallet, end to end.

        Example

        await demos.run.attest.removeUd("brad.crypto")
        
          • (domain, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • domain: string

              The UD domain to unlink (e.g. "brad.crypto").

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • removeWeb2: ((payload: {
            context: string;
            username: string;
        }, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Remove a web2 identity from the connected wallet, end to end.

        Example

        await demos.run.attest.removeWeb2({
        context: "github",
        username: "octocat",
        })
          • (payload, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • payload: {
                  context: string;
                  username: string;
              }

              The identity to unlink (context + username).

              • context: string
              • username: string
            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • removeXm: ((payload: XMCoreTargetIdentityPayload, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Remove a crosschain (XM) identity from the connected wallet, end to end.

        Example

        await demos.run.attest.removeXm({
        chain: "eth",
        subchain: "mainnet",
        targetAddress: "0x...",
        })
          • (payload, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • payload: XMCoreTargetIdentityPayload

              The crosschain identity to unlink.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • telegram: ((attestation: TelegramSignedAttestation, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Link a Telegram identity to the connected wallet, end to end.

        Example

        await demos.run.attest.telegram(signedAttestation)
        
          • (attestation, referralCode?, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • attestation: TelegramSignedAttestation

              The signed Telegram bot attestation.

            • OptionalreferralCode: string

              Optional referral code for incentive points.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • tlsn: ((context: TLSNIdentityContext, proof: TLSNotaryPresentation, recvHash: string, proofRanges: TLSNProofRanges, revealedRecv: number[], username: string, userId: string | number, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Link a web2 identity via a TLSNotary attestation, end to end.

        The proof and its associated fields come from a TLSNotary presentation over the platform's API (GitHub, Discord, or Telegram).

        Example

        await demos.run.attest.tlsn(
        "github",
        presentation,
        recvHash,
        proofRanges,
        revealedRecv,
        "octocat",
        583231,
        )
          • (context, proof, recvHash, proofRanges, revealedRecv, username, userId, referralCode?, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • context: TLSNIdentityContext

              The platform context ("github", "discord", or "telegram").

            • proof: TLSNotaryPresentation

              The TLSNotary presentation.

            • recvHash: string

              The hash of the proven received transcript.

            • proofRanges: TLSNProofRanges

              The revealed byte ranges of the transcript.

            • revealedRecv: number[]

              The revealed received transcript bytes.

            • username: string

              The username from the proven response.

            • userId: string | number

              The user id from the proven response.

            • OptionalreferralCode: string

              Optional referral code for incentive points.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • twitter: ((proof: `https://x.com/${string}/${string}`, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Link a Twitter/X identity to the connected wallet, end to end.

        Example

        await demos.run.attest.twitter("https://x.com/user/status/123")
        
          • (proof, referralCode?, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • proof: `https://x.com/${string}/${string}`

              The tweet proof URL.

            • OptionalreferralCode: string

              Optional referral code for incentive points.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • ud: ((signingAddress: string, signature: string, challenge: string, resolutionData: UnifiedDomainResolution, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Link an Unstoppable Domain identity to the connected wallet, end to end.

        The signing address must be the owner or an authorized address in the supplied UnifiedDomainResolution (resolve it first via Identities.resolveUDDomain), and must have signed the challenge.

        Example

        const resolution = await demos.abstraction.identities.resolveUDDomain(
        demos,
        "brad.crypto",
        )
        await demos.run.attest.ud(
        signingAddress,
        signature,
        challenge,
        resolution,
        )
          • (signingAddress, signature, challenge, resolutionData, referralCode?, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • signingAddress: string

              The address used to sign the challenge (owner or authorized on the domain).

            • signature: string

              The signature over the challenge message.

            • challenge: string

              The challenge message that was signed.

            • resolutionData: UnifiedDomainResolution

              The resolved domain data (owner, network, registry type, authorized addresses).

            • OptionalreferralCode: string

              Optional referral code for incentive points.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • xm: ((payload: InferFromSignaturePayload, referralCode?: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Link a crosschain (XM) identity from a signature, end to end.

        Example

        await demos.run.attest.xm({
        chain: "eth",
        subchain: "mainnet",
        targetAddress: "0x...",
        signature: "0x...",
        })
          • (payload, referralCode?, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • payload: InferFromSignaturePayload

              The signature-inference payload identifying the crosschain address to link.

            • OptionalreferralCode: string

              Optional referral code for incentive points.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

    • bridge: {
          submit: ((compiled: NativeBridgeOperationCompiled, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
      }

      Native bridge operation submission.

      • submit: ((compiled: NativeBridgeOperationCompiled, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Submit a compiled bridge operation as a nativeBridge transaction, end to end.

        NativeBridgeMethods.generateOperationTx signs the transaction (deriving nonce from the Demos instance); the shared runner then confirms it and (in "auto" mode) broadcasts it within the fee cap.

        Example

        // `compiled` comes back from the node's nativeBridge RPC:
        await demos.run.bridge.submit(compiled)
        // build + confirm only, broadcast later yourself:
        const r = await demos.run.bridge.submit(compiled, { confirm: "manual" })
        await demos.broadcast(r.validityData)
          • (compiled, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • compiled: NativeBridgeOperationCompiled

              The compiled bridge operation returned by the RPC.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

    • contracts: {
          at: (<T>(address: string, abi?: ContractABI) => Promise<ContractInstance<T>>);
          batch: (() => BatchBuilder);
          call: (<T>(contractAddress: string, method: string, args?: unknown[], options?: ContractCallOptions) => Promise<ContractCallResult<T>>);
          deploy: ((source: string, constructorArgs?: unknown[], options?: ContractDeployOptions) => Promise<ContractInstance<any>>);
          deployTemplate: ((templateName: string, params?: Record<string, unknown>) => Promise<ContractInstance<any>>);
          estimateGas: ((contractAddress: string, method: string, args?: unknown[]) => Promise<bigint>);
          getAvailableTemplates: (() => string[]);
      }

      Smart contracts — RPC-native, NOT fee-capped (see namespace docs).

      • at: (<T>(address: string, abi?: ContractABI) => Promise<ContractInstance<T>>)

        Get a handle to an already-deployed contract. Read-only; no tx.

          • <T>(address, abi?): Promise<ContractInstance<T>>
          • Type Parameters

            • T = unknown

            Parameters

            • address: string

              The contract address.

            • Optionalabi: ContractABI

              Optional ABI to type the instance.

            Returns Promise<ContractInstance<T>>

      • batch: (() => BatchBuilder)

        Start a batch of deploy/call operations (see DemosContracts.batch).

          • (): BatchBuilder
          • Returns BatchBuilder

      • call: (<T>(contractAddress: string, method: string, args?: unknown[], options?: ContractCallOptions) => Promise<ContractCallResult<T>>)

        Call a method on an existing contract by address.

        RPC-native (not fee-capped). Returns the raw ContractCallResult, not a ProgrammaticTxResult.

          • <T>(contractAddress, method, args?, options?): Promise<ContractCallResult<T>>
          • Type Parameters

            • T = unknown

            Parameters

            • contractAddress: string

              Target contract address.

            • method: string

              Method name to invoke.

            • Optionalargs: unknown[]

              Method arguments (default []).

            • Optionaloptions: ContractCallOptions

              Call options (gas, etc.).

            Returns Promise<ContractCallResult<T>>

      • deploy: ((source: string, constructorArgs?: unknown[], options?: ContractDeployOptions) => Promise<ContractInstance<any>>)

        Deploy a smart contract from source. Requires a connected wallet.

        RPC-native (not fee-capped). Returns the deployed ContractInstance, not a ProgrammaticTxResult.

        Example

        const c = await demos.run.contracts.deploy(source, [arg1, arg2])
        await demos.run.contracts.call(c.address, "transfer", [to, 100])
          • (source, constructorArgs?, options?): Promise<ContractInstance<any>>
          • Parameters

            • source: string

              Contract source code.

            • OptionalconstructorArgs: unknown[]

              Constructor arguments (default []).

            • Optionaloptions: ContractDeployOptions

              Deploy options (gas, etc.).

            Returns Promise<ContractInstance<any>>

      • deployTemplate: ((templateName: string, params?: Record<string, unknown>) => Promise<ContractInstance<any>>)

        Deploy a contract from a named template.

          • (templateName, params?): Promise<ContractInstance<any>>
          • Parameters

            • templateName: string

              Registered template name.

            • Optionalparams: Record<string, unknown>

              Template parameters.

            Returns Promise<ContractInstance<any>>

      • estimateGas: ((contractAddress: string, method: string, args?: unknown[]) => Promise<bigint>)

        Estimate gas for a contract call. Read-only; no tx.

          • (contractAddress, method, args?): Promise<bigint>
          • Parameters

            • contractAddress: string

              Target contract address.

            • method: string

              Method name.

            • Optionalargs: unknown[]

              Method arguments (default []).

            Returns Promise<bigint>

      • getAvailableTemplates: (() => string[])

        List the available contract template names.

          • (): string[]
          • Returns string[]

    • d402: {
          pay: ((requirement: D402PaymentRequirement, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
      }

      d402 payments.

      • pay: ((requirement: D402PaymentRequirement, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Settle an HTTP 402 payment requirement, end to end.

        Example

        const res = await fetch("/premium")
        if (res.status === 402) {
        const requirement = await res.json()
        // auto-broadcast within the 5 DEM fee cap:
        await demos.run.d402.pay(requirement)
        }
          • (requirement, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • requirement: D402PaymentRequirement

              Payment requirements from the 402 response (amount, recipient, resourceId, description).

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

    • demoswork: {
          submit: ((work: DemosWork, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
      }

      Demoswork workflow submission.

      • submit: ((work: DemosWork, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Submit an assembled DemosWork script as a demoswork transaction, end to end.

        prepareDemosWorkPayload serialises and signs the work; the shared runner then confirms it and (in "auto" mode) broadcasts it within the fee cap.

        Example

        import { DemosWork } from "@kynesyslabs/demosdk"
        const work = new DemosWork()
        // ... push steps / operations onto `work` ...
        // auto-broadcast within the fee cap:
        await demos.run.demoswork.submit(work)
        // build + confirm only, broadcast later yourself:
        const r = await demos.run.demoswork.submit(work, { confirm: "manual" })
        await demos.broadcast(r.validityData)
          • (work, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • work: DemosWork

              The assembled DemosWork script to execute.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

    • escrow: {
          claim: ((platform: "github" | "twitter" | "telegram", username: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          refund: ((platform: "github" | "twitter" | "telegram", username: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          send: ((platform: "github" | "twitter" | "telegram", username: string, amount: number | bigint, options?: {
              expiryDays?: number;
              message?: string;
          }, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
      }

      Escrow to social identities (send / claim / refund).

      • claim: ((platform: "github" | "twitter" | "telegram", username: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Claim escrowed funds for a social identity you have linked, end to end.

        Example

        await demos.run.escrow.claim("twitter", "@bob")
        
          • (platform, username, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • platform: "github" | "twitter" | "telegram"

              Social platform ("twitter", "github", "telegram").

            • username: string

              Username to claim for.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • refund: ((platform: "github" | "twitter" | "telegram", username: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Refund an expired escrow back to the original depositor, end to end.

        Example

        await demos.run.escrow.refund("twitter", "@unclaimed_user")
        
          • (platform, username, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • platform: "github" | "twitter" | "telegram"

              Social platform ("twitter", "github", "telegram").

            • username: string

              Username whose expired escrow to refund.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • send: ((platform: "github" | "twitter" | "telegram", username: string, amount: number | bigint, options?: {
            expiryDays?: number;
            message?: string;
        }, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Send DEM to a social-identity escrow, end to end.

        P4 dual-input amount: bigint OS (preferred) or number DEM (legacy, auto-converted). Sub-DEM precision against a pre-fork node throws.

        Example

        import { denomination } from "@kynesyslabs/demosdk"
        // auto-broadcast within the 5 DEM fee cap:
        await demos.run.escrow.send(
        "twitter", "@bob", denomination.demToOs(100),
        { expiryDays: 30, message: "Welcome to Demos!" },
        )
        // build + confirm only, broadcast later yourself:
        const r = await demos.run.escrow.send(
        "twitter", "@bob", 100n, undefined, { confirm: "manual" },
        )
        await demos.broadcast(r.validityData)
          • (platform, username, amount, options?, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • platform: "github" | "twitter" | "telegram"

              Social platform ("twitter", "github", "telegram").

            • username: string

              Username on that platform (e.g., "@bob").

            • amount: number | bigint

              DEM number (legacy) or OS bigint (preferred).

            • Optionaloptions: {
                  expiryDays?: number;
                  message?: string;
              }

              Optional escrow parameters (expiry, memo).

              • OptionalexpiryDays?: number
              • Optionalmessage?: string
            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

    • governance: {
          propose: ((params: ProposeNetworkUpgradeParams, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          vote: ((proposalId: string, approve: boolean, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
      }

      Network-upgrade governance (propose / vote).

      • propose: ((params: ProposeNetworkUpgradeParams, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Submit a network-upgrade proposal, end to end.

        Example

        await demos.run.governance.propose({
        proposalId: crypto.randomUUID(),
        proposedParameters: { blockTimeMs: 5000 },
        rationale: "Reduce block time for lower latency.",
        effectiveAtBlock: 1_000_000,
        })
          • (params, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • params: ProposeNetworkUpgradeParams

              Proposal fields (id, parameters, rationale, activation block).

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • vote: ((proposalId: string, approve: boolean, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Cast a vote on a pending network-upgrade proposal, end to end. The vote is final and non-revocable.

        Example

        await demos.run.governance.vote(proposalId, true) // yes
        await demos.run.governance.vote(proposalId, false) // no
          • (proposalId, approve, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • proposalId: string

              The proposal to vote on.

            • approve: boolean

              true to approve, false to reject.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

    • ipfs: {
          add: ((content: string | Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>, addOptions?: AddOptionsWithCharges, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          pin: ((cid: string, pinOptions?: PinOptionsWithCharges, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          unpin: ((cid: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
      }

      IPFS storage (add / pin / unpin).

      • add: ((content: string | Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>, addOptions?: AddOptionsWithCharges, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Upload content to IPFS (and auto-pin it), end to end.

        Example

        // auto-broadcast within the 5 DEM fee cap:
        await demos.run.ipfs.add("hello world", { filename: "hello.txt" })

        // with a signed cost ceiling from a quote:
        const quote = await demos.ipfs.quote(bytes.length, "IPFS_ADD")
        await demos.run.ipfs.add(bytes, {
        customCharges: IPFSOperations.quoteToCustomCharges(quote),
        })
          • (content, addOptions?, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • content: string | Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>

              Content to upload (Buffer, Uint8Array or string).

            • OptionaladdOptions: AddOptionsWithCharges

              Filename, metadata and optional custom charges.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • pin: ((cid: string, pinOptions?: PinOptionsWithCharges, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Pin an existing CID to the sender's account, end to end.

        Example

        await demos.run.ipfs.pin("QmExampleCID...")
        
          • (cid, pinOptions?, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • cid: string

              The Content Identifier to pin (CIDv0 or CIDv1).

            • OptionalpinOptions: PinOptionsWithCharges

              Duration, metadata, fileSize and optional custom charges.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • unpin: ((cid: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Remove a pin from the sender's account, end to end.

        Example

        await demos.run.ipfs.unpin("QmExampleCID...")
        
          • (cid, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • cid: string

              The Content Identifier to unpin (CIDv0 or CIDv1).

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

    • pay: ((to: string, amount: number | bigint, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

      Send native DEMOS tokens to an address, end to end.

      Example

      import { denomination } from "@kynesyslabs/demosdk"
      // auto-broadcast within the 5 DEM fee cap:
      await demos.run.pay("0x...", denomination.demToOs(100))
      // build + confirm only, broadcast later yourself:
      const r = await demos.run.pay("0x...", 100n, { confirm: "manual" })
      await demos.broadcast(r.validityData)
        • (to, amount, opts?): Promise<ProgrammaticTxResult>
        • Parameters

          • to: string

            Receiver address (0x-prefixed hex).

          • amount: number | bigint

            DEM number (legacy) or OS bigint (preferred).

          • Optionalopts: ProgrammaticTxOptions

            Fee ceiling / confirmation strategy / wait behaviour.

          Returns Promise<ProgrammaticTxResult>

    • storage: {
          program: ((payload: StorageProgramPayload, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          store: ((bytes: Uint8Array<ArrayBufferLike>, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
      }

      Binary storage and storage programs.

      • program: ((payload: StorageProgramPayload, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Sign and submit a storage program, end to end.

        Example

        const r = await demos.run.storage.program({
        storageAddress: "0x...",
        // …program payload fields
        })
          • (payload, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • payload: StorageProgramPayload

              The storage program payload to sign (must carry a storageAddress).

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • store: ((bytes: Uint8Array<ArrayBufferLike>, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Store binary data on the blockchain, end to end.

        Example

        const bytes = new TextEncoder().encode("hello world")
        // auto-broadcast within the 5 DEM fee cap:
        await demos.run.storage.store(bytes)
        // build + confirm only, broadcast later yourself:
        const r = await demos.run.storage.store(bytes, { confirm: "manual" })
        await demos.broadcast(r.validityData)
          • (bytes, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • bytes: Uint8Array<ArrayBufferLike>

              The binary data to store in the sender's account.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

    • tokens: {
          approve: ((tokenAddress: string, spender: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          burn: ((tokenAddress: string, from: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          callMethod: ((tokenAddress: string, method: string, params: unknown[], opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          create: ((params: TokenCreationParams, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          grantPermissions: ((tokenAddress: string, address: string, permissions: string[], opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          mint: ((tokenAddress: string, to: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          pause: ((tokenAddress: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          revokePermissions: ((tokenAddress: string, address: string, permissions: string[], opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          transfer: ((tokenAddress: string, to: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          transferFrom: ((tokenAddress: string, from: string, to: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          transferOwnership: ((tokenAddress: string, newOwner: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          unpause: ((tokenAddress: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          upgradeScript: ((tokenAddress: string, newCode: string, newMethods: TokenScriptMethod[], newHooks: TokenHookType[], opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
      }

      Token creation and execution.

      • approve: ((tokenAddress: string, spender: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Approve a spender to move tokens on your behalf, end to end.

          • (tokenAddress, spender, amount, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • tokenAddress: string

              Token contract address.

            • spender: string

              Spender address being granted the allowance.

            • amount: string

              Amount to approve (bigint-valued decimal string).

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • burn: ((tokenAddress: string, from: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Burn tokens from an address, end to end.

          • (tokenAddress, from, amount, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • tokenAddress: string

              Token contract address.

            • from: string

              Address to burn tokens from.

            • amount: string

              Amount to burn (bigint-valued decimal string).

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • callMethod: ((tokenAddress: string, method: string, params: unknown[], opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Call a custom script method on the token, end to end.

          • (tokenAddress, method, params, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • tokenAddress: string

              Token contract address.

            • method: string

              Method name to invoke.

            • params: unknown[]

              Method parameters.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • create: ((params: TokenCreationParams, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Deploy a new token, end to end.

        Example

        const r = await demos.run.tokens.create({
        name: "My Token",
        ticker: "MYT",
        decimals: 18,
        initialSupply: "1000000",
        })
        console.log(r.transaction.content.to) // derived token address
          • (params, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • params: TokenCreationParams

              Token creation parameters (name, ticker, decimals, initial supply, optional script/ACL).

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • grantPermissions: ((tokenAddress: string, address: string, permissions: string[], opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Grant ACL permissions to an address, end to end.

          • (tokenAddress, address, permissions, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • tokenAddress: string

              Token contract address.

            • address: string

              Address being granted the permissions.

            • permissions: string[]

              Permissions to grant.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • mint: ((tokenAddress: string, to: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Mint new tokens to an address, end to end.

          • (tokenAddress, to, amount, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • tokenAddress: string

              Token contract address.

            • to: string

              Recipient of the minted tokens.

            • amount: string

              Amount to mint (bigint-valued decimal string).

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • pause: ((tokenAddress: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Pause all token operations, end to end.

          • (tokenAddress, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • tokenAddress: string

              Token contract address.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • revokePermissions: ((tokenAddress: string, address: string, permissions: string[], opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Revoke ACL permissions from an address, end to end.

          • (tokenAddress, address, permissions, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • tokenAddress: string

              Token contract address.

            • address: string

              Address the permissions are revoked from.

            • permissions: string[]

              Permissions to revoke.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • transfer: ((tokenAddress: string, to: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Transfer tokens to another address, end to end.

        Example

        // auto-broadcast within the 5 DEM fee cap:
        await demos.run.tokens.transfer("0xToken...", "0xTo...", "1000")
        // build + confirm only, broadcast later yourself:
        const r = await demos.run.tokens.transfer(
        "0xToken...", "0xTo...", "1000", { confirm: "manual" },
        )
        await demos.broadcast(r.validityData)
          • (tokenAddress, to, amount, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • tokenAddress: string

              Token contract address.

            • to: string

              Recipient address.

            • amount: string

              Amount to transfer (bigint-valued decimal string).

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • transferFrom: ((tokenAddress: string, from: string, to: string, amount: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Transfer tokens from one address to another using an existing allowance, end to end.

          • (tokenAddress, from, to, amount, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • tokenAddress: string

              Token contract address.

            • from: string

              Owner address the tokens are moved from.

            • to: string

              Recipient address.

            • amount: string

              Amount to transfer (bigint-valued decimal string).

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • transferOwnership: ((tokenAddress: string, newOwner: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Transfer ownership of the token to a new owner, end to end.

          • (tokenAddress, newOwner, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • tokenAddress: string

              Token contract address.

            • newOwner: string

              Address of the new owner.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • unpause: ((tokenAddress: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Resume a paused token, end to end.

          • (tokenAddress, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • tokenAddress: string

              Token contract address.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • upgradeScript: ((tokenAddress: string, newCode: string, newMethods: TokenScriptMethod[], newHooks: TokenHookType[], opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Upgrade the token's on-chain script, end to end.

          • (tokenAddress, newCode, newMethods, newHooks, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • tokenAddress: string

              Token contract address.

            • newCode: string

              New script code.

            • newMethods: TokenScriptMethod[]

              New method definitions to install.

            • newHooks: TokenHookType[]

              New hooks to activate.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

    • transfer: ((to: string, amount: number | bigint, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

      Alias of pay. Same dual-input amount semantics.

        • (to, amount, opts?): Promise<ProgrammaticTxResult>
        • Parameters

          • to: string

            Receiver address (0x-prefixed hex).

          • amount: number | bigint

            DEM number (legacy) or OS bigint (preferred).

          • Optionalopts: ProgrammaticTxOptions

            Fee ceiling / confirmation strategy / wait behaviour.

          Returns Promise<ProgrammaticTxResult>

    • validator: {
          exit: ((opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          stake: ((amount: string, connectionUrl: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
          unstake: ((opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
      }

      Validator staking (stake / unstake / exit).

      • exit: ((opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Complete validator exit, end to end. Only accepted by the network once the unstake timelock has elapsed (unstake_available_at <= currentBlock).

        Example

        await demos.run.validator.exit()
        
          • (opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • stake: ((amount: string, connectionUrl: string, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Stake toward validator registration, or top up an existing stake, end to end.

        Example

        import { denomination } from "@kynesyslabs/demosdk"
        // register + auto-broadcast within the 5 DEM fee cap:
        await demos.run.validator.stake(
        denomination.demToOs(1000).toString(),
        "https://my-validator.example",
        )
        // build + confirm only, broadcast later yourself:
        const r = await demos.run.validator.stake(
        "1000000000",
        "https://my-validator.example",
        { confirm: "manual" },
        )
        await demos.broadcast(r.validityData)
          • (amount, connectionUrl, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • amount: string

              Stake amount as a non-negative bigint-encoded string (OS).

            • connectionUrl: string

              Validator's public endpoint (required on first stake; used to reach the node).

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

      • unstake: ((opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Arm the unstake lock, end to end. Starts the timelock after which exit becomes accepted by the network.

        Example

        await demos.run.validator.unstake()
        
          • (opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

    • xm: {
          submit: ((xmScript: XMScript, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>);
      }

      Cross-chain (XM) operation submission.

      • submit: ((xmScript: XMScript, opts?: ProgrammaticTxOptions) => Promise<ProgrammaticTxResult>)

        Submit a fully-built XMScript as a crosschainOperation transaction, end to end.

        prepareXMPayload signs the transaction; the shared runner then confirms it and (in "auto" mode) broadcasts it within the fee cap.

        Example

        import { prepareXMScript } from "@kynesyslabs/demosdk"
        const xmScript = prepareXMScript({ chain: "eth", ... })
        // auto-broadcast within the fee cap:
        await demos.run.xm.submit(xmScript)
        // build + confirm only, broadcast later yourself:
        const r = await demos.run.xm.submit(xmScript, { confirm: "manual" })
        await demos.broadcast(r.validityData)
          • (xmScript, opts?): Promise<ProgrammaticTxResult>
          • Parameters

            • xmScript: XMScript

              The assembled cross-chain script to execute.

            • Optionalopts: ProgrammaticTxOptions

              Fee ceiling / confirmation strategy / wait behaviour.

            Returns Promise<ProgrammaticTxResult>

    • Defined in src/websdk/programmatic/ProgrammaticTx.ts:28

Settings

Member Visibility
@kynesyslabs/demosdk
  • Loading...

Generated using TypeDoc