Skip to content

Commit

Permalink
version 0.3.13 snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 3, 2024
1 parent 9f48620 commit ec817e4
Show file tree
Hide file tree
Showing 10 changed files with 557 additions and 542 deletions.
756 changes: 377 additions & 379 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ solana = "1.18.18"
# Specify Rust toolchains for rustfmt, clippy, and build.
# Any unprovided toolchains default to stable.
[workspace.metadata.toolchains]
format = "1.79.0"
lint = "1.79.0"
format = "1.81.0"
lint = "1.81.0"
13 changes: 9 additions & 4 deletions clients/js/src/generated/accounts/counter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ import {
type ReadonlyUint8Array,
} from '@solana/web3.js';

export const COUNTER_DISCRIMINATOR = new Uint8Array([
255, 176, 4, 245, 188, 253, 124, 25,
]);

export function getCounterDiscriminatorBytes() {
return fixEncoderSize(getBytesEncoder(), 8).encode(COUNTER_DISCRIMINATOR);
}

export type Counter = {
discriminator: ReadonlyUint8Array;
authority: Address;
Expand All @@ -52,10 +60,7 @@ export function getCounterEncoder(): Encoder<CounterArgs> {
['authority', getAddressEncoder()],
['count', getU64Encoder()],
]),
(value) => ({
...value,
discriminator: new Uint8Array([255, 176, 4, 245, 188, 253, 124, 25]),
})
(value) => ({ ...value, discriminator: COUNTER_DISCRIMINATOR })
);
}

Expand Down
23 changes: 15 additions & 8 deletions clients/js/src/generated/instructions/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ import {
import { COUNTER_PROGRAM_ADDRESS } from '../programs';
import { getAccountMetaFactory, type ResolvedAccount } from '../shared';

export const CREATE_DISCRIMINATOR = new Uint8Array([
24, 30, 200, 40, 5, 28, 7, 119,
]);

export function getCreateDiscriminatorBytes() {
return fixEncoderSize(getBytesEncoder(), 8).encode(CREATE_DISCRIMINATOR);
}

export type CreateInstruction<
TProgram extends string = typeof COUNTER_PROGRAM_ADDRESS,
TAccountCounter extends string | IAccountMeta<string> = string,
Expand Down Expand Up @@ -74,10 +82,7 @@ export function getCreateInstructionDataEncoder(): Encoder<CreateInstructionData
['discriminator', fixEncoderSize(getBytesEncoder(), 8)],
['authority', getAddressEncoder()],
]),
(value) => ({
...value,
discriminator: new Uint8Array([24, 30, 200, 40, 5, 28, 7, 119]),
})
(value) => ({ ...value, discriminator: CREATE_DISCRIMINATOR })
);
}

Expand Down Expand Up @@ -113,16 +118,18 @@ export function getCreateInstruction<
TAccountCounter extends string,
TAccountPayer extends string,
TAccountSystemProgram extends string,
TProgramAddress extends Address = typeof COUNTER_PROGRAM_ADDRESS,
>(
input: CreateInput<TAccountCounter, TAccountPayer, TAccountSystemProgram>
input: CreateInput<TAccountCounter, TAccountPayer, TAccountSystemProgram>,
config?: { programAddress?: TProgramAddress }
): CreateInstruction<
typeof COUNTER_PROGRAM_ADDRESS,
TProgramAddress,
TAccountCounter,
TAccountPayer,
TAccountSystemProgram
> {
// Program address.
const programAddress = COUNTER_PROGRAM_ADDRESS;
const programAddress = config?.programAddress ?? COUNTER_PROGRAM_ADDRESS;

// Original accounts.
const originalAccounts = {
Expand Down Expand Up @@ -156,7 +163,7 @@ export function getCreateInstruction<
args as CreateInstructionDataArgs
),
} as CreateInstruction<
typeof COUNTER_PROGRAM_ADDRESS,
TProgramAddress,
TAccountCounter,
TAccountPayer,
TAccountSystemProgram
Expand Down
27 changes: 15 additions & 12 deletions clients/js/src/generated/instructions/increment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ import {
import { COUNTER_PROGRAM_ADDRESS } from '../programs';
import { getAccountMetaFactory, type ResolvedAccount } from '../shared';

export const INCREMENT_DISCRIMINATOR = new Uint8Array([
11, 18, 104, 9, 104, 174, 59, 33,
]);

export function getIncrementDiscriminatorBytes() {
return fixEncoderSize(getBytesEncoder(), 8).encode(INCREMENT_DISCRIMINATOR);
}

export type IncrementInstruction<
TProgram extends string = typeof COUNTER_PROGRAM_ADDRESS,
TAccountCounter extends string | IAccountMeta<string> = string,
Expand Down Expand Up @@ -59,10 +67,7 @@ export type IncrementInstructionDataArgs = {};
export function getIncrementInstructionDataEncoder(): Encoder<IncrementInstructionDataArgs> {
return transformEncoder(
getStructEncoder([['discriminator', fixEncoderSize(getBytesEncoder(), 8)]]),
(value) => ({
...value,
discriminator: new Uint8Array([11, 18, 104, 9, 104, 174, 59, 33]),
})
(value) => ({ ...value, discriminator: INCREMENT_DISCRIMINATOR })
);
}

Expand Down Expand Up @@ -93,15 +98,13 @@ export type IncrementInput<
export function getIncrementInstruction<
TAccountCounter extends string,
TAccountAuthority extends string,
TProgramAddress extends Address = typeof COUNTER_PROGRAM_ADDRESS,
>(
input: IncrementInput<TAccountCounter, TAccountAuthority>
): IncrementInstruction<
typeof COUNTER_PROGRAM_ADDRESS,
TAccountCounter,
TAccountAuthority
> {
input: IncrementInput<TAccountCounter, TAccountAuthority>,
config?: { programAddress?: TProgramAddress }
): IncrementInstruction<TProgramAddress, TAccountCounter, TAccountAuthority> {
// Program address.
const programAddress = COUNTER_PROGRAM_ADDRESS;
const programAddress = config?.programAddress ?? COUNTER_PROGRAM_ADDRESS;

// Original accounts.
const originalAccounts = {
Expand All @@ -122,7 +125,7 @@ export function getIncrementInstruction<
programAddress,
data: getIncrementInstructionDataEncoder().encode({}),
} as IncrementInstruction<
typeof COUNTER_PROGRAM_ADDRESS,
TProgramAddress,
TAccountCounter,
TAccountAuthority
>;
Expand Down
2 changes: 2 additions & 0 deletions clients/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ readme = "README.md"
license-file = "../../LICENSE"

[features]
anchor = ["dep:anchor-lang"]
test-sbf = []
serde = ["dep:serde", "dep:serde_with"]

[dependencies]
anchor-lang = { version = "0.30.0", optional = true }
borsh = "^0.10"
num-derive = "^0.3"
num-traits = "^0.2"
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
},
"devDependencies": {
"@iarna/toml": "^2.2.5",
"@kinobi-so/nodes-from-anchor": "^0.20.9",
"@kinobi-so/renderers-js": "^0.21.2",
"@kinobi-so/renderers-rust": "^0.21.0",
"@kinobi-so/nodes-from-anchor": "^0.21.3",
"@kinobi-so/renderers-js": "^0.21.9",
"@kinobi-so/renderers-rust": "^0.21.7",
"@metaplex-foundation/shank-js": "^0.1.7",
"kinobi": "^0.21.0",
"kinobi": "^0.21.5",
"typescript": "^5.5.2",
"zx": "^7.2.3"
},
Expand Down
Loading

0 comments on commit ec817e4

Please sign in to comment.