updated type definitions

This commit is contained in:
Conner Gallagher 2023-07-05 15:44:45 -06:00
parent 34995719ce
commit 37afb622dc
18 changed files with 61 additions and 40 deletions

View File

@ -4249,7 +4249,7 @@ dependencies = [
[[package]]
name = "switchboard-solana"
version = "0.8.3"
version = "0.8.4"
dependencies = [
"anchor-client",
"anchor-lang",

View File

@ -16,6 +16,6 @@ no-log-ix-name = []
cpi = ["no-entrypoint"]
[dependencies]
# switchboard-solana = "0.8.3"
switchboard-solana = { version = "0.8.3", path = "../../../rust/switchboard-solana" }
# switchboard-solana = "0.8.4"
switchboard-solana = { version = "0.8.4", path = "../../../rust/switchboard-solana" }
bytemuck = "1.13.1"

View File

@ -11,5 +11,5 @@ name = "native_feed_parser"
no-entrypoint = []
[dependencies]
# switchboard-solana = "0.8.3"
switchboard-solana = { version = "0.8.3", path = "../../../rust/switchboard-solana" }
# switchboard-solana = "0.8.4"
switchboard-solana = { version = "0.8.4", path = "../../../rust/switchboard-solana" }

View File

@ -4249,9 +4249,9 @@ dependencies = [
[[package]]
name = "switchboard-solana"
version = "0.8.3"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a84b3bc7f04c9972e5db3af87d802dbc50219e419b66a99bb837d05ccf6de55"
checksum = "5ef20c714a71811af9804d6676ad4e7f1353ef34d3fb39d9f187b8fc2aa7441e"
dependencies = [
"anchor-client",
"anchor-lang",

View File

@ -17,6 +17,6 @@ cpi = ["no-entrypoint"]
default = []
[dependencies]
switchboard-solana = "0.8.3"
# switchboard-solana = { version = "0.8.3", path = "../../../rust/switchboard-solana" }
switchboard-solana = "0.8.4"
# switchboard-solana = { version = "0.8.4", path = "../../../rust/switchboard-solana" }
bytemuck = "^1"

View File

@ -15,5 +15,5 @@ serde = "^1"
serde_json = "^1"
switchboard-utils = "0.8.0"
# switchboard-utils = { version = "0.8.1", path = "../../../../../sbv2-core/rust/switchboard-utils" }
switchboard-solana = "0.8.3"
# switchboard-solana = { version = "0.8.3", path = "../../../../rust/switchboard-solana" }
switchboard-solana = "0.8.4"
# switchboard-solana = { version = "0.8.4", path = "../../../../rust/switchboard-solana" }

View File

@ -4249,7 +4249,7 @@ dependencies = [
[[package]]
name = "switchboard-solana"
version = "0.8.3"
version = "0.8.4"
dependencies = [
"anchor-client",
"anchor-lang",

View File

@ -17,5 +17,5 @@ cpi = ["no-entrypoint"]
[dependencies]
bytemuck = "1.13.1"
switchboard-solana = { path = "../../../rust/switchboard-solana", version = "0.8.3" }
# switchboard-solana = { version = "^0.8.3", path = "../../../rust/switchboard-solana" }
switchboard-solana = { path = "../../../rust/switchboard-solana", version = "0.8.4" }
# switchboard-solana = { version = "^0.8.4", path = "../../../rust/switchboard-solana" }

View File

@ -1632,11 +1632,11 @@
}
},
{
"name": "createdAt",
"name": "createdAtSlot",
"docs": [
"The unix timestamp when the function was created."
"The Solana slot when the function was created. (PDA)"
],
"type": "i64"
"type": "u64"
},
{
"name": "updatedAt",
@ -1851,6 +1851,13 @@
],
"type": "publicKey"
},
{
"name": "createdAt",
"docs": [
"The unix timestamp when the function was created."
],
"type": "i64"
},
{
"name": "ebuf",
"docs": [
@ -1859,7 +1866,7 @@
"type": {
"array": [
"u8",
879
871
]
}
}

View File

@ -1,6 +1,6 @@
{
"name": "@switchboard-xyz/solana.js",
"version": "2.3.0",
"version": "2.3.1",
"author": "",
"license": "MIT",
"description": "A Typescript client to interact with Switchboard on Solana.",

View File

@ -17,8 +17,8 @@ export interface FunctionAccountDataFields {
name: Array<number>;
/** The metadata of the function for easier identification. */
metadata: Array<number>;
/** The unix timestamp when the function was created. */
createdAt: BN;
/** The Solana slot when the function was created. (PDA) */
createdAtSlot: BN;
/** The unix timestamp when the function config (container, registry, version, or schedule) was changed. */
updatedAt: BN;
/** The off-chain registry to fetch the function container from. */
@ -78,6 +78,8 @@ export interface FunctionAccountDataFields {
rewardEscrowWallet: PublicKey;
/** The reward_escrow_wallet TokenAccount used to acrue rewards from requests made with custom parameters. */
rewardEscrowTokenWallet: PublicKey;
/** The unix timestamp when the function was created. */
createdAt: BN;
/** Reserved. */
ebuf: Array<number>;
}
@ -94,8 +96,8 @@ export interface FunctionAccountDataJSON {
name: Array<number>;
/** The metadata of the function for easier identification. */
metadata: Array<number>;
/** The unix timestamp when the function was created. */
createdAt: string;
/** The Solana slot when the function was created. (PDA) */
createdAtSlot: string;
/** The unix timestamp when the function config (container, registry, version, or schedule) was changed. */
updatedAt: string;
/** The off-chain registry to fetch the function container from. */
@ -155,6 +157,8 @@ export interface FunctionAccountDataJSON {
rewardEscrowWallet: string;
/** The reward_escrow_wallet TokenAccount used to acrue rewards from requests made with custom parameters. */
rewardEscrowTokenWallet: string;
/** The unix timestamp when the function was created. */
createdAt: string;
/** Reserved. */
ebuf: Array<number>;
}
@ -171,8 +175,8 @@ export class FunctionAccountData {
readonly name: Array<number>;
/** The metadata of the function for easier identification. */
readonly metadata: Array<number>;
/** The unix timestamp when the function was created. */
readonly createdAt: BN;
/** The Solana slot when the function was created. (PDA) */
readonly createdAtSlot: BN;
/** The unix timestamp when the function config (container, registry, version, or schedule) was changed. */
readonly updatedAt: BN;
/** The off-chain registry to fetch the function container from. */
@ -232,6 +236,8 @@ export class FunctionAccountData {
readonly rewardEscrowWallet: PublicKey;
/** The reward_escrow_wallet TokenAccount used to acrue rewards from requests made with custom parameters. */
readonly rewardEscrowTokenWallet: PublicKey;
/** The unix timestamp when the function was created. */
readonly createdAt: BN;
/** Reserved. */
readonly ebuf: Array<number>;
@ -246,7 +252,7 @@ export class FunctionAccountData {
types.FunctionStatus.layout("status"),
borsh.array(borsh.u8(), 64, "name"),
borsh.array(borsh.u8(), 256, "metadata"),
borsh.i64("createdAt"),
borsh.u64("createdAtSlot"),
borsh.i64("updatedAt"),
borsh.array(borsh.u8(), 64, "containerRegistry"),
borsh.array(borsh.u8(), 64, "container"),
@ -272,7 +278,8 @@ export class FunctionAccountData {
borsh.publicKey("escrowTokenWallet"),
borsh.publicKey("rewardEscrowWallet"),
borsh.publicKey("rewardEscrowTokenWallet"),
borsh.array(borsh.u8(), 879, "ebuf"),
borsh.i64("createdAt"),
borsh.array(borsh.u8(), 871, "ebuf"),
]);
constructor(fields: FunctionAccountDataFields) {
@ -282,7 +289,7 @@ export class FunctionAccountData {
this.status = fields.status;
this.name = fields.name;
this.metadata = fields.metadata;
this.createdAt = fields.createdAt;
this.createdAtSlot = fields.createdAtSlot;
this.updatedAt = fields.updatedAt;
this.containerRegistry = fields.containerRegistry;
this.container = fields.container;
@ -309,6 +316,7 @@ export class FunctionAccountData {
this.escrowTokenWallet = fields.escrowTokenWallet;
this.rewardEscrowWallet = fields.rewardEscrowWallet;
this.rewardEscrowTokenWallet = fields.rewardEscrowTokenWallet;
this.createdAt = fields.createdAt;
this.ebuf = fields.ebuf;
}
@ -360,7 +368,7 @@ export class FunctionAccountData {
status: types.FunctionStatus.fromDecoded(dec.status),
name: dec.name,
metadata: dec.metadata,
createdAt: dec.createdAt,
createdAtSlot: dec.createdAtSlot,
updatedAt: dec.updatedAt,
containerRegistry: dec.containerRegistry,
container: dec.container,
@ -387,6 +395,7 @@ export class FunctionAccountData {
escrowTokenWallet: dec.escrowTokenWallet,
rewardEscrowWallet: dec.rewardEscrowWallet,
rewardEscrowTokenWallet: dec.rewardEscrowTokenWallet,
createdAt: dec.createdAt,
ebuf: dec.ebuf,
});
}
@ -399,7 +408,7 @@ export class FunctionAccountData {
status: this.status.toJSON(),
name: this.name,
metadata: this.metadata,
createdAt: this.createdAt.toString(),
createdAtSlot: this.createdAtSlot.toString(),
updatedAt: this.updatedAt.toString(),
containerRegistry: this.containerRegistry,
container: this.container,
@ -426,6 +435,7 @@ export class FunctionAccountData {
escrowTokenWallet: this.escrowTokenWallet.toString(),
rewardEscrowWallet: this.rewardEscrowWallet.toString(),
rewardEscrowTokenWallet: this.rewardEscrowTokenWallet.toString(),
createdAt: this.createdAt.toString(),
ebuf: this.ebuf,
};
}
@ -438,7 +448,7 @@ export class FunctionAccountData {
status: types.FunctionStatus.fromJSON(obj.status),
name: obj.name,
metadata: obj.metadata,
createdAt: new BN(obj.createdAt),
createdAtSlot: new BN(obj.createdAtSlot),
updatedAt: new BN(obj.updatedAt),
containerRegistry: obj.containerRegistry,
container: obj.container,
@ -466,6 +476,7 @@ export class FunctionAccountData {
escrowTokenWallet: new PublicKey(obj.escrowTokenWallet),
rewardEscrowWallet: new PublicKey(obj.rewardEscrowWallet),
rewardEscrowTokenWallet: new PublicKey(obj.rewardEscrowTokenWallet),
createdAt: new BN(obj.createdAt),
ebuf: obj.ebuf,
});
}

View File

@ -4219,7 +4219,7 @@ dependencies = [
[[package]]
name = "switchboard-solana"
version = "0.8.3"
version = "0.8.4"
dependencies = [
"anchor-client",
"anchor-lang",

View File

@ -1,6 +1,6 @@
[package]
name = "switchboard-solana"
version = "0.8.3"
version = "0.8.4"
edition = "2021"
description = "A Rust library to interact with Switchboard accounts."
readme = "README.md"

View File

@ -56,8 +56,8 @@ pub struct FunctionAccountData {
pub name: [u8; 64],
/// The metadata of the function for easier identification.
pub metadata: [u8; 256],
/// The unix timestamp when the function was created.
pub created_at: i64,
/// The Solana slot when the function was created. (PDA)
pub created_at_slot: u64,
/// The unix timestamp when the function config (container, registry, version, or schedule) was changed.
pub updated_at: i64,
@ -129,8 +129,11 @@ pub struct FunctionAccountData {
/// The reward_escrow_wallet TokenAccount used to acrue rewards from requests made with custom parameters.
pub reward_escrow_token_wallet: Pubkey,
/// The unix timestamp when the function was created.
pub created_at: i64,
/// Reserved.
pub _ebuf: [u8; 879],
pub _ebuf: [u8; 871],
}
impl anchor_lang::AccountDeserialize for FunctionAccountData {

View File

@ -8,7 +8,7 @@ pub struct FunctionSetConfig<'info> {
seeds = [
FUNCTION_SEED,
function.load()?.creator_seed.as_ref(),
&function.load()?.created_at.to_le_bytes()
&function.load()?.created_at_slot.to_le_bytes()
],
bump = function.load()?.bump,
has_one = authority @ SwitchboardError::InvalidAuthority

View File

@ -8,7 +8,7 @@ pub struct FunctionSetEscrow<'info> {
seeds = [
FUNCTION_SEED,
function.load()?.creator_seed.as_ref(),
&function.load()?.created_at.to_le_bytes()
&function.load()?.created_at_slot.to_le_bytes()
],
bump = function.load()?.bump,
has_one = authority @ SwitchboardError::InvalidAuthority,

View File

@ -8,7 +8,7 @@ pub struct FunctionTrigger<'info> {
seeds = [
FUNCTION_SEED,
function.load()?.creator_seed.as_ref(),
&function.load()?.created_at.to_le_bytes()
&function.load()?.created_at_slot.to_le_bytes()
],
bump = function.load()?.bump,
has_one = authority,

View File

@ -8,7 +8,7 @@ pub struct FunctionVerify<'info> {
seeds = [
FUNCTION_SEED,
function.load()?.creator_seed.as_ref(),
&function.load()?.created_at.to_le_bytes()
&function.load()?.created_at_slot.to_le_bytes()
],
bump = function.load()?.bump,
has_one = authority,