@aeternity/aepp-sdk 14.0.0 → 14.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/LICENSE +1 -1
- package/README.md +11 -19
- package/dist/aepp-sdk.browser-script.cjs +1 -1
- package/dist/aepp-sdk.browser-script.cjs.LICENSE.txt +2 -0
- package/dist/aepp-sdk.browser-script.cjs.map +1 -1
- package/dist/aepp-sdk.browser.cjs +1 -1
- package/dist/aepp-sdk.browser.cjs.map +1 -1
- package/dist/aepp-sdk.cjs +11678 -6969
- package/dist/aepp-sdk.cjs.map +1 -1
- package/es/AeSdkBase.d.ts +10 -1
- package/es/AeSdkBase.js +12 -2
- package/es/AeSdkBase.js.map +1 -1
- package/es/AeSdkMethods.d.ts +1 -1
- package/es/AeSdkMethods.js.map +1 -1
- package/es/AeSdkWallet.js +1 -1
- package/es/AeSdkWallet.js.map +1 -1
- package/es/Middleware.d.ts +5 -1
- package/es/Middleware.js +7 -2
- package/es/Middleware.js.map +1 -1
- package/es/MiddlewareSubscriber.d.ts +3 -0
- package/es/MiddlewareSubscriber.js +4 -0
- package/es/MiddlewareSubscriber.js.map +1 -1
- package/es/Node.d.ts +6 -1
- package/es/Node.js +28 -4
- package/es/Node.js.map +1 -1
- package/es/account/Base.d.ts +12 -0
- package/es/account/Base.js +1 -0
- package/es/account/Base.js.map +1 -1
- package/es/account/BaseFactory.d.ts +1 -0
- package/es/account/BaseFactory.js +1 -0
- package/es/account/BaseFactory.js.map +1 -1
- package/es/account/Generalized.d.ts +5 -0
- package/es/account/Generalized.js +9 -0
- package/es/account/Generalized.js.map +1 -1
- package/es/account/Ledger.d.ts +5 -0
- package/es/account/Ledger.js +9 -0
- package/es/account/Ledger.js.map +1 -1
- package/es/account/LedgerFactory.d.ts +2 -0
- package/es/account/LedgerFactory.js +10 -4
- package/es/account/LedgerFactory.js.map +1 -1
- package/es/account/Memory.d.ts +5 -0
- package/es/account/Memory.js +14 -5
- package/es/account/Memory.js.map +1 -1
- package/es/account/Metamask.d.ts +8 -0
- package/es/account/Metamask.js +13 -0
- package/es/account/Metamask.js.map +1 -1
- package/es/account/MetamaskFactory.d.ts +20 -2
- package/es/account/MetamaskFactory.js +93 -39
- package/es/account/MetamaskFactory.js.map +1 -1
- package/es/account/MnemonicFactory.d.ts +12 -2
- package/es/account/MnemonicFactory.js +48 -24
- package/es/account/MnemonicFactory.js.map +1 -1
- package/es/account/Rpc.d.ts +5 -0
- package/es/account/Rpc.js +8 -0
- package/es/account/Rpc.js.map +1 -1
- package/es/aens.d.ts +25 -5
- package/es/aens.js +52 -18
- package/es/aens.js.map +1 -1
- package/es/aepp-wallet-communication/connection/BrowserRuntime.d.ts +1 -1
- package/es/aepp-wallet-communication/connection/BrowserRuntime.js.map +1 -1
- package/es/apis/middleware/middleware.d.ts +99 -9
- package/es/apis/middleware/middleware.js +560 -91
- package/es/apis/middleware/middleware.js.map +1 -1
- package/es/apis/middleware/models/index.d.ts +1267 -1582
- package/es/apis/middleware/models/index.js +1 -1363
- package/es/apis/middleware/models/index.js.map +1 -1
- package/es/apis/middleware/models/mappers.d.ts +126 -56
- package/es/apis/middleware/models/mappers.js +6250 -2989
- package/es/apis/middleware/models/mappers.js.map +1 -1
- package/es/apis/middleware/models/parameters.d.ts +54 -33
- package/es/apis/middleware/models/parameters.js +389 -134
- package/es/apis/middleware/models/parameters.js.map +1 -1
- package/es/apis/node/models/index.d.ts +60 -15
- package/es/apis/node/models/index.js.map +1 -1
- package/es/apis/node/models/mappers.d.ts +3 -0
- package/es/apis/node/models/mappers.js +130 -2
- package/es/apis/node/models/mappers.js.map +1 -1
- package/es/apis/node/node.d.ts +13 -1
- package/es/apis/node/node.js +54 -0
- package/es/apis/node/node.js.map +1 -1
- package/es/chain.d.ts +19 -6
- package/es/chain.js +30 -24
- package/es/chain.js.map +1 -1
- package/es/channel/Contract.d.ts +6 -3
- package/es/channel/Contract.js +5 -2
- package/es/channel/Contract.js.map +1 -1
- package/es/channel/Spend.d.ts +1 -1
- package/es/channel/Spend.js.map +1 -1
- package/es/channel/handlers.js +1 -2
- package/es/channel/handlers.js.map +1 -1
- package/es/channel/internal.d.ts +1 -1
- package/es/channel/internal.js +2 -2
- package/es/channel/internal.js.map +1 -1
- package/es/contract/Contract.d.ts +13 -2
- package/es/contract/Contract.js +22 -12
- package/es/contract/Contract.js.map +1 -1
- package/es/contract/compiler/Base.d.ts +1 -0
- package/es/contract/compiler/Base.js +1 -0
- package/es/contract/compiler/Base.js.map +1 -1
- package/es/contract/compiler/Cli.d.ts +2 -1
- package/es/contract/compiler/Cli.js +11 -9
- package/es/contract/compiler/Cli.js.map +1 -1
- package/es/contract/compiler/Http.d.ts +2 -1
- package/es/contract/compiler/Http.js +3 -2
- package/es/contract/compiler/Http.js.map +1 -1
- package/es/contract/compiler/getFileSystem.d.ts +1 -0
- package/es/contract/compiler/getFileSystem.js +1 -0
- package/es/contract/compiler/getFileSystem.js.map +1 -1
- package/es/contract/ga.d.ts +3 -3
- package/es/contract/ga.js +3 -3
- package/es/contract/ga.js.map +1 -1
- package/es/index-browser.d.ts +32 -2
- package/es/index-browser.js +32 -2
- package/es/index-browser.js.map +1 -1
- package/es/oracle/Oracle.d.ts +10 -1
- package/es/oracle/Oracle.js +16 -6
- package/es/oracle/Oracle.js.map +1 -1
- package/es/oracle/OracleBase.d.ts +15 -2
- package/es/oracle/OracleBase.js +23 -1
- package/es/oracle/OracleBase.js.map +1 -1
- package/es/oracle/OracleClient.d.ts +3 -0
- package/es/oracle/OracleClient.js +6 -1
- package/es/oracle/OracleClient.js.map +1 -1
- package/es/spend.js +1 -1
- package/es/spend.js.map +1 -1
- package/es/tx/builder/common.js +6 -3
- package/es/tx/builder/common.js.map +1 -1
- package/es/tx/builder/constants.d.ts +53 -3
- package/es/tx/builder/constants.js +62 -12
- package/es/tx/builder/constants.js.map +1 -1
- package/es/tx/builder/delegation/schema.js +15 -0
- package/es/tx/builder/delegation/schema.js.map +1 -1
- package/es/tx/builder/entry/constants.d.ts +4 -1
- package/es/tx/builder/entry/constants.js +10 -1
- package/es/tx/builder/entry/constants.js.map +1 -1
- package/es/tx/builder/entry/index.js +1 -2
- package/es/tx/builder/entry/index.js.map +1 -1
- package/es/tx/builder/field-types/ct-version.js +1 -2
- package/es/tx/builder/field-types/ct-version.js.map +1 -1
- package/es/tx/builder/field-types/fee.d.ts +1 -1
- package/es/tx/builder/field-types/fee.js +4 -4
- package/es/tx/builder/field-types/fee.js.map +1 -1
- package/es/tx/builder/field-types/gas-price.d.ts +3 -0
- package/es/tx/builder/field-types/gas-price.js +1 -1
- package/es/tx/builder/field-types/gas-price.js.map +1 -1
- package/es/tx/builder/field-types/name-fee.js +1 -1
- package/es/tx/builder/field-types/name-fee.js.map +1 -1
- package/es/tx/builder/field-types/name-id.js +2 -2
- package/es/tx/builder/field-types/name-id.js.map +1 -1
- package/es/tx/builder/field-types/nonce.d.ts +1 -1
- package/es/tx/builder/field-types/nonce.js.map +1 -1
- package/es/tx/builder/field-types/pointers.js +3 -3
- package/es/tx/builder/field-types/pointers.js.map +1 -1
- package/es/tx/builder/field-types/ttl.js +1 -2
- package/es/tx/builder/field-types/ttl.js.map +1 -1
- package/es/tx/builder/helpers.d.ts +18 -12
- package/es/tx/builder/helpers.js +25 -17
- package/es/tx/builder/helpers.js.map +1 -1
- package/es/tx/builder/schema.d.ts +27 -24
- package/es/tx/builder/schema.generated.d.ts +12 -12
- package/es/tx/builder/schema.generated.js.map +1 -1
- package/es/tx/builder/schema.js +5 -3
- package/es/tx/builder/schema.js.map +1 -1
- package/es/tx/execution-cost.d.ts +3 -0
- package/es/tx/execution-cost.js +7 -4
- package/es/tx/execution-cost.js.map +1 -1
- package/es/tx/transaction-signer.d.ts +1 -0
- package/es/tx/transaction-signer.js +1 -0
- package/es/tx/transaction-signer.js.map +1 -1
- package/es/tx/validator.js +4 -3
- package/es/tx/validator.js.map +1 -1
- package/es/utils/MiddlewarePage.d.ts +4 -3
- package/es/utils/MiddlewarePage.js.map +1 -1
- package/es/utils/amount-formatter.d.ts +15 -1
- package/es/utils/amount-formatter.js +17 -1
- package/es/utils/amount-formatter.js.map +1 -1
- package/es/utils/autorest.d.ts +1 -1
- package/es/utils/autorest.js +10 -4
- package/es/utils/autorest.js.map +1 -1
- package/es/utils/bignumber.d.ts +1 -1
- package/es/utils/bignumber.js +1 -1
- package/es/utils/bignumber.js.map +1 -1
- package/es/utils/bytes.d.ts +3 -1
- package/es/utils/bytes.js +3 -1
- package/es/utils/bytes.js.map +1 -1
- package/es/utils/crypto.d.ts +48 -15
- package/es/utils/crypto.js +80 -29
- package/es/utils/crypto.js.map +1 -1
- package/es/utils/encoder-types.d.ts +1 -1
- package/es/utils/encoder-types.js +1 -1
- package/es/utils/encoder-types.js.map +1 -1
- package/es/utils/encoder.d.ts +2 -0
- package/es/utils/encoder.js +2 -0
- package/es/utils/encoder.js.map +1 -1
- package/es/utils/errors.d.ts +2 -2
- package/es/utils/errors.js +2 -2
- package/es/utils/errors.js.map +1 -1
- package/es/utils/json-big.js +1 -1
- package/es/utils/json-big.js.map +1 -1
- package/es/utils/jwt.js +3 -3
- package/es/utils/jwt.js.map +1 -1
- package/es/utils/typed-data.d.ts +5 -0
- package/es/utils/typed-data.js +6 -0
- package/es/utils/typed-data.js.map +1 -1
- package/package.json +50 -51
package/es/utils/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
2
|
import { AensName, Int } from '../tx/builder/constants.js';
|
|
3
3
|
import * as Encoded from './encoder-types.js';
|
|
4
4
|
/**
|
|
@@ -270,7 +270,7 @@ export declare class InvalidAuthDataError extends CompilerError {
|
|
|
270
270
|
* @category exception
|
|
271
271
|
*/
|
|
272
272
|
export declare class BytecodeMismatchError extends ContractError {
|
|
273
|
-
constructor(source: 'source code' | 'bytecode');
|
|
273
|
+
constructor(source: 'source code' | 'bytecode' | 'ACI', details?: string);
|
|
274
274
|
}
|
|
275
275
|
/**
|
|
276
276
|
* @category exception
|
package/es/utils/errors.js
CHANGED
|
@@ -437,8 +437,8 @@ export class InvalidAuthDataError extends CompilerError {
|
|
|
437
437
|
* @category exception
|
|
438
438
|
*/
|
|
439
439
|
export class BytecodeMismatchError extends ContractError {
|
|
440
|
-
constructor(source) {
|
|
441
|
-
super(`Contract ${source} do not correspond to the bytecode deployed on the chain`);
|
|
440
|
+
constructor(source, details = '') {
|
|
441
|
+
super(`Contract ${source} do not correspond to the bytecode deployed on the chain` + details);
|
|
442
442
|
this.name = 'BytecodeMismatchError';
|
|
443
443
|
}
|
|
444
444
|
}
|
package/es/utils/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","names":["BaseError","Error","constructor","message","name","AccountError","AensError","AeppError","ChannelError","CompilerError","ContractError","CryptographyError","NodeError","TransactionError","WalletError","ArgumentError","argumentName","requirement","argumentValue","IllegalArgumentError","ArgumentCountMismatchError","functionName","requiredCount","providedCount","InsufficientBalanceError","MissingParamError","NoSerializerFoundError","RequestTimedOutError","height","TxTimedOutError","blocks","th","TypeError","UnsupportedPlatformError","UnsupportedProtocolError","NotImplementedError","UnsupportedVersionError","dependency","version","geVersion","ltVersion","LogicError","InternalError","UnexpectedTsError","UnavailableAccountError","address","AensPointerContextError","nameOrId","prefix","InsufficientNameFeeError","nameFee","minNameFee","toString","InvalidAensNameError","InvalidRpcMessageError","MissingCallbackError","id","UnAuthorizedAccountError","onAccount","UnknownRpcClientError","UnsubscribedAccountError","ChannelCallError","ChannelConnectionError","ChannelPingTimedOutError","UnexpectedChannelMessageError","ChannelIncomingMessageError","handlerError","incomingMessage","UnknownChannelStateError","InvalidAuthDataError","BytecodeMismatchError","source","DuplicateContractError","InactiveContractError","contractAddress","InvalidMethodInvocationError","MissingContractAddressError","MissingContractDefError","MissingFunctionNameError","NodeInvocationError","transaction","NoSuchContractFunctionError","NotPayableFunctionError","amount","fn","MissingEventDefinitionError","eventNameHash","eventAddress","AmbiguousEventDefinitionError","matchedEvents","map","join","InvalidChecksumError","MerkleTreeHashMismatchError","MissingNodeInTreeError","UnknownNodeLengthError","nodeLength","UnknownPathNibbleError","nibble","DuplicateNodeError","NodeNotFoundError","DecodeError","PayloadLengthError","DryRunError","IllegalBidFeeError","InvalidSignatureError","PrefixNotFoundError","tag","SchemaNotFoundError","key","TagNotFoundError","TxNotInChainError","txHash","AlreadyConnectedError","NoWalletConnectedError","RpcConnectionError"],"sources":["../../src/utils/errors.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport { BigNumber } from 'bignumber.js';\nimport { AensName, Int } from '../tx/builder/constants.js';\nimport * as Encoded from './encoder-types.js';\n\n/**\n * aepp-sdk originated error\n * @category exception\n */\nexport abstract class BaseError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'BaseError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AccountError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'AccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AensError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'AensError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AeppError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'AeppError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'ChannelError';\n }\n}\n\n/**\n * @category exception\n */\nexport class CompilerError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'CompilerError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ContractError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'ContractError';\n }\n}\n\n/**\n * @category exception\n */\nexport class CryptographyError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'CryptographyError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NodeError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'NodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TransactionError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'TransactionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class WalletError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'WalletError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ArgumentError extends BaseError {\n constructor(argumentName: string, requirement: unknown, argumentValue: unknown) {\n super(`${argumentName} should be ${requirement}, got ${argumentValue} instead`);\n this.name = 'ArgumentError';\n }\n}\n\n/**\n * @category exception\n */\nexport class IllegalArgumentError extends CryptographyError {\n constructor(message: string) {\n super(message);\n this.name = 'IllegalArgumentError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ArgumentCountMismatchError extends BaseError {\n constructor(functionName: string, requiredCount: number, providedCount: number) {\n super(`${functionName} expects ${requiredCount} arguments, got ${providedCount} instead`);\n this.name = 'ArgumentCountMismatchError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InsufficientBalanceError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'InsufficientBalanceError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingParamError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'MissingParamError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NoSerializerFoundError extends BaseError {\n constructor() {\n super('Byte serialization not supported');\n this.name = 'NoSerializerFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class RequestTimedOutError extends BaseError {\n constructor(height: number) {\n super(`Giving up at height ${height}`);\n this.name = 'RequestTimedOutError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TxTimedOutError extends BaseError {\n constructor(blocks: number, th: Encoded.TxHash) {\n super(`Giving up after ${blocks} blocks mined, transaction hash: ${th}`);\n this.name = 'TxTimedOutError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TypeError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'TypeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedPlatformError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'UnsupportedPlatformError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedProtocolError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'UnsupportedProtocolError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NotImplementedError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'NotImplementedError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedVersionError extends BaseError {\n constructor(dependency: string, version: string, geVersion: string, ltVersion?: string) {\n super(\n `Unsupported ${dependency} version ${version}. Supported: >= ${geVersion}` +\n (ltVersion == null ? '' : ` < ${ltVersion}`),\n );\n this.name = 'UnsupportedVersionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class LogicError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'LogicError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InternalError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'InternalError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnexpectedTsError extends InternalError {\n constructor(message = 'Expected to not happen, required for TS') {\n super(message);\n this.name = 'UnexpectedTsError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnavailableAccountError extends AccountError {\n constructor(address: Encoded.AccountAddress) {\n super(`Account for ${address} not available`);\n this.name = 'UnavailableAccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AensPointerContextError extends AensError {\n constructor(nameOrId: AensName | Encoded.Name, prefix: string) {\n super(`Name ${nameOrId} don't have pointers for ${prefix}`);\n this.name = 'AensPointerContextError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InsufficientNameFeeError extends AensError {\n constructor(nameFee: BigNumber, minNameFee: BigNumber) {\n super(\n `the provided fee ${nameFee.toString()} is not enough to execute the claim, required: ${minNameFee.toString()}`,\n );\n this.name = 'InsufficientNameFeeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidAensNameError extends AensError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidAensNameError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidRpcMessageError extends AeppError {\n constructor(message: string) {\n super(`Received invalid message: ${message}`);\n this.name = 'InvalidRpcMessageError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingCallbackError extends AeppError {\n constructor(id: number) {\n super(`Can't find callback for this messageId ${id}`);\n this.name = 'MissingCallbackError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnAuthorizedAccountError extends AeppError {\n constructor(onAccount: Encoded.AccountAddress) {\n super(`You do not have access to account ${onAccount}`);\n this.name = 'UnAuthorizedAccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownRpcClientError extends AeppError {\n constructor(id: string) {\n super(`RpcClient with id ${id} do not exist`);\n this.name = 'UnknownRpcClientError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsubscribedAccountError extends AeppError {\n constructor() {\n super('You are not subscribed for an account.');\n this.name = 'UnsubscribedAccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelCallError extends ChannelError {\n constructor(message: string) {\n super(message);\n this.name = 'ChannelCallError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelConnectionError extends ChannelError {\n constructor(message: string) {\n super(message);\n this.name = 'ChannelConnectionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelPingTimedOutError extends ChannelError {\n constructor() {\n super('Server pong timed out');\n this.name = 'ChannelPingTimedOutError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnexpectedChannelMessageError extends ChannelError {\n constructor(message: string) {\n super(message);\n this.name = 'UnexpectedChannelMessageError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelIncomingMessageError extends ChannelError {\n handlerError: Error;\n\n incomingMessage: { [key: string]: any };\n\n constructor(handlerError: Error, incomingMessage: { [key: string]: any }) {\n super(handlerError.message);\n this.handlerError = handlerError;\n this.incomingMessage = incomingMessage;\n this.name = 'ChannelIncomingMessageError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownChannelStateError extends ChannelError {\n constructor() {\n super('State Channels FSM entered unknown state');\n this.name = 'UnknownChannelStateError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidAuthDataError extends CompilerError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidAuthDataError';\n }\n}\n\n/**\n * @category exception\n */\nexport class BytecodeMismatchError extends ContractError {\n constructor(source: 'source code' | 'bytecode') {\n super(`Contract ${source} do not correspond to the bytecode deployed on the chain`);\n this.name = 'BytecodeMismatchError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DuplicateContractError extends ContractError {\n constructor() {\n super('Contract already deployed');\n this.name = 'DuplicateContractError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InactiveContractError extends ContractError {\n constructor(contractAddress: Encoded.ContractAddress) {\n super(`Contract with address ${contractAddress} not active`);\n this.name = 'InactiveContractError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidMethodInvocationError extends ContractError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidMethodInvocationError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingContractAddressError extends ContractError {\n constructor(message: string) {\n super(message);\n this.name = 'MissingContractAddressError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingContractDefError extends ContractError {\n constructor() {\n super('Either ACI or sourceCode or sourceCodePath is required');\n this.name = 'MissingContractDefError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingFunctionNameError extends ContractError {\n constructor() {\n super('Function name is required');\n this.name = 'MissingFunctionNameError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NodeInvocationError extends ContractError {\n transaction?: Encoded.Transaction;\n\n constructor(message: string, transaction?: Encoded.Transaction) {\n super(`Invocation failed${message == null ? '' : `: \"${message}\"`}`);\n this.name = 'NodeInvocationError';\n this.transaction = transaction;\n }\n}\n\n/**\n * @category exception\n */\nexport class NoSuchContractFunctionError extends ContractError {\n constructor(name: string) {\n super(`Function ${name} doesn't exist in contract`);\n this.name = 'NoSuchContractFunctionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NotPayableFunctionError extends ContractError {\n constructor(amount: Int, fn: string) {\n super(\n `You try to pay \"${amount}\" to function \"${fn}\" which is not payable. ` +\n 'Only payable function can accept coins',\n );\n this.name = 'NotPayableFunctionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingEventDefinitionError extends ContractError {\n constructor(eventNameHash: string, eventAddress: Encoded.ContractAddress) {\n super(\n `Can't find definition of ${eventNameHash} event emitted by ${eventAddress}` +\n ' (use omitUnknown option to ignore events like this)',\n );\n this.name = 'MissingEventDefinitionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AmbiguousEventDefinitionError extends ContractError {\n constructor(eventAddress: Encoded.ContractAddress, matchedEvents: Array<[string, string]>) {\n super(\n `Found multiple definitions of \"${matchedEvents[0][1]}\" event with different types emitted by` +\n ` ${eventAddress} in ${matchedEvents.map(([name]) => `\"${name}\"`).join(', ')} contracts` +\n ' (use contractAddressToName option to specify contract name corresponding to address)',\n );\n this.name = 'AmbiguousEventDefinitionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidChecksumError extends CryptographyError {\n constructor() {\n super('Invalid checksum');\n this.name = 'InvalidChecksumError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MerkleTreeHashMismatchError extends CryptographyError {\n constructor() {\n super('Node hash is not equal to provided one');\n this.name = 'MerkleTreeHashMismatchError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingNodeInTreeError extends CryptographyError {\n constructor(message: string) {\n super(message);\n this.name = 'MissingNodeInTreeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownNodeLengthError extends CryptographyError {\n constructor(nodeLength: number) {\n super(`Unknown node length: ${nodeLength}`);\n this.name = 'UnknownNodeLengthError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownPathNibbleError extends CryptographyError {\n constructor(nibble: number) {\n super(`Unknown path nibble: ${nibble}`);\n this.name = 'UnknownPathNibbleError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DuplicateNodeError extends NodeError {\n constructor(name: string) {\n super(`Node with name ${name} already exist`);\n this.name = 'DuplicateNodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NodeNotFoundError extends NodeError {\n constructor(message: string) {\n super(message);\n this.name = 'NodeNotFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DecodeError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'DecodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class PayloadLengthError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'PayloadLengthError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DryRunError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'DryRunError';\n }\n}\n\n/**\n * @category exception\n */\nexport class IllegalBidFeeError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'IllegalBidFeeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidSignatureError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidSignatureError';\n }\n}\n\n/**\n * @category exception\n */\nexport class PrefixNotFoundError extends TransactionError {\n constructor(tag: number) {\n super(`Prefix for id-tag ${tag} not found.`);\n this.name = 'PrefixNotFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class SchemaNotFoundError extends TransactionError {\n constructor(key: string, version: number) {\n super(`Transaction schema not implemented for tag ${key} version ${version}`);\n this.name = 'SchemaNotFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TagNotFoundError extends TransactionError {\n constructor(prefix: string) {\n super(`Id tag for prefix ${prefix} not found.`);\n this.name = 'DecodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TxNotInChainError extends TransactionError {\n constructor(txHash: Encoded.TxHash) {\n super(`Transaction ${txHash} is removed from chain`);\n this.name = 'TxNotInChainError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AlreadyConnectedError extends WalletError {\n constructor(message: string) {\n super(message);\n this.name = 'AlreadyConnectedError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NoWalletConnectedError extends WalletError {\n constructor(message: string) {\n super(message);\n this.name = 'NoWalletConnectedError';\n }\n}\n\n/**\n * @category exception\n */\nexport class RpcConnectionError extends WalletError {\n constructor(message: string) {\n super(message);\n this.name = 'RpcConnectionError';\n }\n}\n"],"mappings":"AAAA;;AAKA;AACA;AACA;AACA;AACA,OAAO,MAAeA,SAAS,SAASC,KAAK,CAAC;EAC5CC,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,WAAW;EACzB;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,SAASL,SAAS,CAAC;EAC1CE,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,cAAc;EAC5B;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAME,SAAS,SAASN,SAAS,CAAC;EACvCE,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,WAAW;EACzB;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMG,SAAS,SAASP,SAAS,CAAC;EACvCE,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,WAAW;EACzB;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMI,YAAY,SAASR,SAAS,CAAC;EAC1CE,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,cAAc;EAC5B;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMK,aAAa,SAAST,SAAS,CAAC;EAC3CE,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,eAAe;EAC7B;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMM,aAAa,SAASV,SAAS,CA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EAAE;IACxC,KAAK,CAAC,8CAA8CuE,GAAG,YAAYvE,OAAO,EAAE,CAAC;IAC7E,IAAI,CAAClC,IAAI,GAAG,qBAAqB;EACnC;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAM0G,gBAAgB,SAASjG,gBAAgB,CAAC;EACrDX,WAAWA,CAAC8C,MAAc,EAAE;IAC1B,KAAK,CAAC,qBAAqBA,MAAM,aAAa,CAAC;IAC/C,IAAI,CAAC5C,IAAI,GAAG,aAAa;EAC3B;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAM2G,iBAAiB,SAASlG,gBAAgB,CAAC;EACtDX,WAAWA,CAAC8G,MAAsB,EAAE;IAClC,KAAK,CAAC,eAAeA,MAAM,wBAAwB,CAAC;IACpD,IAAI,CAAC5G,IAAI,GAAG,mBAAmB;EACjC;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAM6G,qBAAqB,SAASnG,WAAW,CAAC;EACrDZ,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,uBAAuB;EACrC;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAM8G,sBAAsB,SAASpG,WAAW,CAAC;EACtDZ,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,wBAAwB;EACtC;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAM+G,kBAAkB,SAASrG,WAAW,CAAC;EAClDZ,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,oBAAoB;EAClC;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"errors.js","names":["BaseError","Error","constructor","message","name","AccountError","AensError","AeppError","ChannelError","CompilerError","ContractError","CryptographyError","NodeError","TransactionError","WalletError","ArgumentError","argumentName","requirement","argumentValue","IllegalArgumentError","ArgumentCountMismatchError","functionName","requiredCount","providedCount","InsufficientBalanceError","MissingParamError","NoSerializerFoundError","RequestTimedOutError","height","TxTimedOutError","blocks","th","TypeError","UnsupportedPlatformError","UnsupportedProtocolError","NotImplementedError","UnsupportedVersionError","dependency","version","geVersion","ltVersion","LogicError","InternalError","UnexpectedTsError","UnavailableAccountError","address","AensPointerContextError","nameOrId","prefix","InsufficientNameFeeError","nameFee","minNameFee","toString","InvalidAensNameError","InvalidRpcMessageError","MissingCallbackError","id","UnAuthorizedAccountError","onAccount","UnknownRpcClientError","UnsubscribedAccountError","ChannelCallError","ChannelConnectionError","ChannelPingTimedOutError","UnexpectedChannelMessageError","ChannelIncomingMessageError","handlerError","incomingMessage","UnknownChannelStateError","InvalidAuthDataError","BytecodeMismatchError","source","details","DuplicateContractError","InactiveContractError","contractAddress","InvalidMethodInvocationError","MissingContractAddressError","MissingContractDefError","MissingFunctionNameError","NodeInvocationError","transaction","NoSuchContractFunctionError","NotPayableFunctionError","amount","fn","MissingEventDefinitionError","eventNameHash","eventAddress","AmbiguousEventDefinitionError","matchedEvents","map","join","InvalidChecksumError","MerkleTreeHashMismatchError","MissingNodeInTreeError","UnknownNodeLengthError","nodeLength","UnknownPathNibbleError","nibble","DuplicateNodeError","NodeNotFoundError","DecodeError","PayloadLengthError","DryRunError","IllegalBidFeeError","InvalidSignatureError","PrefixNotFoundError","tag","SchemaNotFoundError","key","TagNotFoundError","TxNotInChainError","txHash","AlreadyConnectedError","NoWalletConnectedError","RpcConnectionError"],"sources":["../../src/utils/errors.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport BigNumber from 'bignumber.js';\nimport { AensName, Int } from '../tx/builder/constants.js';\nimport * as Encoded from './encoder-types.js';\n\n/**\n * aepp-sdk originated error\n * @category exception\n */\nexport abstract class BaseError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'BaseError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AccountError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'AccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AensError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'AensError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AeppError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'AeppError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'ChannelError';\n }\n}\n\n/**\n * @category exception\n */\nexport class CompilerError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'CompilerError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ContractError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'ContractError';\n }\n}\n\n/**\n * @category exception\n */\nexport class CryptographyError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'CryptographyError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NodeError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'NodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TransactionError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'TransactionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class WalletError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'WalletError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ArgumentError extends BaseError {\n constructor(argumentName: string, requirement: unknown, argumentValue: unknown) {\n super(`${argumentName} should be ${requirement}, got ${argumentValue} instead`);\n this.name = 'ArgumentError';\n }\n}\n\n/**\n * @category exception\n */\nexport class IllegalArgumentError extends CryptographyError {\n constructor(message: string) {\n super(message);\n this.name = 'IllegalArgumentError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ArgumentCountMismatchError extends BaseError {\n constructor(functionName: string, requiredCount: number, providedCount: number) {\n super(`${functionName} expects ${requiredCount} arguments, got ${providedCount} instead`);\n this.name = 'ArgumentCountMismatchError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InsufficientBalanceError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'InsufficientBalanceError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingParamError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'MissingParamError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NoSerializerFoundError extends BaseError {\n constructor() {\n super('Byte serialization not supported');\n this.name = 'NoSerializerFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class RequestTimedOutError extends BaseError {\n constructor(height: number) {\n super(`Giving up at height ${height}`);\n this.name = 'RequestTimedOutError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TxTimedOutError extends BaseError {\n constructor(blocks: number, th: Encoded.TxHash) {\n super(`Giving up after ${blocks} blocks mined, transaction hash: ${th}`);\n this.name = 'TxTimedOutError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TypeError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'TypeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedPlatformError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'UnsupportedPlatformError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedProtocolError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'UnsupportedProtocolError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NotImplementedError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'NotImplementedError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsupportedVersionError extends BaseError {\n constructor(dependency: string, version: string, geVersion: string, ltVersion?: string) {\n super(\n `Unsupported ${dependency} version ${version}. Supported: >= ${geVersion}` +\n (ltVersion == null ? '' : ` < ${ltVersion}`),\n );\n this.name = 'UnsupportedVersionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class LogicError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'LogicError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InternalError extends BaseError {\n constructor(message: string) {\n super(message);\n this.name = 'InternalError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnexpectedTsError extends InternalError {\n constructor(message = 'Expected to not happen, required for TS') {\n super(message);\n this.name = 'UnexpectedTsError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnavailableAccountError extends AccountError {\n constructor(address: Encoded.AccountAddress) {\n super(`Account for ${address} not available`);\n this.name = 'UnavailableAccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AensPointerContextError extends AensError {\n constructor(nameOrId: AensName | Encoded.Name, prefix: string) {\n super(`Name ${nameOrId} don't have pointers for ${prefix}`);\n this.name = 'AensPointerContextError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InsufficientNameFeeError extends AensError {\n constructor(nameFee: BigNumber, minNameFee: BigNumber) {\n super(\n `the provided fee ${nameFee.toString()} is not enough to execute the claim, required: ${minNameFee.toString()}`,\n );\n this.name = 'InsufficientNameFeeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidAensNameError extends AensError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidAensNameError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidRpcMessageError extends AeppError {\n constructor(message: string) {\n super(`Received invalid message: ${message}`);\n this.name = 'InvalidRpcMessageError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingCallbackError extends AeppError {\n constructor(id: number) {\n super(`Can't find callback for this messageId ${id}`);\n this.name = 'MissingCallbackError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnAuthorizedAccountError extends AeppError {\n constructor(onAccount: Encoded.AccountAddress) {\n super(`You do not have access to account ${onAccount}`);\n this.name = 'UnAuthorizedAccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownRpcClientError extends AeppError {\n constructor(id: string) {\n super(`RpcClient with id ${id} do not exist`);\n this.name = 'UnknownRpcClientError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnsubscribedAccountError extends AeppError {\n constructor() {\n super('You are not subscribed for an account.');\n this.name = 'UnsubscribedAccountError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelCallError extends ChannelError {\n constructor(message: string) {\n super(message);\n this.name = 'ChannelCallError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelConnectionError extends ChannelError {\n constructor(message: string) {\n super(message);\n this.name = 'ChannelConnectionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelPingTimedOutError extends ChannelError {\n constructor() {\n super('Server pong timed out');\n this.name = 'ChannelPingTimedOutError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnexpectedChannelMessageError extends ChannelError {\n constructor(message: string) {\n super(message);\n this.name = 'UnexpectedChannelMessageError';\n }\n}\n\n/**\n * @category exception\n */\nexport class ChannelIncomingMessageError extends ChannelError {\n handlerError: Error;\n\n incomingMessage: { [key: string]: any };\n\n constructor(handlerError: Error, incomingMessage: { [key: string]: any }) {\n super(handlerError.message);\n this.handlerError = handlerError;\n this.incomingMessage = incomingMessage;\n this.name = 'ChannelIncomingMessageError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownChannelStateError extends ChannelError {\n constructor() {\n super('State Channels FSM entered unknown state');\n this.name = 'UnknownChannelStateError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidAuthDataError extends CompilerError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidAuthDataError';\n }\n}\n\n/**\n * @category exception\n */\nexport class BytecodeMismatchError extends ContractError {\n constructor(source: 'source code' | 'bytecode' | 'ACI', details: string = '') {\n super(`Contract ${source} do not correspond to the bytecode deployed on the chain` + details);\n this.name = 'BytecodeMismatchError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DuplicateContractError extends ContractError {\n constructor() {\n super('Contract already deployed');\n this.name = 'DuplicateContractError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InactiveContractError extends ContractError {\n constructor(contractAddress: Encoded.ContractAddress) {\n super(`Contract with address ${contractAddress} not active`);\n this.name = 'InactiveContractError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidMethodInvocationError extends ContractError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidMethodInvocationError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingContractAddressError extends ContractError {\n constructor(message: string) {\n super(message);\n this.name = 'MissingContractAddressError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingContractDefError extends ContractError {\n constructor() {\n super('Either ACI or sourceCode or sourceCodePath is required');\n this.name = 'MissingContractDefError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingFunctionNameError extends ContractError {\n constructor() {\n super('Function name is required');\n this.name = 'MissingFunctionNameError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NodeInvocationError extends ContractError {\n transaction?: Encoded.Transaction;\n\n constructor(message: string, transaction?: Encoded.Transaction) {\n super(`Invocation failed${message == null ? '' : `: \"${message}\"`}`);\n this.name = 'NodeInvocationError';\n this.transaction = transaction;\n }\n}\n\n/**\n * @category exception\n */\nexport class NoSuchContractFunctionError extends ContractError {\n constructor(name: string) {\n super(`Function ${name} doesn't exist in contract`);\n this.name = 'NoSuchContractFunctionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NotPayableFunctionError extends ContractError {\n constructor(amount: Int, fn: string) {\n super(\n `You try to pay \"${amount}\" to function \"${fn}\" which is not payable. ` +\n 'Only payable function can accept coins',\n );\n this.name = 'NotPayableFunctionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingEventDefinitionError extends ContractError {\n constructor(eventNameHash: string, eventAddress: Encoded.ContractAddress) {\n super(\n `Can't find definition of ${eventNameHash} event emitted by ${eventAddress}` +\n ' (use omitUnknown option to ignore events like this)',\n );\n this.name = 'MissingEventDefinitionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AmbiguousEventDefinitionError extends ContractError {\n constructor(eventAddress: Encoded.ContractAddress, matchedEvents: Array<[string, string]>) {\n super(\n `Found multiple definitions of \"${matchedEvents[0][1]}\" event with different types emitted by` +\n ` ${eventAddress} in ${matchedEvents.map(([name]) => `\"${name}\"`).join(', ')} contracts` +\n ' (use contractAddressToName option to specify contract name corresponding to address)',\n );\n this.name = 'AmbiguousEventDefinitionError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidChecksumError extends CryptographyError {\n constructor() {\n super('Invalid checksum');\n this.name = 'InvalidChecksumError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MerkleTreeHashMismatchError extends CryptographyError {\n constructor() {\n super('Node hash is not equal to provided one');\n this.name = 'MerkleTreeHashMismatchError';\n }\n}\n\n/**\n * @category exception\n */\nexport class MissingNodeInTreeError extends CryptographyError {\n constructor(message: string) {\n super(message);\n this.name = 'MissingNodeInTreeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownNodeLengthError extends CryptographyError {\n constructor(nodeLength: number) {\n super(`Unknown node length: ${nodeLength}`);\n this.name = 'UnknownNodeLengthError';\n }\n}\n\n/**\n * @category exception\n */\nexport class UnknownPathNibbleError extends CryptographyError {\n constructor(nibble: number) {\n super(`Unknown path nibble: ${nibble}`);\n this.name = 'UnknownPathNibbleError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DuplicateNodeError extends NodeError {\n constructor(name: string) {\n super(`Node with name ${name} already exist`);\n this.name = 'DuplicateNodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NodeNotFoundError extends NodeError {\n constructor(message: string) {\n super(message);\n this.name = 'NodeNotFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DecodeError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'DecodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class PayloadLengthError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'PayloadLengthError';\n }\n}\n\n/**\n * @category exception\n */\nexport class DryRunError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'DryRunError';\n }\n}\n\n/**\n * @category exception\n */\nexport class IllegalBidFeeError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'IllegalBidFeeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class InvalidSignatureError extends TransactionError {\n constructor(message: string) {\n super(message);\n this.name = 'InvalidSignatureError';\n }\n}\n\n/**\n * @category exception\n */\nexport class PrefixNotFoundError extends TransactionError {\n constructor(tag: number) {\n super(`Prefix for id-tag ${tag} not found.`);\n this.name = 'PrefixNotFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class SchemaNotFoundError extends TransactionError {\n constructor(key: string, version: number) {\n super(`Transaction schema not implemented for tag ${key} version ${version}`);\n this.name = 'SchemaNotFoundError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TagNotFoundError extends TransactionError {\n constructor(prefix: string) {\n super(`Id tag for prefix ${prefix} not found.`);\n this.name = 'DecodeError';\n }\n}\n\n/**\n * @category exception\n */\nexport class TxNotInChainError extends TransactionError {\n constructor(txHash: Encoded.TxHash) {\n super(`Transaction ${txHash} is removed from chain`);\n this.name = 'TxNotInChainError';\n }\n}\n\n/**\n * @category exception\n */\nexport class AlreadyConnectedError extends WalletError {\n constructor(message: string) {\n super(message);\n this.name = 'AlreadyConnectedError';\n }\n}\n\n/**\n * @category exception\n */\nexport class NoWalletConnectedError extends WalletError {\n constructor(message: string) {\n super(message);\n this.name = 'NoWalletConnectedError';\n }\n}\n\n/**\n * @category exception\n */\nexport class RpcConnectionError extends WalletError {\n constructor(message: string) {\n super(message);\n this.name = 'RpcConnectionError';\n }\n}\n"],"mappings":"AAAA;;AAKA;AACA;AACA;AACA;AACA,OAAO,MAAeA,SAAS,SAASC,KAAK,CAAC;EAC5CC,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,WAAW;EACzB;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,SAASL,SAAS,CAAC;EAC1CE,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,cAAc;EAC5B;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAME,SAAS,SAASN,SAAS,CAAC;EACvCE,WAAWA,CAACC,OAAe,EAAE;IAC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qBAAqB,SAASpG,WAAW,CAAC;EACrDZ,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,uBAAuB;EACrC;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAM+G,sBAAsB,SAASrG,WAAW,CAAC;EACtDZ,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,wBAAwB;EACtC;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMgH,kBAAkB,SAAStG,WAAW,CAAC;EAClDZ,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,oBAAoB;EAClC;AACF","ignoreList":[]}
|
package/es/utils/json-big.js
CHANGED
package/es/utils/json-big.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-big.js","names":["JsonBig","BigNumber","mapObject","jsonBig","storeAsString","convertValuesToBigNumbers","value","constructor","Object","k","v","Array","isArray","map","item","toString","bn","toJSON","stringify","args","slice","parse"],"sources":["../../src/utils/json-big.ts"],"sourcesContent":["import JsonBig from 'json-bigint';\nimport
|
|
1
|
+
{"version":3,"file":"json-big.js","names":["JsonBig","BigNumber","mapObject","jsonBig","storeAsString","convertValuesToBigNumbers","value","constructor","Object","k","v","Array","isArray","map","item","toString","bn","toJSON","stringify","args","slice","parse"],"sources":["../../src/utils/json-big.ts"],"sourcesContent":["import JsonBig from 'json-bigint';\nimport BigNumber from 'bignumber.js';\nimport { mapObject } from './other.js';\n\nconst jsonBig = JsonBig({ storeAsString: true });\n\nconst convertValuesToBigNumbers = (value: any): any => {\n if (typeof value === 'object' && value !== null && value.constructor === Object) {\n return mapObject(value, ([k, v]) => [k, convertValuesToBigNumbers(v)]);\n }\n if (Array.isArray(value)) {\n return value.map((item) => convertValuesToBigNumbers(item));\n }\n if (typeof value === 'string' && new BigNumber(value).toString(10) === value) {\n const bn = new BigNumber(value);\n bn.toJSON = () => bn.toString(10);\n return bn;\n }\n return value;\n};\n\nexport default {\n stringify: (...args: Parameters<(typeof JsonBig)['stringify']>): string =>\n jsonBig.stringify(convertValuesToBigNumbers(args[0]), ...args.slice(1)),\n parse: jsonBig.parse,\n};\n"],"mappings":"AAAA,OAAOA,OAAO,MAAM,aAAa;AACjC,OAAOC,SAAS,MAAM,cAAc;AACpC,SAASC,SAAS,QAAQ,YAAY;AAEtC,MAAMC,OAAO,GAAGH,OAAO,CAAC;EAAEI,aAAa,EAAE;AAAK,CAAC,CAAC;AAEhD,MAAMC,yBAAyB,GAAIC,KAAU,IAAU;EACrD,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI,IAAIA,KAAK,CAACC,WAAW,KAAKC,MAAM,EAAE;IAC/E,OAAON,SAAS,CAACI,KAAK,EAAE,CAAC,CAACG,CAAC,EAAEC,CAAC,CAAC,KAAK,CAACD,CAAC,EAAEJ,yBAAyB,CAACK,CAAC,CAAC,CAAC,CAAC;EACxE;EACA,IAAIC,KAAK,CAACC,OAAO,CAACN,KAAK,CAAC,EAAE;IACxB,OAAOA,KAAK,CAACO,GAAG,CAAEC,IAAI,IAAKT,yBAAyB,CAACS,IAAI,CAAC,CAAC;EAC7D;EACA,IAAI,OAAOR,KAAK,KAAK,QAAQ,IAAI,IAAIL,SAAS,CAACK,KAAK,CAAC,CAACS,QAAQ,CAAC,EAAE,CAAC,KAAKT,KAAK,EAAE;IAC5E,MAAMU,EAAE,GAAG,IAAIf,SAAS,CAACK,KAAK,CAAC;IAC/BU,EAAE,CAACC,MAAM,GAAG,MAAMD,EAAE,CAACD,QAAQ,CAAC,EAAE,CAAC;IACjC,OAAOC,EAAE;EACX;EACA,OAAOV,KAAK;AACd,CAAC;AAED,eAAe;EACbY,SAAS,EAAEA,CAAC,GAAGC,IAA+C,KAC5DhB,OAAO,CAACe,SAAS,CAACb,yBAAyB,CAACc,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,GAAGA,IAAI,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EACzEC,KAAK,EAAElB,OAAO,CAACkB;AACjB,CAAC","ignoreList":[]}
|
package/es/utils/jwt.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Buffer as _Buffer } from "buffer";
|
|
2
2
|
import canonicalize from 'canonicalize';
|
|
3
3
|
import { Encoding, decode, encode } from './encoder.js';
|
|
4
|
-
import {
|
|
4
|
+
import { verifySignature } from './crypto.js';
|
|
5
5
|
import { ArgumentError, InvalidSignatureError } from './errors.js';
|
|
6
6
|
|
|
7
7
|
// TODO: use Buffer.from(data, 'base64url') after solving https://github.com/feross/buffer/issues/309
|
|
@@ -38,7 +38,7 @@ export async function signJwt(originalPayload, account) {
|
|
|
38
38
|
}
|
|
39
39
|
if (payload.sub_jwk === undefined) delete payload.sub_jwk;
|
|
40
40
|
const body = `${header}.${objectToBase64Url(payload)}`;
|
|
41
|
-
const signature = await account.
|
|
41
|
+
const signature = await account.unsafeSign(body);
|
|
42
42
|
return `${body}.${toBase64Url(signature)}`;
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -60,7 +60,7 @@ export function unpackJwt(jwt, address) {
|
|
|
60
60
|
if (address != null && signer !== address) {
|
|
61
61
|
throw new ArgumentError('address', `${signer} ("sub_jwk")`, address);
|
|
62
62
|
}
|
|
63
|
-
if (signer != null && !
|
|
63
|
+
if (signer != null && !verifySignature(_Buffer.from(`${h}.${payloadEncoded}`), fromBase64Url(signature), signer)) {
|
|
64
64
|
throw new InvalidSignatureError(`JWT is not signed by ${signer}`);
|
|
65
65
|
}
|
|
66
66
|
return {
|
package/es/utils/jwt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.js","names":["canonicalize","Encoding","decode","encode","
|
|
1
|
+
{"version":3,"file":"jwt.js","names":["canonicalize","Encoding","decode","encode","verifySignature","ArgumentError","InvalidSignatureError","toBase64Url","data","_Buffer","from","toString","replaceAll","replace","fromBase64Url","objectToBase64Url","_canonicalize","header","signJwt","originalPayload","account","payload","sub_jwk","kty","crv","x","address","undefined","body","signature","unsafeSign","unpackJwt","jwt","_payload$sub_jwk","components","split","length","h","payloadEncoded","JSON","parse","jwk","signer","AccountAddress","isJwt","maybeJwt","error","ensureJwt","verifyJwt"],"sources":["../../src/utils/jwt.ts"],"sourcesContent":["import canonicalize from 'canonicalize';\nimport AccountBase from '../account/Base.js';\nimport { Encoded, Encoding, decode, encode } from './encoder.js';\nimport { verifySignature } from './crypto.js';\nimport { ArgumentError, InvalidSignatureError } from './errors.js';\n\n// TODO: use Buffer.from(data, 'base64url') after solving https://github.com/feross/buffer/issues/309\nconst toBase64Url = (data: Buffer | Uint8Array | string): string =>\n Buffer.from(data).toString('base64').replaceAll('/', '_').replaceAll('+', '-').replace(/=+$/, '');\n\nconst fromBase64Url = (data: string): Buffer =>\n Buffer.from(data.replaceAll('_', '/').replaceAll('-', '+'), 'base64');\n\nconst objectToBase64Url = (data: any): string => toBase64Url(canonicalize(data) ?? '');\n\nconst header = 'eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9'; // objectToBase64Url({ alg: 'EdDSA', typ: 'JWT' })\n\n/**\n * JWT including specific header\n * @category JWT\n */\nexport type Jwt = `${typeof header}.${string}.${string}`;\n\n/**\n * Generate a signed JWT\n * Provide `\"sub_jwk\": undefined` in payload to omit signer public key added by default.\n * @param originalPayload - Payload to sign\n * @param account - Account to sign by\n * @category JWT\n */\nexport async function signJwt(originalPayload: any, account: AccountBase): Promise<Jwt> {\n const payload = { ...originalPayload };\n if (!('sub_jwk' in payload)) {\n payload.sub_jwk = {\n kty: 'OKP',\n crv: 'Ed25519',\n x: toBase64Url(decode(account.address)),\n };\n }\n if (payload.sub_jwk === undefined) delete payload.sub_jwk;\n const body = `${header}.${objectToBase64Url(payload)}` as const;\n const signature = await account.unsafeSign(body);\n return `${body}.${toBase64Url(signature)}`;\n}\n\n/**\n * Unpack JWT. It will check signature if address or \"sub_jwk\" provided.\n * @param jwt - JWT to unpack\n * @param address - Address to check signature\n * @category JWT\n */\nexport function unpackJwt(\n jwt: Jwt,\n address?: Encoded.AccountAddress,\n): {\n /**\n * JWT payload as object\n */\n payload: any;\n /**\n * Undefined returned in case signature is not checked\n */\n signer: Encoded.AccountAddress | undefined;\n} {\n const components = jwt.split('.');\n if (components.length !== 3)\n throw new ArgumentError('JWT components count', 3, components.length);\n const [h, payloadEncoded, signature] = components;\n if (h !== header) throw new ArgumentError('JWT header', header, h);\n const payload = JSON.parse(fromBase64Url(payloadEncoded).toString());\n const jwk = payload.sub_jwk ?? {};\n const signer =\n jwk.x == null || jwk.kty !== 'OKP' || jwk.crv !== 'Ed25519'\n ? address\n : encode(fromBase64Url(jwk.x), Encoding.AccountAddress);\n if (address != null && signer !== address) {\n throw new ArgumentError('address', `${signer} (\"sub_jwk\")`, address);\n }\n if (\n signer != null &&\n !verifySignature(Buffer.from(`${h}.${payloadEncoded}`), fromBase64Url(signature), signer)\n ) {\n throw new InvalidSignatureError(`JWT is not signed by ${signer}`);\n }\n return { payload, signer };\n}\n\n/**\n * Check is string a JWT or not. Use to validate the user input.\n * @param maybeJwt - A string to check\n * @returns True if argument is a JWT\n * @category JWT\n */\nexport function isJwt(maybeJwt: string): maybeJwt is Jwt {\n try {\n unpackJwt(maybeJwt as Jwt);\n return true;\n } catch (error) {\n return false;\n }\n}\n\n/**\n * Throws an error if argument is not JWT. Use to ensure that a value is JWT.\n * @param maybeJwt - A string to check\n * @category JWT\n */\nexport function ensureJwt(maybeJwt: string): asserts maybeJwt is Jwt {\n unpackJwt(maybeJwt as Jwt);\n}\n\n/**\n * Check is JWT signed by address from arguments or \"sub_jwk\"\n * @param jwt - JWT to check\n * @param address - Address to check signature\n * @category JWT\n */\nexport function verifyJwt(jwt: Jwt, address?: Encoded.AccountAddress): boolean {\n try {\n const { signer } = unpackJwt(jwt, address);\n return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AAc,CAAC;EAC3D,IAAIjB,OAAO,IAAI,IAAI,IAAIgB,MAAM,KAAKhB,OAAO,EAAE;IACzC,MAAM,IAAIrB,aAAa,CAAC,SAAS,EAAE,GAAGqC,MAAM,cAAc,EAAEhB,OAAO,CAAC;EACtE;EACA,IACEgB,MAAM,IAAI,IAAI,IACd,CAACtC,eAAe,CAACK,OAAA,CAAOC,IAAI,CAAC,GAAG2B,CAAC,IAAIC,cAAc,EAAE,CAAC,EAAExB,aAAa,CAACe,SAAS,CAAC,EAAEa,MAAM,CAAC,EACzF;IACA,MAAM,IAAIpC,qBAAqB,CAAC,wBAAwBoC,MAAM,EAAE,CAAC;EACnE;EACA,OAAO;IAAErB,OAAO;IAAEqB;EAAO,CAAC;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,KAAKA,CAACC,QAAgB,EAAmB;EACvD,IAAI;IACFd,SAAS,CAACc,QAAe,CAAC;IAC1B,OAAO,IAAI;EACb,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,OAAO,KAAK;EACd;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAACF,QAAgB,EAA2B;EACnEd,SAAS,CAACc,QAAe,CAAC;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,SAASA,CAAChB,GAAQ,EAAEN,OAAgC,EAAW;EAC7E,IAAI;IACF,MAAM;MAAEgB;IAAO,CAAC,GAAGX,SAAS,CAACC,GAAG,EAAEN,OAAO,CAAC;IAC1C,OAAOgB,MAAM,IAAI,IAAI;EACvB,CAAC,CAAC,OAAOI,KAAK,EAAE;IACd,OAAO,KAAK;EACd;AACF","ignoreList":[]}
|
package/es/utils/typed-data.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Encoded } from './encoder.js';
|
|
2
2
|
/**
|
|
3
3
|
* Hashes arbitrary object, can be used to inline the aci hash to contract source code
|
|
4
|
+
* @category typed data signing
|
|
4
5
|
*/
|
|
5
6
|
export declare function hashJson(data: unknown): Buffer;
|
|
6
7
|
export type AciValue = 'void' | 'unit' | 'int' | 'bool' | 'string' | 'bits' | 'hash' | 'signature' | 'address' | 'contract_pubkey' | 'Chain.ttl' | 'Chain.ga_meta_tx' | 'Chain.paying_for_tx' | 'Chain.base_tx' | 'AENS.pointee' | 'AENS.name' | 'MCL_BLS12_381.fr' | 'MCL_BLS12_381.fp' | {
|
|
@@ -37,6 +38,10 @@ export interface Domain {
|
|
|
37
38
|
}
|
|
38
39
|
/**
|
|
39
40
|
* Hashes domain object, can be used to inline domain hash to contract source code
|
|
41
|
+
* @category typed data signing
|
|
40
42
|
*/
|
|
41
43
|
export declare function hashDomain(domain: Domain): Buffer;
|
|
44
|
+
/**
|
|
45
|
+
* @category typed data signing
|
|
46
|
+
*/
|
|
42
47
|
export declare function hashTypedData(data: Encoded.ContractBytearray, aci: AciValue, domain: Domain): Buffer;
|
package/es/utils/typed-data.js
CHANGED
|
@@ -6,6 +6,7 @@ import { concatBuffers } from './other.js';
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Hashes arbitrary object, can be used to inline the aci hash to contract source code
|
|
9
|
+
* @category typed data signing
|
|
9
10
|
*/
|
|
10
11
|
export function hashJson(data) {
|
|
11
12
|
var _canonicalize;
|
|
@@ -17,6 +18,7 @@ export function hashJson(data) {
|
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* Hashes domain object, can be used to inline domain hash to contract source code
|
|
21
|
+
* @category typed data signing
|
|
20
22
|
*/
|
|
21
23
|
export function hashDomain(domain) {
|
|
22
24
|
const domainAci = {
|
|
@@ -46,6 +48,10 @@ export function hashDomain(domain) {
|
|
|
46
48
|
const fateValue = new ContractByteArrayEncoder().encodeWithType(domain, domainType);
|
|
47
49
|
return hash(decode(fateValue));
|
|
48
50
|
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @category typed data signing
|
|
54
|
+
*/
|
|
49
55
|
export function hashTypedData(data, aci, domain) {
|
|
50
56
|
return hash(concatBuffers([messagePrefixLength, new Uint8Array([0]), hashDomain(domain), hashJson(aci), hash(decode(data))]));
|
|
51
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typed-data.js","names":["TypeResolver","ContractByteArrayEncoder","canonicalize","decode","hash","messagePrefixLength","concatBuffers","hashJson","data","_canonicalize","hashDomain","domain","domainAci","record","name","type","option","domainType","resolveType","fateValue","encodeWithType","hashTypedData","aci","Uint8Array"],"sources":["../../src/utils/typed-data.ts"],"sourcesContent":["import { TypeResolver, ContractByteArrayEncoder } from '@aeternity/aepp-calldata';\nimport canonicalize from 'canonicalize';\nimport { Encoded, decode } from './encoder.js';\nimport { hash, messagePrefixLength } from './crypto.js';\nimport { concatBuffers } from './other.js';\n\n/**\n * Hashes arbitrary object, can be used to inline the aci hash to contract source code\n */\nexport function hashJson(data: unknown): Buffer {\n return hash(canonicalize(data) ?? '');\n}\n\n// TODO: move this type to calldata library https://github.com/aeternity/aepp-calldata-js/issues/215\n// based on https://github.com/aeternity/aepp-calldata-js/blob/82b5a98f9b308482627da8d7484d213e9cf87151/src/AciTypeResolver.js#L129\nexport type AciValue =\n | 'void'\n | 'unit'\n | 'int'\n | 'bool'\n | 'string'\n | 'bits'\n | 'hash'\n | 'signature'\n | 'address'\n | 'contract_pubkey'\n | 'Chain.ttl'\n | 'Chain.ga_meta_tx'\n | 'Chain.paying_for_tx'\n | 'Chain.base_tx'\n | 'AENS.pointee'\n | 'AENS.name'\n | 'MCL_BLS12_381.fr'\n | 'MCL_BLS12_381.fp'\n | { 'Set.set': readonly [AciValue] }\n | { bytes: number }\n | { list: readonly [AciValue] }\n | { map: readonly [AciValue, AciValue] }\n | { tuple: readonly AciValue[] }\n | { record: ReadonlyArray<{ name: string; type: AciValue }> }\n | { variant: ReadonlyArray<{ [key: string]: readonly AciValue[] }> }\n | { option: readonly [AciValue] }\n | { oracle: readonly [AciValue, AciValue] }\n | { oracle_query: readonly [AciValue, AciValue] };\n\nexport interface Domain {\n name?: string;\n version?: number;\n networkId?: string;\n contractAddress?: Encoded.ContractAddress;\n}\n\n/**\n * Hashes domain object, can be used to inline domain hash to contract source code\n */\nexport function hashDomain(domain: Domain): Buffer {\n const domainAci = {\n record: [\n {\n name: 'name',\n type: { option: ['string'] },\n },\n {\n name: 'version',\n type: { option: ['int'] },\n },\n {\n name: 'networkId',\n type: { option: ['string'] },\n },\n {\n name: 'contractAddress',\n type: { option: ['contract_pubkey'] },\n },\n ],\n } as const;\n const domainType = new TypeResolver().resolveType(domainAci, {});\n const fateValue = new ContractByteArrayEncoder().encodeWithType(domain, domainType);\n return hash(decode(fateValue));\n}\n\nexport function hashTypedData(\n data: Encoded.ContractBytearray,\n aci: AciValue,\n domain: Domain,\n): Buffer {\n return hash(\n concatBuffers([\n messagePrefixLength,\n new Uint8Array([0]),\n hashDomain(domain),\n hashJson(aci),\n hash(decode(data)),\n ]),\n );\n}\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,wBAAwB,QAAQ,0BAA0B;AACjF,OAAOC,YAAY,MAAM,cAAc;AACvC,SAAkBC,MAAM,QAAQ,cAAc;AAC9C,SAASC,IAAI,EAAEC,mBAAmB,QAAQ,aAAa;AACvD,SAASC,aAAa,QAAQ,YAAY;;AAE1C;AACA;AACA;AACA,OAAO,SAASC,QAAQA,CAACC,IAAa,EAAU;EAAA,IAAAC,aAAA;EAC9C,OAAOL,IAAI,EAAAK,aAAA,GAACP,YAAY,CAACM,IAAI,CAAC,cAAAC,aAAA,cAAAA,aAAA,GAAI,EAAE,CAAC;AACvC;;AAEA;AACA;;AAsCA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAACC,MAAc,EAAU;EACjD,MAAMC,SAAS,GAAG;IAChBC,MAAM,EAAE,CACN;MACEC,IAAI,EAAE,MAAM;MACZC,IAAI,EAAE;QAAEC,MAAM,EAAE,CAAC,QAAQ;MAAE;IAC7B,CAAC,EACD;MACEF,IAAI,EAAE,SAAS;MACfC,IAAI,EAAE;QAAEC,MAAM,EAAE,CAAC,KAAK;MAAE;IAC1B,CAAC,EACD;MACEF,IAAI,EAAE,WAAW;MACjBC,IAAI,EAAE;QAAEC,MAAM,EAAE,CAAC,QAAQ;MAAE;IAC7B,CAAC,EACD;MACEF,IAAI,EAAE,iBAAiB;MACvBC,IAAI,EAAE;QAAEC,MAAM,EAAE,CAAC,iBAAiB;MAAE;IACtC,CAAC;EAEL,CAAU;EACV,MAAMC,UAAU,GAAG,IAAIjB,YAAY,CAAC,CAAC,CAACkB,WAAW,CAACN,SAAS,EAAE,CAAC,CAAC,CAAC;EAChE,MAAMO,SAAS,GAAG,IAAIlB,wBAAwB,CAAC,CAAC,CAACmB,cAAc,CAACT,MAAM,EAAEM,UAAU,CAAC;EACnF,OAAOb,IAAI,CAACD,MAAM,CAACgB,SAAS,CAAC,CAAC;AAChC;
|
|
1
|
+
{"version":3,"file":"typed-data.js","names":["TypeResolver","ContractByteArrayEncoder","canonicalize","decode","hash","messagePrefixLength","concatBuffers","hashJson","data","_canonicalize","hashDomain","domain","domainAci","record","name","type","option","domainType","resolveType","fateValue","encodeWithType","hashTypedData","aci","Uint8Array"],"sources":["../../src/utils/typed-data.ts"],"sourcesContent":["import { TypeResolver, ContractByteArrayEncoder } from '@aeternity/aepp-calldata';\nimport canonicalize from 'canonicalize';\nimport { Encoded, decode } from './encoder.js';\nimport { hash, messagePrefixLength } from './crypto.js';\nimport { concatBuffers } from './other.js';\n\n/**\n * Hashes arbitrary object, can be used to inline the aci hash to contract source code\n * @category typed data signing\n */\nexport function hashJson(data: unknown): Buffer {\n return hash(canonicalize(data) ?? '');\n}\n\n// TODO: move this type to calldata library https://github.com/aeternity/aepp-calldata-js/issues/215\n// based on https://github.com/aeternity/aepp-calldata-js/blob/82b5a98f9b308482627da8d7484d213e9cf87151/src/AciTypeResolver.js#L129\nexport type AciValue =\n | 'void'\n | 'unit'\n | 'int'\n | 'bool'\n | 'string'\n | 'bits'\n | 'hash'\n | 'signature'\n | 'address'\n | 'contract_pubkey'\n | 'Chain.ttl'\n | 'Chain.ga_meta_tx'\n | 'Chain.paying_for_tx'\n | 'Chain.base_tx'\n | 'AENS.pointee'\n | 'AENS.name'\n | 'MCL_BLS12_381.fr'\n | 'MCL_BLS12_381.fp'\n | { 'Set.set': readonly [AciValue] }\n | { bytes: number }\n | { list: readonly [AciValue] }\n | { map: readonly [AciValue, AciValue] }\n | { tuple: readonly AciValue[] }\n | { record: ReadonlyArray<{ name: string; type: AciValue }> }\n | { variant: ReadonlyArray<{ [key: string]: readonly AciValue[] }> }\n | { option: readonly [AciValue] }\n | { oracle: readonly [AciValue, AciValue] }\n | { oracle_query: readonly [AciValue, AciValue] };\n\nexport interface Domain {\n name?: string;\n version?: number;\n networkId?: string;\n contractAddress?: Encoded.ContractAddress;\n}\n\n/**\n * Hashes domain object, can be used to inline domain hash to contract source code\n * @category typed data signing\n */\nexport function hashDomain(domain: Domain): Buffer {\n const domainAci = {\n record: [\n {\n name: 'name',\n type: { option: ['string'] },\n },\n {\n name: 'version',\n type: { option: ['int'] },\n },\n {\n name: 'networkId',\n type: { option: ['string'] },\n },\n {\n name: 'contractAddress',\n type: { option: ['contract_pubkey'] },\n },\n ],\n } as const;\n const domainType = new TypeResolver().resolveType(domainAci, {});\n const fateValue = new ContractByteArrayEncoder().encodeWithType(domain, domainType);\n return hash(decode(fateValue));\n}\n\n/**\n * @category typed data signing\n */\nexport function hashTypedData(\n data: Encoded.ContractBytearray,\n aci: AciValue,\n domain: Domain,\n): Buffer {\n return hash(\n concatBuffers([\n messagePrefixLength,\n new Uint8Array([0]),\n hashDomain(domain),\n hashJson(aci),\n hash(decode(data)),\n ]),\n );\n}\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,wBAAwB,QAAQ,0BAA0B;AACjF,OAAOC,YAAY,MAAM,cAAc;AACvC,SAAkBC,MAAM,QAAQ,cAAc;AAC9C,SAASC,IAAI,EAAEC,mBAAmB,Q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,UAAU,CAACC,MAAM,CAAC,EAClBJ,QAAQ,CAACe,GAAG,CAAC,EACblB,IAAI,CAACD,MAAM,CAACK,IAAI,CAAC,CAAC,CACnB,CACH,CAAC;AACH","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeternity/aepp-sdk",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.1.0",
|
|
4
4
|
"description": "SDK for the æternity blockchain",
|
|
5
|
+
"homepage": "https://sdk.aeternity.io/",
|
|
5
6
|
"main": "dist/aepp-sdk.cjs",
|
|
6
7
|
"types": "es/index.d.ts",
|
|
7
8
|
"module": "es/index.js",
|
|
@@ -23,22 +24,21 @@
|
|
|
23
24
|
"sideEffects": false,
|
|
24
25
|
"scripts": {
|
|
25
26
|
"build:assets": "node tooling/fetch-aesophia-cli.js",
|
|
26
|
-
"build:types": "tsc",
|
|
27
|
+
"build:types": "tsc -p tsconfig.src.json",
|
|
27
28
|
"build:dist": "webpack",
|
|
28
29
|
"build:es": "babel src --config-file ./babel.esm.config.js --out-dir es --extensions .ts --source-maps true",
|
|
29
30
|
"build:api:node": "autorest tooling/autorest/node.yaml && node tooling/autorest/postprocessing.js node",
|
|
30
31
|
"build:api:compiler": "node tooling/autorest/compiler-prepare.js && autorest tooling/autorest/compiler.yaml && node tooling/autorest/postprocessing.js compiler",
|
|
31
|
-
"
|
|
32
|
-
"build:api:middleware": "autorest tooling/autorest/middleware.yaml && node tooling/autorest/postprocessing.js middleware",
|
|
32
|
+
"build:api:middleware": "node tooling/autorest/middleware-prepare.js && autorest tooling/autorest/middleware.yaml && node tooling/autorest/postprocessing.js middleware",
|
|
33
33
|
"build:generate": "tsx tooling/generate-schema.ts",
|
|
34
34
|
"build": "run-p build:api:* build:assets build:generate && run-p build:dist build:es build:types",
|
|
35
|
-
"docs:examples": "node tooling/docs/examples-to-md.js examples/node
|
|
35
|
+
"docs:examples": "node tooling/docs/examples-to-md.js examples/node",
|
|
36
36
|
"docs:api": "typedoc",
|
|
37
37
|
"commitlint": "commitlint --from develop",
|
|
38
38
|
"lint": "run-p lint:*",
|
|
39
39
|
"lint:prettier": "prettier . --check",
|
|
40
40
|
"lint:eslint": "eslint . --ext .ts,.js",
|
|
41
|
-
"lint:types": "tsc
|
|
41
|
+
"lint:types": "tsc",
|
|
42
42
|
"format": "prettier . --write",
|
|
43
43
|
"test": "mocha './test/unit/' './test/integration/'",
|
|
44
44
|
"test:assets": "node tooling/fetch-metamask.js",
|
|
@@ -59,25 +59,25 @@
|
|
|
59
59
|
"SDK"
|
|
60
60
|
],
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@aeternity/aepp-calldata": "^1.
|
|
63
|
-
"@azure/core-client": "^1.9.
|
|
64
|
-
"@azure/core-rest-pipeline": "^1.
|
|
65
|
-
"@babel/runtime-corejs3": "^7.
|
|
62
|
+
"@aeternity/aepp-calldata": "^1.9.1",
|
|
63
|
+
"@azure/core-client": "^1.9.3",
|
|
64
|
+
"@azure/core-rest-pipeline": "^1.19.1",
|
|
65
|
+
"@babel/runtime-corejs3": "^7.27.0",
|
|
66
66
|
"@ledgerhq/hw-transport": "^6.31.4",
|
|
67
|
-
"@metamask/providers": "
|
|
68
|
-
"@scure/bip39": "^1.
|
|
67
|
+
"@metamask/providers": "^22.1.0",
|
|
68
|
+
"@scure/bip39": "^1.6.0",
|
|
69
69
|
"@types/json-bigint": "^1.0.4",
|
|
70
|
-
"@types/node": "^22.
|
|
71
|
-
"@types/readable-stream": "^4.0.
|
|
70
|
+
"@types/node": "^22.15.3",
|
|
71
|
+
"@types/readable-stream": "^4.0.18",
|
|
72
72
|
"@types/sha.js": "^2.4.4",
|
|
73
|
-
"@types/webextension-polyfill": "^0.12.
|
|
73
|
+
"@types/webextension-polyfill": "^0.12.3",
|
|
74
74
|
"@types/websocket": "^1.0.10",
|
|
75
|
-
"@types/ws": "^8.
|
|
76
|
-
"bignumber.js": "^9.
|
|
75
|
+
"@types/ws": "^8.18.1",
|
|
76
|
+
"bignumber.js": "^9.3.0",
|
|
77
77
|
"blakejs": "^1.2.1",
|
|
78
78
|
"bs58": "^6.0.0",
|
|
79
79
|
"buffer": "^6.0.3",
|
|
80
|
-
"canonicalize": "^2.
|
|
80
|
+
"canonicalize": "^2.1.0",
|
|
81
81
|
"eventemitter3": "^5.0.1",
|
|
82
82
|
"events": "^3.3.0",
|
|
83
83
|
"isomorphic-ws": "^5.0.0",
|
|
@@ -87,63 +87,62 @@
|
|
|
87
87
|
"sha.js": "^2.4.11",
|
|
88
88
|
"tweetnacl": "^1.0.3",
|
|
89
89
|
"tweetnacl-auth": "^1.0.1",
|
|
90
|
-
"varuint-bitcoin": "^2.0.0",
|
|
91
90
|
"webextension-polyfill": "^0.12.0",
|
|
92
91
|
"websocket": "^1.0.35",
|
|
93
|
-
"ws": "^8.18.
|
|
92
|
+
"ws": "^8.18.1"
|
|
94
93
|
},
|
|
95
94
|
"repository": {
|
|
96
95
|
"type": "git",
|
|
97
96
|
"url": "git+https://github.com/aeternity/aepp-sdk-js.git"
|
|
98
97
|
},
|
|
99
98
|
"devDependencies": {
|
|
100
|
-
"@babel/cli": "^7.
|
|
101
|
-
"@babel/core": "^7.
|
|
102
|
-
"@babel/node": "^7.
|
|
103
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
104
|
-
"@babel/preset-env": "^7.
|
|
105
|
-
"@babel/preset-typescript": "^7.
|
|
106
|
-
"@babel/register": "^7.25.
|
|
107
|
-
"@commitlint/cli": "^19.
|
|
108
|
-
"@commitlint/config-conventional": "^19.
|
|
99
|
+
"@babel/cli": "^7.27.0",
|
|
100
|
+
"@babel/core": "^7.26.10",
|
|
101
|
+
"@babel/node": "^7.26.0",
|
|
102
|
+
"@babel/plugin-transform-runtime": "^7.26.10",
|
|
103
|
+
"@babel/preset-env": "^7.26.9",
|
|
104
|
+
"@babel/preset-typescript": "^7.27.0",
|
|
105
|
+
"@babel/register": "^7.25.9",
|
|
106
|
+
"@commitlint/cli": "^19.8.0",
|
|
107
|
+
"@commitlint/config-conventional": "^19.8.0",
|
|
109
108
|
"@ledgerhq/hw-transport-mocker": "^6.29.4",
|
|
110
109
|
"@ledgerhq/hw-transport-node-hid-singleton": "^6.31.5",
|
|
111
110
|
"@ledgerhq/hw-transport-webusb": "^6.29.4",
|
|
112
|
-
"@types/chai": "^5.
|
|
113
|
-
"@types/chai-as-promised": "^8.0.
|
|
114
|
-
"@types/mocha": "^10.0.
|
|
111
|
+
"@types/chai": "^5.2.1",
|
|
112
|
+
"@types/chai-as-promised": "^8.0.2",
|
|
113
|
+
"@types/mocha": "^10.0.10",
|
|
115
114
|
"@types/node-hid": "^1.3.4",
|
|
116
|
-
"@types/sinon": "^17.0.
|
|
115
|
+
"@types/sinon": "^17.0.4",
|
|
117
116
|
"@typescript-eslint/eslint-plugin": "^7.15.0",
|
|
118
117
|
"@typescript-eslint/parser": "^7.15.0",
|
|
119
118
|
"autorest": "^3.7.1",
|
|
120
|
-
"babel-loader": "^
|
|
119
|
+
"babel-loader": "^10.0.0",
|
|
121
120
|
"babel-plugin-import-globals": "^2.0.0",
|
|
122
|
-
"babel-plugin-transform-import-meta": "^2.2
|
|
123
|
-
"
|
|
124
|
-
"chai
|
|
121
|
+
"babel-plugin-transform-import-meta": "^2.3.2",
|
|
122
|
+
"c8": "^10.1.3",
|
|
123
|
+
"chai": "^5.2.0",
|
|
124
|
+
"chai-as-promised": "^8.0.1",
|
|
125
125
|
"eslint": "^8.57.1",
|
|
126
126
|
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
127
127
|
"eslint-plugin-import": "^2.31.0",
|
|
128
128
|
"eslint-plugin-rulesdir": "^0.2.2",
|
|
129
|
-
"eslint-plugin-tsdoc": "^0.
|
|
129
|
+
"eslint-plugin-tsdoc": "^0.4.0",
|
|
130
130
|
"extract-zip": "^2.0.1",
|
|
131
|
-
"html-webpack-plugin": "^5.6.
|
|
132
|
-
"mocha": "^
|
|
133
|
-
"npm-run-all2": "^
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"sinon": "^19.0.2",
|
|
131
|
+
"html-webpack-plugin": "^5.6.3",
|
|
132
|
+
"mocha": "^11.1.0",
|
|
133
|
+
"npm-run-all2": "^7.0.2",
|
|
134
|
+
"prettier": "^3.5.3",
|
|
135
|
+
"puppeteer-core": "^24.7.2",
|
|
136
|
+
"sinon": "^20.0.0",
|
|
138
137
|
"source-map": "^0.7.4",
|
|
139
138
|
"standard-version": "^9.5.0",
|
|
140
|
-
"tsx": "^4.19.
|
|
141
|
-
"typedoc": "^0.
|
|
142
|
-
"typedoc-plugin-missing-exports": "^3.
|
|
139
|
+
"tsx": "^4.19.4",
|
|
140
|
+
"typedoc": "^0.27.9",
|
|
141
|
+
"typedoc-plugin-missing-exports": "^3.1.0",
|
|
143
142
|
"typescript": "^5.6.3",
|
|
144
|
-
"webpack": "^5.
|
|
143
|
+
"webpack": "^5.99.7",
|
|
145
144
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
146
|
-
"webpack-cli": "^
|
|
145
|
+
"webpack-cli": "^6.0.1"
|
|
147
146
|
},
|
|
148
147
|
"files": [
|
|
149
148
|
"dist",
|
|
@@ -169,7 +168,7 @@
|
|
|
169
168
|
"engines": {
|
|
170
169
|
"node": ">=18.19"
|
|
171
170
|
},
|
|
172
|
-
"packageManager": "npm@
|
|
171
|
+
"packageManager": "npm@11.3.0",
|
|
173
172
|
"contributors": [
|
|
174
173
|
"Till Kolter <till.kolter@gmail.com>",
|
|
175
174
|
"Alexander Kahl <ak@sodosopa.io>",
|