@aeternity/aepp-sdk 13.0.0 → 13.1.0
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/README.md +4 -2
- package/bin/aesophia_cli +0 -0
- package/dist/aepp-sdk.browser-script.js +1 -1
- package/dist/aepp-sdk.browser-script.js.map +1 -1
- package/dist/aepp-sdk.browser.js +1 -1
- package/dist/aepp-sdk.browser.js.map +1 -1
- package/dist/aepp-sdk.js +27068 -16862
- package/dist/aepp-sdk.js.map +1 -1
- package/es/AeSdkBase.d.ts +11 -3
- package/es/AeSdkBase.mjs +24 -3
- package/es/AeSdkBase.mjs.map +1 -1
- package/es/AeSdkMethods.d.ts +9 -14
- package/es/AeSdkMethods.mjs +20 -49
- package/es/AeSdkMethods.mjs.map +1 -1
- package/es/AeSdkWallet.mjs +28 -5
- package/es/AeSdkWallet.mjs.map +1 -1
- package/es/Middleware.d.ts +38 -0
- package/es/Middleware.mjs +90 -0
- package/es/Middleware.mjs.map +1 -0
- package/es/MiddlewareSubscriber.d.ts +30 -0
- package/es/MiddlewareSubscriber.mjs +198 -0
- package/es/MiddlewareSubscriber.mjs.map +1 -0
- package/es/Node.d.ts +1 -1
- package/es/Node.mjs.map +1 -1
- package/es/account/Base.d.ts +14 -2
- package/es/account/Base.mjs.map +1 -1
- package/es/account/Generalized.d.ts +1 -0
- package/es/account/Generalized.mjs +5 -0
- package/es/account/Generalized.mjs.map +1 -1
- package/es/account/Ledger.d.ts +1 -0
- package/es/account/Ledger.mjs +5 -0
- package/es/account/Ledger.mjs.map +1 -1
- package/es/account/Memory.d.ts +2 -0
- package/es/account/Memory.mjs +18 -0
- package/es/account/Memory.mjs.map +1 -1
- package/es/account/Rpc.d.ts +1 -6
- package/es/account/Rpc.mjs +24 -10
- package/es/account/Rpc.mjs.map +1 -1
- package/es/aens.d.ts +1 -1
- package/es/aens.mjs +1 -1
- package/es/aens.mjs.map +1 -1
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs +5 -2
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -1
- package/es/aepp-wallet-communication/rpc/types.d.ts +10 -0
- package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -1
- package/es/aepp-wallet-communication/schema.d.ts +1 -8
- package/es/aepp-wallet-communication/schema.mjs +1 -14
- package/es/aepp-wallet-communication/schema.mjs.map +1 -1
- package/es/aepp-wallet-communication/wallet-detector.d.ts +1 -1
- package/es/aepp-wallet-communication/wallet-detector.mjs +0 -3
- package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -1
- package/es/apis/compiler/compiler.mjs +15 -1
- package/es/apis/compiler/compiler.mjs.map +1 -1
- package/es/apis/compiler/models/index.d.ts +1 -7
- package/es/apis/compiler/models/index.mjs.map +1 -1
- package/es/apis/compiler/models/mappers.d.ts +0 -1
- package/es/apis/compiler/models/mappers.mjs +0 -43
- package/es/apis/compiler/models/mappers.mjs.map +1 -1
- package/es/apis/middleware/index.d.ts +2 -0
- package/es/apis/middleware/index.mjs +3 -0
- package/es/apis/middleware/index.mjs.map +1 -0
- package/es/apis/middleware/middleware.d.ts +309 -0
- package/es/apis/middleware/middleware.mjs +1527 -0
- package/es/apis/middleware/middleware.mjs.map +1 -0
- package/es/apis/middleware/models/index.d.ts +1496 -0
- package/es/apis/middleware/models/index.mjs +364 -0
- package/es/apis/middleware/models/index.mjs.map +1 -0
- package/es/apis/middleware/models/mappers.d.ts +102 -0
- package/es/apis/middleware/models/mappers.mjs +3334 -0
- package/es/apis/middleware/models/mappers.mjs.map +1 -0
- package/es/apis/middleware/models/parameters.d.ts +43 -0
- package/es/apis/middleware/models/parameters.mjs +417 -0
- package/es/apis/middleware/models/parameters.mjs.map +1 -0
- package/es/chain.d.ts +2 -1
- package/es/chain.mjs +4 -2
- package/es/chain.mjs.map +1 -1
- package/es/channel/Base.d.ts +1 -1
- package/es/channel/Base.mjs +1 -4
- package/es/channel/Base.mjs.map +1 -1
- package/es/channel/internal.mjs +2 -0
- package/es/channel/internal.mjs.map +1 -1
- package/es/contract/Contract.d.ts +1 -2
- package/es/contract/Contract.mjs +1 -1
- package/es/contract/Contract.mjs.map +1 -1
- package/es/contract/compiler/Base.d.ts +21 -0
- package/es/contract/compiler/Base.mjs.map +1 -1
- package/es/contract/compiler/Cli.d.ts +2 -0
- package/es/contract/compiler/Cli.mjs +24 -3
- package/es/contract/compiler/Cli.mjs.map +1 -1
- package/es/contract/compiler/Http.d.ts +2 -0
- package/es/contract/compiler/Http.mjs +22 -2
- package/es/contract/compiler/Http.mjs.map +1 -1
- package/es/contract/compiler/HttpNode.d.ts +1 -0
- package/es/contract/compiler/HttpNode.mjs +5 -0
- package/es/contract/compiler/HttpNode.mjs.map +1 -1
- package/es/deprecated.d.ts +14 -0
- package/es/deprecated.mjs +22 -0
- package/es/deprecated.mjs.map +1 -0
- package/es/index-browser.d.ts +20 -14
- package/es/index-browser.mjs +19 -15
- package/es/index-browser.mjs.map +1 -1
- package/es/tx/builder/constants.d.ts +0 -1
- package/es/tx/builder/constants.mjs +0 -1
- package/es/tx/builder/constants.mjs.map +1 -1
- package/es/tx/builder/field-types/coin-amount.d.ts +1 -1
- package/es/tx/builder/field-types/coin-amount.mjs +2 -1
- package/es/tx/builder/field-types/coin-amount.mjs.map +1 -1
- package/es/tx/builder/field-types/deposit.d.ts +1 -1
- package/es/tx/builder/field-types/entry.mjs +2 -1
- package/es/tx/builder/field-types/entry.mjs.map +1 -1
- package/es/tx/builder/field-types/index.d.ts +2 -2
- package/es/tx/builder/helpers.d.ts +8 -1
- package/es/tx/builder/helpers.mjs +53 -9
- package/es/tx/builder/helpers.mjs.map +1 -1
- package/es/tx/builder/index.d.ts +4 -2
- package/es/tx/builder/index.mjs +0 -1
- package/es/tx/builder/index.mjs.map +1 -1
- package/es/tx/builder/schema.d.ts +9 -9
- package/es/tx/execution-cost.d.ts +17 -0
- package/es/tx/execution-cost.mjs +17 -0
- package/es/tx/execution-cost.mjs.map +1 -1
- package/es/tx/validator.mjs +6 -3
- package/es/tx/validator.mjs.map +1 -1
- package/es/utils/amount-formatter.d.ts +1 -2
- package/es/utils/amount-formatter.mjs +2 -2
- package/es/utils/amount-formatter.mjs.map +1 -1
- package/es/utils/autorest.mjs +6 -8
- package/es/utils/autorest.mjs.map +1 -1
- package/es/utils/crypto.d.ts +1 -0
- package/es/utils/crypto.mjs +12 -2
- package/es/utils/crypto.mjs.map +1 -1
- package/es/utils/errors.d.ts +2 -2
- package/es/utils/errors.mjs.map +1 -1
- package/es/utils/other.d.ts +1 -0
- package/es/utils/other.mjs +5 -0
- package/es/utils/other.mjs.map +1 -1
- package/es/utils/typed-data.d.ts +45 -0
- package/es/utils/typed-data.mjs +71 -0
- package/es/utils/typed-data.mjs.map +1 -0
- package/package.json +23 -4
- package/src/AeSdkBase.ts +30 -5
- package/src/AeSdkMethods.ts +31 -50
- package/src/AeSdkWallet.ts +27 -5
- package/src/Middleware.ts +141 -0
- package/src/MiddlewareSubscriber.ts +207 -0
- package/src/Node.ts +1 -1
- package/src/account/Base.ts +20 -3
- package/src/account/Generalized.ts +5 -0
- package/src/account/Ledger.ts +5 -0
- package/src/account/Memory.ts +15 -0
- package/src/account/Rpc.ts +19 -7
- package/src/aens.ts +1 -1
- package/src/aepp-wallet-communication/rpc/RpcClient.ts +11 -3
- package/src/aepp-wallet-communication/rpc/types.ts +11 -0
- package/src/aepp-wallet-communication/schema.ts +2 -17
- package/src/aepp-wallet-communication/wallet-detector.ts +1 -2
- package/src/apis/compiler/compiler.ts +8 -1
- package/src/apis/compiler/models/index.ts +1 -8
- package/src/apis/compiler/models/mappers.ts +0 -36
- package/src/apis/middleware/index.ts +2 -0
- package/src/apis/middleware/middleware.ts +1807 -0
- package/src/apis/middleware/models/index.ts +1747 -0
- package/src/apis/middleware/models/mappers.ts +3370 -0
- package/src/apis/middleware/models/parameters.ts +463 -0
- package/src/chain.ts +3 -2
- package/src/channel/Base.ts +5 -5
- package/src/channel/internal.ts +2 -0
- package/src/contract/Contract.ts +2 -1
- package/src/contract/compiler/Base.ts +26 -0
- package/src/contract/compiler/Cli.ts +27 -3
- package/src/contract/compiler/Http.ts +21 -2
- package/src/contract/compiler/HttpNode.ts +6 -0
- package/src/deprecated.ts +23 -0
- package/src/index-browser.ts +77 -15
- package/src/tx/builder/constants.ts +0 -1
- package/src/tx/builder/field-types/coin-amount.ts +2 -1
- package/src/tx/builder/field-types/entry.ts +1 -1
- package/src/tx/builder/helpers.ts +54 -9
- package/src/tx/builder/index.ts +6 -9
- package/src/tx/execution-cost.ts +17 -0
- package/src/tx/validator.ts +4 -2
- package/src/utils/amount-formatter.ts +1 -1
- package/src/utils/autorest.ts +5 -10
- package/src/utils/crypto.ts +12 -2
- package/src/utils/errors.ts +2 -2
- package/src/utils/other.ts +5 -0
- package/src/utils/typed-data.ts +95 -0
- package/types-legacy/ts4.2/AeSdkBase.d.ts +11 -3
- package/types-legacy/ts4.2/AeSdkMethods.d.ts +9 -14
- package/types-legacy/ts4.2/Middleware.d.ts +46 -0
- package/types-legacy/ts4.2/MiddlewareSubscriber.d.ts +30 -0
- package/types-legacy/ts4.2/Node.d.ts +1 -1
- package/types-legacy/ts4.2/account/Base.d.ts +14 -2
- package/types-legacy/ts4.2/account/Generalized.d.ts +1 -0
- package/types-legacy/ts4.2/account/Ledger.d.ts +1 -0
- package/types-legacy/ts4.2/account/Memory.d.ts +2 -0
- package/types-legacy/ts4.2/account/Rpc.d.ts +1 -6
- package/types-legacy/ts4.2/aens.d.ts +1 -1
- package/types-legacy/ts4.2/aepp-wallet-communication/rpc/types.d.ts +10 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/schema.d.ts +1 -8
- package/types-legacy/ts4.2/aepp-wallet-communication/wallet-detector.d.ts +1 -1
- package/types-legacy/ts4.2/apis/compiler/models/index.d.ts +1 -7
- package/types-legacy/ts4.2/apis/compiler/models/mappers.d.ts +0 -1
- package/types-legacy/ts4.2/apis/middleware/index.d.ts +2 -0
- package/types-legacy/ts4.2/apis/middleware/middleware.d.ts +309 -0
- package/types-legacy/ts4.2/apis/middleware/models/index.d.ts +1496 -0
- package/types-legacy/ts4.2/apis/middleware/models/mappers.d.ts +102 -0
- package/types-legacy/ts4.2/apis/middleware/models/parameters.d.ts +43 -0
- package/types-legacy/ts4.2/chain.d.ts +2 -1
- package/types-legacy/ts4.2/channel/Base.d.ts +1 -1
- package/types-legacy/ts4.2/contract/Contract.d.ts +1 -2
- package/types-legacy/ts4.2/contract/compiler/Base.d.ts +21 -0
- package/types-legacy/ts4.2/contract/compiler/Cli.d.ts +2 -0
- package/types-legacy/ts4.2/contract/compiler/Http.d.ts +2 -0
- package/types-legacy/ts4.2/contract/compiler/HttpNode.d.ts +1 -0
- package/types-legacy/ts4.2/deprecated.d.ts +14 -0
- package/types-legacy/ts4.2/index-browser.d.ts +20 -14
- package/types-legacy/ts4.2/tx/builder/constants.d.ts +0 -1
- package/types-legacy/ts4.2/tx/builder/field-types/coin-amount.d.ts +1 -1
- package/types-legacy/ts4.2/tx/builder/field-types/deposit.d.ts +1 -1
- package/types-legacy/ts4.2/tx/builder/field-types/index.d.ts +2 -2
- package/types-legacy/ts4.2/tx/builder/helpers.d.ts +8 -1
- package/types-legacy/ts4.2/tx/builder/index.d.ts +4 -2
- package/types-legacy/ts4.2/tx/builder/schema.d.ts +9 -9
- package/types-legacy/ts4.2/tx/execution-cost.d.ts +17 -0
- package/types-legacy/ts4.2/utils/amount-formatter.d.ts +1 -2
- package/types-legacy/ts4.2/utils/crypto.d.ts +1 -0
- package/types-legacy/ts4.2/utils/errors.d.ts +2 -2
- package/types-legacy/ts4.2/utils/other.d.ts +1 -0
- package/types-legacy/ts4.2/utils/typed-data.d.ts +60 -0
- package/types-legacy/ts4.5/AeSdkBase.d.ts +11 -3
- package/types-legacy/ts4.5/AeSdkMethods.d.ts +9 -14
- package/types-legacy/ts4.5/Middleware.d.ts +46 -0
- package/types-legacy/ts4.5/MiddlewareSubscriber.d.ts +30 -0
- package/types-legacy/ts4.5/Node.d.ts +1 -1
- package/types-legacy/ts4.5/account/Base.d.ts +14 -2
- package/types-legacy/ts4.5/account/Generalized.d.ts +1 -0
- package/types-legacy/ts4.5/account/Ledger.d.ts +1 -0
- package/types-legacy/ts4.5/account/Memory.d.ts +2 -0
- package/types-legacy/ts4.5/account/Rpc.d.ts +1 -6
- package/types-legacy/ts4.5/aens.d.ts +1 -1
- package/types-legacy/ts4.5/aepp-wallet-communication/rpc/types.d.ts +10 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/schema.d.ts +1 -8
- package/types-legacy/ts4.5/aepp-wallet-communication/wallet-detector.d.ts +1 -1
- package/types-legacy/ts4.5/apis/compiler/models/index.d.ts +1 -7
- package/types-legacy/ts4.5/apis/compiler/models/mappers.d.ts +0 -1
- package/types-legacy/ts4.5/apis/middleware/index.d.ts +2 -0
- package/types-legacy/ts4.5/apis/middleware/middleware.d.ts +309 -0
- package/types-legacy/ts4.5/apis/middleware/models/index.d.ts +1496 -0
- package/types-legacy/ts4.5/apis/middleware/models/mappers.d.ts +102 -0
- package/types-legacy/ts4.5/apis/middleware/models/parameters.d.ts +43 -0
- package/types-legacy/ts4.5/chain.d.ts +2 -1
- package/types-legacy/ts4.5/channel/Base.d.ts +1 -1
- package/types-legacy/ts4.5/contract/Contract.d.ts +1 -2
- package/types-legacy/ts4.5/contract/compiler/Base.d.ts +21 -0
- package/types-legacy/ts4.5/contract/compiler/Cli.d.ts +2 -0
- package/types-legacy/ts4.5/contract/compiler/Http.d.ts +2 -0
- package/types-legacy/ts4.5/contract/compiler/HttpNode.d.ts +1 -0
- package/types-legacy/ts4.5/deprecated.d.ts +14 -0
- package/types-legacy/ts4.5/index-browser.d.ts +20 -14
- package/types-legacy/ts4.5/tx/builder/constants.d.ts +0 -1
- package/types-legacy/ts4.5/tx/builder/field-types/coin-amount.d.ts +1 -1
- package/types-legacy/ts4.5/tx/builder/field-types/deposit.d.ts +1 -1
- package/types-legacy/ts4.5/tx/builder/field-types/index.d.ts +2 -2
- package/types-legacy/ts4.5/tx/builder/helpers.d.ts +8 -1
- package/types-legacy/ts4.5/tx/builder/index.d.ts +4 -2
- package/types-legacy/ts4.5/tx/builder/schema.d.ts +9 -9
- package/types-legacy/ts4.5/tx/execution-cost.d.ts +17 -0
- package/types-legacy/ts4.5/utils/amount-formatter.d.ts +1 -2
- package/types-legacy/ts4.5/utils/crypto.d.ts +1 -0
- package/types-legacy/ts4.5/utils/errors.d.ts +2 -2
- package/types-legacy/ts4.5/utils/other.d.ts +1 -0
- package/types-legacy/ts4.5/utils/typed-data.d.ts +60 -0
- package/es/typings/@aeternity__aepp-calldata/index.d.mjs +0 -2
- package/es/typings/@aeternity__aepp-calldata/index.d.mjs.map +0 -1
- package/src/typings/@aeternity__aepp-calldata/index.d.ts +0 -20
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
export const accept = {
|
|
2
|
+
parameterPath: "accept",
|
|
3
|
+
mapper: {
|
|
4
|
+
defaultValue: "application/json",
|
|
5
|
+
isConstant: true,
|
|
6
|
+
serializedName: "Accept",
|
|
7
|
+
type: {
|
|
8
|
+
name: "String"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
export const $host = {
|
|
13
|
+
parameterPath: "$host",
|
|
14
|
+
mapper: {
|
|
15
|
+
serializedName: "$host",
|
|
16
|
+
required: true,
|
|
17
|
+
type: {
|
|
18
|
+
name: "String"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
skipEncoding: true
|
|
22
|
+
};
|
|
23
|
+
export const id = {
|
|
24
|
+
parameterPath: "id",
|
|
25
|
+
mapper: {
|
|
26
|
+
serializedName: "id",
|
|
27
|
+
required: true,
|
|
28
|
+
type: {
|
|
29
|
+
name: "String"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
export const ownedOnly = {
|
|
34
|
+
parameterPath: ["options", "ownedOnly"],
|
|
35
|
+
mapper: {
|
|
36
|
+
serializedName: "owned_only",
|
|
37
|
+
type: {
|
|
38
|
+
name: "Boolean"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
export const type = {
|
|
43
|
+
parameterPath: ["options", "type"],
|
|
44
|
+
mapper: {
|
|
45
|
+
serializedName: "type",
|
|
46
|
+
type: {
|
|
47
|
+
name: "String"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export const limit = {
|
|
52
|
+
parameterPath: "limit",
|
|
53
|
+
mapper: {
|
|
54
|
+
defaultValue: 10,
|
|
55
|
+
constraints: {
|
|
56
|
+
InclusiveMaximum: 100,
|
|
57
|
+
InclusiveMinimum: 1
|
|
58
|
+
},
|
|
59
|
+
serializedName: "limit",
|
|
60
|
+
type: {
|
|
61
|
+
name: "Number"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
export const scope = {
|
|
66
|
+
parameterPath: "scope",
|
|
67
|
+
mapper: {
|
|
68
|
+
constraints: {
|
|
69
|
+
Pattern: new RegExp("(txi|gen):\\d+(-\\d+)?")
|
|
70
|
+
},
|
|
71
|
+
serializedName: "scope",
|
|
72
|
+
type: {
|
|
73
|
+
name: "String"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
export const direction = {
|
|
78
|
+
parameterPath: "direction",
|
|
79
|
+
mapper: {
|
|
80
|
+
serializedName: "direction",
|
|
81
|
+
type: {
|
|
82
|
+
name: "String"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
export const by = {
|
|
87
|
+
parameterPath: ["options", "by"],
|
|
88
|
+
mapper: {
|
|
89
|
+
serializedName: "by",
|
|
90
|
+
type: {
|
|
91
|
+
name: "String"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
export const prefix = {
|
|
96
|
+
parameterPath: ["options", "prefix"],
|
|
97
|
+
mapper: {
|
|
98
|
+
serializedName: "prefix",
|
|
99
|
+
type: {
|
|
100
|
+
name: "String"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
export const accountId = {
|
|
105
|
+
parameterPath: "accountId",
|
|
106
|
+
mapper: {
|
|
107
|
+
serializedName: "accountId",
|
|
108
|
+
required: true,
|
|
109
|
+
type: {
|
|
110
|
+
name: "String"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
export const contractId = {
|
|
115
|
+
parameterPath: "contractId",
|
|
116
|
+
mapper: {
|
|
117
|
+
serializedName: "contractId",
|
|
118
|
+
required: true,
|
|
119
|
+
type: {
|
|
120
|
+
name: "String"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
export const tokenId = {
|
|
125
|
+
parameterPath: "tokenId",
|
|
126
|
+
mapper: {
|
|
127
|
+
serializedName: "tokenId",
|
|
128
|
+
required: true,
|
|
129
|
+
type: {
|
|
130
|
+
name: "Number"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
export const templateId = {
|
|
135
|
+
parameterPath: "templateId",
|
|
136
|
+
mapper: {
|
|
137
|
+
serializedName: "templateId",
|
|
138
|
+
required: true,
|
|
139
|
+
type: {
|
|
140
|
+
name: "Number"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
export const accountId1 = {
|
|
145
|
+
parameterPath: "accountId",
|
|
146
|
+
mapper: {
|
|
147
|
+
serializedName: "account_id",
|
|
148
|
+
required: true,
|
|
149
|
+
type: {
|
|
150
|
+
name: "String"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
export const sender = {
|
|
155
|
+
parameterPath: "sender",
|
|
156
|
+
mapper: {
|
|
157
|
+
serializedName: "sender",
|
|
158
|
+
required: true,
|
|
159
|
+
type: {
|
|
160
|
+
name: "String"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
export const recipient = {
|
|
165
|
+
parameterPath: "recipient",
|
|
166
|
+
mapper: {
|
|
167
|
+
serializedName: "recipient",
|
|
168
|
+
required: true,
|
|
169
|
+
type: {
|
|
170
|
+
name: "String"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
export const hash = {
|
|
175
|
+
parameterPath: "hash",
|
|
176
|
+
mapper: {
|
|
177
|
+
serializedName: "hash",
|
|
178
|
+
required: true,
|
|
179
|
+
type: {
|
|
180
|
+
name: "String"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
export const hashOrKbi = {
|
|
185
|
+
parameterPath: "hashOrKbi",
|
|
186
|
+
mapper: {
|
|
187
|
+
serializedName: "hash_or_kbi",
|
|
188
|
+
required: true,
|
|
189
|
+
type: {
|
|
190
|
+
name: "String"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
export const kbi = {
|
|
195
|
+
parameterPath: "kbi",
|
|
196
|
+
mapper: {
|
|
197
|
+
serializedName: "kbi",
|
|
198
|
+
required: true,
|
|
199
|
+
type: {
|
|
200
|
+
name: "Number"
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
export const mbi = {
|
|
205
|
+
parameterPath: "mbi",
|
|
206
|
+
mapper: {
|
|
207
|
+
serializedName: "mbi",
|
|
208
|
+
required: true,
|
|
209
|
+
type: {
|
|
210
|
+
name: "Number"
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
export const state = {
|
|
215
|
+
parameterPath: ["options", "state"],
|
|
216
|
+
mapper: {
|
|
217
|
+
serializedName: "state",
|
|
218
|
+
type: {
|
|
219
|
+
name: "String"
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
export const contractId1 = {
|
|
224
|
+
parameterPath: ["options", "contractId"],
|
|
225
|
+
mapper: {
|
|
226
|
+
serializedName: "contract_id",
|
|
227
|
+
type: {
|
|
228
|
+
name: "String"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
export const event = {
|
|
233
|
+
parameterPath: ["options", "event"],
|
|
234
|
+
mapper: {
|
|
235
|
+
serializedName: "event",
|
|
236
|
+
type: {
|
|
237
|
+
name: "String"
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
export const functionPrefix = {
|
|
242
|
+
parameterPath: ["options", "functionPrefix"],
|
|
243
|
+
mapper: {
|
|
244
|
+
serializedName: "function_prefix",
|
|
245
|
+
type: {
|
|
246
|
+
name: "String"
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
export const data = {
|
|
251
|
+
parameterPath: ["options", "data"],
|
|
252
|
+
mapper: {
|
|
253
|
+
serializedName: "data",
|
|
254
|
+
type: {
|
|
255
|
+
name: "String"
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
export const aexnArgs = {
|
|
260
|
+
parameterPath: ["options", "aexnArgs"],
|
|
261
|
+
mapper: {
|
|
262
|
+
serializedName: "aexn-args",
|
|
263
|
+
type: {
|
|
264
|
+
name: "Boolean"
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
export const hash1 = {
|
|
269
|
+
parameterPath: "hash",
|
|
270
|
+
mapper: {
|
|
271
|
+
serializedName: "hash",
|
|
272
|
+
required: true,
|
|
273
|
+
type: {
|
|
274
|
+
name: "String"
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
export const ownedBy = {
|
|
279
|
+
parameterPath: ["options", "ownedBy"],
|
|
280
|
+
mapper: {
|
|
281
|
+
serializedName: "owned_by",
|
|
282
|
+
type: {
|
|
283
|
+
name: "String"
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
export const state1 = {
|
|
288
|
+
parameterPath: ["options", "state"],
|
|
289
|
+
mapper: {
|
|
290
|
+
serializedName: "state",
|
|
291
|
+
type: {
|
|
292
|
+
name: "String"
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
export const type1 = {
|
|
297
|
+
parameterPath: ["options", "type"],
|
|
298
|
+
mapper: {
|
|
299
|
+
serializedName: "type",
|
|
300
|
+
type: {
|
|
301
|
+
name: "Sequence",
|
|
302
|
+
element: {
|
|
303
|
+
type: {
|
|
304
|
+
name: "String"
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
collectionFormat: "Multi"
|
|
310
|
+
};
|
|
311
|
+
export const typeGroup = {
|
|
312
|
+
parameterPath: ["options", "typeGroup"],
|
|
313
|
+
mapper: {
|
|
314
|
+
serializedName: "type_group",
|
|
315
|
+
type: {
|
|
316
|
+
name: "Sequence",
|
|
317
|
+
element: {
|
|
318
|
+
type: {
|
|
319
|
+
name: "String"
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
collectionFormat: "Multi"
|
|
325
|
+
};
|
|
326
|
+
export const account = {
|
|
327
|
+
parameterPath: ["options", "account"],
|
|
328
|
+
mapper: {
|
|
329
|
+
serializedName: "account",
|
|
330
|
+
type: {
|
|
331
|
+
name: "String"
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
export const contract = {
|
|
336
|
+
parameterPath: ["options", "contract"],
|
|
337
|
+
mapper: {
|
|
338
|
+
serializedName: "contract",
|
|
339
|
+
type: {
|
|
340
|
+
name: "String"
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
export const channel = {
|
|
345
|
+
parameterPath: ["options", "channel"],
|
|
346
|
+
mapper: {
|
|
347
|
+
serializedName: "channel",
|
|
348
|
+
type: {
|
|
349
|
+
name: "String"
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
export const oracle = {
|
|
354
|
+
parameterPath: ["options", "oracle"],
|
|
355
|
+
mapper: {
|
|
356
|
+
serializedName: "oracle",
|
|
357
|
+
type: {
|
|
358
|
+
name: "String"
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
export const senderId = {
|
|
363
|
+
parameterPath: ["options", "senderId"],
|
|
364
|
+
mapper: {
|
|
365
|
+
serializedName: "sender_id",
|
|
366
|
+
type: {
|
|
367
|
+
name: "String"
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
export const recipientId = {
|
|
372
|
+
parameterPath: ["options", "recipientId"],
|
|
373
|
+
mapper: {
|
|
374
|
+
serializedName: "recipient_id",
|
|
375
|
+
type: {
|
|
376
|
+
name: "String"
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
export const entrypoint = {
|
|
381
|
+
parameterPath: ["options", "entrypoint"],
|
|
382
|
+
mapper: {
|
|
383
|
+
serializedName: "entrypoint",
|
|
384
|
+
type: {
|
|
385
|
+
name: "String"
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
export const txType = {
|
|
390
|
+
parameterPath: ["options", "txType"],
|
|
391
|
+
mapper: {
|
|
392
|
+
serializedName: "tx_type",
|
|
393
|
+
type: {
|
|
394
|
+
name: "String"
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
export const id1 = {
|
|
399
|
+
parameterPath: ["options", "id"],
|
|
400
|
+
mapper: {
|
|
401
|
+
serializedName: "id",
|
|
402
|
+
type: {
|
|
403
|
+
name: "String"
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
};
|
|
407
|
+
export const hashOrIndex = {
|
|
408
|
+
parameterPath: "hashOrIndex",
|
|
409
|
+
mapper: {
|
|
410
|
+
serializedName: "hash_or_index",
|
|
411
|
+
required: true,
|
|
412
|
+
type: {
|
|
413
|
+
name: "String"
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
//# sourceMappingURL=parameters.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.mjs","names":["accept","parameterPath","mapper","defaultValue","isConstant","serializedName","type","name","$host","required","skipEncoding","id","ownedOnly","limit","constraints","InclusiveMaximum","InclusiveMinimum","scope","Pattern","RegExp","direction","by","prefix","accountId","contractId","tokenId","templateId","accountId1","sender","recipient","hash","hashOrKbi","kbi","mbi","state","contractId1","event","functionPrefix","data","aexnArgs","hash1","ownedBy","state1","type1","element","collectionFormat","typeGroup","account","contract","channel","oracle","senderId","recipientId","entrypoint","txType","id1","hashOrIndex"],"sources":["../../../../src/apis/middleware/models/parameters.ts"],"sourcesContent":["import {\n OperationParameter,\n OperationURLParameter,\n OperationQueryParameter\n} from \"@azure/core-client\";\n\nexport const accept: OperationParameter = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/json\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const $host: OperationURLParameter = {\n parameterPath: \"$host\",\n mapper: {\n serializedName: \"$host\",\n required: true,\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\n\nexport const id: OperationURLParameter = {\n parameterPath: \"id\",\n mapper: {\n serializedName: \"id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const ownedOnly: OperationQueryParameter = {\n parameterPath: [\"options\", \"ownedOnly\"],\n mapper: {\n serializedName: \"owned_only\",\n type: {\n name: \"Boolean\"\n }\n }\n};\n\nexport const type: OperationQueryParameter = {\n parameterPath: [\"options\", \"type\"],\n mapper: {\n serializedName: \"type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const limit: OperationQueryParameter = {\n parameterPath: \"limit\",\n mapper: {\n defaultValue: 10,\n constraints: {\n InclusiveMaximum: 100,\n InclusiveMinimum: 1\n },\n serializedName: \"limit\",\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const scope: OperationQueryParameter = {\n parameterPath: \"scope\",\n mapper: {\n constraints: {\n Pattern: new RegExp(\"(txi|gen):\\\\d+(-\\\\d+)?\")\n },\n serializedName: \"scope\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const direction: OperationQueryParameter = {\n parameterPath: \"direction\",\n mapper: {\n serializedName: \"direction\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const by: OperationQueryParameter = {\n parameterPath: [\"options\", \"by\"],\n mapper: {\n serializedName: \"by\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const prefix: OperationQueryParameter = {\n parameterPath: [\"options\", \"prefix\"],\n mapper: {\n serializedName: \"prefix\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const accountId: OperationURLParameter = {\n parameterPath: \"accountId\",\n mapper: {\n serializedName: \"accountId\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const contractId: OperationURLParameter = {\n parameterPath: \"contractId\",\n mapper: {\n serializedName: \"contractId\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const tokenId: OperationURLParameter = {\n parameterPath: \"tokenId\",\n mapper: {\n serializedName: \"tokenId\",\n required: true,\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const templateId: OperationURLParameter = {\n parameterPath: \"templateId\",\n mapper: {\n serializedName: \"templateId\",\n required: true,\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const accountId1: OperationURLParameter = {\n parameterPath: \"accountId\",\n mapper: {\n serializedName: \"account_id\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const sender: OperationURLParameter = {\n parameterPath: \"sender\",\n mapper: {\n serializedName: \"sender\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const recipient: OperationURLParameter = {\n parameterPath: \"recipient\",\n mapper: {\n serializedName: \"recipient\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const hash: OperationQueryParameter = {\n parameterPath: \"hash\",\n mapper: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const hashOrKbi: OperationURLParameter = {\n parameterPath: \"hashOrKbi\",\n mapper: {\n serializedName: \"hash_or_kbi\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const kbi: OperationURLParameter = {\n parameterPath: \"kbi\",\n mapper: {\n serializedName: \"kbi\",\n required: true,\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const mbi: OperationURLParameter = {\n parameterPath: \"mbi\",\n mapper: {\n serializedName: \"mbi\",\n required: true,\n type: {\n name: \"Number\"\n }\n }\n};\n\nexport const state: OperationQueryParameter = {\n parameterPath: [\"options\", \"state\"],\n mapper: {\n serializedName: \"state\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const contractId1: OperationQueryParameter = {\n parameterPath: [\"options\", \"contractId\"],\n mapper: {\n serializedName: \"contract_id\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const event: OperationQueryParameter = {\n parameterPath: [\"options\", \"event\"],\n mapper: {\n serializedName: \"event\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const functionPrefix: OperationQueryParameter = {\n parameterPath: [\"options\", \"functionPrefix\"],\n mapper: {\n serializedName: \"function_prefix\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const data: OperationQueryParameter = {\n parameterPath: [\"options\", \"data\"],\n mapper: {\n serializedName: \"data\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const aexnArgs: OperationQueryParameter = {\n parameterPath: [\"options\", \"aexnArgs\"],\n mapper: {\n serializedName: \"aexn-args\",\n type: {\n name: \"Boolean\"\n }\n }\n};\n\nexport const hash1: OperationURLParameter = {\n parameterPath: \"hash\",\n mapper: {\n serializedName: \"hash\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const ownedBy: OperationQueryParameter = {\n parameterPath: [\"options\", \"ownedBy\"],\n mapper: {\n serializedName: \"owned_by\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const state1: OperationQueryParameter = {\n parameterPath: [\"options\", \"state\"],\n mapper: {\n serializedName: \"state\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const type1: OperationQueryParameter = {\n parameterPath: [\"options\", \"type\"],\n mapper: {\n serializedName: \"type\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n collectionFormat: \"Multi\"\n};\n\nexport const typeGroup: OperationQueryParameter = {\n parameterPath: [\"options\", \"typeGroup\"],\n mapper: {\n serializedName: \"type_group\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n collectionFormat: \"Multi\"\n};\n\nexport const account: OperationQueryParameter = {\n parameterPath: [\"options\", \"account\"],\n mapper: {\n serializedName: \"account\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const contract: OperationQueryParameter = {\n parameterPath: [\"options\", \"contract\"],\n mapper: {\n serializedName: \"contract\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const channel: OperationQueryParameter = {\n parameterPath: [\"options\", \"channel\"],\n mapper: {\n serializedName: \"channel\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const oracle: OperationQueryParameter = {\n parameterPath: [\"options\", \"oracle\"],\n mapper: {\n serializedName: \"oracle\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const senderId: OperationQueryParameter = {\n parameterPath: [\"options\", \"senderId\"],\n mapper: {\n serializedName: \"sender_id\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const recipientId: OperationQueryParameter = {\n parameterPath: [\"options\", \"recipientId\"],\n mapper: {\n serializedName: \"recipient_id\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const entrypoint: OperationQueryParameter = {\n parameterPath: [\"options\", \"entrypoint\"],\n mapper: {\n serializedName: \"entrypoint\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const txType: OperationQueryParameter = {\n parameterPath: [\"options\", \"txType\"],\n mapper: {\n serializedName: \"tx_type\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const id1: OperationQueryParameter = {\n parameterPath: [\"options\", \"id\"],\n mapper: {\n serializedName: \"id\",\n type: {\n name: \"String\"\n }\n }\n};\n\nexport const hashOrIndex: OperationURLParameter = {\n parameterPath: \"hashOrIndex\",\n mapper: {\n serializedName: \"hash_or_index\",\n required: true,\n type: {\n name: \"String\"\n }\n }\n};\n"],"mappings":"AAMA,OAAO,MAAMA,MAA0B,GAAG;EACxCC,aAAa,EAAE,QAAQ;EACvBC,MAAM,EAAE;IACNC,YAAY,EAAE,kBAAkB;IAChCC,UAAU,EAAE,IAAI;IAChBC,cAAc,EAAE,QAAQ;IACxBC,IAAI,EAAE;MACJC,IAAI,EAAE;IACR;EACF;AACF,CAAC;AAED,OAAO,MAAMC,KAA4B,GAAG;EAC1CP,aAAa,EAAE,OAAO;EACtBC,MAAM,EAAE;IACNG,cAAc,EAAE,OAAO;IACvBI,QAAQ,EAAE,IAAI;IACdH,IAAI,EAAE;MACJC,IAAI,EAAE;IACR;EACF,CAAC;EACDG,YAAY,EAAE;AAChB,CAAC;AAED,OAAO,MAAMC,EAAyB,GAAG;EACvCV,aAAa,EAAE,IAAI;EACnBC,MAAM,EAAE;IACNG,cAAc,EAAE,IAAI;IACpBI,QAAQ,EAAE,IAAI;IACdH,IAAI,EAAE;MACJC,IAAI,EAAE;IACR;EACF;AACF,CAAC;AAED,OAAO,MAAMK,SAAkC,GAAG;EAChDX,aAAa,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC;EACvCC,MAAM,EAAE;IACNG,cAAc,EAAE,YAAY;IAC5BC,IAAI,EAAE;MACJC,IAAI,EAAE;IACR;EACF;AACF,CAAC;AAED,OAAO,MAAMD,IAA6B,GAAG;EAC3CL,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;EAClCC,MAAM,EAAE;IACNG,cAAc,EAAE,MAAM;IACtBC,IAAI,EAAE;MACJC,IAAI,EAAE;IACR;EACF;AACF,CAAC;AAED,OAAO,MAAMM,K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MAAM,EAAE;IACNG,cAAc,EAAE,WAAW;IAC3BC,IAAI,EAAE;MACJC,IAAI,EAAE;IACR;EACF;AACF,CAAC;AAED,OAAO,MAAM6C,WAAoC,GAAG;EAClDnD,aAAa,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC;EACzCC,MAAM,EAAE;IACNG,cAAc,EAAE,cAAc;IAC9BC,IAAI,EAAE;MACJC,IAAI,EAAE;IACR;EACF;AACF,CAAC;AAED,OAAO,MAAM8C,UAAmC,GAAG;EACjDpD,aAAa,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC;EACxCC,MAAM,EAAE;IACNG,cAAc,EAAE,YAAY;IAC5BC,IAAI,EAAE;MACJC,IAAI,EAAE;IACR;EACF;AACF,CAAC;AAED,OAAO,MAAM+C,MAA+B,GAAG;EAC7CrD,aAAa,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;EACpCC,MAAM,EAAE;IACNG,cAAc,EAAE,SAAS;IACzBC,IAAI,EAAE;MACJC,IAAI,EAAE;IACR;EACF;AACF,CAAC;AAED,OAAO,MAAMgD,GAA4B,GAAG;EAC1CtD,aAAa,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;EAChCC,MAAM,EAAE;IACNG,cAAc,EAAE,IAAI;IACpBC,IAAI,EAAE;MACJC,IAAI,EAAE;IACR;EACF;AACF,CAAC;AAED,OAAO,MAAMiD,WAAkC,GAAG;EAChDvD,aAAa,EAAE,aAAa;EAC5BC,MAAM,EAAE;IACNG,cAAc,EAAE,eAAe;IAC/BI,QAAQ,EAAE,IAAI;IACdH,IAAI,EAAE;MACJC,IAAI,EAAE;IACR;EACF;AACF,CAAC"}
|
package/es/chain.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ import AccountBase from './account/Base';
|
|
|
9
9
|
/**
|
|
10
10
|
* @category chain
|
|
11
11
|
*/
|
|
12
|
-
export declare function _getPollInterval(type: 'block' | 'microblock',
|
|
12
|
+
export declare function _getPollInterval(type: 'block' | 'microblock', // TODO: rename to 'key-block' | 'micro-block'
|
|
13
|
+
{ _expectedMineRate, _microBlockCycle, _maxPollInterval }: {
|
|
13
14
|
_expectedMineRate?: number;
|
|
14
15
|
_microBlockCycle?: number;
|
|
15
16
|
_maxPollInterval?: number;
|
package/es/chain.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AE_AMOUNT_FORMATS, formatAmount } from "./utils/amount-formatter.mjs";
|
|
2
2
|
import verifyTransaction from "./tx/validator.mjs";
|
|
3
|
-
import { isAccountNotFoundError, pause } from "./utils/other.mjs";
|
|
3
|
+
import { ensureError, isAccountNotFoundError, pause } from "./utils/other.mjs";
|
|
4
4
|
import { isNameValid, produceNameId } from "./tx/builder/helpers.mjs";
|
|
5
5
|
import { DRY_RUN_ACCOUNT } from "./tx/builder/schema.mjs";
|
|
6
6
|
import { AensPointerContextError, DryRunError, InvalidAensNameError, TransactionError, TxTimedOutError, TxNotInChainError, InternalError } from "./utils/errors.mjs";
|
|
@@ -9,7 +9,8 @@ import { buildTxHash } from "./tx/builder/index.mjs";
|
|
|
9
9
|
/**
|
|
10
10
|
* @category chain
|
|
11
11
|
*/
|
|
12
|
-
export function _getPollInterval(type,
|
|
12
|
+
export function _getPollInterval(type, // TODO: rename to 'key-block' | 'micro-block'
|
|
13
|
+
_ref) {
|
|
13
14
|
let {
|
|
14
15
|
_expectedMineRate = 180000,
|
|
15
16
|
_microBlockCycle = 3000,
|
|
@@ -228,6 +229,7 @@ export async function sendTransaction(txUnsigned, _ref6) {
|
|
|
228
229
|
rawTx: tx
|
|
229
230
|
};
|
|
230
231
|
} catch (error) {
|
|
232
|
+
ensureError(error);
|
|
231
233
|
throw Object.assign(error, {
|
|
232
234
|
rawTx: tx,
|
|
233
235
|
verifyTx: async () => verifyTransaction(tx, onNode)
|
package/es/chain.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain.mjs","names":["AE_AMOUNT_FORMATS","formatAmount","verifyTransaction","isAccountNotFoundError","pause","isNameValid","produceNameId","DRY_RUN_ACCOUNT","AensPointerContextError","DryRunError","InvalidAensNameError","TransactionError","TxTimedOutError","TxNotInChainError","InternalError","decode","encode","Encoding","buildTxHash","_getPollInterval","type","_ref","_expectedMineRate","_microBlockCycle","_maxPollInterval","base","block","microblock","Math","min","InvalidTxError","constructor","message","validation","transaction","name","getHeight","_ref2","onNode","getCurrentKeyBlockHeight","height","poll","th","_ref3","_interval","blocks","interval","options","max","tx","getTransactionByHash","blockHeight","awaitHeight","_ref4","_interval2","currentHeight","waitForTxConfirm","txHash","_ref5","confirm","newBlockHeight","sendTransaction","txUnsigned","_ref6","onAccount","verify","waitMined","innerTx","signTransaction","networkId","getNetworkId","hash","rawTx","length","map","v","join","__queue","address","error","postTransaction","requestOptions","customHeaders","pollResult","txData","c","undefined","confirmationHeight","Object","assign","verifyTx","getAccount","_ref7","getAccountByPubkeyAndHeight","getAccountByPubkeyAndHash","getAccountByPubkey","getBalance","_ref8","format","AETTOS","addr","startsWith","AccountAddress","balance","catch","targetDenomination","getCurrentGeneration","_ref9","getGeneration","hashOrHeight","_ref10","getGenerationByHeight","getGenerationByHash","getMicroBlockTransactions","_ref11","getMicroBlockTransactionsByHash","transactions","getKeyBlock","_ref12","getKeyBlockByHeight","getKeyBlockByHash","getMicroBlockHeader","_ref13","getMicroBlockHeaderByHash","txDryRunRequests","Map","txDryRunHandler","key","rs","get","delete","dryRunRes","top","protectedDryRunTxs","txEvents","txs","req","accounts","Array","from","Set","accountAddress","pubKey","amount","forEach","_ref14","reject","results","_ref15","idx","result","reason","resultPayload","resolve","txDryRun","_ref16","_txDryRunRequests$get","combine","requests","set","Promise","_requests$timeout","push","timeout","setTimeout","getContractByteCode","contractId","_ref17","getContractCode","getContract","_ref18","getName","_ref19","getNameEntryByName","resolveName","nameOrId","_ref20","resolveByNode","pointer","pointers","find","p","id"],"sources":["../src/chain.ts"],"sourcesContent":["import { AE_AMOUNT_FORMATS, formatAmount } from './utils/amount-formatter';\nimport verifyTransaction, { ValidatorResult } from './tx/validator';\nimport { isAccountNotFoundError, pause } from './utils/other';\nimport { isNameValid, produceNameId } from './tx/builder/helpers';\nimport { DRY_RUN_ACCOUNT } from './tx/builder/schema';\nimport { AensName } from './tx/builder/constants';\nimport {\n AensPointerContextError, DryRunError, InvalidAensNameError, TransactionError,\n TxTimedOutError, TxNotInChainError, InternalError,\n} from './utils/errors';\nimport Node, { TransformNodeType } from './Node';\nimport {\n Account as AccountNode, ByteCode, ContractObject, DryRunResult, DryRunResults,\n Generation, KeyBlock, MicroBlockHeader, NameEntry, SignedTx,\n} from './apis/node';\nimport {\n decode, encode, Encoded, Encoding,\n} from './utils/encoder';\nimport AccountBase from './account/Base';\nimport { buildTxHash } from './tx/builder';\n\n/**\n * @category chain\n */\nexport function _getPollInterval(\n type: 'block' | 'microblock',\n { _expectedMineRate = 180000, _microBlockCycle = 3000, _maxPollInterval = 5000 }:\n { _expectedMineRate?: number; _microBlockCycle?: number; _maxPollInterval?: number },\n): number {\n const base = {\n block: _expectedMineRate,\n microblock: _microBlockCycle,\n }[type];\n return Math.min(base / 3, _maxPollInterval);\n}\n\n/**\n * @category exception\n */\nexport class InvalidTxError extends TransactionError {\n validation: ValidatorResult[];\n\n transaction: Encoded.Transaction;\n\n constructor(\n message: string,\n validation: ValidatorResult[],\n transaction: Encoded.Transaction,\n ) {\n super(message);\n this.name = 'InvalidTxError';\n this.validation = validation;\n this.transaction = transaction;\n }\n}\n\n/**\n * Obtain current height of the chain\n * @category chain\n * @returns Current chain height\n */\nexport async function getHeight({ onNode }: { onNode: Node }): Promise<number> {\n return (await onNode.getCurrentKeyBlockHeight()).height;\n}\n\n/**\n * Wait for a transaction to be mined\n * @category chain\n * @param th - The hash of transaction to poll\n * @param options - Options\n * @param options.interval - Interval (in ms) at which to poll the chain\n * @param options.blocks - Number of blocks mined after which to fail\n * @param options.onNode - Node to use\n * @returns The transaction as it was mined\n */\nexport async function poll(\n th: Encoded.TxHash,\n {\n blocks = 5, interval, onNode, ...options\n }:\n { blocks?: number; interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): Promise<TransformNodeType<SignedTx>> {\n interval ??= _getPollInterval('microblock', options);\n const max = await getHeight({ onNode }) + blocks;\n do {\n const tx = await onNode.getTransactionByHash(th);\n if (tx.blockHeight !== -1) return tx;\n await pause(interval);\n } while (await getHeight({ onNode }) < max);\n throw new TxTimedOutError(blocks, th);\n}\n\n/**\n * Wait for the chain to reach a specific height\n * @category chain\n * @param height - Height to wait for\n * @param options - Options\n * @param options.interval - Interval (in ms) at which to poll the chain\n * @param options.onNode - Node to use\n * @returns Current chain height\n */\nexport async function awaitHeight(\n height: number,\n { interval, onNode, ...options }:\n { interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): Promise<number> {\n interval ??= _getPollInterval('block', options);\n let currentHeight;\n do {\n if (currentHeight != null) await pause(interval);\n currentHeight = (await onNode.getCurrentKeyBlockHeight()).height;\n } while (currentHeight < height);\n return currentHeight;\n}\n\n/**\n * Wait for transaction confirmation\n * @category chain\n * @param txHash - Transaction hash\n * @param options - Options\n * @param options.confirm - Number of micro blocks to wait for transaction confirmation\n * @param options.onNode - Node to use\n * @returns Current Height\n */\nexport async function waitForTxConfirm(\n txHash: Encoded.TxHash,\n { confirm = 3, onNode, ...options }:\n { confirm?: number; onNode: Node } & Parameters<typeof awaitHeight>[1],\n): Promise<number> {\n const { blockHeight } = await onNode.getTransactionByHash(txHash);\n const height = await awaitHeight(blockHeight + confirm, { onNode, ...options });\n const { blockHeight: newBlockHeight } = await onNode.getTransactionByHash(txHash);\n switch (newBlockHeight) {\n case -1:\n throw new TxNotInChainError(txHash);\n case blockHeight:\n return height;\n default:\n return waitForTxConfirm(txHash, { onNode, confirm, ...options });\n }\n}\n\n/**\n * Signs and submits transaction for mining\n * @category chain\n * @param txUnsigned - Transaction to sign and submit\n * @param options - Options\n * @param options.onNode - Node to use\n * @param options.onAccount - Account to use\n * @param options.verify - Verify transaction before broadcast, throw error if not\n * @param options.waitMined - Ensure that transaction get into block\n * @param options.confirm - Number of micro blocks that should be mined after tx get included\n * @returns Transaction details\n */\nexport async function sendTransaction(\n txUnsigned: Encoded.Transaction,\n {\n onNode, onAccount, verify = true, waitMined = true, confirm, innerTx, ...options\n }:\n SendTransactionOptions,\n): Promise<SendTransactionReturnType> {\n const tx = await onAccount.signTransaction(txUnsigned, {\n ...options,\n onNode,\n innerTx,\n networkId: await onNode.getNetworkId(),\n });\n\n if (innerTx === true) return { hash: buildTxHash(tx), rawTx: tx };\n\n if (verify) {\n const validation = await verifyTransaction(tx, onNode);\n if (validation.length > 0) {\n const message = `Transaction verification errors: ${\n validation.map((v: { message: string }) => v.message).join(', ')}`;\n throw new InvalidTxError(message, validation, tx);\n }\n }\n\n try {\n let __queue;\n try {\n __queue = onAccount != null ? `tx-${onAccount.address}` : null;\n } catch (error) {\n __queue = null;\n }\n const { txHash } = await onNode.postTransaction(\n { tx },\n __queue != null ? { requestOptions: { customHeaders: { __queue } } } : {},\n );\n\n if (waitMined) {\n const pollResult = await poll(txHash, { onNode, ...options });\n const txData = {\n ...pollResult,\n hash: pollResult.hash as Encoded.TxHash,\n rawTx: tx,\n };\n // wait for transaction confirmation\n if (confirm != null && (confirm === true || confirm > 0)) {\n const c = typeof confirm === 'boolean' ? undefined : confirm;\n return {\n ...txData,\n confirmationHeight: await waitForTxConfirm(txHash, { onNode, confirm: c, ...options }),\n };\n }\n return txData;\n }\n return { hash: txHash, rawTx: tx };\n } catch (error) {\n throw Object.assign(error, {\n rawTx: tx,\n verifyTx: async () => verifyTransaction(tx, onNode),\n });\n }\n}\n\ntype SendTransactionOptionsType = {\n onNode: Node;\n onAccount: AccountBase;\n verify?: boolean;\n waitMined?: boolean;\n confirm?: boolean | number;\n} & Parameters<typeof poll>[1] & Omit<Parameters<typeof waitForTxConfirm>[1], 'confirm'>\n& Parameters<AccountBase['signTransaction']>[1];\nexport interface SendTransactionOptions extends SendTransactionOptionsType {}\ninterface SendTransactionReturnType extends Partial<TransformNodeType<SignedTx>> {\n hash: Encoded.TxHash;\n rawTx: Encoded.Transaction;\n confirmationHeight?: number;\n}\n\n/**\n * Get account by account public key\n * @category chain\n * @param address - Account address (public key)\n * @param options - Options\n * @param options.height - Get account on specific block by block height\n * @param options.hash - Get account on specific block by micro block hash or key block hash\n * @param options.onNode - Node to use\n */\nexport async function getAccount(\n address: Encoded.AccountAddress | Encoded.ContractAddress,\n { height, hash, onNode }:\n { height?: number; hash?: Encoded.KeyBlockHash | Encoded.MicroBlockHash; onNode: Node },\n): Promise<TransformNodeType<AccountNode>> {\n if (height != null) return onNode.getAccountByPubkeyAndHeight(address, height);\n if (hash != null) return onNode.getAccountByPubkeyAndHash(address, hash);\n return onNode.getAccountByPubkey(address);\n}\n\n/**\n * Request the balance of specified account\n * @category chain\n * @param address - The public account address to obtain the balance for\n * @param options - Options\n * @param options.format\n * @param options.height - The chain height at which to obtain the balance for\n * (default: top of chain)\n * @param options.hash - The block hash on which to obtain the balance for (default: top of chain)\n */\nexport async function getBalance(\n address: Encoded.AccountAddress | Encoded.ContractAddress | Encoded.OracleAddress,\n { format = AE_AMOUNT_FORMATS.AETTOS, ...options }:\n { format?: AE_AMOUNT_FORMATS } & Parameters<typeof getAccount>[1],\n): Promise<string> {\n const addr = address.startsWith('ok_')\n ? encode(decode(address), Encoding.AccountAddress)\n : address as Encoded.AccountAddress | Encoded.ContractAddress;\n\n const { balance } = await getAccount(addr, options).catch((error) => {\n if (!isAccountNotFoundError(error)) throw error;\n return { balance: 0n };\n });\n\n return formatAmount(balance, { targetDenomination: format });\n}\n\n/**\n * Obtain current generation\n * @category chain\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Current Generation\n */\nexport async function getCurrentGeneration(\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<Generation>> {\n return onNode.getCurrentGeneration();\n}\n\n/**\n * Get generation by hash or height\n * @category chain\n * @param hashOrHeight - Generation hash or height\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Generation\n */\nexport async function getGeneration(\n hashOrHeight: Encoded.KeyBlockHash | number,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<Generation>> {\n if (typeof hashOrHeight === 'number') return onNode.getGenerationByHeight(hashOrHeight);\n return onNode.getGenerationByHash(hashOrHeight);\n}\n\n/**\n * Get micro block transactions\n * @category chain\n * @param hash - Micro block hash\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Transactions\n */\nexport async function getMicroBlockTransactions(\n hash: Encoded.MicroBlockHash,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<SignedTx[]>> {\n return (await onNode.getMicroBlockTransactionsByHash(hash)).transactions;\n}\n\n/**\n * Get key block\n * @category chain\n * @param hashOrHeight - Key block hash or height\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Key Block\n */\nexport async function getKeyBlock(\n hashOrHeight: Encoded.KeyBlockHash | number,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<KeyBlock>> {\n if (typeof hashOrHeight === 'number') return onNode.getKeyBlockByHeight(hashOrHeight);\n return onNode.getKeyBlockByHash(hashOrHeight);\n}\n\n/**\n * Get micro block header\n * @category chain\n * @param hash - Micro block hash\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Micro block header\n */\nexport async function getMicroBlockHeader(\n hash: Encoded.MicroBlockHash,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<MicroBlockHeader>> {\n return onNode.getMicroBlockHeaderByHash(hash);\n}\n\ninterface TxDryRunArguments {\n tx: Encoded.Transaction;\n accountAddress: Encoded.AccountAddress;\n top?: number | Encoded.KeyBlockHash | Encoded.MicroBlockHash;\n txEvents?: any;\n resolve: Function;\n reject: Function;\n}\nconst txDryRunRequests: Map<string, TxDryRunArguments[] & { timeout?: NodeJS.Timeout }> = new Map();\n\nasync function txDryRunHandler(key: string, onNode: Node): Promise<void> {\n const rs = txDryRunRequests.get(key);\n txDryRunRequests.delete(key);\n if (rs == null) throw new InternalError('Can\\'t get dry-run request');\n\n let dryRunRes;\n try {\n const top = typeof rs[0].top === 'number'\n ? (await getKeyBlock(rs[0].top, { onNode })).hash : rs[0].top;\n dryRunRes = await onNode.protectedDryRunTxs({\n top,\n txEvents: rs[0].txEvents,\n txs: rs.map((req) => ({ tx: req.tx })),\n accounts: Array.from(new Set(rs.map((req) => req.accountAddress)))\n .map((pubKey) => ({ pubKey, amount: DRY_RUN_ACCOUNT.amount })),\n });\n } catch (error) {\n rs.forEach(({ reject }) => reject(error));\n return;\n }\n\n const { results, txEvents } = dryRunRes;\n results.forEach(({ result, reason, ...resultPayload }, idx) => {\n const {\n resolve, reject, tx, accountAddress,\n } = rs[idx];\n if (result === 'ok') resolve({ ...resultPayload, txEvents });\n else reject(Object.assign(new DryRunError(reason as string), { tx, accountAddress }));\n });\n}\n\n/**\n * Transaction dry-run\n * @category chain\n * @param tx - transaction to execute\n * @param accountAddress - address that will be used to execute transaction\n * @param options - Options\n * @param options.top - hash of block on which to make dry-run\n * @param options.txEvents - collect and return on-chain tx events that would result from the call\n * @param options.combine - Enables combining of similar requests to a single dry-run call\n * @param options.onNode - Node to use\n */\nexport async function txDryRun(\n tx: Encoded.Transaction,\n accountAddress: Encoded.AccountAddress,\n {\n top, txEvents, combine, onNode,\n }:\n { top?: TxDryRunArguments['top']; txEvents?: boolean; combine?: boolean; onNode: Node },\n): Promise<{\n txEvents?: TransformNodeType<DryRunResults['txEvents']>;\n } & TransformNodeType<DryRunResult>> {\n const key = combine === true ? [top, txEvents].join() : 'immediate';\n const requests = txDryRunRequests.get(key) ?? [];\n txDryRunRequests.set(key, requests);\n return new Promise((resolve, reject) => {\n requests.push({\n tx, accountAddress, top, txEvents, resolve, reject,\n });\n if (combine !== true) {\n void txDryRunHandler(key, onNode);\n return;\n }\n requests.timeout ??= setTimeout(() => { void txDryRunHandler(key, onNode); });\n });\n}\n\n/**\n * Get contract byte code\n * @category contract\n * @param contractId - Contract address\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getContractByteCode(\n contractId: Encoded.ContractAddress,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<ByteCode>> {\n return onNode.getContractCode(contractId);\n}\n\n/**\n * Get contract entry\n * @category contract\n * @param contractId - Contract address\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getContract(\n contractId: Encoded.ContractAddress,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<ContractObject>> {\n return onNode.getContract(contractId);\n}\n\n/**\n * Get name entry\n * @category AENS\n * @param name - AENS name\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getName(\n name: AensName,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<NameEntry>> {\n return onNode.getNameEntryByName(name);\n}\n\n/**\n * Resolve AENS name and return name hash\n * @category AENS\n * @param nameOrId - AENS name or address\n * @param key - in AENS pointers record\n * @param options - Options\n * @param options.verify - To ensure that name exist and have a corresponding pointer\n * // TODO: avoid that to don't trust to current api gateway\n * @param options.resolveByNode - Enables pointer resolving using node\n * @param options.onNode - Node to use\n * @returns Address or AENS name hash\n */\nexport async function resolveName <\n Type extends Encoding.AccountAddress | Encoding.ContractAddress,\n>(\n nameOrId: AensName | Encoded.Generic<Type>,\n key: string,\n { verify = true, resolveByNode = false, onNode }:\n { verify?: boolean; resolveByNode?: boolean; onNode: Node },\n): Promise<Encoded.Generic<Type | Encoding.Name>> {\n if (isNameValid(nameOrId)) {\n if (verify || resolveByNode) {\n const name = await onNode.getNameEntryByName(nameOrId);\n const pointer = name.pointers.find((p) => p.key === key);\n if (pointer == null) throw new AensPointerContextError(nameOrId, key);\n if (resolveByNode) return pointer.id as Encoded.Generic<Type>;\n }\n return produceNameId(nameOrId);\n }\n try {\n decode(nameOrId);\n return nameOrId;\n } catch (error) {\n throw new InvalidAensNameError(`Invalid name or address: ${nameOrId}`);\n }\n}\n"],"mappings":"SAASA,iBAAiB,EAAEC,YAAY;AAAA,OACjCC,iBAAiB;AAAA,SACfC,sBAAsB,EAAEC,KAA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,EAAC,CAAC;EACxE;AACF"}
|
|
1
|
+
{"version":3,"file":"chain.mjs","names":["AE_AMOUNT_FORMATS","formatAmount","verifyTransaction","ensureError","isAccountNotFoundError","pause","isNameValid","produceNameId","DRY_RUN_ACCOUNT","AensPointerContextError","DryRunError","InvalidAensNameError","TransactionError","TxTimedOutError","TxNotInChainError","InternalError","decode","encode","Encoding","buildTxHash","_getPollInterval","type","_ref","_expectedMineRate","_microBlockCycle","_maxPollInterval","base","block","microblock","Math","min","InvalidTxError","constructor","message","validation","transaction","name","getHeight","_ref2","onNode","getCurrentKeyBlockHeight","height","poll","th","_ref3","_interval","blocks","interval","options","max","tx","getTransactionByHash","blockHeight","awaitHeight","_ref4","_interval2","currentHeight","waitForTxConfirm","txHash","_ref5","confirm","newBlockHeight","sendTransaction","txUnsigned","_ref6","onAccount","verify","waitMined","innerTx","signTransaction","networkId","getNetworkId","hash","rawTx","length","map","v","join","__queue","address","error","postTransaction","requestOptions","customHeaders","pollResult","txData","c","undefined","confirmationHeight","Object","assign","verifyTx","getAccount","_ref7","getAccountByPubkeyAndHeight","getAccountByPubkeyAndHash","getAccountByPubkey","getBalance","_ref8","format","AETTOS","addr","startsWith","AccountAddress","balance","catch","targetDenomination","getCurrentGeneration","_ref9","getGeneration","hashOrHeight","_ref10","getGenerationByHeight","getGenerationByHash","getMicroBlockTransactions","_ref11","getMicroBlockTransactionsByHash","transactions","getKeyBlock","_ref12","getKeyBlockByHeight","getKeyBlockByHash","getMicroBlockHeader","_ref13","getMicroBlockHeaderByHash","txDryRunRequests","Map","txDryRunHandler","key","rs","get","delete","dryRunRes","top","protectedDryRunTxs","txEvents","txs","req","accounts","Array","from","Set","accountAddress","pubKey","amount","forEach","_ref14","reject","results","_ref15","idx","result","reason","resultPayload","resolve","txDryRun","_ref16","_txDryRunRequests$get","combine","requests","set","Promise","_requests$timeout","push","timeout","setTimeout","getContractByteCode","contractId","_ref17","getContractCode","getContract","_ref18","getName","_ref19","getNameEntryByName","resolveName","nameOrId","_ref20","resolveByNode","pointer","pointers","find","p","id"],"sources":["../src/chain.ts"],"sourcesContent":["import { AE_AMOUNT_FORMATS, formatAmount } from './utils/amount-formatter';\nimport verifyTransaction, { ValidatorResult } from './tx/validator';\nimport { ensureError, isAccountNotFoundError, pause } from './utils/other';\nimport { isNameValid, produceNameId } from './tx/builder/helpers';\nimport { DRY_RUN_ACCOUNT } from './tx/builder/schema';\nimport { AensName } from './tx/builder/constants';\nimport {\n AensPointerContextError, DryRunError, InvalidAensNameError, TransactionError,\n TxTimedOutError, TxNotInChainError, InternalError,\n} from './utils/errors';\nimport Node, { TransformNodeType } from './Node';\nimport {\n Account as AccountNode, ByteCode, ContractObject, DryRunResult, DryRunResults,\n Generation, KeyBlock, MicroBlockHeader, NameEntry, SignedTx,\n} from './apis/node';\nimport {\n decode, encode, Encoded, Encoding,\n} from './utils/encoder';\nimport AccountBase from './account/Base';\nimport { buildTxHash } from './tx/builder';\n\n/**\n * @category chain\n */\nexport function _getPollInterval(\n type: 'block' | 'microblock', // TODO: rename to 'key-block' | 'micro-block'\n { _expectedMineRate = 180000, _microBlockCycle = 3000, _maxPollInterval = 5000 }:\n { _expectedMineRate?: number; _microBlockCycle?: number; _maxPollInterval?: number },\n): number {\n const base = {\n block: _expectedMineRate,\n microblock: _microBlockCycle,\n }[type];\n return Math.min(base / 3, _maxPollInterval);\n}\n\n/**\n * @category exception\n */\nexport class InvalidTxError extends TransactionError {\n validation: ValidatorResult[];\n\n transaction: Encoded.Transaction;\n\n constructor(\n message: string,\n validation: ValidatorResult[],\n transaction: Encoded.Transaction,\n ) {\n super(message);\n this.name = 'InvalidTxError';\n this.validation = validation;\n this.transaction = transaction;\n }\n}\n\n/**\n * Obtain current height of the chain\n * @category chain\n * @returns Current chain height\n */\nexport async function getHeight({ onNode }: { onNode: Node }): Promise<number> {\n return (await onNode.getCurrentKeyBlockHeight()).height;\n}\n\n/**\n * Wait for a transaction to be mined\n * @category chain\n * @param th - The hash of transaction to poll\n * @param options - Options\n * @param options.interval - Interval (in ms) at which to poll the chain\n * @param options.blocks - Number of blocks mined after which to fail\n * @param options.onNode - Node to use\n * @returns The transaction as it was mined\n */\nexport async function poll(\n th: Encoded.TxHash,\n {\n blocks = 5, interval, onNode, ...options\n }:\n { blocks?: number; interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): Promise<TransformNodeType<SignedTx>> {\n interval ??= _getPollInterval('microblock', options);\n const max = await getHeight({ onNode }) + blocks;\n do {\n const tx = await onNode.getTransactionByHash(th);\n if (tx.blockHeight !== -1) return tx;\n await pause(interval);\n } while (await getHeight({ onNode }) < max);\n throw new TxTimedOutError(blocks, th);\n}\n\n/**\n * Wait for the chain to reach a specific height\n * @category chain\n * @param height - Height to wait for\n * @param options - Options\n * @param options.interval - Interval (in ms) at which to poll the chain\n * @param options.onNode - Node to use\n * @returns Current chain height\n */\nexport async function awaitHeight(\n height: number,\n { interval, onNode, ...options }:\n { interval?: number; onNode: Node } & Parameters<typeof _getPollInterval>[1],\n): Promise<number> {\n interval ??= _getPollInterval('block', options);\n let currentHeight;\n do {\n if (currentHeight != null) await pause(interval);\n currentHeight = (await onNode.getCurrentKeyBlockHeight()).height;\n } while (currentHeight < height);\n return currentHeight;\n}\n\n/**\n * Wait for transaction confirmation\n * @category chain\n * @param txHash - Transaction hash\n * @param options - Options\n * @param options.confirm - Number of micro blocks to wait for transaction confirmation\n * @param options.onNode - Node to use\n * @returns Current Height\n */\nexport async function waitForTxConfirm(\n txHash: Encoded.TxHash,\n { confirm = 3, onNode, ...options }:\n { confirm?: number; onNode: Node } & Parameters<typeof awaitHeight>[1],\n): Promise<number> {\n const { blockHeight } = await onNode.getTransactionByHash(txHash);\n const height = await awaitHeight(blockHeight + confirm, { onNode, ...options });\n const { blockHeight: newBlockHeight } = await onNode.getTransactionByHash(txHash);\n switch (newBlockHeight) {\n case -1:\n throw new TxNotInChainError(txHash);\n case blockHeight:\n return height;\n default:\n return waitForTxConfirm(txHash, { onNode, confirm, ...options });\n }\n}\n\n/**\n * Signs and submits transaction for mining\n * @category chain\n * @param txUnsigned - Transaction to sign and submit\n * @param options - Options\n * @param options.onNode - Node to use\n * @param options.onAccount - Account to use\n * @param options.verify - Verify transaction before broadcast, throw error if not\n * @param options.waitMined - Ensure that transaction get into block\n * @param options.confirm - Number of micro blocks that should be mined after tx get included\n * @returns Transaction details\n */\nexport async function sendTransaction(\n txUnsigned: Encoded.Transaction,\n {\n onNode, onAccount, verify = true, waitMined = true, confirm, innerTx, ...options\n }:\n SendTransactionOptions,\n): Promise<SendTransactionReturnType> {\n const tx = await onAccount.signTransaction(txUnsigned, {\n ...options,\n onNode,\n innerTx,\n networkId: await onNode.getNetworkId(),\n });\n\n if (innerTx === true) return { hash: buildTxHash(tx), rawTx: tx };\n\n if (verify) {\n const validation = await verifyTransaction(tx, onNode);\n if (validation.length > 0) {\n const message = `Transaction verification errors: ${\n validation.map((v: { message: string }) => v.message).join(', ')}`;\n throw new InvalidTxError(message, validation, tx);\n }\n }\n\n try {\n let __queue;\n try {\n __queue = onAccount != null ? `tx-${onAccount.address}` : null;\n } catch (error) {\n __queue = null;\n }\n const { txHash } = await onNode.postTransaction(\n { tx },\n __queue != null ? { requestOptions: { customHeaders: { __queue } } } : {},\n );\n\n if (waitMined) {\n const pollResult = await poll(txHash, { onNode, ...options });\n const txData = {\n ...pollResult,\n hash: pollResult.hash as Encoded.TxHash,\n rawTx: tx,\n };\n // wait for transaction confirmation\n if (confirm != null && (confirm === true || confirm > 0)) {\n const c = typeof confirm === 'boolean' ? undefined : confirm;\n return {\n ...txData,\n confirmationHeight: await waitForTxConfirm(txHash, { onNode, confirm: c, ...options }),\n };\n }\n return txData;\n }\n return { hash: txHash, rawTx: tx };\n } catch (error) {\n ensureError(error);\n throw Object.assign(error, {\n rawTx: tx,\n verifyTx: async () => verifyTransaction(tx, onNode),\n });\n }\n}\n\ntype SendTransactionOptionsType = {\n onNode: Node;\n onAccount: AccountBase;\n verify?: boolean;\n waitMined?: boolean;\n confirm?: boolean | number;\n} & Parameters<typeof poll>[1] & Omit<Parameters<typeof waitForTxConfirm>[1], 'confirm'>\n& Parameters<AccountBase['signTransaction']>[1];\nexport interface SendTransactionOptions extends SendTransactionOptionsType {}\ninterface SendTransactionReturnType extends Partial<TransformNodeType<SignedTx>> {\n hash: Encoded.TxHash;\n rawTx: Encoded.Transaction;\n confirmationHeight?: number;\n}\n\n/**\n * Get account by account public key\n * @category chain\n * @param address - Account address (public key)\n * @param options - Options\n * @param options.height - Get account on specific block by block height\n * @param options.hash - Get account on specific block by micro block hash or key block hash\n * @param options.onNode - Node to use\n */\nexport async function getAccount(\n address: Encoded.AccountAddress | Encoded.ContractAddress,\n { height, hash, onNode }:\n { height?: number; hash?: Encoded.KeyBlockHash | Encoded.MicroBlockHash; onNode: Node },\n): Promise<TransformNodeType<AccountNode>> {\n if (height != null) return onNode.getAccountByPubkeyAndHeight(address, height);\n if (hash != null) return onNode.getAccountByPubkeyAndHash(address, hash);\n return onNode.getAccountByPubkey(address);\n}\n\n/**\n * Request the balance of specified account\n * @category chain\n * @param address - The public account address to obtain the balance for\n * @param options - Options\n * @param options.format\n * @param options.height - The chain height at which to obtain the balance for\n * (default: top of chain)\n * @param options.hash - The block hash on which to obtain the balance for (default: top of chain)\n */\nexport async function getBalance(\n address: Encoded.AccountAddress | Encoded.ContractAddress | Encoded.OracleAddress,\n { format = AE_AMOUNT_FORMATS.AETTOS, ...options }:\n { format?: AE_AMOUNT_FORMATS } & Parameters<typeof getAccount>[1],\n): Promise<string> {\n const addr = address.startsWith('ok_')\n ? encode(decode(address), Encoding.AccountAddress)\n : address as Encoded.AccountAddress | Encoded.ContractAddress;\n\n const { balance } = await getAccount(addr, options).catch((error) => {\n if (!isAccountNotFoundError(error)) throw error;\n return { balance: 0n };\n });\n\n return formatAmount(balance, { targetDenomination: format });\n}\n\n/**\n * Obtain current generation\n * @category chain\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Current Generation\n */\nexport async function getCurrentGeneration(\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<Generation>> {\n return onNode.getCurrentGeneration();\n}\n\n/**\n * Get generation by hash or height\n * @category chain\n * @param hashOrHeight - Generation hash or height\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Generation\n */\nexport async function getGeneration(\n hashOrHeight: Encoded.KeyBlockHash | number,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<Generation>> {\n if (typeof hashOrHeight === 'number') return onNode.getGenerationByHeight(hashOrHeight);\n return onNode.getGenerationByHash(hashOrHeight);\n}\n\n/**\n * Get micro block transactions\n * @category chain\n * @param hash - Micro block hash\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Transactions\n */\nexport async function getMicroBlockTransactions(\n hash: Encoded.MicroBlockHash,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<SignedTx[]>> {\n return (await onNode.getMicroBlockTransactionsByHash(hash)).transactions;\n}\n\n/**\n * Get key block\n * @category chain\n * @param hashOrHeight - Key block hash or height\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Key Block\n */\nexport async function getKeyBlock(\n hashOrHeight: Encoded.KeyBlockHash | number,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<KeyBlock>> {\n if (typeof hashOrHeight === 'number') return onNode.getKeyBlockByHeight(hashOrHeight);\n return onNode.getKeyBlockByHash(hashOrHeight);\n}\n\n/**\n * Get micro block header\n * @category chain\n * @param hash - Micro block hash\n * @param options - Options\n * @param options.onNode - Node to use\n * @returns Micro block header\n */\nexport async function getMicroBlockHeader(\n hash: Encoded.MicroBlockHash,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<MicroBlockHeader>> {\n return onNode.getMicroBlockHeaderByHash(hash);\n}\n\ninterface TxDryRunArguments {\n tx: Encoded.Transaction;\n accountAddress: Encoded.AccountAddress;\n top?: number | Encoded.KeyBlockHash | Encoded.MicroBlockHash;\n txEvents?: any;\n resolve: Function;\n reject: Function;\n}\nconst txDryRunRequests: Map<string, TxDryRunArguments[] & { timeout?: NodeJS.Timeout }> = new Map();\n\nasync function txDryRunHandler(key: string, onNode: Node): Promise<void> {\n const rs = txDryRunRequests.get(key);\n txDryRunRequests.delete(key);\n if (rs == null) throw new InternalError('Can\\'t get dry-run request');\n\n let dryRunRes;\n try {\n const top = typeof rs[0].top === 'number'\n ? (await getKeyBlock(rs[0].top, { onNode })).hash : rs[0].top;\n dryRunRes = await onNode.protectedDryRunTxs({\n top,\n txEvents: rs[0].txEvents,\n txs: rs.map((req) => ({ tx: req.tx })),\n accounts: Array.from(new Set(rs.map((req) => req.accountAddress)))\n .map((pubKey) => ({ pubKey, amount: DRY_RUN_ACCOUNT.amount })),\n });\n } catch (error) {\n rs.forEach(({ reject }) => reject(error));\n return;\n }\n\n const { results, txEvents } = dryRunRes;\n results.forEach(({ result, reason, ...resultPayload }, idx) => {\n const {\n resolve, reject, tx, accountAddress,\n } = rs[idx];\n if (result === 'ok') resolve({ ...resultPayload, txEvents });\n else reject(Object.assign(new DryRunError(reason as string), { tx, accountAddress }));\n });\n}\n\n/**\n * Transaction dry-run\n * @category chain\n * @param tx - transaction to execute\n * @param accountAddress - address that will be used to execute transaction\n * @param options - Options\n * @param options.top - hash of block on which to make dry-run\n * @param options.txEvents - collect and return on-chain tx events that would result from the call\n * @param options.combine - Enables combining of similar requests to a single dry-run call\n * @param options.onNode - Node to use\n */\nexport async function txDryRun(\n tx: Encoded.Transaction,\n accountAddress: Encoded.AccountAddress,\n {\n top, txEvents, combine, onNode,\n }:\n { top?: TxDryRunArguments['top']; txEvents?: boolean; combine?: boolean; onNode: Node },\n): Promise<{\n txEvents?: TransformNodeType<DryRunResults['txEvents']>;\n } & TransformNodeType<DryRunResult>> {\n const key = combine === true ? [top, txEvents].join() : 'immediate';\n const requests = txDryRunRequests.get(key) ?? [];\n txDryRunRequests.set(key, requests);\n return new Promise((resolve, reject) => {\n requests.push({\n tx, accountAddress, top, txEvents, resolve, reject,\n });\n if (combine !== true) {\n void txDryRunHandler(key, onNode);\n return;\n }\n requests.timeout ??= setTimeout(() => { void txDryRunHandler(key, onNode); });\n });\n}\n\n/**\n * Get contract byte code\n * @category contract\n * @param contractId - Contract address\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getContractByteCode(\n contractId: Encoded.ContractAddress,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<ByteCode>> {\n return onNode.getContractCode(contractId);\n}\n\n/**\n * Get contract entry\n * @category contract\n * @param contractId - Contract address\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getContract(\n contractId: Encoded.ContractAddress,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<ContractObject>> {\n return onNode.getContract(contractId);\n}\n\n/**\n * Get name entry\n * @category AENS\n * @param name - AENS name\n * @param options - Options\n * @param options.onNode - Node to use\n */\nexport async function getName(\n name: AensName,\n { onNode }: { onNode: Node },\n): Promise<TransformNodeType<NameEntry>> {\n return onNode.getNameEntryByName(name);\n}\n\n/**\n * Resolve AENS name and return name hash\n * @category AENS\n * @param nameOrId - AENS name or address\n * @param key - in AENS pointers record\n * @param options - Options\n * @param options.verify - To ensure that name exist and have a corresponding pointer\n * // TODO: avoid that to don't trust to current api gateway\n * @param options.resolveByNode - Enables pointer resolving using node\n * @param options.onNode - Node to use\n * @returns Address or AENS name hash\n */\nexport async function resolveName <\n Type extends Encoding.AccountAddress | Encoding.ContractAddress,\n>(\n nameOrId: AensName | Encoded.Generic<Type>,\n key: string,\n { verify = true, resolveByNode = false, onNode }:\n { verify?: boolean; resolveByNode?: boolean; onNode: Node },\n): Promise<Encoded.Generic<Type | Encoding.Name>> {\n if (isNameValid(nameOrId)) {\n if (verify || resolveByNode) {\n const name = await onNode.getNameEntryByName(nameOrId);\n const pointer = name.pointers.find((p) => p.key === key);\n if (pointer == null) throw new AensPointerContextError(nameOrId, key);\n if (resolveByNode) return pointer.id as Encoded.Generic<Type>;\n }\n return produceNameId(nameOrId);\n }\n try {\n decode(nameOrId);\n return nameOrId;\n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C;IACA,OAAOhL,aAAa,CAACyK,QAAQ,CAAC;EAChC;EACA,IAAI;IACFhK,MAAM,CAACgK,QAAQ,CAAC;IAChB,OAAOA,QAAQ;EACjB,CAAC,CAAC,OAAOhG,KAAK,EAAE;IACd,MAAM,IAAIrE,oBAAoB,CAAE,4BAA2BqK,QAAS,EAAC,CAAC;EACxE;AACF"}
|
package/es/channel/Base.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
|
-
import
|
|
3
|
+
import EventEmitter from 'events';
|
|
4
4
|
import { w3cwebsocket as W3CWebSocket } from 'websocket';
|
|
5
5
|
import { Tag } from '../tx/builder/constants';
|
|
6
6
|
import { SignTx, ChannelOptions, ChannelState, ChannelHandler, ChannelAction, ChannelStatus, ChannelFsm, ChannelMessage, ChannelEvents } from './internal';
|
package/es/channel/Base.mjs
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
2
|
-
import
|
|
3
|
-
const {
|
|
4
|
-
EventEmitter
|
|
5
|
-
} = _events;
|
|
2
|
+
import EventEmitter from 'events';
|
|
6
3
|
import { snakeToPascal } from "../utils/string.mjs";
|
|
7
4
|
import { buildTx, unpackTx } from "../tx/builder/index.mjs";
|
|
8
5
|
import { Tag } from "../tx/builder/constants.mjs";
|