@alephium/web3 0.1.0-rc.0 → 0.1.0-rc.3

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.
@@ -35,7 +35,7 @@ export interface AssetOutput {
35
35
  /** @format 32-byte-hash */
36
36
  key: string;
37
37
  /** @format uint256 */
38
- alphAmount: string;
38
+ attoAlphAmount: string;
39
39
  /** @format address */
40
40
  address: string;
41
41
  tokens: Token[];
@@ -47,7 +47,7 @@ export interface AssetOutput {
47
47
  }
48
48
  export interface AssetState {
49
49
  /** @format uint256 */
50
- alphAmount: string;
50
+ attoAlphAmount: string;
51
51
  tokens?: Token[];
52
52
  }
53
53
  export interface BadRequest {
@@ -125,7 +125,7 @@ export interface BuildDeployContractTx {
125
125
  /** @format hex-string */
126
126
  bytecode: string;
127
127
  /** @format uint256 */
128
- initialAlphAmount?: string;
128
+ initialAttoAlphAmount?: string;
129
129
  initialTokenAmounts?: Token[];
130
130
  /** @format uint256 */
131
131
  issueTokenAmount?: string;
@@ -153,7 +153,7 @@ export interface BuildExecuteScriptTx {
153
153
  /** @format hex-string */
154
154
  bytecode: string;
155
155
  /** @format uint256 */
156
- alphAmount?: string;
156
+ attoAlphAmount?: string;
157
157
  tokens?: Token[];
158
158
  /** @format gas */
159
159
  gasAmount?: number;
@@ -319,7 +319,7 @@ export interface ContractOutput {
319
319
  /** @format 32-byte-hash */
320
320
  key: string;
321
321
  /** @format uint256 */
322
- alphAmount: string;
322
+ attoAlphAmount: string;
323
323
  /** @format address */
324
324
  address: string;
325
325
  tokens: Token[];
@@ -349,7 +349,7 @@ export interface Destination {
349
349
  /** @format address */
350
350
  address: string;
351
351
  /** @format uint256 */
352
- alphAmount: string;
352
+ attoAlphAmount: string;
353
353
  tokens?: Token[];
354
354
  /** @format int64 */
355
355
  lockTime?: number;
@@ -376,7 +376,7 @@ export interface FixedAssetOutput {
376
376
  /** @format 32-byte-hash */
377
377
  key: string;
378
378
  /** @format uint256 */
379
- alphAmount: string;
379
+ attoAlphAmount: string;
380
380
  /** @format address */
381
381
  address: string;
382
382
  tokens: Token[];
@@ -158,7 +158,7 @@ export interface DeployContractTransaction {
158
158
  export interface BuildDeployContractTx {
159
159
  signerAddress: string;
160
160
  initialFields?: Fields;
161
- initialAlphAmount?: string;
161
+ initialAttoAlphAmount?: string;
162
162
  initialTokenAmounts?: Token[];
163
163
  issueTokenAmount?: Number256;
164
164
  gasAmount?: number;
@@ -168,7 +168,7 @@ export interface BuildDeployContractTx {
168
168
  export interface BuildExecuteScriptTx {
169
169
  signerAddress: string;
170
170
  initialFields?: Fields;
171
- alphAmount?: Number256;
171
+ attoAlphAmount?: Number256;
172
172
  tokens?: Token[];
173
173
  gasAmount?: number;
174
174
  gasPrice?: Number256;
@@ -364,7 +364,7 @@ class Contract extends Common {
364
364
  const signerParams = {
365
365
  signerAddress: params.signerAddress,
366
366
  bytecode: bytecode,
367
- initialAlphAmount: extractOptionalNumber256(params.initialAlphAmount),
367
+ initialAttoAlphAmount: extractOptionalNumber256(params.initialAttoAlphAmount),
368
368
  issueTokenAmount: extractOptionalNumber256(params.issueTokenAmount),
369
369
  initialTokenAmounts: params.initialTokenAmounts?.map(toApiToken),
370
370
  gasAmount: params.gasAmount,
@@ -455,7 +455,7 @@ class Script extends Common {
455
455
  const signerParams = {
456
456
  signerAddress: params.signerAddress,
457
457
  bytecode: this.buildByteCodeToDeploy(params.initialFields ? params.initialFields : {}),
458
- alphAmount: extractOptionalNumber256(params.alphAmount),
458
+ attoAlphAmount: extractOptionalNumber256(params.attoAlphAmount),
459
459
  tokens: typeof params.tokens !== 'undefined' ? params.tokens.map(toApiToken) : undefined,
460
460
  gasAmount: params.gasAmount,
461
461
  gasPrice: extractOptionalNumber256(params.gasPrice)
@@ -681,13 +681,13 @@ function fromApiToken(token) {
681
681
  }
682
682
  function toApiAsset(asset) {
683
683
  return {
684
- alphAmount: extractNumber256(asset.alphAmount),
684
+ attoAlphAmount: extractNumber256(asset.alphAmount),
685
685
  tokens: typeof asset.tokens !== 'undefined' ? asset.tokens.map(toApiToken) : []
686
686
  };
687
687
  }
688
688
  function fromApiAsset(asset) {
689
689
  return {
690
- alphAmount: decodeNumber256(asset.alphAmount),
690
+ alphAmount: decodeNumber256(asset.attoAlphAmount),
691
691
  tokens: typeof asset.tokens !== 'undefined' ? asset.tokens.map(fromApiToken) : undefined
692
692
  };
693
693
  }
@@ -734,7 +734,7 @@ function fromApiOutput(output) {
734
734
  return {
735
735
  type: 'AssetOutput',
736
736
  address: asset.address,
737
- alphAmount: decodeNumber256(asset.alphAmount),
737
+ alphAmount: decodeNumber256(asset.attoAlphAmount),
738
738
  tokens: asset.tokens.map(fromApiToken),
739
739
  lockTime: asset.lockTime,
740
740
  message: asset.message
@@ -745,7 +745,7 @@ function fromApiOutput(output) {
745
745
  return {
746
746
  type: 'ContractOutput',
747
747
  address: asset.address,
748
- alphAmount: decodeNumber256(asset.alphAmount),
748
+ alphAmount: decodeNumber256(asset.attoAlphAmount),
749
749
  tokens: asset.tokens.map(fromApiToken)
750
750
  };
751
751
  }
@@ -39,7 +39,7 @@ export interface SignTransferTxResult {
39
39
  export interface SignDeployContractTxParams {
40
40
  signerAddress: string;
41
41
  bytecode: string;
42
- initialAlphAmount?: string;
42
+ initialAttoAlphAmount?: string;
43
43
  initialTokenAmounts?: Token[];
44
44
  issueTokenAmount?: string;
45
45
  gasAmount?: number;
@@ -58,7 +58,7 @@ export interface SignDeployContractTxResult {
58
58
  export interface SignExecuteScriptTxParams {
59
59
  signerAddress: string;
60
60
  bytecode: string;
61
- alphAmount?: string;
61
+ attoAlphAmount?: string;
62
62
  tokens?: node.Token[];
63
63
  gasAmount?: number;
64
64
  gasPrice?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alephium/web3",
3
- "version": "0.1.0-rc.0",
3
+ "version": "0.1.0-rc.3",
4
4
  "description": "A JS/TS library to interact with the Alephium platform",
5
5
  "license": "GPL",
6
6
  "main": "dist/src/index.js",
@@ -27,8 +27,8 @@
27
27
  },
28
28
  "author": "Alephium dev <dev@alephium.org>",
29
29
  "config": {
30
- "alephium_version": "1.4.0-rc2",
31
- "explorer_backend_version": "1.7.0-leman1"
30
+ "alephium_version": "1.4.0-rc3",
31
+ "explorer_backend_version": "1.7.0-leman2"
32
32
  },
33
33
  "scripts": {
34
34
  "build": "rm -rf dist/* && npx tsc --build . && webpack",
@@ -59,10 +59,9 @@
59
59
  "alephium": "dist/scripts/create-project.js"
60
60
  },
61
61
  "dependencies": {
62
- "@scure/bip32": "1.0.1",
63
62
  "base-x": "4.0.0",
64
- "bip39": "3.0.4",
65
63
  "blakejs": "1.2.1",
64
+ "buffer": "^6.0.3",
66
65
  "commander": "^9.1.0",
67
66
  "cross-fetch": "^3.1.5",
68
67
  "crypto-js": "4.1.1",
@@ -83,7 +82,6 @@
83
82
  "@typescript-eslint/eslint-plugin": "^4.30.0",
84
83
  "@typescript-eslint/parser": "^4.30.0",
85
84
  "babel-eslint": "^10.1.0",
86
- "buffer": "^6.0.3",
87
85
  "clean-webpack-plugin": "4.0.0",
88
86
  "crypto-browserify": "^3.12.0",
89
87
  "eslint": "^7.32.0",
@@ -59,7 +59,7 @@ export interface AssetOutput {
59
59
  key: string
60
60
 
61
61
  /** @format uint256 */
62
- alphAmount: string
62
+ attoAlphAmount: string
63
63
 
64
64
  /** @format address */
65
65
  address: string
@@ -75,7 +75,7 @@ export interface AssetOutput {
75
75
 
76
76
  export interface AssetState {
77
77
  /** @format uint256 */
78
- alphAmount: string
78
+ attoAlphAmount: string
79
79
  tokens?: Token[]
80
80
  }
81
81
 
@@ -175,7 +175,7 @@ export interface BuildDeployContractTx {
175
175
  bytecode: string
176
176
 
177
177
  /** @format uint256 */
178
- initialAlphAmount?: string
178
+ initialAttoAlphAmount?: string
179
179
  initialTokenAmounts?: Token[]
180
180
 
181
181
  /** @format uint256 */
@@ -214,7 +214,7 @@ export interface BuildExecuteScriptTx {
214
214
  bytecode: string
215
215
 
216
216
  /** @format uint256 */
217
- alphAmount?: string
217
+ attoAlphAmount?: string
218
218
  tokens?: Token[]
219
219
 
220
220
  /** @format gas */
@@ -427,7 +427,7 @@ export interface ContractOutput {
427
427
  key: string
428
428
 
429
429
  /** @format uint256 */
430
- alphAmount: string
430
+ attoAlphAmount: string
431
431
 
432
432
  /** @format address */
433
433
  address: string
@@ -466,7 +466,7 @@ export interface Destination {
466
466
  address: string
467
467
 
468
468
  /** @format uint256 */
469
- alphAmount: string
469
+ attoAlphAmount: string
470
470
  tokens?: Token[]
471
471
 
472
472
  /** @format int64 */
@@ -502,7 +502,7 @@ export interface FixedAssetOutput {
502
502
  key: string
503
503
 
504
504
  /** @format uint256 */
505
- alphAmount: string
505
+ attoAlphAmount: string
506
506
 
507
507
  /** @format address */
508
508
  address: string
@@ -466,7 +466,7 @@ export class Contract extends Common {
466
466
  const signerParams: SignDeployContractTxParams = {
467
467
  signerAddress: params.signerAddress,
468
468
  bytecode: bytecode,
469
- initialAlphAmount: extractOptionalNumber256(params.initialAlphAmount),
469
+ initialAttoAlphAmount: extractOptionalNumber256(params.initialAttoAlphAmount),
470
470
  issueTokenAmount: extractOptionalNumber256(params.issueTokenAmount),
471
471
  initialTokenAmounts: params.initialTokenAmounts?.map(toApiToken),
472
472
  gasAmount: params.gasAmount,
@@ -580,7 +580,7 @@ export class Script extends Common {
580
580
  const signerParams: SignExecuteScriptTxParams = {
581
581
  signerAddress: params.signerAddress,
582
582
  bytecode: this.buildByteCodeToDeploy(params.initialFields ? params.initialFields : {}),
583
- alphAmount: extractOptionalNumber256(params.alphAmount),
583
+ attoAlphAmount: extractOptionalNumber256(params.attoAlphAmount),
584
584
  tokens: typeof params.tokens !== 'undefined' ? params.tokens.map(toApiToken) : undefined,
585
585
  gasAmount: params.gasAmount,
586
586
  gasPrice: extractOptionalNumber256(params.gasPrice)
@@ -825,14 +825,14 @@ function fromApiToken(token: node.Token): Token {
825
825
 
826
826
  function toApiAsset(asset: Asset): node.AssetState {
827
827
  return {
828
- alphAmount: extractNumber256(asset.alphAmount),
828
+ attoAlphAmount: extractNumber256(asset.alphAmount),
829
829
  tokens: typeof asset.tokens !== 'undefined' ? asset.tokens.map(toApiToken) : []
830
830
  }
831
831
  }
832
832
 
833
833
  function fromApiAsset(asset: node.AssetState): Asset {
834
834
  return {
835
- alphAmount: decodeNumber256(asset.alphAmount),
835
+ alphAmount: decodeNumber256(asset.attoAlphAmount),
836
836
  tokens: typeof asset.tokens !== 'undefined' ? asset.tokens.map(fromApiToken) : undefined
837
837
  }
838
838
  }
@@ -950,7 +950,7 @@ function fromApiOutput(output: node.Output): Output {
950
950
  return {
951
951
  type: 'AssetOutput',
952
952
  address: asset.address,
953
- alphAmount: decodeNumber256(asset.alphAmount),
953
+ alphAmount: decodeNumber256(asset.attoAlphAmount),
954
954
  tokens: asset.tokens.map(fromApiToken),
955
955
  lockTime: asset.lockTime,
956
956
  message: asset.message
@@ -960,7 +960,7 @@ function fromApiOutput(output: node.Output): Output {
960
960
  return {
961
961
  type: 'ContractOutput',
962
962
  address: asset.address,
963
- alphAmount: decodeNumber256(asset.alphAmount),
963
+ alphAmount: decodeNumber256(asset.attoAlphAmount),
964
964
  tokens: asset.tokens.map(fromApiToken)
965
965
  }
966
966
  } else {
@@ -986,7 +986,7 @@ type BuildTxParams<T> = Omit<T, 'bytecode'> & { initialFields?: Val[] }
986
986
  export interface BuildDeployContractTx {
987
987
  signerAddress: string
988
988
  initialFields?: Fields
989
- initialAlphAmount?: string
989
+ initialAttoAlphAmount?: string
990
990
  initialTokenAmounts?: Token[]
991
991
  issueTokenAmount?: Number256
992
992
  gasAmount?: number
@@ -998,7 +998,7 @@ assertType<Eq<keyof BuildDeployContractTx, keyof BuildTxParams<SignDeployContrac
998
998
  export interface BuildExecuteScriptTx {
999
999
  signerAddress: string
1000
1000
  initialFields?: Fields
1001
- alphAmount?: Number256
1001
+ attoAlphAmount?: Number256
1002
1002
  tokens?: Token[]
1003
1003
  gasAmount?: number
1004
1004
  gasPrice?: Number256
@@ -68,7 +68,7 @@ assertType<Eq<SignTransferTxResult, SignResult>>()
68
68
  export interface SignDeployContractTxParams {
69
69
  signerAddress: string
70
70
  bytecode: string
71
- initialAlphAmount?: string
71
+ initialAttoAlphAmount?: string
72
72
  initialTokenAmounts?: Token[]
73
73
  issueTokenAmount?: string
74
74
  gasAmount?: number
@@ -90,7 +90,7 @@ assertType<Eq<SignDeployContractTxResult, SignResult & { contractId: string; con
90
90
  export interface SignExecuteScriptTxParams {
91
91
  signerAddress: string
92
92
  bytecode: string
93
- alphAmount?: string
93
+ attoAlphAmount?: string
94
94
  tokens?: node.Token[]
95
95
  gasAmount?: number
96
96
  gasPrice?: string
@@ -12,7 +12,7 @@
12
12
  "stop-devnet": "node scripts/stop-devnet.js"
13
13
  },
14
14
  "dependencies": {
15
- "@alephium/web3": "0.1.0-rc.0"
15
+ "@alephium/web3": "0.1.0-rc.3"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/elliptic": "^6.4.13",
@@ -12,7 +12,7 @@
12
12
  "@types/node": "^16.11.26",
13
13
  "@types/react": "^18.0.3",
14
14
  "@types/react-dom": "^18.0.0",
15
- "@alephium/web3": "0.1.0-rc.0",
15
+ "@alephium/web3": "0.1.0-rc.3",
16
16
  "react": "^18.0.0",
17
17
  "react-dom": "^18.0.0",
18
18
  "react-scripts": "5.0.1",