Skip to content

Commit

Permalink
feat: wrap methods with is
Browse files Browse the repository at this point in the history
chore: updated deps
  • Loading branch information
krigga committed Sep 16, 2024
1 parent c79864b commit 7b2781c
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 39 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.21.0] - 2024-09-16

### Added

- `SandboxContract` now wraps methods starting with `is` (having the same semantics as `get`) as well as `send` and `get`

### Changed

- Updated dependencies

## [0.20.0] - 2024-05-31

### Added
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ton/sandbox",
"version": "0.20.0",
"version": "0.21.0",
"description": "TON transaction emulator",
"main": "dist/index.js",
"license": "MIT",
Expand All @@ -13,10 +13,10 @@
"url": "git+https://github.com/ton-org/sandbox"
},
"devDependencies": {
"@ton/core": "^0.56.0",
"@ton/crypto": "3.2.0",
"@ton/core": "^0.58.1",
"@ton/crypto": "3.3.0",
"@ton/test-utils": "^0.3.1",
"@ton/ton": "^13.11.0",
"@ton/ton": "^15.0.0",
"@types/jest": "^29.5.0",
"@types/node": "^18.15.11",
"jest": "^29.5.0",
Expand All @@ -25,8 +25,8 @@
"typescript": "^4.9.5"
},
"peerDependencies": {
"@ton/core": ">=0.56.0",
"@ton/crypto": ">=3.2.0"
"@ton/core": ">=0.58.1",
"@ton/crypto": ">=3.3.0"
},
"scripts": {
"wasm:pack": "ts-node ./scripts/pack-wasm.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/blockchain/Blockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const SANDBOX_CONTRACT_SYMBOL = Symbol('SandboxContract')
* @template F Type parameter representing the original contract object.
*/
export type SandboxContract<F> = {
[P in keyof F]: P extends `get${string}`
[P in keyof F]: P extends `${'get' | 'is'}${string}`
? (F[P] extends (x: infer CP, ...args: infer P) => infer R ? (ExtendsContractProvider<CP> extends true ? (...args: P) => R : never) : never)
: (P extends `send${string}`
? (F[P] extends (x: infer CP, ...args: infer P) => infer R ? (ExtendsContractProvider<CP> extends true ? (...args: P) => Promise<SendMessageResult & {
Expand Down
123 changes: 91 additions & 32 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -789,54 +789,54 @@ __metadata:
languageName: node
linkType: hard

"@ton/core@npm:^0.56.0":
version: 0.56.0
resolution: "@ton/core@npm:0.56.0"
"@ton/core@npm:^0.58.1":
version: 0.58.1
resolution: "@ton/core@npm:0.58.1"
dependencies:
symbol.inspect: 1.0.1
peerDependencies:
"@ton/crypto": ">=3.2.0"
checksum: ce7540c8ee079908a756d789833a672710251a5543f2af00122b965d21f31de2d5d4fa0d2ce232d531ae772919fbc65ec0ca498b475a042f99e7738f80590872
checksum: f762e96203acb85a3637f9657f1f2320f6777afe31c0611acbd6ca03371c43d701e66d379424a556d47cb8945bafeb64b06ba0d1e6c301665d7e40548d9c697d
languageName: node
linkType: hard

"@ton/crypto-primitives@npm:2.0.0":
version: 2.0.0
resolution: "@ton/crypto-primitives@npm:2.0.0"
"@ton/crypto-primitives@npm:2.1.0":
version: 2.1.0
resolution: "@ton/crypto-primitives@npm:2.1.0"
dependencies:
jssha: 3.2.0
checksum: 1a686b04dc1430792341339f0ddc1e2f5effd94d31ae118baf2c510e074201495801787b2ca881a6ceb587f89212eb081ec9e3979d374d9c9004c6c4b61fc591
checksum: 71119f74461ae17bf2cfe7e0a6fcea8d4e359665ea6878b0c935cfd83ca0d84f9c299df3467adb1b1b7ba50f7d446732f2c13b5ea5e26dc1703a6dc24063be3a
languageName: node
linkType: hard

"@ton/crypto@npm:3.2.0":
version: 3.2.0
resolution: "@ton/crypto@npm:3.2.0"
"@ton/crypto@npm:3.3.0":
version: 3.3.0
resolution: "@ton/crypto@npm:3.3.0"
dependencies:
"@ton/crypto-primitives": 2.0.0
"@ton/crypto-primitives": 2.1.0
jssha: 3.2.0
tweetnacl: 1.0.3
checksum: 0851fad506796573ec6079c1f36d3d07f4070abb90a4a2f3e621f6b2b2c6725c13096a5afdabb24611aa2a063ba335dcbc742e98a3c1cd0bbf3645ae55c1a8c6
checksum: e25036de9850b284dac53ef51dbf00ce63f9d451b2a3a2720d91e9f5b3d6b335e045510cd38d99cce8095b468ad312da76f607ca99a5b66d1b5059c9844b4098
languageName: node
linkType: hard

"@ton/sandbox@workspace:.":
version: 0.0.0-use.local
resolution: "@ton/sandbox@workspace:."
dependencies:
"@ton/core": ^0.56.0
"@ton/crypto": 3.2.0
"@ton/core": ^0.58.1
"@ton/crypto": 3.3.0
"@ton/test-utils": ^0.3.1
"@ton/ton": ^13.11.0
"@ton/ton": ^15.0.0
"@types/jest": ^29.5.0
"@types/node": ^18.15.11
jest: ^29.5.0
ts-jest: ^29.0.5
ts-node: ^10.9.1
typescript: ^4.9.5
peerDependencies:
"@ton/core": ">=0.56.0"
"@ton/crypto": ">=3.2.0"
"@ton/core": ">=0.58.1"
"@ton/crypto": ">=3.3.0"
languageName: unknown
linkType: soft

Expand All @@ -858,19 +858,19 @@ __metadata:
languageName: node
linkType: hard

"@ton/ton@npm:^13.11.0":
version: 13.11.0
resolution: "@ton/ton@npm:13.11.0"
"@ton/ton@npm:^15.0.0":
version: 15.0.0
resolution: "@ton/ton@npm:15.0.0"
dependencies:
axios: ^0.25.0
axios: ^1.6.7
dataloader: ^2.0.0
symbol.inspect: 1.0.1
teslabot: ^1.3.0
zod: ^3.21.4
peerDependencies:
"@ton/core": ">=0.56.0"
"@ton/crypto": ">=3.2.0"
checksum: 21484bb4828d6b7d35c0fa8bd6131218b5200782f85fd3c285bf8e1ba71c8c8e9fc9f69d7531f5f8f715b8eb15fdfdae63dba5cf1fc94d75a5919860e24290d3
checksum: 713488f1fc016df47a5527b1dc2b694df5461374e3a95de19901ecf79ac22c030c7653ac32a5b645689751806583ab182bd2407a1efdca4aaa8d23b2afe5cee8
languageName: node
linkType: hard

Expand Down Expand Up @@ -1189,12 +1189,21 @@ __metadata:
languageName: node
linkType: hard

"axios@npm:^0.25.0":
version: 0.25.0
resolution: "axios@npm:0.25.0"
"asynckit@npm:^0.4.0":
version: 0.4.0
resolution: "asynckit@npm:0.4.0"
checksum: 7b78c451df768adba04e2d02e63e2d0bf3b07adcd6e42b4cf665cb7ce899bedd344c69a1dcbce355b5f972d597b25aaa1c1742b52cffd9caccb22f348114f6be
languageName: node
linkType: hard

"axios@npm:^1.6.7":
version: 1.7.7
resolution: "axios@npm:1.7.7"
dependencies:
follow-redirects: ^1.14.7
checksum: 2a8a3787c05f2a0c9c3878f49782357e2a9f38945b93018fb0c4fd788171c43dceefbb577988628e09fea53952744d1ecebde234b561f1e703aa43e0a598a3ad
follow-redirects: ^1.15.6
form-data: ^4.0.0
proxy-from-env: ^1.1.0
checksum: 882d4fe0ec694a07c7f5c1f68205eb6dc5a62aecdb632cc7a4a3d0985188ce3030e0b277e1a8260ac3f194d314ae342117660a151fabffdc5081ca0b5a8b47fe
languageName: node
linkType: hard

Expand Down Expand Up @@ -1518,6 +1527,15 @@ __metadata:
languageName: node
linkType: hard

"combined-stream@npm:^1.0.8":
version: 1.0.8
resolution: "combined-stream@npm:1.0.8"
dependencies:
delayed-stream: ~1.0.0
checksum: 49fa4aeb4916567e33ea81d088f6584749fc90c7abec76fd516bf1c5aa5c79f3584b5ba3de6b86d26ddd64bae5329c4c7479343250cfe71c75bb366eae53bb7c
languageName: node
linkType: hard

"concat-map@npm:0.0.1":
version: 0.0.1
resolution: "concat-map@npm:0.0.1"
Expand Down Expand Up @@ -1597,6 +1615,13 @@ __metadata:
languageName: node
linkType: hard

"delayed-stream@npm:~1.0.0":
version: 1.0.0
resolution: "delayed-stream@npm:1.0.0"
checksum: 46fe6e83e2cb1d85ba50bd52803c68be9bd953282fa7096f51fc29edd5d67ff84ff753c51966061e5ba7cb5e47ef6d36a91924eddb7f3f3483b1c560f77a0020
languageName: node
linkType: hard

"delegates@npm:^1.0.0":
version: 1.0.0
resolution: "delegates@npm:1.0.0"
Expand Down Expand Up @@ -1810,13 +1835,13 @@ __metadata:
languageName: node
linkType: hard

"follow-redirects@npm:^1.14.7":
version: 1.15.2
resolution: "follow-redirects@npm:1.15.2"
"follow-redirects@npm:^1.15.6":
version: 1.15.9
resolution: "follow-redirects@npm:1.15.9"
peerDependenciesMeta:
debug:
optional: true
checksum: faa66059b66358ba65c234c2f2a37fcec029dc22775f35d9ad6abac56003268baf41e55f9ee645957b32c7d9f62baf1f0b906e68267276f54ec4b4c597c2b190
checksum: 859e2bacc7a54506f2bf9aacb10d165df78c8c1b0ceb8023f966621b233717dab56e8d08baadc3ad3b9db58af290413d585c999694b7c146aaf2616340c3d2a6
languageName: node
linkType: hard

Expand All @@ -1830,6 +1855,17 @@ __metadata:
languageName: node
linkType: hard

"form-data@npm:^4.0.0":
version: 4.0.0
resolution: "form-data@npm:4.0.0"
dependencies:
asynckit: ^0.4.0
combined-stream: ^1.0.8
mime-types: ^2.1.12
checksum: 01135bf8675f9d5c61ff18e2e2932f719ca4de964e3be90ef4c36aacfc7b9cb2fceb5eca0b7e0190e3383fe51c5b37f4cb80b62ca06a99aaabfcfd6ac7c9328c
languageName: node
linkType: hard

"fs-minipass@npm:^2.0.0":
version: 2.1.0
resolution: "fs-minipass@npm:2.1.0"
Expand Down Expand Up @@ -2856,6 +2892,22 @@ __metadata:
languageName: node
linkType: hard

"mime-db@npm:1.52.0":
version: 1.52.0
resolution: "mime-db@npm:1.52.0"
checksum: 0d99a03585f8b39d68182803b12ac601d9c01abfa28ec56204fa330bc9f3d1c5e14beb049bafadb3dbdf646dfb94b87e24d4ec7b31b7279ef906a8ea9b6a513f
languageName: node
linkType: hard

"mime-types@npm:^2.1.12":
version: 2.1.35
resolution: "mime-types@npm:2.1.35"
dependencies:
mime-db: 1.52.0
checksum: 89a5b7f1def9f3af5dad6496c5ed50191ae4331cc5389d7c521c8ad28d5fdad2d06fd81baf38fed813dc4e46bb55c8145bb0ff406330818c9cf712fb2e9b3836
languageName: node
linkType: hard

"mimic-fn@npm:^2.1.0":
version: 2.1.0
resolution: "mimic-fn@npm:2.1.0"
Expand Down Expand Up @@ -3255,6 +3307,13 @@ __metadata:
languageName: node
linkType: hard

"proxy-from-env@npm:^1.1.0":
version: 1.1.0
resolution: "proxy-from-env@npm:1.1.0"
checksum: ed7fcc2ba0a33404958e34d95d18638249a68c430e30fcb6c478497d72739ba64ce9810a24f53a7d921d0c065e5b78e3822759800698167256b04659366ca4d4
languageName: node
linkType: hard

"pure-rand@npm:^6.0.0":
version: 6.0.2
resolution: "pure-rand@npm:6.0.2"
Expand Down

0 comments on commit 7b2781c

Please sign in to comment.