Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 29d424e

Browse files
etodanikDanny Povolotskijordaaash
authored
fully switch to @solana/buffer-layout (#2634)
* remove unused buffer-layout * change to solana implementation of buffer-layout * use latest buffer-layout and utils * update buffer-layout-utils * update buffer-layout-utils * info.data is already Uint8Array * update deps, fix lint * remove node engine requirements Co-authored-by: Danny Povolotski <[email protected]> Co-authored-by: Jordan Sexton <[email protected]>
1 parent 762c584 commit 29d424e

31 files changed

+10070
-6146
lines changed

name-service/js/package-lock.json

Lines changed: 9293 additions & 157 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

name-service/js/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
"bn.js": "^5.1.3",
5858
"borsh": "^0.4.0",
5959
"bs58": "4.0.1",
60-
"buffer-layout": "^1.2.0",
6160
"core-util-is": "^1.0.2",
6261
"crypto": "^1.0.1",
6362
"crypto-ts": "^1.0.2",

name-service/js/yarn.lock

Lines changed: 0 additions & 5120 deletions
This file was deleted.

token-lending/js/package.json

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,38 +29,36 @@
2929
"lint:fix": "eslint . --ext .ts --fix && prettier --write '**/*.{ts,js,json}'"
3030
},
3131
"dependencies": {
32+
"@solana/buffer-layout": "^4.0.0",
33+
"@solana/buffer-layout-utils": "^0.2.0",
3234
"bigint-buffer": "^1.1.5",
33-
"bignumber.js": "^9.0.1",
34-
"buffer-layout": "^1.2.1"
35+
"bignumber.js": "^9.0.1"
3536
},
3637
"peerDependencies": {
3738
"@solana/spl-token": "^0.1.6",
3839
"@solana/web3.js": "^1.20.0"
3940
},
4041
"devDependencies": {
41-
"@rollup/plugin-commonjs": "^21.0.0",
42-
"@rollup/plugin-node-resolve": "^13.0.0",
43-
"@rollup/plugin-typescript": "^8.2.1",
44-
"@solana/spl-token": "^0.1.6",
45-
"@solana/web3.js": "^1.20.0",
46-
"@types/eslint": "^7.2.13",
42+
"@rollup/plugin-commonjs": "^21.0.2",
43+
"@rollup/plugin-node-resolve": "^13.1.3",
44+
"@rollup/plugin-typescript": "^8.3.1",
45+
"@solana/spl-token": "^0.2.0",
46+
"@solana/web3.js": "^1.36.0",
47+
"@types/eslint": "^8.4.1",
4748
"@types/eslint-plugin-prettier": "^3.1.0",
4849
"@types/node": "^16.0.0",
49-
"@types/prettier": "^2.3.1",
50-
"@typescript-eslint/eslint-plugin": "^4.28.0",
51-
"@typescript-eslint/parser": "^4.28.1",
52-
"eslint": "^7.29.0",
53-
"eslint-config-prettier": "^8.3.0",
54-
"eslint-plugin-prettier": "^3.4.0",
50+
"@types/prettier": "^2.4.4",
51+
"@typescript-eslint/eslint-plugin": "^5.16.0",
52+
"@typescript-eslint/parser": "^5.16.0",
53+
"eslint": "^8.12.0",
54+
"eslint-config-prettier": "^8.5.0",
55+
"eslint-plugin-prettier": "^4.0.0",
5556
"gh-pages": "^3.2.3",
56-
"prettier": "^2.2.1",
57-
"rollup": "^2.52.3",
58-
"ts-node": "^10.0.0",
57+
"prettier": "^2.6.1",
58+
"rollup": "^2.70.1",
59+
"ts-node": "^10.7.0",
5960
"tslib": "^2.3.0",
60-
"typedoc": "^0.22.3",
61-
"typescript": "^4.3.5"
62-
},
63-
"engines": {
64-
"node": ">= 10"
61+
"typedoc": "^0.22.13",
62+
"typescript": "^4.6.3"
6563
}
6664
}

token-lending/js/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
export * from './constants';
22
export * from './instructions';
33
export * from './state';
4-
export * from './util';

token-lending/js/src/instructions/borrowObligationLiquidity.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { TOKEN_PROGRAM_ID } from '@solana/spl-token';
22
import { PublicKey, SYSVAR_CLOCK_PUBKEY, TransactionInstruction } from '@solana/web3.js';
3-
import { struct, u8 } from 'buffer-layout';
3+
import { struct, u8 } from '@solana/buffer-layout';
44
import { LENDING_PROGRAM_ID } from '../constants';
5-
import { u64 } from '../util';
5+
import { u64 } from '@solana/buffer-layout-utils';
66
import { LendingInstruction } from './instruction';
77

88
interface Data {

token-lending/js/src/instructions/depositObligationCollateral.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { TOKEN_PROGRAM_ID } from '@solana/spl-token';
22
import { PublicKey, SYSVAR_CLOCK_PUBKEY, TransactionInstruction } from '@solana/web3.js';
3-
import { struct, u8 } from 'buffer-layout';
3+
import { struct, u8 } from '@solana/buffer-layout';
44
import { LENDING_PROGRAM_ID } from '../constants';
5-
import { u64 } from '../util';
5+
import { u64 } from '@solana/buffer-layout-utils';
66
import { LendingInstruction } from './instruction';
77

88
interface Data {

token-lending/js/src/instructions/depositReserveLiquidity.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { TOKEN_PROGRAM_ID } from '@solana/spl-token';
22
import { PublicKey, SYSVAR_CLOCK_PUBKEY, TransactionInstruction } from '@solana/web3.js';
3-
import { struct, u8 } from 'buffer-layout';
3+
import { struct, u8 } from '@solana/buffer-layout';
44
import { LENDING_PROGRAM_ID } from '../constants';
5-
import { u64 } from '../util';
5+
import { u64 } from '@solana/buffer-layout-utils';
66
import { LendingInstruction } from './instruction';
77

88
interface Data {

token-lending/js/src/instructions/flashLoan.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { TOKEN_PROGRAM_ID } from '@solana/spl-token';
22
import { PublicKey, TransactionInstruction } from '@solana/web3.js';
3-
import { struct, u8 } from 'buffer-layout';
3+
import { struct, u8 } from '@solana/buffer-layout';
44
import { LENDING_PROGRAM_ID } from '../constants';
5-
import { u64 } from '../util';
5+
import { u64 } from '@solana/buffer-layout-utils';
66
import { LendingInstruction } from './instruction';
77

88
interface Data {

token-lending/js/src/instructions/initLendingMarket.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import { TOKEN_PROGRAM_ID } from '@solana/spl-token';
22
import { PublicKey, SYSVAR_RENT_PUBKEY, TransactionInstruction } from '@solana/web3.js';
3-
import { blob, struct, u8 } from 'buffer-layout';
3+
import { blob, struct, u8 } from '@solana/buffer-layout';
44
import { LENDING_PROGRAM_ID, ORACLE_PROGRAM_ID } from '../constants';
5-
import { publicKey } from '../util';
5+
import { publicKey } from '@solana/buffer-layout-utils';
66
import { LendingInstruction } from './instruction';
77

88
interface Data {
99
instruction: number;
1010
owner: PublicKey;
11-
quoteCurrency: Buffer;
11+
quoteCurrency: Uint8Array;
1212
}
1313

1414
const DataLayout = struct<Data>([u8('instruction'), publicKey('owner'), blob(32, 'quoteCurrency')]);
1515

1616
export const initLendingMarketInstruction = (
1717
owner: PublicKey,
18-
quoteCurrency: Buffer,
18+
quoteCurrency: Uint8Array,
1919
lendingMarket: PublicKey
2020
): TransactionInstruction => {
2121
const data = Buffer.alloc(DataLayout.span);

0 commit comments

Comments
 (0)