Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update usage of IInstructionWithData #336

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update usage of IInstructionWithData
  • Loading branch information
lorisleiva committed Nov 28, 2024
commit a1af5e6e1d394496cc28b26431e47c168762292b
2 changes: 1 addition & 1 deletion packages/dynamic-codecs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@codama/errors": "workspace:*",
"@codama/nodes": "workspace:*",
"@codama/visitors-core": "workspace:*",
"@solana/codecs": "2.0.0"
"@solana/codecs": "2.1.0-canary-20241128134801"
},
"license": "MIT",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/dynamic-parsers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
"@codama/errors": "workspace:*",
"@codama/nodes": "workspace:*",
"@codama/visitors-core": "workspace:*",
"@solana/instructions": "2.0.0"
"@solana/instructions": "2.1.0-canary-20241128134801"
},
"devDependencies": {
"@solana/codecs": "2.0.0"
"@solana/codecs": "2.1.0-canary-20241128134801"
},
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/dynamic-parsers/src/parsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function parseInstruction(
root: RootNode,
instruction: IInstruction &
IInstructionWithAccounts<readonly (IAccountLookupMeta | IAccountMeta)[]> &
IInstructionWithData<Uint8Array>,
IInstructionWithData<ReadonlyUint8Array>,
): ParsedInstruction | undefined {
const parsedData = parseInstructionData(root, instruction.data);
if (!parsedData) return undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/renderers-js-umi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@codama/renderers-core": "workspace:*",
"@codama/validators": "workspace:*",
"@codama/visitors-core": "workspace:*",
"@solana/codecs-strings": "rc",
"@solana/codecs-strings": "2.1.0-canary-20241128134801",
"nunjucks": "^3.2.4",
"prettier": "^3.4.1"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/renderers-js/e2e/anchor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
},
"license": "MIT",
"peerDependencies": {
"@solana/web3.js": "2.0.0-rc.0"
"@solana/web3.js": "2.1.0-canary-20241128134801"
},
"devDependencies": {
"@ava/typescript": "^4.1.0",
"@solana/eslint-config-solana": "^3.0.0",
"@solana/web3.js": "rc",
"@solana/webcrypto-ed25519-polyfill": "rc",
"@solana/web3.js": "2.1.0-canary-20241128134801",
"@solana/webcrypto-ed25519-polyfill": "2.1.0-canary-20241128134801",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"ava": "^6.1.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/renderers-js/e2e/dummy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
},
"license": "MIT",
"peerDependencies": {
"@solana/web3.js": "2.0.0-rc.0"
"@solana/web3.js": "2.1.0-canary-20241128134801"
},
"devDependencies": {
"@ava/typescript": "^4.1.0",
"@solana/eslint-config-solana": "^3.0.0",
"@solana/web3.js": "rc",
"@solana/webcrypto-ed25519-polyfill": "rc",
"@solana/web3.js": "2.1.0-canary-20241128134801",
"@solana/webcrypto-ed25519-polyfill": "2.1.0-canary-20241128134801",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"ava": "^6.1.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/renderers-js/e2e/memo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
},
"license": "MIT",
"peerDependencies": {
"@solana/web3.js": "2.0.0-rc.0"
"@solana/web3.js": "2.1.0-canary-20241128134801"
},
"devDependencies": {
"@ava/typescript": "^4.1.0",
"@solana/eslint-config-solana": "^3.0.0",
"@solana/web3.js": "rc",
"@solana/webcrypto-ed25519-polyfill": "rc",
"@solana/web3.js": "2.1.0-canary-20241128134801",
"@solana/webcrypto-ed25519-polyfill": "2.1.0-canary-20241128134801",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"ava": "^6.1.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/renderers-js/e2e/system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
},
"license": "MIT",
"peerDependencies": {
"@solana/web3.js": "2.0.0-rc.0"
"@solana/web3.js": "2.1.0-canary-20241128134801"
},
"devDependencies": {
"@ava/typescript": "^4.1.0",
"@solana/eslint-config-solana": "^3.0.0",
"@solana/web3.js": "rc",
"@solana/webcrypto-ed25519-polyfill": "rc",
"@solana/web3.js": "2.1.0-canary-20241128134801",
"@solana/webcrypto-ed25519-polyfill": "2.1.0-canary-20241128134801",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"ava": "^6.1.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/renderers-js/e2e/token/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
},
"license": "MIT",
"peerDependencies": {
"@solana/web3.js": "2.0.0-rc.0"
"@solana/web3.js": "2.1.0-canary-20241128134801"
},
"devDependencies": {
"@ava/typescript": "^4.1.0",
"@solana/eslint-config-solana": "^3.0.0",
"@solana/web3.js": "rc",
"@solana/webcrypto-ed25519-polyfill": "rc",
"@solana/web3.js": "2.1.0-canary-20241128134801",
"@solana/webcrypto-ed25519-polyfill": "2.1.0-canary-20241128134801",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"ava": "^6.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/renderers-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@codama/nodes-from-anchor": "workspace:*",
"@codama/renderers-core": "workspace:*",
"@codama/visitors-core": "workspace:*",
"@solana/codecs-strings": "rc",
"@solana/codecs-strings": "2.1.0-canary-20241128134801",
"nunjucks": "^3.2.4",
"prettier": "^3.4.1"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function {{ instructionParseFunction }}<
& IInstructionWithAccounts<TAccountMetas>
{% endif %}
{% if hasData %}
& IInstructionWithData<Uint8Array>
& IInstructionWithData<ReadonlyUint8Array>
{% endif %}
): {{ instructionParsedType }}<TProgram {{ ', TAccountMetas' if hasAccounts }}> {
{% if hasAccounts %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export type {{ instructionType }}<
TRemainingAccounts extends readonly IAccountMeta<string>[] = [],
> = IInstruction<TProgram>
{% if hasData %}
& IInstructionWithData<Uint8Array>
& IInstructionWithData<ReadonlyUint8Array>
{% endif %}
{% if hasAccounts %}
& IInstructionWithAccounts<[{{ accountMetas }}, ...TRemainingAccounts]>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@ export function getInstructionParseFunctionFragment(
.addImports('generatedPrograms', [programAddressConstant])
.addImports('solanaInstructions', ['type IInstruction'])
.addImports('solanaInstructions', hasAccounts ? ['type IInstructionWithAccounts', 'type IAccountMeta'] : [])
.addImports('solanaInstructions', hasData ? ['type IInstructionWithData'] : []);
.addImports('solanaInstructions', hasData ? ['type IInstructionWithData'] : [])
.addImports('solanaCodecsCore', hasData ? ['type ReadonlyUint8Array'] : []);
}
1 change: 1 addition & 0 deletions packages/renderers-js/src/fragments/instructionType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export function getInstructionTypeFragment(
})
.mergeImportsWith(accountTypeParamsFragment, accountMetasFragment)
.addImports('generatedPrograms', [programAddressConstant])
.addImports('solanaCodecsCore', hasData ? ['type ReadonlyUint8Array'] : [])
.addImports('solanaInstructions', [
'type IAccountMeta',
'type IInstruction',
Expand Down
2 changes: 1 addition & 1 deletion packages/renderers-rust/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@codama/nodes": "workspace:*",
"@codama/renderers-core": "workspace:*",
"@codama/visitors-core": "workspace:*",
"@solana/codecs-strings": "rc",
"@solana/codecs-strings": "2.1.0-canary-20241128134801",
"nunjucks": "^3.2.4"
},
"devDependencies": {
Expand Down
Loading