@jpool/bond-sdk 0.1.0-next.1 → 0.1.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,45 +0,0 @@
1
- import type { Keypair, PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js'
2
-
3
- function isVersionedTransaction(tx: Transaction | VersionedTransaction): tx is VersionedTransaction {
4
- return 'version' in tx
5
- }
6
-
7
- export type Wallet = {
8
- publicKey: PublicKey
9
- signMessage?: (message: Uint8Array) => Promise<Uint8Array>
10
- signTransaction: <T extends Transaction | VersionedTransaction>(tx: T) => Promise<T>
11
- signAllTransactions: <T extends Transaction | VersionedTransaction>(txs: T[]) => Promise<T[]>
12
- }
13
-
14
- export class NodeWallet implements Wallet {
15
- constructor(readonly payer: Keypair) {}
16
-
17
- async signTransaction<T extends Transaction | VersionedTransaction>(
18
- tx: T,
19
- ): Promise<T> {
20
- if (isVersionedTransaction(tx)) {
21
- tx.sign([this.payer])
22
- } else {
23
- tx.partialSign(this.payer)
24
- }
25
-
26
- return tx
27
- }
28
-
29
- async signAllTransactions<T extends Transaction | VersionedTransaction>(
30
- txs: T[],
31
- ): Promise<T[]> {
32
- return txs.map((t) => {
33
- if (isVersionedTransaction(t)) {
34
- t.sign([this.payer])
35
- } else {
36
- t.partialSign(this.payer)
37
- }
38
- return t
39
- })
40
- }
41
-
42
- get publicKey(): PublicKey {
43
- return this.payer.publicKey
44
- }
45
- }
package/tsconfig.json DELETED
@@ -1,39 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "display": "Default",
4
- "compilerOptions": {
5
- "target": "esnext",
6
- "lib": [
7
- "dom",
8
- "esnext"
9
- ],
10
- "rootDir": "src",
11
- "module": "esnext",
12
- "moduleResolution": "bundler",
13
- "resolveJsonModule": true,
14
- "allowJs": true,
15
- "strict": true,
16
- "noFallthroughCasesInSwitch": true,
17
- "noImplicitAny": false,
18
- "useUnknownInCatchVariables": true,
19
- "declaration": true,
20
- "declarationMap": true,
21
- "importHelpers": false,
22
- "inlineSources": false,
23
- "outDir": "dist",
24
- "sourceMap": true,
25
- "esModuleInterop": true,
26
- "forceConsistentCasingInFileNames": true,
27
- "isolatedModules": true,
28
- "skipLibCheck": true
29
- },
30
- "include": [
31
- "src",
32
- "types",
33
- "tests"
34
- ],
35
- "exclude": [
36
- "node_modules",
37
- "dist"
38
- ]
39
- }
package/tsup.config.ts DELETED
@@ -1,19 +0,0 @@
1
- import type { Options } from 'tsup'
2
- import { defineConfig } from 'tsup'
3
-
4
- export default defineConfig((options: Options) => ({
5
- entry: ['src/index.ts'],
6
- format: ['cjs', 'esm'],
7
- platform: 'neutral',
8
- sourcemap: true,
9
- cjsInterop: true,
10
- shims: true,
11
- dts: true,
12
- treeshake: true,
13
- external: [
14
- /@project-serum\/.*/,
15
- /@coral-xyz\/.*/,
16
- /@solana\/.*/,
17
- ],
18
- ...options,
19
- }))