@aeternity/aepp-sdk 13.2.0 → 13.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +84 -4345
- package/dist/aepp-sdk.js.map +1 -1
- package/es/Middleware.d.ts +1 -1
- package/es/Middleware.mjs +1 -1
- package/es/Middleware.mjs.map +1 -1
- package/es/Node.d.ts +1 -1
- package/es/Node.mjs +12 -3
- package/es/Node.mjs.map +1 -1
- package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -1
- package/es/aepp-wallet-communication/wallet-detector.d.ts +2 -5
- package/es/aepp-wallet-communication/wallet-detector.mjs +9 -4
- package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -1
- package/es/contract/Contract.d.ts +1 -1
- package/es/contract/Contract.mjs +18 -8
- package/es/contract/Contract.mjs.map +1 -1
- package/es/contract/compiler/Cli.d.ts +7 -2
- package/es/contract/compiler/Cli.mjs +7 -2
- package/es/contract/compiler/Cli.mjs.map +1 -1
- package/es/deprecated.d.ts +10 -0
- package/es/deprecated.mjs +21 -1
- package/es/deprecated.mjs.map +1 -1
- package/es/index-browser.d.ts +2 -2
- package/es/index-browser.mjs +2 -2
- package/es/index-browser.mjs.map +1 -1
- package/es/tx/builder/constants.d.ts +2 -1
- package/es/tx/builder/constants.mjs +1 -0
- package/es/tx/builder/constants.mjs.map +1 -1
- package/es/tx/builder/field-types/ct-version.d.ts +1 -1
- package/es/tx/builder/field-types/ct-version.mjs +1 -1
- package/es/tx/builder/field-types/ct-version.mjs.map +1 -1
- package/es/tx/builder/field-types/fee.mjs +1 -1
- package/es/tx/builder/field-types/fee.mjs.map +1 -1
- package/es/tx/builder/field-types/gas-price.mjs +1 -1
- package/es/tx/builder/field-types/gas-price.mjs.map +1 -1
- package/es/tx/builder/field-types/u-int.mjs +1 -1
- package/es/tx/builder/field-types/u-int.mjs.map +1 -1
- package/es/utils/autorest.mjs +4 -4
- package/es/utils/autorest.mjs.map +1 -1
- package/es/utils/crypto.d.ts +1 -1
- package/es/utils/crypto.mjs +1 -1
- package/es/utils/crypto.mjs.map +1 -1
- package/es/utils/typed-data.d.ts +0 -2
- package/es/utils/typed-data.mjs +8 -24
- package/es/utils/typed-data.mjs.map +1 -1
- package/package.json +2 -2
- package/src/Middleware.ts +1 -1
- package/src/Node.ts +14 -3
- package/src/aepp-wallet-communication/rpc/types.ts +1 -1
- package/src/aepp-wallet-communication/wallet-detector.ts +10 -10
- package/src/contract/Contract.ts +12 -6
- package/src/contract/compiler/Cli.ts +7 -2
- package/src/deprecated.ts +19 -1
- package/src/index-browser.ts +4 -4
- package/src/tx/builder/constants.ts +1 -0
- package/src/tx/builder/field-types/ct-version.ts +1 -1
- package/src/tx/builder/field-types/fee.ts +1 -1
- package/src/tx/builder/field-types/gas-price.ts +1 -1
- package/src/tx/builder/field-types/u-int.ts +1 -1
- package/src/utils/autorest.ts +4 -4
- package/src/utils/crypto.ts +1 -1
- package/src/utils/typed-data.ts +4 -30
- package/types-legacy/ts4.2/Middleware.d.ts +1 -1
- package/types-legacy/ts4.2/Node.d.ts +1 -1
- package/types-legacy/ts4.2/aepp-wallet-communication/wallet-detector.d.ts +2 -5
- package/types-legacy/ts4.2/contract/Contract.d.ts +1 -1
- package/types-legacy/ts4.2/contract/compiler/Cli.d.ts +7 -2
- package/types-legacy/ts4.2/deprecated.d.ts +10 -0
- package/types-legacy/ts4.2/index-browser.d.ts +2 -2
- package/types-legacy/ts4.2/tx/builder/constants.d.ts +2 -1
- package/types-legacy/ts4.2/tx/builder/field-types/ct-version.d.ts +1 -1
- package/types-legacy/ts4.2/utils/crypto.d.ts +1 -1
- package/types-legacy/ts4.2/utils/typed-data.d.ts +0 -2
- package/types-legacy/ts4.5/Middleware.d.ts +1 -1
- package/types-legacy/ts4.5/Node.d.ts +1 -1
- package/types-legacy/ts4.5/aepp-wallet-communication/wallet-detector.d.ts +2 -5
- package/types-legacy/ts4.5/contract/Contract.d.ts +1 -1
- package/types-legacy/ts4.5/contract/compiler/Cli.d.ts +7 -2
- package/types-legacy/ts4.5/deprecated.d.ts +10 -0
- package/types-legacy/ts4.5/index-browser.d.ts +2 -2
- package/types-legacy/ts4.5/tx/builder/constants.d.ts +2 -1
- package/types-legacy/ts4.5/tx/builder/field-types/ct-version.d.ts +1 -1
- package/types-legacy/ts4.5/utils/crypto.d.ts +1 -1
- package/types-legacy/ts4.5/utils/typed-data.d.ts +0 -2
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import CompilerBase, { Aci } from './Base';
|
|
2
2
|
import { Encoded } from '../../utils/encoder';
|
|
3
3
|
/**
|
|
4
|
-
* A wrapper around aesophia_cli, available only in Node.js
|
|
5
|
-
*
|
|
4
|
+
* A wrapper around aesophia_cli, available only in Node.js.
|
|
5
|
+
* Requires Erlang installed, assumes that `escript` is available in PATH.
|
|
6
6
|
*/
|
|
7
7
|
export default class CompilerCli extends CompilerBase {
|
|
8
8
|
#private;
|
|
9
|
+
/**
|
|
10
|
+
* @param compilerPath - A path to aesophia_cli binary, by default uses the integrated one
|
|
11
|
+
* @param options - Options
|
|
12
|
+
* @param options.ignoreVersion - Don't ensure that the compiler is supported
|
|
13
|
+
*/
|
|
9
14
|
constructor(compilerPath?: string, { ignoreVersion }?: {
|
|
10
15
|
ignoreVersion?: boolean;
|
|
11
16
|
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AciValue } from './utils/typed-data';
|
|
2
|
+
import { Encoded } from './utils/encoder';
|
|
1
3
|
import { RpcError } from './aepp-wallet-communication/schema';
|
|
2
4
|
/**
|
|
3
5
|
* @category exception
|
|
@@ -12,3 +14,11 @@ export declare class RpcBroadcastError extends RpcError {
|
|
|
12
14
|
* @deprecated use isAuctionName instead
|
|
13
15
|
*/
|
|
14
16
|
export declare const NAME_BID_MAX_LENGTH = 12;
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated use ContractByteArrayEncoder:encodeWithType from \@aeternity/aepp-calldata
|
|
19
|
+
*/
|
|
20
|
+
export declare function encodeFateValue(value: unknown, aci: AciValue): Encoded.ContractBytearray;
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated use ContractByteArrayEncoder:decodeWithType from \@aeternity/aepp-calldata
|
|
23
|
+
*/
|
|
24
|
+
export declare function decodeFateValue(value: Encoded.ContractBytearray, aci: AciValue): any;
|
|
@@ -13,7 +13,7 @@ export { default as getTransactionSignerAddress } from './tx/transaction-signer'
|
|
|
13
13
|
export { AE_AMOUNT_FORMATS, formatAmount, toAe, toAettos, prefixedAmount, } from './utils/amount-formatter';
|
|
14
14
|
export { DerivationError, deriveChild, derivePathFromKey, getMasterKeyFromSeed, derivePathFromSeed, getKeyPair, generateSaveHDWalletFromSeed, getSaveHDWalletAccounts, getHdWalletAccountFromSeed, } from './utils/hd-wallet';
|
|
15
15
|
export { encode, decode, Encoding, Encoded, } from './utils/encoder';
|
|
16
|
-
export {
|
|
16
|
+
export { hashTypedData, hashDomain, hashJson } from './utils/typed-data';
|
|
17
17
|
export { aensRevoke, aensUpdate, aensTransfer, aensQuery, aensClaim, aensPreclaim, aensBid, } from './aens';
|
|
18
18
|
export { default as Contract } from './contract/Contract';
|
|
19
19
|
export type { ContractMethodsBase } from './contract/Contract';
|
|
@@ -43,4 +43,4 @@ export { default as walletDetector } from './aepp-wallet-communication/wallet-de
|
|
|
43
43
|
export { default as BrowserRuntimeConnection } from './aepp-wallet-communication/connection/BrowserRuntime';
|
|
44
44
|
export { default as BrowserWindowMessageConnection } from './aepp-wallet-communication/connection/BrowserWindowMessage';
|
|
45
45
|
export { BaseError, AccountError, AensError, AeppError, ChannelError, CompilerError, ContractError, CryptographyError, NodeError, TransactionError, WalletError, ArgumentError, IllegalArgumentError, ArgumentCountMismatchError, InsufficientBalanceError, MissingParamError, NoSerializerFoundError, RequestTimedOutError, TxTimedOutError, TypeError, UnsupportedPlatformError, UnsupportedProtocolError, NotImplementedError, UnsupportedVersionError, InternalError, UnexpectedTsError, UnavailableAccountError, AensPointerContextError, InsufficientNameFeeError, InvalidAensNameError, InvalidRpcMessageError, MissingCallbackError, UnAuthorizedAccountError, UnknownRpcClientError, UnsubscribedAccountError, ChannelCallError, ChannelConnectionError, ChannelPingTimedOutError, UnexpectedChannelMessageError, ChannelIncomingMessageError, UnknownChannelStateError, InvalidAuthDataError, BytecodeMismatchError, DuplicateContractError, InactiveContractError, InvalidMethodInvocationError, MissingContractAddressError, MissingContractDefError, MissingFunctionNameError, NodeInvocationError, NoSuchContractFunctionError, NotPayableFunctionError, MissingEventDefinitionError, AmbiguousEventDefinitionError, InvalidChecksumError, InvalidPasswordError, MerkleTreeHashMismatchError, MissingNodeInTreeError, UnknownNodeLengthError, UnknownPathNibbleError, DuplicateNodeError, NodeNotFoundError, DecodeError, PayloadLengthError, DryRunError, IllegalBidFeeError, InvalidSignatureError, PrefixNotFoundError, SchemaNotFoundError, TagNotFoundError, TxNotInChainError, AlreadyConnectedError, NoWalletConnectedError, RpcConnectionError, } from './utils/errors';
|
|
46
|
-
export { RpcBroadcastError, NAME_BID_MAX_LENGTH } from './deprecated';
|
|
46
|
+
export { RpcBroadcastError, NAME_BID_MAX_LENGTH, encodeFateValue, decodeFateValue, } from './deprecated';
|
|
@@ -88,7 +88,7 @@ export declare function verifyMessage(message: string, signature: Uint8Array, ad
|
|
|
88
88
|
/**
|
|
89
89
|
* Check key pair for validity
|
|
90
90
|
*
|
|
91
|
-
*
|
|
91
|
+
* Signs a message, and then verifies that signature
|
|
92
92
|
* @param privateKey - Private key to verify
|
|
93
93
|
* @param publicKey - Public key to verify as hex string
|
|
94
94
|
* @returns Valid?
|
|
@@ -51,8 +51,6 @@ export interface Domain {
|
|
|
51
51
|
networkId?: string;
|
|
52
52
|
contractAddress?: Encoded.ContractAddress;
|
|
53
53
|
}
|
|
54
|
-
export declare function encodeFateValue(value: unknown, aci: AciValue): Encoded.ContractBytearray;
|
|
55
|
-
export declare function decodeFateValue(value: Encoded.ContractBytearray, aci: AciValue): Encoded.ContractBytearray;
|
|
56
54
|
/**
|
|
57
55
|
* Hashes domain object, can be used to inline domain hash to contract source code
|
|
58
56
|
*/
|
|
@@ -33,7 +33,7 @@ export default class Middleware extends Middleware_base {
|
|
|
33
33
|
/**
|
|
34
34
|
* @param url - Url for middleware API
|
|
35
35
|
* @param options - Options
|
|
36
|
-
* @param options.ignoreVersion - Don't
|
|
36
|
+
* @param options.ignoreVersion - Don't ensure that the middleware is supported
|
|
37
37
|
* @param options.retryCount - Amount of extra requests to do in case of failure
|
|
38
38
|
* @param options.retryOverallDelay - Time in ms to wait between all retries
|
|
39
39
|
*/
|
|
@@ -67,7 +67,7 @@ export default class Node extends Node_base {
|
|
|
67
67
|
/**
|
|
68
68
|
* @param url - Url for node API
|
|
69
69
|
* @param options - Options
|
|
70
|
-
* @param options.ignoreVersion - Don't
|
|
70
|
+
* @param options.ignoreVersion - Don't ensure that the node is supported
|
|
71
71
|
* @param options.retryCount - Amount of extra requests to do in case of failure
|
|
72
72
|
* @param options.retryOverallDelay - Time in ms to wait between all retries
|
|
73
73
|
*/
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import BrowserConnection from './connection/Browser';
|
|
2
2
|
import BrowserWindowMessageConnection from './connection/BrowserWindowMessage';
|
|
3
|
+
import { WalletInfo } from './rpc/types';
|
|
3
4
|
interface Wallet {
|
|
4
|
-
info:
|
|
5
|
-
id: string;
|
|
6
|
-
type: string;
|
|
7
|
-
origin: string;
|
|
8
|
-
};
|
|
5
|
+
info: WalletInfo;
|
|
9
6
|
getConnection: () => BrowserWindowMessageConnection;
|
|
10
7
|
}
|
|
11
8
|
interface Wallets {
|
|
@@ -81,7 +81,7 @@ interface GetCallResultByHashReturnType<M extends ContractMethodsBase, Fn extend
|
|
|
81
81
|
* const staticCallResult = await contractIns.$call('setState', [123], { callStatic: true })
|
|
82
82
|
* ```
|
|
83
83
|
* Also you can call contract like: `await contractIns.setState(123, options)`
|
|
84
|
-
* Then sdk decide to make on-chain or static call(dry-run API) transaction based on function is
|
|
84
|
+
* Then sdk decide to make on-chain or static call (dry-run API) transaction based on function is
|
|
85
85
|
* stateful or not
|
|
86
86
|
*/
|
|
87
87
|
declare class Contract<M extends ContractMethodsBase> {
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import CompilerBase, { Aci } from './Base';
|
|
2
2
|
import { Encoded } from '../../utils/encoder';
|
|
3
3
|
/**
|
|
4
|
-
* A wrapper around aesophia_cli, available only in Node.js
|
|
5
|
-
*
|
|
4
|
+
* A wrapper around aesophia_cli, available only in Node.js.
|
|
5
|
+
* Requires Erlang installed, assumes that `escript` is available in PATH.
|
|
6
6
|
*/
|
|
7
7
|
export default class CompilerCli extends CompilerBase {
|
|
8
8
|
#private;
|
|
9
|
+
/**
|
|
10
|
+
* @param compilerPath - A path to aesophia_cli binary, by default uses the integrated one
|
|
11
|
+
* @param options - Options
|
|
12
|
+
* @param options.ignoreVersion - Don't ensure that the compiler is supported
|
|
13
|
+
*/
|
|
9
14
|
constructor(compilerPath?: string, { ignoreVersion }?: {
|
|
10
15
|
ignoreVersion?: boolean;
|
|
11
16
|
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AciValue } from './utils/typed-data';
|
|
2
|
+
import { Encoded } from './utils/encoder';
|
|
1
3
|
import { RpcError } from './aepp-wallet-communication/schema';
|
|
2
4
|
/**
|
|
3
5
|
* @category exception
|
|
@@ -12,3 +14,11 @@ export declare class RpcBroadcastError extends RpcError {
|
|
|
12
14
|
* @deprecated use isAuctionName instead
|
|
13
15
|
*/
|
|
14
16
|
export declare const NAME_BID_MAX_LENGTH = 12;
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated use ContractByteArrayEncoder:encodeWithType from \@aeternity/aepp-calldata
|
|
19
|
+
*/
|
|
20
|
+
export declare function encodeFateValue(value: unknown, aci: AciValue): Encoded.ContractBytearray;
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated use ContractByteArrayEncoder:decodeWithType from \@aeternity/aepp-calldata
|
|
23
|
+
*/
|
|
24
|
+
export declare function decodeFateValue(value: Encoded.ContractBytearray, aci: AciValue): any;
|
|
@@ -13,7 +13,7 @@ export { default as getTransactionSignerAddress } from './tx/transaction-signer'
|
|
|
13
13
|
export { AE_AMOUNT_FORMATS, formatAmount, toAe, toAettos, prefixedAmount, } from './utils/amount-formatter';
|
|
14
14
|
export { DerivationError, deriveChild, derivePathFromKey, getMasterKeyFromSeed, derivePathFromSeed, getKeyPair, generateSaveHDWalletFromSeed, getSaveHDWalletAccounts, getHdWalletAccountFromSeed, } from './utils/hd-wallet';
|
|
15
15
|
export { encode, decode, Encoding, Encoded, } from './utils/encoder';
|
|
16
|
-
export {
|
|
16
|
+
export { hashTypedData, hashDomain, hashJson } from './utils/typed-data';
|
|
17
17
|
export { aensRevoke, aensUpdate, aensTransfer, aensQuery, aensClaim, aensPreclaim, aensBid, } from './aens';
|
|
18
18
|
export { default as Contract } from './contract/Contract';
|
|
19
19
|
export type { ContractMethodsBase } from './contract/Contract';
|
|
@@ -43,4 +43,4 @@ export { default as walletDetector } from './aepp-wallet-communication/wallet-de
|
|
|
43
43
|
export { default as BrowserRuntimeConnection } from './aepp-wallet-communication/connection/BrowserRuntime';
|
|
44
44
|
export { default as BrowserWindowMessageConnection } from './aepp-wallet-communication/connection/BrowserWindowMessage';
|
|
45
45
|
export { BaseError, AccountError, AensError, AeppError, ChannelError, CompilerError, ContractError, CryptographyError, NodeError, TransactionError, WalletError, ArgumentError, IllegalArgumentError, ArgumentCountMismatchError, InsufficientBalanceError, MissingParamError, NoSerializerFoundError, RequestTimedOutError, TxTimedOutError, TypeError, UnsupportedPlatformError, UnsupportedProtocolError, NotImplementedError, UnsupportedVersionError, InternalError, UnexpectedTsError, UnavailableAccountError, AensPointerContextError, InsufficientNameFeeError, InvalidAensNameError, InvalidRpcMessageError, MissingCallbackError, UnAuthorizedAccountError, UnknownRpcClientError, UnsubscribedAccountError, ChannelCallError, ChannelConnectionError, ChannelPingTimedOutError, UnexpectedChannelMessageError, ChannelIncomingMessageError, UnknownChannelStateError, InvalidAuthDataError, BytecodeMismatchError, DuplicateContractError, InactiveContractError, InvalidMethodInvocationError, MissingContractAddressError, MissingContractDefError, MissingFunctionNameError, NodeInvocationError, NoSuchContractFunctionError, NotPayableFunctionError, MissingEventDefinitionError, AmbiguousEventDefinitionError, InvalidChecksumError, InvalidPasswordError, MerkleTreeHashMismatchError, MissingNodeInTreeError, UnknownNodeLengthError, UnknownPathNibbleError, DuplicateNodeError, NodeNotFoundError, DecodeError, PayloadLengthError, DryRunError, IllegalBidFeeError, InvalidSignatureError, PrefixNotFoundError, SchemaNotFoundError, TagNotFoundError, TxNotInChainError, AlreadyConnectedError, NoWalletConnectedError, RpcConnectionError, } from './utils/errors';
|
|
46
|
-
export { RpcBroadcastError, NAME_BID_MAX_LENGTH } from './deprecated';
|
|
46
|
+
export { RpcBroadcastError, NAME_BID_MAX_LENGTH, encodeFateValue, decodeFateValue, } from './deprecated';
|
|
@@ -88,7 +88,7 @@ export declare function verifyMessage(message: string, signature: Uint8Array, ad
|
|
|
88
88
|
/**
|
|
89
89
|
* Check key pair for validity
|
|
90
90
|
*
|
|
91
|
-
*
|
|
91
|
+
* Signs a message, and then verifies that signature
|
|
92
92
|
* @param privateKey - Private key to verify
|
|
93
93
|
* @param publicKey - Public key to verify as hex string
|
|
94
94
|
* @returns Valid?
|
|
@@ -51,8 +51,6 @@ export interface Domain {
|
|
|
51
51
|
networkId?: string;
|
|
52
52
|
contractAddress?: Encoded.ContractAddress;
|
|
53
53
|
}
|
|
54
|
-
export declare function encodeFateValue(value: unknown, aci: AciValue): Encoded.ContractBytearray;
|
|
55
|
-
export declare function decodeFateValue(value: Encoded.ContractBytearray, aci: AciValue): Encoded.ContractBytearray;
|
|
56
54
|
/**
|
|
57
55
|
* Hashes domain object, can be used to inline domain hash to contract source code
|
|
58
56
|
*/
|