@wuwei-labs/srsly 3.0.0-beta.16 → 3.0.0-beta.18
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.
- package/dist/cjs/accounts/borrower.js +48 -0
- package/dist/cjs/accounts/borrower.js.map +1 -1
- package/dist/cjs/accounts/config.js +50 -2
- package/dist/cjs/accounts/config.js.map +1 -1
- package/dist/cjs/accounts/contract.js +51 -0
- package/dist/cjs/accounts/contract.js.map +1 -1
- package/dist/cjs/accounts/rental.js +48 -0
- package/dist/cjs/accounts/rental.js.map +1 -1
- package/dist/cjs/demos.js +31 -1
- package/dist/cjs/demos.js.map +1 -1
- package/dist/cjs/index.js +6 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/utils/instructionResult.js +19 -25
- package/dist/cjs/utils/instructionResult.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/accounts/borrower.js +48 -1
- package/dist/esm/accounts/borrower.js.map +1 -1
- package/dist/esm/accounts/config.js +48 -1
- package/dist/esm/accounts/config.js.map +1 -1
- package/dist/esm/accounts/contract.js +51 -1
- package/dist/esm/accounts/contract.js.map +1 -1
- package/dist/esm/accounts/rental.js +48 -1
- package/dist/esm/accounts/rental.js.map +1 -1
- package/dist/esm/demos.js +30 -0
- package/dist/esm/demos.js.map +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +1 -1
- package/dist/esm/utils/instructionResult.js +19 -25
- package/dist/esm/utils/instructionResult.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/accounts/borrower.d.ts +19 -0
- package/dist/types/accounts/borrower.d.ts.map +1 -1
- package/dist/types/accounts/config.d.ts +19 -0
- package/dist/types/accounts/config.d.ts.map +1 -1
- package/dist/types/accounts/contract.d.ts +19 -0
- package/dist/types/accounts/contract.d.ts.map +1 -1
- package/dist/types/accounts/rental.d.ts +19 -0
- package/dist/types/accounts/rental.d.ts.map +1 -1
- package/dist/types/demos.d.ts +6 -0
- package/dist/types/demos.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/utils/instructionResult.d.ts +13 -21
- package/dist/types/utils/instructionResult.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +2 -2
|
@@ -19,26 +19,28 @@ export interface LegacyInstruction<TPublicKey = any> {
|
|
|
19
19
|
data: ReadonlyUint8Array | Uint8Array;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* InstructionResult -
|
|
22
|
+
* InstructionResult - Wrapper for @solana/kit Instructions with legacy conversion
|
|
23
23
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
24
|
+
* Contains a plain Instruction[] array accessible via `.instructions`.
|
|
25
|
+
* Supports iteration (`for...of`, spread) and `.toLegacy()` conversion for web3.js.
|
|
26
26
|
*
|
|
27
27
|
* @example
|
|
28
28
|
* ```typescript
|
|
29
|
-
* // Kit users -
|
|
30
|
-
* const
|
|
31
|
-
*
|
|
29
|
+
* // Kit users - access instructions directly
|
|
30
|
+
* const result = await createContract(params);
|
|
31
|
+
* for (const ix of result) { ... }
|
|
32
|
+
* // Or unwrap: result.instructions
|
|
32
33
|
*
|
|
33
34
|
* // Web3.js users - convert to legacy format
|
|
34
35
|
* import { PublicKey } from '@solana/web3.js';
|
|
35
|
-
* const legacyIxs =
|
|
36
|
+
* const legacyIxs = result.toLegacy(PublicKey);
|
|
36
37
|
* // Or if PublicKey is configured in SDK:
|
|
37
38
|
* setSdkConfig({ PublicKey });
|
|
38
|
-
* const legacyIxs =
|
|
39
|
+
* const legacyIxs = result.toLegacy();
|
|
39
40
|
* ```
|
|
40
41
|
*/
|
|
41
|
-
export declare class InstructionResult
|
|
42
|
+
export declare class InstructionResult {
|
|
43
|
+
readonly instructions: Instruction[];
|
|
42
44
|
constructor(instructions: Instruction[]);
|
|
43
45
|
/**
|
|
44
46
|
* Convert to legacy web3.js instruction format
|
|
@@ -47,19 +49,9 @@ export declare class InstructionResult extends Array<Instruction> {
|
|
|
47
49
|
* uses the PublicKey from SDK config (set via setSdkConfig)
|
|
48
50
|
* @returns Array of instructions in web3.js format
|
|
49
51
|
* @throws Error if no PublicKey is available
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* ```typescript
|
|
53
|
-
* // Option 1: Pass PublicKey explicitly
|
|
54
|
-
* import { PublicKey } from '@solana/web3.js';
|
|
55
|
-
* const legacyIxs = ixs.toLegacy(PublicKey);
|
|
56
|
-
*
|
|
57
|
-
* // Option 2: Configure SDK once, then call without args
|
|
58
|
-
* import { PublicKey } from '@solana/web3.js';
|
|
59
|
-
* setSdkConfig({ PublicKey });
|
|
60
|
-
* const legacyIxs = ixs.toLegacy();
|
|
61
|
-
* ```
|
|
62
52
|
*/
|
|
63
53
|
toLegacy<TPublicKey = any>(PublicKey?: PublicKeyConstructor<TPublicKey>): LegacyInstruction<TPublicKey>[];
|
|
54
|
+
get length(): number;
|
|
55
|
+
[Symbol.iterator](): ArrayIterator<Instruction<string, readonly (import("@solana/kit").AccountMeta<string> | import("@solana/kit").AccountLookupMeta<string, string>)[]>>;
|
|
64
56
|
}
|
|
65
57
|
//# sourceMappingURL=instructionResult.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructionResult.d.ts","sourceRoot":"","sources":["../../../src/utils/instructionResult.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAgB,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,UAAU,GAAG,GAAG;IACjD,IAAI,EAAE,KAAK,CAAC;QACV,MAAM,EAAE,UAAU,CAAC;QACnB,UAAU,EAAE,OAAO,CAAC;QACpB,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC,CAAC;IACH,SAAS,EAAE,UAAU,CAAC;IACtB,IAAI,EAAE,kBAAkB,GAAG,UAAU,CAAC;CACvC;AAuBD
|
|
1
|
+
{"version":3,"file":"instructionResult.d.ts","sourceRoot":"","sources":["../../../src/utils/instructionResult.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAgB,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,UAAU,GAAG,GAAG;IACjD,IAAI,EAAE,KAAK,CAAC;QACV,MAAM,EAAE,UAAU,CAAC;QACnB,UAAU,EAAE,OAAO,CAAC;QACpB,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC,CAAC;IACH,SAAS,EAAE,UAAU,CAAC;IACtB,IAAI,EAAE,kBAAkB,GAAG,UAAU,CAAC;CACvC;AAuBD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,iBAAiB;IAC5B,QAAQ,CAAC,YAAY,EAAE,WAAW,EAAE,CAAC;gBAEzB,YAAY,EAAE,WAAW,EAAE;IAIvC;;;;;;;OAOG;IACH,QAAQ,CAAC,UAAU,GAAG,GAAG,EACvB,SAAS,CAAC,EAAE,oBAAoB,CAAC,UAAU,CAAC,GAC3C,iBAAiB,CAAC,UAAU,CAAC,EAAE;IAUlC,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,CAAC,MAAM,CAAC,QAAQ,CAAC;CAGlB"}
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "3.0.0-beta.
|
|
1
|
+
export declare const VERSION = "3.0.0-beta.17";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wuwei-labs/srsly",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.18",
|
|
4
4
|
"description": "TypeScript SDK for SRSLY",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@codama/nodes-from-anchor": "^1.2.9",
|
|
56
56
|
"@codama/renderers-js": "^1.4.2",
|
|
57
57
|
"@solana/kit": "^2.1.1",
|
|
58
|
-
"@wuwei-labs/slyvault": "1.1.
|
|
58
|
+
"@wuwei-labs/slyvault": "1.1.2"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/node": "^24.0.3",
|