added cacheTask

cache task


cacheTask now uses job instead of task[]


proto docs


docs


removed buffer from valueTask


added big field to math & value tasks


docs(website): add vrf request randomness code sample


docs(protos): updated proto comments
This commit is contained in:
Conner Gallagher 2022-06-15 20:09:08 -06:00
parent 436e9080f4
commit c99d50f8eb
4 changed files with 1110 additions and 957 deletions

View File

@ -57,8 +57,7 @@ message OracleJob {
optional AggregationMethod aggregation_method = 2; optional AggregationMethod aggregation_method = 2;
} }
// Returns the median of all the results returned by the provided subtasks and subjobs. Nested // Returns the median of all the results returned by the provided subtasks and subjobs. Nested tasks must return a Number.
// tasks must return a Number.
message MedianTask { message MedianTask {
// A list of subtasks to process and produce a list of result values. // A list of subtasks to process and produce a list of result values.
repeated Task tasks = 1; repeated Task tasks = 1;
@ -90,6 +89,8 @@ message OracleJob {
double value = 1; double value = 1;
// Specifies an aggregatorr to pull the value of. // Specifies an aggregatorr to pull the value of.
string aggregator_pubkey = 2; string aggregator_pubkey = 2;
// A stringified big.js. `Accepts variable expansion syntax.`
string big = 3;
} }
} }
@ -126,11 +127,12 @@ message OracleJob {
string aggregator_pubkey = 2; string aggregator_pubkey = 2;
// A job whose result is computed before dividing our numerical input by that result. // A job whose result is computed before dividing our numerical input by that result.
OracleJob job = 3; OracleJob job = 3;
// A stringified big.js. `Accepts variable expansion syntax.`
string big = 4;
} }
} }
// This task will multiply a numerical input by a scalar value or by another // This task will multiply a numerical input by a scalar value or by another aggregator.
// aggregate.
message MultiplyTask { message MultiplyTask {
oneof Multiple { oneof Multiple {
// Specifies a scalar to multiply by. // Specifies a scalar to multiply by.
@ -139,6 +141,8 @@ message OracleJob {
string aggregator_pubkey = 2; string aggregator_pubkey = 2;
// A job whose result is computed before multiplying our numerical input by that result. // A job whose result is computed before multiplying our numerical input by that result.
OracleJob job = 3; OracleJob job = 3;
// A stringified big.js. `Accepts variable expansion syntax.`
string big = 4;
} }
} }
@ -152,6 +156,8 @@ message OracleJob {
string aggregator_pubkey = 2; string aggregator_pubkey = 2;
// A job whose result is computed before adding our numerical input by that result. // A job whose result is computed before adding our numerical input by that result.
OracleJob job = 3; OracleJob job = 3;
// A stringified big.js. `Accepts variable expansion syntax.`
string big = 4;
} }
} }
@ -165,6 +171,8 @@ message OracleJob {
string aggregator_pubkey = 2; string aggregator_pubkey = 2;
// A job whose result is computed before subtracting our numerical input by that result. // A job whose result is computed before subtracting our numerical input by that result.
OracleJob job = 3; OracleJob job = 3;
// A stringified big.js. `Accepts variable expansion syntax.`
string big = 4;
} }
} }
@ -250,6 +258,8 @@ message OracleJob {
double scalar = 1; double scalar = 1;
// Take the working value to the exponent of the aggregators value. // Take the working value to the exponent of the aggregators value.
string aggregator_pubkey = 2; string aggregator_pubkey = 2;
// A stringified big.js. `Accepts variable expansion syntax.`
string big = 3;
} }
} }
@ -274,13 +284,17 @@ message OracleJob {
optional string perp_market_address = 1; optional string perp_market_address = 1;
} }
// Fetch the simulated price for a swap on JupiterSwap.
message JupiterSwapTask { message JupiterSwapTask {
// The input token address.
optional string in_token_address = 1; optional string in_token_address = 1;
// The output token address.
optional string out_token_address = 2; optional string out_token_address = 2;
// The amount of tokens to swap.
optional double base_amount = 3; optional double base_amount = 3;
} }
// Fetch the current price of a perpetual market // Fetch the current price of a perpetual market.
message PerpMarketTask { message PerpMarketTask {
oneof MarketAddress { oneof MarketAddress {
// Market address for a mango perpetual market. A full list can be found here: https://github.com/blockworks-foundation/mango-client-v3/blob/main/src/ids.json // Market address for a mango perpetual market. A full list can be found here: https://github.com/blockworks-foundation/mango-client-v3/blob/main/src/ids.json
@ -294,14 +308,14 @@ message OracleJob {
} }
} }
// Fetch the current price of a Solana oracle protocol // Fetch the current price of a Solana oracle protocol.
message OracleTask { message OracleTask {
oneof AggregatorAddress { oneof AggregatorAddress {
// Mainnet address of a Switchboard V2 feed. Switchboard is decentralized and allows anyone to build their own feed. A small subset of feeds is available here: https://switchboard.xyz/explorer // Mainnet address of a Switchboard V2 feed. Switchboard is decentralized and allows anyone to build their own feed. A small subset of feeds is available here: https://switchboard.xyz/explorer
string switchboard_address = 1; string switchboard_address = 1;
// Mainnet address for a Pyth feed. A full list can be found here: https://pyth.network/markets/ // Mainnet address for a Pyth feed. A full list can be found here: https://pyth.network/markets/
string pyth_address = 2; string pyth_address = 2;
// Devnet address for a Chainlink feed. A full list can be found here: https://docs.chain.link/docs/solana/data-feeds-solana // Mainnet address for a Chainlink feed. A full list can be found here: https://docs.chain.link/docs/solana/data-feeds-solana
string chainlink_address = 3; string chainlink_address = 3;
} }
// Value (as a percentage) that the lower bound confidence interval is of the actual value. // Value (as a percentage) that the lower bound confidence interval is of the actual value.
@ -317,94 +331,148 @@ message OracleJob {
optional string account_address = 2; optional string account_address = 2;
} }
message DefiKingdomsTask {
message Token {
optional string address = 1;
optional int32 decimals = 2;
}
optional string provider = 1;
optional Token in_token = 2;
optional Token out_token = 3;
}
// Fetch the current transactions per second.
message TpsTask {} message TpsTask {}
// Fetch the JSON representation of an SPL Stake Pool account.
message SplStakePoolTask { message SplStakePoolTask {
// The pubkey of the SPL Stake Pool.`` // The pubkey of the SPL Stake Pool.
optional string pubkey = 1; optional string pubkey = 1;
} }
// Fetch the JSON representation of an SPL token mint.
message SplTokenParseTask { message SplTokenParseTask {
oneof AccountAddress { oneof AccountAddress {
// The publicKey of a token account to fetch the mintInfo for.
string token_account_address = 1; string token_account_address = 1;
// The publicKey of the token mint address.
string mint_address = 2; string mint_address = 2;
} }
} }
// Fetch the swap price from DefiKingdoms.
message DefiKingdomsTask {
message Token {
// The address of the token.
optional string address = 1;
// The number of decimal places for a token.
optional int32 decimals = 2;
}
// The RPC provider to use for the swap.
optional string provider = 1;
// The input token of the swap.
optional Token in_token = 2;
// The output token of the swap.
optional Token out_token = 3;
}
// Fetch the swap price from UniSwap.
message UniswapExchangeRateTask { message UniswapExchangeRateTask {
// The input token address.
optional string in_token_address = 1; optional string in_token_address = 1;
// The output token address.
optional string out_token_address = 2; optional string out_token_address = 2;
// The amount of tokens to swap.
optional double in_token_amount = 3; optional double in_token_amount = 3;
// The allowable slippage in percent for the swap.
optional double slippage = 4; optional double slippage = 4;
// The RPC provider to use for the swap.
optional string provider = 5; optional string provider = 5;
} }
// Fetch the swap price from SushiSwap.
message SushiswapExchangeRateTask { message SushiswapExchangeRateTask {
// The input token address.
optional string in_token_address = 1; optional string in_token_address = 1;
// The output token address.
optional string out_token_address = 2; optional string out_token_address = 2;
// The amount of tokens to swap.
optional double in_token_amount = 3; optional double in_token_amount = 3;
// The allowable slippage in percent for the swap.
optional double slippage = 4; optional double slippage = 4;
// The RPC provider to use for the swap.
optional string provider = 5; optional string provider = 5;
} }
// Fetch the swap price from PancakeSwap.
message PancakeswapExchangeRateTask { message PancakeswapExchangeRateTask {
// The input token address.
optional string in_token_address = 1; optional string in_token_address = 1;
// The output token address.
optional string out_token_address = 2; optional string out_token_address = 2;
// The amount of tokens to swap.
optional double in_token_amount = 3; optional double in_token_amount = 3;
// The allowable slippage in percent for the swap.
optional double slippage = 4; optional double slippage = 4;
// The RPC provider to use for the swap.
optional string provider = 5; optional string provider = 5;
} }
// Execute a job and store the result in a variable to reference later.
message CacheTask { message CacheTask {
optional string name = 1; message CacheItem {
enum Method { // The name of the variable to store in cache to reference later with `${VARIABLE_NAME}`.
METHOD_GET = 0; optional string variable_name = 1;
METHOD_SET = 1; // The OracleJob to execute to yield the value to store in cache.
optional OracleJob job = 2;
} }
optional Method method = 2; // A list of cached variables to reference in the job with `${VARIABLE_NAME}`.
repeated CacheItem cache_items = 1;
} }
// Return the difference between an oracle's clock and the current timestamp at `SYSVAR_CLOCK_PUBKEY`.
message SysclockOffsetTask {} message SysclockOffsetTask {}
message MarinadeStateTask {} message MarinadeStateTask {}
// Fetch the account data in a stringified buffer format.
message SolanaAccountDataFetchTask { message SolanaAccountDataFetchTask {
// The on-chain account to fetch the account data from.
optional string pubkey = 1; optional string pubkey = 1;
} }
// Return the deserialized value from a stringified buffer.
message BufferLayoutParseTask { message BufferLayoutParseTask {
// The buffer offset to start deserializing from.
optional uint32 offset = 1; optional uint32 offset = 1;
enum Endian { enum Endian {
LITTLE_ENDIAN = 0; LITTLE_ENDIAN = 0;
BIG_ENDIAN = 1; BIG_ENDIAN = 1;
} }
// The endianness of the stored value.
optional Endian endian = 2; optional Endian endian = 2;
enum BufferParseType { enum BufferParseType {
// A public key.
pubkey = 1; pubkey = 1;
// A boolean.
bool = 2; bool = 2;
// An 8-bit unsigned value.
u8 = 3; u8 = 3;
// An 8-bit signed value.
i8 = 4; i8 = 4;
// A 16-bit unsigned value.
u16 = 5; u16 = 5;
// A 16-bit signed value.
i16 = 6; i16 = 6;
// A 32-bit unsigned value.
u32 = 7; u32 = 7;
// A 32-bit signed value.
i32 = 8; i32 = 8;
// A 32-bit IEEE floating point value.
f32 = 9; f32 = 9;
// A 64-bit unsigned value.
u64 = 10; u64 = 10;
// A 64-bit signed value.
i64 = 11; i64 = 11;
// A 64-bit IEEE floating point value.
f64 = 12; f64 = 12;
// A 128-bit unsigned value.
u128 = 13; u128 = 13;
// A 128-bit signed value.
i128 = 14; i128 = 14;
} }
// The type of value to deserialize.
optional BufferParseType type = 3; optional BufferParseType type = 3;
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@switchboard-xyz/switchboard-v2", "name": "@switchboard-xyz/switchboard-v2",
"version": "0.0.110", "version": "0.0.111-beta.0",
"license": "MIT", "license": "MIT",
"author": "mitch@switchboard.xyz", "author": "mitch@switchboard.xyz",
"description": "API wrapper for intergating with the Switchboardv2 program", "description": "API wrapper for intergating with the Switchboardv2 program",

View File

@ -714,6 +714,9 @@ export namespace OracleJob {
/** ValueTask aggregatorPubkey */ /** ValueTask aggregatorPubkey */
aggregatorPubkey?: (string|null); aggregatorPubkey?: (string|null);
/** ValueTask big */
big?: (string|null);
} }
/** Represents a ValueTask. */ /** Represents a ValueTask. */
@ -731,8 +734,11 @@ export namespace OracleJob {
/** ValueTask aggregatorPubkey. */ /** ValueTask aggregatorPubkey. */
public aggregatorPubkey?: (string|null); public aggregatorPubkey?: (string|null);
/** ValueTask big. */
public big?: (string|null);
/** ValueTask Value. */ /** ValueTask Value. */
public Value?: ("value"|"aggregatorPubkey"); public Value?: ("value"|"aggregatorPubkey"|"big");
/** /**
* Creates a new ValueTask instance using the specified properties. * Creates a new ValueTask instance using the specified properties.
@ -1020,6 +1026,9 @@ export namespace OracleJob {
/** DivideTask job */ /** DivideTask job */
job?: (IOracleJob|null); job?: (IOracleJob|null);
/** DivideTask big */
big?: (string|null);
} }
/** Represents a DivideTask. */ /** Represents a DivideTask. */
@ -1040,8 +1049,11 @@ export namespace OracleJob {
/** DivideTask job. */ /** DivideTask job. */
public job?: (IOracleJob|null); public job?: (IOracleJob|null);
/** DivideTask big. */
public big?: (string|null);
/** DivideTask Denominator. */ /** DivideTask Denominator. */
public Denominator?: ("scalar"|"aggregatorPubkey"|"job"); public Denominator?: ("scalar"|"aggregatorPubkey"|"job"|"big");
/** /**
* Creates a new DivideTask instance using the specified properties. * Creates a new DivideTask instance using the specified properties.
@ -1125,6 +1137,9 @@ export namespace OracleJob {
/** MultiplyTask job */ /** MultiplyTask job */
job?: (IOracleJob|null); job?: (IOracleJob|null);
/** MultiplyTask big */
big?: (string|null);
} }
/** Represents a MultiplyTask. */ /** Represents a MultiplyTask. */
@ -1145,8 +1160,11 @@ export namespace OracleJob {
/** MultiplyTask job. */ /** MultiplyTask job. */
public job?: (IOracleJob|null); public job?: (IOracleJob|null);
/** MultiplyTask big. */
public big?: (string|null);
/** MultiplyTask Multiple. */ /** MultiplyTask Multiple. */
public Multiple?: ("scalar"|"aggregatorPubkey"|"job"); public Multiple?: ("scalar"|"aggregatorPubkey"|"job"|"big");
/** /**
* Creates a new MultiplyTask instance using the specified properties. * Creates a new MultiplyTask instance using the specified properties.
@ -1230,6 +1248,9 @@ export namespace OracleJob {
/** AddTask job */ /** AddTask job */
job?: (IOracleJob|null); job?: (IOracleJob|null);
/** AddTask big */
big?: (string|null);
} }
/** Represents an AddTask. */ /** Represents an AddTask. */
@ -1250,8 +1271,11 @@ export namespace OracleJob {
/** AddTask job. */ /** AddTask job. */
public job?: (IOracleJob|null); public job?: (IOracleJob|null);
/** AddTask big. */
public big?: (string|null);
/** AddTask Addition. */ /** AddTask Addition. */
public Addition?: ("scalar"|"aggregatorPubkey"|"job"); public Addition?: ("scalar"|"aggregatorPubkey"|"job"|"big");
/** /**
* Creates a new AddTask instance using the specified properties. * Creates a new AddTask instance using the specified properties.
@ -1335,6 +1359,9 @@ export namespace OracleJob {
/** SubtractTask job */ /** SubtractTask job */
job?: (IOracleJob|null); job?: (IOracleJob|null);
/** SubtractTask big */
big?: (string|null);
} }
/** Represents a SubtractTask. */ /** Represents a SubtractTask. */
@ -1355,8 +1382,11 @@ export namespace OracleJob {
/** SubtractTask job. */ /** SubtractTask job. */
public job?: (IOracleJob|null); public job?: (IOracleJob|null);
/** SubtractTask big. */
public big?: (string|null);
/** SubtractTask Subtraction. */ /** SubtractTask Subtraction. */
public Subtraction?: ("scalar"|"aggregatorPubkey"|"job"); public Subtraction?: ("scalar"|"aggregatorPubkey"|"job"|"big");
/** /**
* Creates a new SubtractTask instance using the specified properties. * Creates a new SubtractTask instance using the specified properties.
@ -2088,6 +2118,9 @@ export namespace OracleJob {
/** PowTask aggregatorPubkey */ /** PowTask aggregatorPubkey */
aggregatorPubkey?: (string|null); aggregatorPubkey?: (string|null);
/** PowTask big */
big?: (string|null);
} }
/** Represents a PowTask. */ /** Represents a PowTask. */
@ -2105,8 +2138,11 @@ export namespace OracleJob {
/** PowTask aggregatorPubkey. */ /** PowTask aggregatorPubkey. */
public aggregatorPubkey?: (string|null); public aggregatorPubkey?: (string|null);
/** PowTask big. */
public big?: (string|null);
/** PowTask Exponent. */ /** PowTask Exponent. */
public Exponent?: ("scalar"|"aggregatorPubkey"); public Exponent?: ("scalar"|"aggregatorPubkey"|"big");
/** /**
* Creates a new PowTask instance using the specified properties. * Creates a new PowTask instance using the specified properties.
@ -2800,207 +2836,6 @@ export namespace OracleJob {
public toJSON(): { [k: string]: any }; public toJSON(): { [k: string]: any };
} }
/** Properties of a DefiKingdomsTask. */
interface IDefiKingdomsTask {
/** DefiKingdomsTask provider */
provider?: (string|null);
/** DefiKingdomsTask inToken */
inToken?: (OracleJob.DefiKingdomsTask.IToken|null);
/** DefiKingdomsTask outToken */
outToken?: (OracleJob.DefiKingdomsTask.IToken|null);
}
/** Represents a DefiKingdomsTask. */
class DefiKingdomsTask implements IDefiKingdomsTask {
/**
* Constructs a new DefiKingdomsTask.
* @param [properties] Properties to set
*/
constructor(properties?: OracleJob.IDefiKingdomsTask);
/** DefiKingdomsTask provider. */
public provider: string;
/** DefiKingdomsTask inToken. */
public inToken?: (OracleJob.DefiKingdomsTask.IToken|null);
/** DefiKingdomsTask outToken. */
public outToken?: (OracleJob.DefiKingdomsTask.IToken|null);
/**
* Creates a new DefiKingdomsTask instance using the specified properties.
* @param [properties] Properties to set
* @returns DefiKingdomsTask instance
*/
public static create(properties?: OracleJob.IDefiKingdomsTask): OracleJob.DefiKingdomsTask;
/**
* Encodes the specified DefiKingdomsTask message. Does not implicitly {@link OracleJob.DefiKingdomsTask.verify|verify} messages.
* @param message DefiKingdomsTask message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: OracleJob.IDefiKingdomsTask, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified DefiKingdomsTask message, length delimited. Does not implicitly {@link OracleJob.DefiKingdomsTask.verify|verify} messages.
* @param message DefiKingdomsTask message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: OracleJob.IDefiKingdomsTask, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a DefiKingdomsTask message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns DefiKingdomsTask
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): OracleJob.DefiKingdomsTask;
/**
* Decodes a DefiKingdomsTask message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns DefiKingdomsTask
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): OracleJob.DefiKingdomsTask;
/**
* Verifies a DefiKingdomsTask message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a DefiKingdomsTask message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns DefiKingdomsTask
*/
public static fromObject(object: { [k: string]: any }): OracleJob.DefiKingdomsTask;
/**
* Creates a plain object from a DefiKingdomsTask message. Also converts values to other types if specified.
* @param message DefiKingdomsTask
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: OracleJob.DefiKingdomsTask, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this DefiKingdomsTask to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
}
namespace DefiKingdomsTask {
/** Properties of a Token. */
interface IToken {
/** Token address */
address?: (string|null);
/** Token decimals */
decimals?: (number|null);
}
/** Represents a Token. */
class Token implements IToken {
/**
* Constructs a new Token.
* @param [properties] Properties to set
*/
constructor(properties?: OracleJob.DefiKingdomsTask.IToken);
/** Token address. */
public address: string;
/** Token decimals. */
public decimals: number;
/**
* Creates a new Token instance using the specified properties.
* @param [properties] Properties to set
* @returns Token instance
*/
public static create(properties?: OracleJob.DefiKingdomsTask.IToken): OracleJob.DefiKingdomsTask.Token;
/**
* Encodes the specified Token message. Does not implicitly {@link OracleJob.DefiKingdomsTask.Token.verify|verify} messages.
* @param message Token message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: OracleJob.DefiKingdomsTask.IToken, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified Token message, length delimited. Does not implicitly {@link OracleJob.DefiKingdomsTask.Token.verify|verify} messages.
* @param message Token message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: OracleJob.DefiKingdomsTask.IToken, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a Token message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns Token
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): OracleJob.DefiKingdomsTask.Token;
/**
* Decodes a Token message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns Token
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): OracleJob.DefiKingdomsTask.Token;
/**
* Verifies a Token message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a Token message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns Token
*/
public static fromObject(object: { [k: string]: any }): OracleJob.DefiKingdomsTask.Token;
/**
* Creates a plain object from a Token message. Also converts values to other types if specified.
* @param message Token
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: OracleJob.DefiKingdomsTask.Token, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this Token to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
}
}
/** Properties of a TpsTask. */ /** Properties of a TpsTask. */
interface ITpsTask { interface ITpsTask {
} }
@ -3274,6 +3109,207 @@ export namespace OracleJob {
public toJSON(): { [k: string]: any }; public toJSON(): { [k: string]: any };
} }
/** Properties of a DefiKingdomsTask. */
interface IDefiKingdomsTask {
/** DefiKingdomsTask provider */
provider?: (string|null);
/** DefiKingdomsTask inToken */
inToken?: (OracleJob.DefiKingdomsTask.IToken|null);
/** DefiKingdomsTask outToken */
outToken?: (OracleJob.DefiKingdomsTask.IToken|null);
}
/** Represents a DefiKingdomsTask. */
class DefiKingdomsTask implements IDefiKingdomsTask {
/**
* Constructs a new DefiKingdomsTask.
* @param [properties] Properties to set
*/
constructor(properties?: OracleJob.IDefiKingdomsTask);
/** DefiKingdomsTask provider. */
public provider: string;
/** DefiKingdomsTask inToken. */
public inToken?: (OracleJob.DefiKingdomsTask.IToken|null);
/** DefiKingdomsTask outToken. */
public outToken?: (OracleJob.DefiKingdomsTask.IToken|null);
/**
* Creates a new DefiKingdomsTask instance using the specified properties.
* @param [properties] Properties to set
* @returns DefiKingdomsTask instance
*/
public static create(properties?: OracleJob.IDefiKingdomsTask): OracleJob.DefiKingdomsTask;
/**
* Encodes the specified DefiKingdomsTask message. Does not implicitly {@link OracleJob.DefiKingdomsTask.verify|verify} messages.
* @param message DefiKingdomsTask message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: OracleJob.IDefiKingdomsTask, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified DefiKingdomsTask message, length delimited. Does not implicitly {@link OracleJob.DefiKingdomsTask.verify|verify} messages.
* @param message DefiKingdomsTask message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: OracleJob.IDefiKingdomsTask, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a DefiKingdomsTask message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns DefiKingdomsTask
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): OracleJob.DefiKingdomsTask;
/**
* Decodes a DefiKingdomsTask message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns DefiKingdomsTask
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): OracleJob.DefiKingdomsTask;
/**
* Verifies a DefiKingdomsTask message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a DefiKingdomsTask message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns DefiKingdomsTask
*/
public static fromObject(object: { [k: string]: any }): OracleJob.DefiKingdomsTask;
/**
* Creates a plain object from a DefiKingdomsTask message. Also converts values to other types if specified.
* @param message DefiKingdomsTask
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: OracleJob.DefiKingdomsTask, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this DefiKingdomsTask to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
}
namespace DefiKingdomsTask {
/** Properties of a Token. */
interface IToken {
/** Token address */
address?: (string|null);
/** Token decimals */
decimals?: (number|null);
}
/** Represents a Token. */
class Token implements IToken {
/**
* Constructs a new Token.
* @param [properties] Properties to set
*/
constructor(properties?: OracleJob.DefiKingdomsTask.IToken);
/** Token address. */
public address: string;
/** Token decimals. */
public decimals: number;
/**
* Creates a new Token instance using the specified properties.
* @param [properties] Properties to set
* @returns Token instance
*/
public static create(properties?: OracleJob.DefiKingdomsTask.IToken): OracleJob.DefiKingdomsTask.Token;
/**
* Encodes the specified Token message. Does not implicitly {@link OracleJob.DefiKingdomsTask.Token.verify|verify} messages.
* @param message Token message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: OracleJob.DefiKingdomsTask.IToken, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified Token message, length delimited. Does not implicitly {@link OracleJob.DefiKingdomsTask.Token.verify|verify} messages.
* @param message Token message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: OracleJob.DefiKingdomsTask.IToken, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a Token message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns Token
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): OracleJob.DefiKingdomsTask.Token;
/**
* Decodes a Token message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns Token
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): OracleJob.DefiKingdomsTask.Token;
/**
* Verifies a Token message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a Token message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns Token
*/
public static fromObject(object: { [k: string]: any }): OracleJob.DefiKingdomsTask.Token;
/**
* Creates a plain object from a Token message. Also converts values to other types if specified.
* @param message Token
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: OracleJob.DefiKingdomsTask.Token, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this Token to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
}
}
/** Properties of an UniswapExchangeRateTask. */ /** Properties of an UniswapExchangeRateTask. */
interface IUniswapExchangeRateTask { interface IUniswapExchangeRateTask {
@ -3619,11 +3655,8 @@ export namespace OracleJob {
/** Properties of a CacheTask. */ /** Properties of a CacheTask. */
interface ICacheTask { interface ICacheTask {
/** CacheTask name */ /** CacheTask cacheItems */
name?: (string|null); cacheItems?: (OracleJob.CacheTask.ICacheItem[]|null);
/** CacheTask method */
method?: (OracleJob.CacheTask.Method|null);
} }
/** Represents a CacheTask. */ /** Represents a CacheTask. */
@ -3635,11 +3668,8 @@ export namespace OracleJob {
*/ */
constructor(properties?: OracleJob.ICacheTask); constructor(properties?: OracleJob.ICacheTask);
/** CacheTask name. */ /** CacheTask cacheItems. */
public name: string; public cacheItems: OracleJob.CacheTask.ICacheItem[];
/** CacheTask method. */
public method: OracleJob.CacheTask.Method;
/** /**
* Creates a new CacheTask instance using the specified properties. * Creates a new CacheTask instance using the specified properties.
@ -3714,10 +3744,100 @@ export namespace OracleJob {
namespace CacheTask { namespace CacheTask {
/** Method enum. */ /** Properties of a CacheItem. */
enum Method { interface ICacheItem {
METHOD_GET = 0,
METHOD_SET = 1 /** CacheItem variableName */
variableName?: (string|null);
/** CacheItem job */
job?: (IOracleJob|null);
}
/** Represents a CacheItem. */
class CacheItem implements ICacheItem {
/**
* Constructs a new CacheItem.
* @param [properties] Properties to set
*/
constructor(properties?: OracleJob.CacheTask.ICacheItem);
/** CacheItem variableName. */
public variableName: string;
/** CacheItem job. */
public job?: (IOracleJob|null);
/**
* Creates a new CacheItem instance using the specified properties.
* @param [properties] Properties to set
* @returns CacheItem instance
*/
public static create(properties?: OracleJob.CacheTask.ICacheItem): OracleJob.CacheTask.CacheItem;
/**
* Encodes the specified CacheItem message. Does not implicitly {@link OracleJob.CacheTask.CacheItem.verify|verify} messages.
* @param message CacheItem message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: OracleJob.CacheTask.ICacheItem, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified CacheItem message, length delimited. Does not implicitly {@link OracleJob.CacheTask.CacheItem.verify|verify} messages.
* @param message CacheItem message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: OracleJob.CacheTask.ICacheItem, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a CacheItem message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns CacheItem
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): OracleJob.CacheTask.CacheItem;
/**
* Decodes a CacheItem message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns CacheItem
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): OracleJob.CacheTask.CacheItem;
/**
* Verifies a CacheItem message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a CacheItem message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns CacheItem
*/
public static fromObject(object: { [k: string]: any }): OracleJob.CacheTask.CacheItem;
/**
* Creates a plain object from a CacheItem message. Also converts values to other types if specified.
* @param message CacheItem
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: OracleJob.CacheTask.CacheItem, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this CacheItem to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
} }
} }

File diff suppressed because it is too large Load Diff