Skip to content

Commit 123ae05

Browse files
Merge pull request #57 from IntersectMBO/feat/upgrade-modules-11
fix: optimize Hash implementations and update tests for ExUnits class
2 parents 683c575 + e21b7f5 commit 123ae05

File tree

403 files changed

+18668
-19549
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

403 files changed

+18668
-19549
lines changed

docs/content/docs/addresses/address-types/base.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const address = new Core.BaseAddress.BaseAddress({
3636
});
3737

3838
// Convert to Bech32 string
39-
const bech32 = Core.Address.toBech32(address);
39+
const bech32 = Core.AddressEras.toBech32(address);
4040
console.log(bech32); // "addr1..."
4141
```
4242

@@ -49,7 +49,7 @@ import { Core } from "@evolution-sdk/evolution";
4949

5050
const bech32 = "addr1qx2kd28nq8ac5prwg32hhvudlwggpgfp8utlyqxu6wqgz62f79qsdmm5dsknt9ecr5w468r9ey0fxwkdrwh08ly3tu9sy0f4qd";
5151

52-
const address = Core.Address.fromBech32(bech32) as Core.BaseAddress.BaseAddress;
52+
const address = Core.AddressEras.fromBech32(bech32) as Core.BaseAddress.BaseAddress;
5353

5454
console.log("Network ID:", address.networkId);
5555
console.log("Payment:", address.paymentCredential);
@@ -74,7 +74,7 @@ const scriptAddress = new Core.BaseAddress.BaseAddress({
7474
})
7575
});
7676

77-
const bech32 = Core.Address.toBech32(scriptAddress);
77+
const bech32 = Core.AddressEras.toBech32(scriptAddress);
7878
console.log("Script-based address:", bech32);
7979
```
8080

docs/content/docs/addresses/address-types/enterprise.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const address = new Core.EnterpriseAddress.EnterpriseAddress({
3131
});
3232

3333
// Convert to Bech32 string
34-
const bech32 = Core.Address.toBech32(address);
34+
const bech32 = Core.AddressEras.toBech32(address);
3535
console.log(bech32); // "addr1..."
3636
```
3737

@@ -44,7 +44,7 @@ import { Core } from "@evolution-sdk/evolution";
4444

4545
const bech32 = "addr1vx2kd28nq8ac5prwg32hhvudlwggpgfp8utlyqxu6wqgz6cevnrgl";
4646

47-
const address = Core.Address.fromBech32(bech32) as Core.EnterpriseAddress.EnterpriseAddress;
47+
const address = Core.AddressEras.fromBech32(bech32) as Core.EnterpriseAddress.EnterpriseAddress;
4848

4949
console.log("Network ID:", address.networkId);
5050
console.log("Payment:", address.paymentCredential);
@@ -66,7 +66,7 @@ const scriptAddr = new Core.EnterpriseAddress.EnterpriseAddress({
6666
});
6767

6868
// Convert to Bech32 string
69-
const bech32 = Core.Address.toBech32(scriptAddr);
69+
const bech32 = Core.AddressEras.toBech32(scriptAddr);
7070
console.log("Script enterprise address:", bech32);
7171
```
7272

docs/content/docs/modules/core/Address.mdx

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ Added in v1.0.0
1818
- [fromBech32](#frombech32)
1919
- [Schema](#schema)
2020
- [Address (class)](#address-class)
21+
- [toJSON (method)](#tojson-method)
2122
- [toString (method)](#tostring-method)
22-
- [[Symbol.for("nodejs.util.inspect.custom")] (method)](#symbolfornodejsutilinspectcustom-method)
23+
- [[Inspectable.NodeInspectSymbol] (method)](#inspectablenodeinspectsymbol-method)
24+
- [[Equal.symbol] (method)](#equalsymbol-method)
25+
- [[Hash.symbol] (method)](#hashsymbol-method)
2326
- [Transformations](#transformations)
2427
- [FromBech32](#frombech32-1)
2528
- [FromBytes](#frombytes)
2629
- [FromHex](#fromhex)
2730
- [Utils](#utils)
28-
- [equals](#equals)
2931
- [getNetworkId](#getnetworkid)
3032
- [hasStakingCredential](#hasstakingcredential)
3133
- [isEnterprise](#isenterprise)
3234
- [utils](#utils-1)
33-
- [AddressError (class)](#addresserror-class)
34-
- [Either (namespace)](#either-namespace)
3535
- [fromBytes](#frombytes-1)
3636
- [fromHex](#fromhex-1)
3737
- [toBech32](#tobech32)
@@ -58,12 +58,12 @@ Added in v1.0.0
5858
5959
## fromBech32
6060
61-
Sync functions using Function module utilities
61+
Sync functions using Schema utilities
6262
6363
**Signature**
6464
6565
```ts
66-
export declare const fromBech32: (input: string) => Address
66+
export declare const fromBech32: (i: string, overrideOptions?: ParseOptions) => Address
6767
```
6868
6969
Added in v1.0.0
@@ -80,6 +80,14 @@ export declare class Address
8080

8181
Added in v1.0.0
8282

83+
### toJSON (method)
84+
85+
**Signature**
86+
87+
```ts
88+
toJSON()
89+
```
90+
8391
### toString (method)
8492

8593
**Signature**
@@ -88,12 +96,28 @@ Added in v1.0.0
8896
toString(): string
8997
```
9098

91-
### [Symbol.for("nodejs.util.inspect.custom")] (method)
99+
### [Inspectable.NodeInspectSymbol] (method)
100+
101+
**Signature**
102+
103+
```ts
104+
[Inspectable.NodeInspectSymbol](): unknown
105+
```
106+
107+
### [Equal.symbol] (method)
108+
109+
**Signature**
110+
111+
```ts
112+
[Equal.symbol](that: unknown): boolean
113+
```
114+
115+
### [Hash.symbol] (method)
92116

93117
**Signature**
94118

95119
```ts
96-
[Symbol.for("nodejs.util.inspect.custom")](): string
120+
[Hash.symbol](): number
97121
```
98122

99123
# Transformations
@@ -152,18 +176,6 @@ Added in v1.0.0
152176

153177
# Utils
154178

155-
## equals
156-
157-
Check if two AddressStructure instances are equal.
158-
159-
**Signature**
160-
161-
```ts
162-
export declare const equals: (a: Address, b: Address) => boolean
163-
```
164-
165-
Added in v1.0.0
166-
167179
## getNetworkId
168180

169181
Get network ID from AddressStructure
@@ -202,52 +214,42 @@ Added in v1.0.0
202214

203215
# utils
204216

205-
## AddressError (class)
206-
207-
**Signature**
208-
209-
```ts
210-
export declare class AddressError
211-
```
212-
213-
## Either (namespace)
214-
215217
## fromBytes
216218

217219
**Signature**
218220

219221
```ts
220-
export declare const fromBytes: (input: any) => Address
222+
export declare const fromBytes: (i: any, overrideOptions?: ParseOptions) => Address
221223
```
222224

223225
## fromHex
224226

225227
**Signature**
226228

227229
```ts
228-
export declare const fromHex: (input: string) => Address
230+
export declare const fromHex: (i: string, overrideOptions?: ParseOptions) => Address
229231
```
230232

231233
## toBech32
232234

233235
**Signature**
234236

235237
```ts
236-
export declare const toBech32: (input: Address) => string
238+
export declare const toBech32: (a: Address, overrideOptions?: ParseOptions) => string
237239
```
238240

239241
## toBytes
240242

241243
**Signature**
242244

243245
```ts
244-
export declare const toBytes: (input: Address) => any
246+
export declare const toBytes: (a: Address, overrideOptions?: ParseOptions) => any
245247
```
246248

247249
## toHex
248250

249251
**Signature**
250252

251253
```ts
252-
export declare const toHex: (input: Address) => string
254+
export declare const toHex: (a: Address, overrideOptions?: ParseOptions) => string
253255
```

docs/content/docs/modules/core/AddressEras.mdx

Lines changed: 15 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@ parent: Modules
1212

1313
- [arbitrary](#arbitrary)
1414
- [arbitrary](#arbitrary-1)
15-
- [effect](#effect)
16-
- [Either (namespace)](#either-namespace)
1715
- [encoding](#encoding)
1816
- [toBech32](#tobech32)
1917
- [toBytes](#tobytes)
2018
- [toHex](#tohex)
2119
- [model](#model)
2220
- [AddressEras](#addresseras)
2321
- [AddressEras (type alias)](#addresseras-type-alias)
24-
- [AddressErasError (class)](#addresseraserror-class)
2522
- [parsing](#parsing)
2623
- [fromBech32](#frombech32)
2724
- [fromBytes](#frombytes)
@@ -31,7 +28,6 @@ parent: Modules
3128
- [FromBytes](#frombytes-1)
3229
- [FromHex](#fromhex-1)
3330
- [utils](#utils)
34-
- [equals](#equals)
3531
- [isAddress](#isaddress)
3632

3733
---
@@ -55,14 +51,6 @@ export declare const arbitrary: FastCheck.Arbitrary<
5551
5652
Added in v2.0.0
5753
58-
# effect
59-
60-
## Either (namespace)
61-
62-
Effect-based error handling variants for functions that can fail.
63-
64-
Added in v2.0.0
65-
6654
# encoding
6755
6856
## toBech32
@@ -73,12 +61,13 @@ Convert an Address to Bech32 string.
7361
7462
```ts
7563
export declare const toBech32: (
76-
input:
64+
a:
7765
| RewardAccount.RewardAccount
7866
| BaseAddress.BaseAddress
7967
| EnterpriseAddress.EnterpriseAddress
8068
| PointerAddress.PointerAddress
81-
| ByronAddress.ByronAddress
69+
| ByronAddress.ByronAddress,
70+
overrideOptions?: ParseOptions
8271
) => string
8372
```
8473
@@ -92,12 +81,13 @@ Convert an Address to bytes.
9281
9382
```ts
9483
export declare const toBytes: (
95-
input:
84+
a:
9685
| RewardAccount.RewardAccount
9786
| BaseAddress.BaseAddress
9887
| EnterpriseAddress.EnterpriseAddress
9988
| PointerAddress.PointerAddress
100-
| ByronAddress.ByronAddress
89+
| ByronAddress.ByronAddress,
90+
overrideOptions?: ParseOptions
10191
) => any
10292
```
10393
@@ -111,12 +101,13 @@ Convert an Address to hex string.
111101
112102
```ts
113103
export declare const toHex: (
114-
input:
104+
a:
115105
| RewardAccount.RewardAccount
116106
| BaseAddress.BaseAddress
117107
| EnterpriseAddress.EnterpriseAddress
118108
| PointerAddress.PointerAddress
119-
| ByronAddress.ByronAddress
109+
| ByronAddress.ByronAddress,
110+
overrideOptions?: ParseOptions
120111
) => string
121112
```
122113
@@ -156,18 +147,6 @@ export type AddressEras = typeof AddressEras.Type
156147
157148
Added in v2.0.0
158149
159-
## AddressErasError (class)
160-
161-
Error thrown when address operations fail
162-
163-
**Signature**
164-
165-
```ts
166-
export declare class AddressErasError
167-
```
168-
169-
Added in v2.0.0
170-
171150
# parsing
172151
173152
## fromBech32
@@ -178,7 +157,8 @@ Parse an Address from Bech32 string.
178157
179158
```ts
180159
export declare const fromBech32: (
181-
input: string
160+
i: string,
161+
overrideOptions?: ParseOptions
182162
) =>
183163
| RewardAccount.RewardAccount
184164
| BaseAddress.BaseAddress
@@ -197,7 +177,8 @@ Parse an Address from bytes.
197177
198178
```ts
199179
export declare const fromBytes: (
200-
input: any
180+
i: any,
181+
overrideOptions?: ParseOptions
201182
) =>
202183
| RewardAccount.RewardAccount
203184
| BaseAddress.BaseAddress
@@ -216,7 +197,8 @@ Parse an Address from hex string.
216197
217198
```ts
218199
export declare const fromHex: (
219-
input: string
200+
i: string,
201+
overrideOptions?: ParseOptions
220202
) =>
221203
| RewardAccount.RewardAccount
222204
| BaseAddress.BaseAddress
@@ -318,18 +300,6 @@ Added in v2.0.0
318300
319301
# utils
320302
321-
## equals
322-
323-
Checks if two addresses are equal.
324-
325-
**Signature**
326-
327-
```ts
328-
export declare const equals: (a: AddressEras, b: AddressEras) => boolean
329-
```
330-
331-
Added in v2.0.0
332-
333303
## isAddress
334304
335305
**Signature**

0 commit comments

Comments
 (0)