Socket
Socket
Sign inDemoInstall

@clockwork-xyz/sdk

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clockwork-xyz/sdk - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4

18

lib/ClockworkProvider.d.ts
import * as anchor from "@coral-xyz/anchor";
import { Connection, PublicKey, TransactionInstruction } from "@solana/web3.js";
import { ConfirmOptions, Connection, PublicKey, Transaction, TransactionInstruction } from "@solana/web3.js";
import { ThreadProgram } from "./programs/thread/types";

@@ -7,7 +7,21 @@ import { NetworkProgram } from "./programs/network/types";

import { ThreadSettingsInput, TriggerInput } from "./models";
/**
* Wallet interface for objects that can be used to sign provider transactions.
*/
export interface ClockworkProviderWallet {
signTransaction(tx: Transaction): Promise<Transaction>;
signAllTransactions(txs: Transaction[]): Promise<Transaction[]>;
publicKey: PublicKey;
}
declare class ClockworkProvider {
threadProgram: anchor.Program<ThreadProgram>;
networkProgram: anchor.Program<NetworkProgram>;
constructor(wallet: anchor.Wallet, connection: Connection);
constructor(wallet: ClockworkProviderWallet, connection: Connection, opts?: ConfirmOptions);
/**
* Build a ClockworkProvider from an AnchorProvider
*
* @param authority thread authority
*/
static fromAnchorProvider(provider: anchor.AnchorProvider): ClockworkProvider;
/**
* Get Thread PDA. Returns the public key and bump.

@@ -14,0 +28,0 @@ *

15

lib/ClockworkProvider.js

@@ -44,6 +44,4 @@ "use strict";

class ClockworkProvider {
constructor(wallet, connection) {
const provider = new anchor.AnchorProvider(connection, wallet, {
commitment: "confirmed",
});
constructor(wallet, connection, opts = anchor.AnchorProvider.defaultOptions()) {
const provider = new anchor.AnchorProvider(connection, wallet, opts);
this.threadProgram = new anchor.Program(idl_json_1.default, idl_json_1.default.metadata.address, provider);

@@ -53,2 +51,11 @@ this.networkProgram = new anchor.Program(idl_json_2.default, idl_json_2.default.metadata.address, provider);

/**
* Build a ClockworkProvider from an AnchorProvider
*
* @param authority thread authority
*/
static fromAnchorProvider(provider) {
const clockworkProvider = new ClockworkProvider(provider.wallet, provider.connection, provider.opts);
return clockworkProvider;
}
/**
* Get Thread PDA. Returns the public key and bump.

@@ -55,0 +62,0 @@ *

{
"name": "@clockwork-xyz/sdk",
"author": "Clockwork",
"version": "0.2.3",
"version": "0.2.4",
"description": "Clockwork Typescript SDK",

@@ -6,0 +6,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc