diff --git a/examples/feeds/01_feed_client/Cargo.lock b/examples/feeds/01_feed_client/Cargo.lock index b5d9d7f..626cccd 100644 --- a/examples/feeds/01_feed_client/Cargo.lock +++ b/examples/feeds/01_feed_client/Cargo.lock @@ -4249,7 +4249,7 @@ dependencies = [ [[package]] name = "switchboard-solana" -version = "0.8.3" +version = "0.8.4" dependencies = [ "anchor-client", "anchor-lang", diff --git a/examples/feeds/01_feed_client/Cargo.toml b/examples/feeds/01_feed_client/Cargo.toml index 9481bce..4413788 100644 --- a/examples/feeds/01_feed_client/Cargo.toml +++ b/examples/feeds/01_feed_client/Cargo.toml @@ -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" diff --git a/examples/feeds/02_spl_native/Cargo.toml b/examples/feeds/02_spl_native/Cargo.toml index 7c3406f..0d4fee6 100644 --- a/examples/feeds/02_spl_native/Cargo.toml +++ b/examples/feeds/02_spl_native/Cargo.toml @@ -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" } diff --git a/examples/functions/01_basic_oracle/Cargo.lock b/examples/functions/01_basic_oracle/Cargo.lock index 82e156b..10c9b13 100644 --- a/examples/functions/01_basic_oracle/Cargo.lock +++ b/examples/functions/01_basic_oracle/Cargo.lock @@ -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", diff --git a/examples/functions/01_basic_oracle/Cargo.toml b/examples/functions/01_basic_oracle/Cargo.toml index 704dbf7..e231212 100644 --- a/examples/functions/01_basic_oracle/Cargo.toml +++ b/examples/functions/01_basic_oracle/Cargo.toml @@ -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" diff --git a/examples/functions/01_basic_oracle/sgx-function/Cargo.toml b/examples/functions/01_basic_oracle/sgx-function/Cargo.toml index 444bc60..74a2c4e 100644 --- a/examples/functions/01_basic_oracle/sgx-function/Cargo.toml +++ b/examples/functions/01_basic_oracle/sgx-function/Cargo.toml @@ -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" } diff --git a/examples/vrf/01_vrf_client/Cargo.lock b/examples/vrf/01_vrf_client/Cargo.lock index 5a8591d..cb5736d 100644 --- a/examples/vrf/01_vrf_client/Cargo.lock +++ b/examples/vrf/01_vrf_client/Cargo.lock @@ -4249,7 +4249,7 @@ dependencies = [ [[package]] name = "switchboard-solana" -version = "0.8.3" +version = "0.8.4" dependencies = [ "anchor-client", "anchor-lang", diff --git a/examples/vrf/01_vrf_client/Cargo.toml b/examples/vrf/01_vrf_client/Cargo.toml index a1427a7..ff18b93 100644 --- a/examples/vrf/01_vrf_client/Cargo.toml +++ b/examples/vrf/01_vrf_client/Cargo.toml @@ -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" } diff --git a/javascript/solana.js/idl/attestation-devnet.json b/javascript/solana.js/idl/attestation-devnet.json index 92440a1..45972c3 100644 --- a/javascript/solana.js/idl/attestation-devnet.json +++ b/javascript/solana.js/idl/attestation-devnet.json @@ -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 ] } } diff --git a/javascript/solana.js/package.json b/javascript/solana.js/package.json index 8dced74..4c9d67e 100644 --- a/javascript/solana.js/package.json +++ b/javascript/solana.js/package.json @@ -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.", diff --git a/javascript/solana.js/src/generated/attestation-program/accounts/FunctionAccountData.ts b/javascript/solana.js/src/generated/attestation-program/accounts/FunctionAccountData.ts index 3d1e164..5cd1ac6 100644 --- a/javascript/solana.js/src/generated/attestation-program/accounts/FunctionAccountData.ts +++ b/javascript/solana.js/src/generated/attestation-program/accounts/FunctionAccountData.ts @@ -17,8 +17,8 @@ export interface FunctionAccountDataFields { name: Array; /** The metadata of the function for easier identification. */ metadata: Array; - /** 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; } @@ -94,8 +96,8 @@ export interface FunctionAccountDataJSON { name: Array; /** The metadata of the function for easier identification. */ metadata: Array; - /** 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; } @@ -171,8 +175,8 @@ export class FunctionAccountData { readonly name: Array; /** The metadata of the function for easier identification. */ readonly metadata: Array; - /** 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; @@ -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, }); } diff --git a/rust/switchboard-solana/Cargo.lock b/rust/switchboard-solana/Cargo.lock index 3f6bccc..d612fe9 100644 --- a/rust/switchboard-solana/Cargo.lock +++ b/rust/switchboard-solana/Cargo.lock @@ -4219,7 +4219,7 @@ dependencies = [ [[package]] name = "switchboard-solana" -version = "0.8.3" +version = "0.8.4" dependencies = [ "anchor-client", "anchor-lang", diff --git a/rust/switchboard-solana/Cargo.toml b/rust/switchboard-solana/Cargo.toml index e190cc1..101766d 100644 --- a/rust/switchboard-solana/Cargo.toml +++ b/rust/switchboard-solana/Cargo.toml @@ -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" diff --git a/rust/switchboard-solana/src/attestation_program/accounts/function.rs b/rust/switchboard-solana/src/attestation_program/accounts/function.rs index 4e5e27a..59bbf99 100644 --- a/rust/switchboard-solana/src/attestation_program/accounts/function.rs +++ b/rust/switchboard-solana/src/attestation_program/accounts/function.rs @@ -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 { diff --git a/rust/switchboard-solana/src/attestation_program/instructions/function_set_config.rs b/rust/switchboard-solana/src/attestation_program/instructions/function_set_config.rs index 0486dd2..6d1285e 100644 --- a/rust/switchboard-solana/src/attestation_program/instructions/function_set_config.rs +++ b/rust/switchboard-solana/src/attestation_program/instructions/function_set_config.rs @@ -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 diff --git a/rust/switchboard-solana/src/attestation_program/instructions/function_set_escrow.rs b/rust/switchboard-solana/src/attestation_program/instructions/function_set_escrow.rs index 300f23d..51bc327 100644 --- a/rust/switchboard-solana/src/attestation_program/instructions/function_set_escrow.rs +++ b/rust/switchboard-solana/src/attestation_program/instructions/function_set_escrow.rs @@ -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, diff --git a/rust/switchboard-solana/src/attestation_program/instructions/function_trigger.rs b/rust/switchboard-solana/src/attestation_program/instructions/function_trigger.rs index 4955dc9..9ef137e 100644 --- a/rust/switchboard-solana/src/attestation_program/instructions/function_trigger.rs +++ b/rust/switchboard-solana/src/attestation_program/instructions/function_trigger.rs @@ -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, diff --git a/rust/switchboard-solana/src/attestation_program/instructions/function_verify.rs b/rust/switchboard-solana/src/attestation_program/instructions/function_verify.rs index e763a4a..1521b31 100644 --- a/rust/switchboard-solana/src/attestation_program/instructions/function_verify.rs +++ b/rust/switchboard-solana/src/attestation_program/instructions/function_verify.rs @@ -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,