-
Notifications
You must be signed in to change notification settings - Fork 46
/
transaction.go
36 lines (31 loc) · 1.12 KB
/
transaction.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package antchain
import "context"
func (c *client) CreateAccount(ctx context.Context, account, kmsID string, gas int) (string, error) {
return c.chainCallForBiz(ctx, "TENANTCREATEACCUNT",
WithParam("newAccountId", account),
WithParam("newAccountKmsId", kmsID),
WithParam("gas", gas),
)
}
func (c *client) Deposit(ctx context.Context, content string, gas int) (string, error) {
return c.chainCallForBiz(ctx, "DEPOSIT",
WithParam("content", content),
WithParam("gas", gas),
)
}
func (c *client) DeploySolidity(ctx context.Context, name, code string, gas int) (string, error) {
return c.chainCallForBiz(ctx, "DEPLOYCONTRACTFORBIZ",
WithParam("contractName", name),
WithParam("contractCode", code),
WithParam("gas", gas),
)
}
func (c *client) AsyncCallSolidity(ctx context.Context, contractName, methodSign, inputParams, outTypes string, gas int) (string, error) {
return c.chainCallForBiz(ctx, "CALLCONTRACTBIZASYNC",
WithParam("contractName", contractName),
WithParam("methodSignature", methodSign),
WithParam("inputParamListStr", inputParams),
WithParam("outTypes", outTypes),
WithParam("gas", gas),
)
}