@alephium/web3 0.4.0 → 0.5.0-rc.1
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/alephium-web3.min.js +1 -1
- package/dist/alephium-web3.min.js.map +1 -1
- package/dist/src/api/api-alephium.d.ts +5 -3
- package/dist/src/api/api-alephium.js +1 -1
- package/dist/src/api/types.d.ts +1 -0
- package/dist/src/api/types.js +9 -1
- package/dist/src/constants.d.ts +1 -0
- package/dist/src/constants.js +2 -1
- package/dist/src/contract/contract.d.ts +90 -49
- package/dist/src/contract/contract.js +297 -77
- package/dist/src/contract/ralph.js +12 -3
- package/dist/src/signer/tx-builder.js +2 -2
- package/dist/src/signer/types.d.ts +2 -4
- package/dist/src/utils/utils.d.ts +1 -0
- package/dist/src/utils/utils.js +3 -1
- package/package.json +3 -3
- package/src/api/api-alephium.ts +5 -3
- package/src/api/types.ts +8 -0
- package/src/constants.ts +1 -0
- package/src/contract/contract.ts +472 -143
- package/src/contract/ralph.ts +13 -3
- package/src/signer/tx-builder.ts +2 -2
- package/src/signer/types.ts +14 -6
- package/src/utils/utils.ts +4 -1
package/src/api/api-alephium.ts
CHANGED
|
@@ -577,7 +577,8 @@ export interface ContractState {
|
|
|
577
577
|
|
|
578
578
|
/** @format 32-byte-hash */
|
|
579
579
|
initialStateHash?: string
|
|
580
|
-
|
|
580
|
+
immFields: Val[]
|
|
581
|
+
mutFields: Val[]
|
|
581
582
|
asset: AssetState
|
|
582
583
|
}
|
|
583
584
|
|
|
@@ -884,7 +885,8 @@ export interface TestContract {
|
|
|
884
885
|
|
|
885
886
|
/** @format contract */
|
|
886
887
|
bytecode: string
|
|
887
|
-
|
|
888
|
+
initialImmFields?: Val[]
|
|
889
|
+
initialMutFields?: Val[]
|
|
888
890
|
initialAsset?: AssetState
|
|
889
891
|
|
|
890
892
|
/** @format int32 */
|
|
@@ -1332,7 +1334,7 @@ export class HttpClient<SecurityDataType = unknown> {
|
|
|
1332
1334
|
|
|
1333
1335
|
/**
|
|
1334
1336
|
* @title Alephium API
|
|
1335
|
-
* @version 1.
|
|
1337
|
+
* @version 1.7.0
|
|
1336
1338
|
* @baseUrl ../
|
|
1337
1339
|
*/
|
|
1338
1340
|
export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
|
package/src/api/types.ts
CHANGED
|
@@ -227,3 +227,11 @@ function foldVals(vals: Val[], dims: number[]): Val {
|
|
|
227
227
|
return result
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
|
+
|
|
231
|
+
export function typeLength(tpe: string): number {
|
|
232
|
+
if (tpe === 'U256' || tpe === 'I256' || tpe === 'Bool' || tpe === 'ByteVec' || tpe === 'Address') {
|
|
233
|
+
return 1
|
|
234
|
+
}
|
|
235
|
+
const [, dims] = decodeArrayType(tpe)
|
|
236
|
+
return dims.reduce((a, b) => a * b)
|
|
237
|
+
}
|
package/src/constants.ts
CHANGED