@@ -19,12 +19,13 @@ import { Contract } from '@aeternity/aepp-sdk' (Using bundle)
19
19
* [ @aeternity/aepp-sdk /es/ae/contract] ( #module_@aeternity/aepp-sdk/es/ae/contract )
20
20
* [ Contract([ options] )] ( #exp_module_@aeternity/aepp-sdk/es/ae/contract--Contract ) ⇒ ` Object ` ⏏
21
21
* _ async_
22
- * [ encodeCall(code, abi, name, args, call )] ( #exp_module_@aeternity/aepp-sdk/es/ae/contract--encodeCall ) ⇒ ` Promise.<Object > ` ⏏
23
- * [ callStatic(address, abi, name, options, top, args, call, options )] ( #exp_module_@aeternity/aepp-sdk/es/ae/contract--callStatic ) ⇒ ` Promise.<Object > ` ⏏
22
+ * [ handleCallError(result )] ( #exp_module_@aeternity/aepp-sdk/es/ae/contract--handleCallError ) ⇒ ` Promise.<void > ` ⏏
23
+ * [ encodeCall(source, name, args)] ( #exp_module_@aeternity/aepp-sdk/es/ae/contract--encodeCall ) ⇒ ` Promise.<String > ` ⏏
24
24
* [ decode(type, data)] ( #exp_module_@aeternity/aepp-sdk/es/ae/contract--decode ) ⇒ ` Promise.<String> ` ⏏
25
- * [ call(code, abi, address, name, [ options] )] ( #exp_module_@aeternity/aepp-sdk/es/ae/contract--call ) ⇒ ` Promise.<Object> ` ⏏
26
- * [ deploy(code, abi, [ options] )] ( #exp_module_@aeternity/aepp-sdk/es/ae/contract--deploy ) ⇒ ` Promise.<Object> ` ⏏
27
- * [ compile(code, options)] ( #exp_module_@aeternity/aepp-sdk/es/ae/contract--compile ) ⇒ ` Promise.<Object> ` ⏏
25
+ * [ callStatic(source, address, name, args, options, top, options)] ( #exp_module_@aeternity/aepp-sdk/es/ae/contract--callStatic ) ⇒ ` Promise.<Object> ` ⏏
26
+ * [ call(source, address, name, args, options)] ( #exp_module_@aeternity/aepp-sdk/es/ae/contract--call ) ⇒ ` Promise.<Object> ` ⏏
27
+ * [ deploy(code, source, initState, options)] ( #exp_module_@aeternity/aepp-sdk/es/ae/contract--deploy ) ⇒ ` Promise.<Object> ` ⏏
28
+ * [ compile(source, options)] ( #exp_module_@aeternity/aepp-sdk/es/ae/contract--compile ) ⇒ ` Promise.<Object> ` ⏏
28
29
29
30
<a id =" exp_module_@aeternity/aepp-sdk/es/ae/contract--Contract " ></a >
30
31
@@ -42,41 +43,35 @@ Provide contract implementation
42
43
| --- | --- | --- | --- |
43
44
| [ options] | ` Object ` | <code >{}</code > | Initializer object |
44
45
45
- <a id =" exp_module_@aeternity/aepp-sdk/es/ae/contract--encodeCall " ></a >
46
+ <a id =" exp_module_@aeternity/aepp-sdk/es/ae/contract--handleCallError " ></a >
46
47
47
- ### encodeCall(code, abi, name, args, call ) ⇒ ` Promise.<Object > ` ⏏
48
- Encode call data for contract call
48
+ ### handleCallError(result ) ⇒ ` Promise.<void > ` ⏏
49
+ Handle contract call error
49
50
50
51
** Kind** : Exported function
51
52
** Category** : async
53
+ ** Throws** :
54
+
55
+ - Error Decoded error
56
+
52
57
53
58
| Param | Type | Description |
54
59
| --- | --- | --- |
55
- | code | ` String ` | Contract source code or Contract address |
56
- | abi | ` String ` | ABI('sophia', 'sophia-address') |
57
- | name | ` String ` | Name of function to call |
58
- | args | ` String ` | Argument's for call ('()') |
59
- | call | ` String ` | Code of ` call ` contract(Pseudo code with __ call => {name}({args}) function) |
60
+ | result | ` Object ` | call result object |
60
61
61
- <a id =" exp_module_@aeternity/aepp-sdk/es/ae/contract--callStatic " ></a >
62
+ <a id =" exp_module_@aeternity/aepp-sdk/es/ae/contract--encodeCall " ></a >
62
63
63
- ### callStatic(address, abi, name, options, top, args, call, options ) ⇒ ` Promise.<Object > ` ⏏
64
- Static contract call(using dry-run)
64
+ ### encodeCall(source, name, args) ⇒ ` Promise.<String > ` ⏏
65
+ Encode call data for contract call
65
66
66
67
** Kind** : Exported function
67
- ** Returns** : ` Promise.<Object> ` - Result object
68
68
** Category** : async
69
69
70
- | Param | Type | Default | Description |
71
- | --- | --- | --- | --- |
72
- | address | ` String ` | | Contract address |
73
- | abi | ` String ` | <code >sophia-address</code > | ABI('sophia', 'sophia-address') |
74
- | name | ` String ` | | Name of function to call |
75
- | options | ` Object ` | | [ options={}] Options |
76
- | top | ` String ` | | [ options.top] Block hash ob which you want to call contract |
77
- | args | ` String ` | | [ options.args] Argument's for call function |
78
- | call | ` String ` | | [ options.call] Code of ` call ` contract(Pseudo code with __ call => {name}({args}) function) |
79
- | options | ` String ` | | [ options.options] Transaction options (fee, ttl, gas, amount, deposit) |
70
+ | Param | Type | Description |
71
+ | --- | --- | --- |
72
+ | source | ` String ` | Contract source code |
73
+ | name | ` String ` | Name of function to call |
74
+ | args | ` Array ` | Argument's for call |
80
75
81
76
<a id =" exp_module_@aeternity/aepp-sdk/es/ae/contract--decode " ></a >
82
77
@@ -92,46 +87,61 @@ Decode contract call result data
92
87
| type | ` String ` | Data type (int, string, list,...) |
93
88
| data | ` String ` | call result data (cb_iwer89fjsdf2j93fjews_ (ssdffsdfsdf...) |
94
89
90
+ <a id =" exp_module_@aeternity/aepp-sdk/es/ae/contract--callStatic " ></a >
91
+
92
+ ### callStatic(source, address, name, args, options, top, options) ⇒ ` Promise.<Object> ` ⏏
93
+ Static contract call(using dry-run)
94
+
95
+ ** Kind** : Exported function
96
+ ** Returns** : ` Promise.<Object> ` - Result object
97
+ ** Category** : async
98
+
99
+ | Param | Type | Description |
100
+ | --- | --- | --- |
101
+ | source | ` String ` | Contract source code |
102
+ | address | ` String ` | Contract address |
103
+ | name | ` String ` | Name of function to call |
104
+ | args | ` Array ` | Argument's for call function |
105
+ | options | ` Object ` | [ options={}] Options |
106
+ | top | ` String ` | [ options.top] Block hash on which you want to call contract |
107
+ | options | ` String ` | [ options.options] Transaction options (fee, ttl, gas, amount, deposit) |
108
+
95
109
<a id =" exp_module_@aeternity/aepp-sdk/es/ae/contract--call " ></a >
96
110
97
- ### call(code, abi, address, name, [ options] ) ⇒ ` Promise.<Object> ` ⏏
111
+ ### call(source, address, name, args, options) ⇒ ` Promise.<Object> ` ⏏
98
112
Call contract function
99
113
100
114
** Kind** : Exported function
101
115
** Returns** : ` Promise.<Object> ` - Result object
102
116
** Category** : async
103
117
104
- | Param | Type | Default | Description |
105
- | --- | --- | --- | --- |
106
- | code | ` String ` | | Contract source code |
107
- | abi | ` String ` | | ABI('sophia', 'sophia-address') |
108
- | address | ` String ` | | Contract address |
109
- | name | ` String ` | | Name of function to call |
110
- | [ options] | ` Object ` | <code >{}</code > | options Options |
111
- | [ options.args] | ` String ` | | args Argument's for call function |
112
- | [ options.call] | ` String ` | | call Code of ` call ` contract(Pseudo code with __ call => {name}({args}) function) |
113
- | [ options.options] | ` String ` | | options Transaction options (fee, ttl, gas, amount, deposit) |
118
+ | Param | Type | Description |
119
+ | --- | --- | --- |
120
+ | source | ` String ` | Contract source code |
121
+ | address | ` String ` | Contract address |
122
+ | name | ` String ` | Name of function to call |
123
+ | args | ` Array ` | Argument's for call function |
124
+ | options | ` Object ` | Transaction options (fee, ttl, gas, amount, deposit) |
114
125
115
126
<a id =" exp_module_@aeternity/aepp-sdk/es/ae/contract--deploy " ></a >
116
127
117
- ### deploy(code, abi, [ options] ) ⇒ ` Promise.<Object> ` ⏏
128
+ ### deploy(code, source, initState, options) ⇒ ` Promise.<Object> ` ⏏
118
129
Deploy contract to the node
119
130
120
131
** Kind** : Exported function
121
132
** Returns** : ` Promise.<Object> ` - Result object
122
133
** Category** : async
123
134
124
- | Param | Type | Default | Description |
125
- | --- | --- | --- | --- |
126
- | code | ` String ` | | Contract source code |
127
- | abi | ` String ` | | ABI('sophia', 'sophia-address') |
128
- | [ options] | ` Object ` | <code >{}</code > | options Options |
129
- | [ options.initState] | ` String ` | | initState Argument's for contract init function |
130
- | [ options.options] | ` String ` | | options Transaction options (fee, ttl, gas, amount, deposit) |
135
+ | Param | Type | Description |
136
+ | --- | --- | --- |
137
+ | code | ` String ` | Compiled contract |
138
+ | source | ` String ` | Contract source code |
139
+ | initState | ` Array ` | Arguments of contract constructor(init) function |
140
+ | options | ` Object ` | Transaction options (fee, ttl, gas, amount, deposit) |
131
141
132
142
<a id =" exp_module_@aeternity/aepp-sdk/es/ae/contract--compile " ></a >
133
143
134
- ### compile(code , options) ⇒ ` Promise.<Object> ` ⏏
144
+ ### compile(source , options) ⇒ ` Promise.<Object> ` ⏏
135
145
Compile contract source code
136
146
137
147
** Kind** : Exported function
@@ -140,6 +150,6 @@ Compile contract source code
140
150
141
151
| Param | Type | Description |
142
152
| --- | --- | --- |
143
- | code | ` String ` | Contract code |
153
+ | source | ` String ` | Contract sourece code |
144
154
| options | ` Object ` | Transaction options (fee, ttl, gas, amount, deposit) |
145
155
0 commit comments