@taquito/michelson-encoder 12.1.0 → 13.0.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.
Files changed (122) hide show
  1. package/dist/lib/schema/parameter.js +3 -3
  2. package/dist/lib/schema/parameter.js.map +1 -1
  3. package/dist/lib/schema/storage.js +33 -14
  4. package/dist/lib/schema/storage.js.map +1 -1
  5. package/dist/lib/tokens/bigmap.js +4 -1
  6. package/dist/lib/tokens/bigmap.js.map +1 -1
  7. package/dist/lib/tokens/bls12-381-fr.js +4 -1
  8. package/dist/lib/tokens/bls12-381-fr.js.map +1 -1
  9. package/dist/lib/tokens/bls12-381-g1.js +4 -1
  10. package/dist/lib/tokens/bls12-381-g1.js.map +1 -1
  11. package/dist/lib/tokens/bls12-381-g2.js +4 -1
  12. package/dist/lib/tokens/bls12-381-g2.js.map +1 -1
  13. package/dist/lib/tokens/chain-id.js +4 -1
  14. package/dist/lib/tokens/chain-id.js.map +1 -1
  15. package/dist/lib/tokens/chest-key.js +4 -1
  16. package/dist/lib/tokens/chest-key.js.map +1 -1
  17. package/dist/lib/tokens/chest.js +4 -1
  18. package/dist/lib/tokens/chest.js.map +1 -1
  19. package/dist/lib/tokens/comparable/address.js +15 -9
  20. package/dist/lib/tokens/comparable/address.js.map +1 -1
  21. package/dist/lib/tokens/comparable/bool.js +4 -1
  22. package/dist/lib/tokens/comparable/bool.js.map +1 -1
  23. package/dist/lib/tokens/comparable/bytes.js +4 -1
  24. package/dist/lib/tokens/comparable/bytes.js.map +1 -1
  25. package/dist/lib/tokens/comparable/int.js +4 -1
  26. package/dist/lib/tokens/comparable/int.js.map +1 -1
  27. package/dist/lib/tokens/comparable/key_hash.js +4 -1
  28. package/dist/lib/tokens/comparable/key_hash.js.map +1 -1
  29. package/dist/lib/tokens/comparable/mutez.js +4 -1
  30. package/dist/lib/tokens/comparable/mutez.js.map +1 -1
  31. package/dist/lib/tokens/comparable/nat.js +4 -1
  32. package/dist/lib/tokens/comparable/nat.js.map +1 -1
  33. package/dist/lib/tokens/comparable/string.js +4 -1
  34. package/dist/lib/tokens/comparable/string.js.map +1 -1
  35. package/dist/lib/tokens/comparable/timestamp.js +4 -1
  36. package/dist/lib/tokens/comparable/timestamp.js.map +1 -1
  37. package/dist/lib/tokens/comparable/tx_rollup_l2_address.js +88 -0
  38. package/dist/lib/tokens/comparable/tx_rollup_l2_address.js.map +1 -0
  39. package/dist/lib/tokens/constant.js +4 -1
  40. package/dist/lib/tokens/constant.js.map +1 -1
  41. package/dist/lib/tokens/contract.js +8 -2
  42. package/dist/lib/tokens/contract.js.map +1 -1
  43. package/dist/lib/tokens/key.js +4 -1
  44. package/dist/lib/tokens/key.js.map +1 -1
  45. package/dist/lib/tokens/lambda.js +4 -1
  46. package/dist/lib/tokens/lambda.js.map +1 -1
  47. package/dist/lib/tokens/list.js +4 -1
  48. package/dist/lib/tokens/list.js.map +1 -1
  49. package/dist/lib/tokens/map.js +4 -1
  50. package/dist/lib/tokens/map.js.map +1 -1
  51. package/dist/lib/tokens/never.js +4 -1
  52. package/dist/lib/tokens/never.js.map +1 -1
  53. package/dist/lib/tokens/operation.js +4 -1
  54. package/dist/lib/tokens/operation.js.map +1 -1
  55. package/dist/lib/tokens/option.js +2 -2
  56. package/dist/lib/tokens/option.js.map +1 -1
  57. package/dist/lib/tokens/or.js +5 -5
  58. package/dist/lib/tokens/or.js.map +1 -1
  59. package/dist/lib/tokens/pair.js +9 -3
  60. package/dist/lib/tokens/pair.js.map +1 -1
  61. package/dist/lib/tokens/sapling-state.js +4 -1
  62. package/dist/lib/tokens/sapling-state.js.map +1 -1
  63. package/dist/lib/tokens/sapling-transaction.js +4 -1
  64. package/dist/lib/tokens/sapling-transaction.js.map +1 -1
  65. package/dist/lib/tokens/set.js +4 -1
  66. package/dist/lib/tokens/set.js.map +1 -1
  67. package/dist/lib/tokens/signature.js +9 -2
  68. package/dist/lib/tokens/signature.js.map +1 -1
  69. package/dist/lib/tokens/ticket.js +4 -1
  70. package/dist/lib/tokens/ticket.js.map +1 -1
  71. package/dist/lib/tokens/token.js +24 -3
  72. package/dist/lib/tokens/token.js.map +1 -1
  73. package/dist/lib/tokens/tokens.js +2 -0
  74. package/dist/lib/tokens/tokens.js.map +1 -1
  75. package/dist/lib/tokens/unit.js +4 -1
  76. package/dist/lib/tokens/unit.js.map +1 -1
  77. package/dist/lib/version.js +2 -2
  78. package/dist/taquito-michelson-encoder.es6.js +301 -73
  79. package/dist/taquito-michelson-encoder.es6.js.map +1 -1
  80. package/dist/taquito-michelson-encoder.umd.js +300 -72
  81. package/dist/taquito-michelson-encoder.umd.js.map +1 -1
  82. package/dist/types/schema/parameter.d.ts +2 -2
  83. package/dist/types/schema/storage.d.ts +3 -3
  84. package/dist/types/schema/types.d.ts +1 -1
  85. package/dist/types/taquito-michelson-encoder.d.ts +1 -1
  86. package/dist/types/tokens/bigmap.d.ts +2 -2
  87. package/dist/types/tokens/bls12-381-fr.d.ts +2 -6
  88. package/dist/types/tokens/bls12-381-g1.d.ts +2 -2
  89. package/dist/types/tokens/bls12-381-g2.d.ts +2 -2
  90. package/dist/types/tokens/chain-id.d.ts +2 -2
  91. package/dist/types/tokens/chest-key.d.ts +2 -2
  92. package/dist/types/tokens/chest.d.ts +2 -2
  93. package/dist/types/tokens/comparable/address.d.ts +2 -2
  94. package/dist/types/tokens/comparable/bool.d.ts +3 -7
  95. package/dist/types/tokens/comparable/bytes.d.ts +2 -4
  96. package/dist/types/tokens/comparable/int.d.ts +2 -2
  97. package/dist/types/tokens/comparable/key_hash.d.ts +2 -2
  98. package/dist/types/tokens/comparable/mutez.d.ts +2 -2
  99. package/dist/types/tokens/comparable/nat.d.ts +2 -2
  100. package/dist/types/tokens/comparable/string.d.ts +2 -2
  101. package/dist/types/tokens/comparable/timestamp.d.ts +2 -2
  102. package/dist/types/tokens/comparable/tx_rollup_l2_address.d.ts +45 -0
  103. package/dist/types/tokens/constant.d.ts +2 -2
  104. package/dist/types/tokens/contract.d.ts +2 -2
  105. package/dist/types/tokens/key.d.ts +2 -2
  106. package/dist/types/tokens/lambda.d.ts +2 -2
  107. package/dist/types/tokens/list.d.ts +2 -2
  108. package/dist/types/tokens/map.d.ts +2 -2
  109. package/dist/types/tokens/never.d.ts +2 -2
  110. package/dist/types/tokens/operation.d.ts +2 -2
  111. package/dist/types/tokens/option.d.ts +3 -6
  112. package/dist/types/tokens/or.d.ts +3 -6
  113. package/dist/types/tokens/pair.d.ts +5 -11
  114. package/dist/types/tokens/sapling-state.d.ts +2 -2
  115. package/dist/types/tokens/sapling-transaction.d.ts +2 -4
  116. package/dist/types/tokens/set.d.ts +2 -2
  117. package/dist/types/tokens/signature.d.ts +6 -8
  118. package/dist/types/tokens/ticket.d.ts +2 -2
  119. package/dist/types/tokens/token.d.ts +11 -23
  120. package/dist/types/tokens/tokens.d.ts +2 -1
  121. package/dist/types/tokens/unit.d.ts +2 -2
  122. package/package.json +5 -6
@@ -1,4 +1,4 @@
1
- import { Semantic } from '../tokens/token';
1
+ import { Semantic, SemanticEncoding } from '../tokens/token';
2
2
  import { ScriptResponse, MichelsonV1Expression } from '@taquito/rpc';
3
3
  import { TokenSchema } from './types';
4
4
  /**
@@ -14,7 +14,7 @@ export declare class ParameterSchema {
14
14
  constructor(val: MichelsonV1Expression);
15
15
  Execute(val: any, semantics?: Semantic): any;
16
16
  Encode(...args: any[]): any;
17
- EncodeObject(_value?: any): any;
17
+ EncodeObject(value?: any, semantics?: SemanticEncoding): any;
18
18
  /**
19
19
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
20
20
  *
@@ -1,5 +1,5 @@
1
1
  import { MichelsonV1Expression, ScriptResponse } from '@taquito/rpc';
2
- import { BigMapKeyType, Semantic, Token } from '../tokens/token';
2
+ import { BigMapKeyType, Semantic, SemanticEncoding, Token } from '../tokens/token';
3
3
  import { RpcTransaction } from './model';
4
4
  import { TokenSchema } from './types';
5
5
  declare const schemaTypeSymbol: unique symbol;
@@ -10,7 +10,7 @@ export declare class Schema {
10
10
  readonly val: MichelsonV1Expression;
11
11
  private root;
12
12
  [schemaTypeSymbol]: boolean;
13
- static isSchema(obj: any): obj is Schema;
13
+ static isSchema(obj: Schema): boolean;
14
14
  private bigMap?;
15
15
  static fromRPCResponse(val: {
16
16
  script: ScriptResponse;
@@ -31,7 +31,7 @@ export declare class Schema {
31
31
  args?: object[] | undefined;
32
32
  };
33
33
  };
34
- Encode(_value?: any): any;
34
+ Encode(value?: any, semantics?: SemanticEncoding): any;
35
35
  /**
36
36
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
37
37
  *
@@ -1,6 +1,6 @@
1
1
  export declare type Falsy<T> = T | undefined | false;
2
2
  export declare type BaseTokenSchema = {
3
- __michelsonType: 'address' | 'bool' | 'bytes' | 'int' | 'key' | 'key_hash' | 'mutez' | 'nat' | 'string' | 'timestamp' | 'bls12_381_fr' | 'bls12_381_g1' | 'bls12_381_g2' | 'chain_id' | 'never' | 'operation' | 'chest' | 'chest_key' | 'signature' | 'unit';
3
+ __michelsonType: 'address' | 'bool' | 'bytes' | 'int' | 'key' | 'key_hash' | 'mutez' | 'nat' | 'string' | 'timestamp' | 'bls12_381_fr' | 'bls12_381_g1' | 'bls12_381_g2' | 'chain_id' | 'never' | 'operation' | 'chest' | 'chest_key' | 'signature' | 'unit' | 'tx_rollup_l2_address';
4
4
  schema: string;
5
5
  };
6
6
  export declare type OrTokenSchema = {
@@ -7,7 +7,7 @@ export * from './schema/parameter';
7
7
  export * from './schema/view-schema';
8
8
  export * from './schema/error';
9
9
  export * from './schema/types';
10
- export { Semantic, BigMapKeyType } from './tokens/token';
10
+ export { Semantic, SemanticEncoding, BigMapKeyType } from './tokens/token';
11
11
  export * from './errors';
12
12
  export declare const UnitValue: unique symbol;
13
13
  export declare const SaplingStateValue: {};
@@ -1,5 +1,5 @@
1
1
  import { BigMapTokenSchema } from '../schema/types';
2
- import { ComparableToken, Semantic, Token, TokenFactory, TokenValidationError } from './token';
2
+ import { ComparableToken, Semantic, SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
3
3
  /**
4
4
  * @category Error
5
5
  * @description Error that indicates a failure happening when parsing encoding/executing Big Map types
@@ -39,7 +39,7 @@ export declare class BigMapToken extends Token {
39
39
  generateSchema(): BigMapTokenSchema;
40
40
  private isValid;
41
41
  Encode(args: any[]): any;
42
- EncodeObject(args: any): any;
42
+ EncodeObject(args: any, semantic?: SemanticEncoding): any;
43
43
  Execute(val: any[] | {
44
44
  int: string;
45
45
  }, semantic?: Semantic): any;
@@ -1,5 +1,5 @@
1
1
  import { BaseTokenSchema } from '../schema/types';
2
- import { Token, TokenFactory, TokenValidationError } from './token';
2
+ import { SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
3
3
  export declare class Bls12381frValidationError extends TokenValidationError {
4
4
  value: any;
5
5
  token: Bls12381frToken;
@@ -29,12 +29,8 @@ export declare class Bls12381frToken extends Token {
29
29
  bytes: any;
30
30
  int?: undefined;
31
31
  };
32
- EncodeObject(val: string | Uint8Array | number): {
33
- int: string;
34
- bytes?: undefined;
35
- } | {
32
+ EncodeObject(val: string | Uint8Array | number, semantic?: SemanticEncoding): import("@taquito/rpc").MichelsonV1ExpressionExtended | import("@taquito/rpc").MichelsonV1ExpressionBase | import("@taquito/rpc").MichelsonV1Expression[] | {
36
33
  bytes: string | number | Uint8Array;
37
- int?: undefined;
38
34
  };
39
35
  Execute(val: any): string;
40
36
  /**
@@ -1,5 +1,5 @@
1
1
  import { BaseTokenSchema } from '../schema/types';
2
- import { Token, TokenFactory, TokenValidationError } from './token';
2
+ import { SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
3
3
  export declare class Bls12381g1ValidationError extends TokenValidationError {
4
4
  value: any;
5
5
  token: Bls12381g1Token;
@@ -25,7 +25,7 @@ export declare class Bls12381g1Token extends Token {
25
25
  Encode(args: any[]): {
26
26
  bytes: any;
27
27
  };
28
- EncodeObject(val: string | Uint8Array): {
28
+ EncodeObject(val: string | Uint8Array, semantic?: SemanticEncoding): import("@taquito/rpc").MichelsonV1ExpressionExtended | import("@taquito/rpc").MichelsonV1ExpressionBase | import("@taquito/rpc").MichelsonV1Expression[] | {
29
29
  bytes: string | Uint8Array;
30
30
  };
31
31
  Execute(val: any): string;
@@ -1,5 +1,5 @@
1
1
  import { BaseTokenSchema } from '../schema/types';
2
- import { Token, TokenFactory, TokenValidationError } from './token';
2
+ import { SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
3
3
  export declare class Bls12381g2ValidationError extends TokenValidationError {
4
4
  value: any;
5
5
  token: Bls12381g2Token;
@@ -25,7 +25,7 @@ export declare class Bls12381g2Token extends Token {
25
25
  Encode(args: any[]): {
26
26
  bytes: any;
27
27
  };
28
- EncodeObject(val: string | Uint8Array): {
28
+ EncodeObject(val: string | Uint8Array, semantic?: SemanticEncoding): import("@taquito/rpc").MichelsonV1ExpressionExtended | import("@taquito/rpc").MichelsonV1ExpressionBase | import("@taquito/rpc").MichelsonV1Expression[] | {
29
29
  bytes: string | Uint8Array;
30
30
  };
31
31
  Execute(val: any): string;
@@ -1,4 +1,4 @@
1
- import { Token, TokenFactory, ComparableToken, TokenValidationError } from './token';
1
+ import { Token, TokenFactory, ComparableToken, TokenValidationError, SemanticEncoding } from './token';
2
2
  import { BaseTokenSchema } from '../schema/types';
3
3
  export declare class ChainIDValidationError extends TokenValidationError {
4
4
  value: any;
@@ -29,7 +29,7 @@ export declare class ChainIDToken extends ComparableToken {
29
29
  ExtractSchema(): "chain_id";
30
30
  generateSchema(): BaseTokenSchema;
31
31
  Encode(args: any[]): any;
32
- EncodeObject(val: any): any;
32
+ EncodeObject(val: any, semantic?: SemanticEncoding): any;
33
33
  ToKey({ string }: any): any;
34
34
  ToBigMapKey(val: string): {
35
35
  key: {
@@ -1,5 +1,5 @@
1
1
  import { BaseTokenSchema } from '../schema/types';
2
- import { Token, TokenFactory, TokenValidationError } from './token';
2
+ import { SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
3
3
  export declare class ChestKeyValidationError extends TokenValidationError {
4
4
  value: any;
5
5
  token: ChestKeyToken;
@@ -25,7 +25,7 @@ export declare class ChestKeyToken extends Token {
25
25
  Encode(args: any[]): {
26
26
  bytes: any;
27
27
  };
28
- EncodeObject(val: string | Uint8Array): {
28
+ EncodeObject(val: string | Uint8Array, semantic?: SemanticEncoding): import("@taquito/rpc").MichelsonV1ExpressionExtended | import("@taquito/rpc").MichelsonV1ExpressionBase | import("@taquito/rpc").MichelsonV1Expression[] | {
29
29
  bytes: string | Uint8Array;
30
30
  };
31
31
  Execute(val: any): string;
@@ -1,5 +1,5 @@
1
1
  import { BaseTokenSchema } from '../schema/types';
2
- import { Token, TokenFactory, TokenValidationError } from './token';
2
+ import { SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
3
3
  export declare class ChestValidationError extends TokenValidationError {
4
4
  value: any;
5
5
  token: ChestToken;
@@ -25,7 +25,7 @@ export declare class ChestToken extends Token {
25
25
  Encode(args: any[]): {
26
26
  bytes: any;
27
27
  };
28
- EncodeObject(val: string | Uint8Array): {
28
+ EncodeObject(val: string | Uint8Array, semantic?: SemanticEncoding): import("@taquito/rpc").MichelsonV1ExpressionExtended | import("@taquito/rpc").MichelsonV1ExpressionBase | import("@taquito/rpc").MichelsonV1Expression[] | {
29
29
  bytes: string | Uint8Array;
30
30
  };
31
31
  Execute(val: any): string;
@@ -1,4 +1,4 @@
1
- import { Token, TokenFactory, ComparableToken, TokenValidationError } from '../token';
1
+ import { Token, TokenFactory, ComparableToken, TokenValidationError, SemanticEncoding } from '../token';
2
2
  import { BaseTokenSchema } from '../../schema/types';
3
3
  export declare class AddressValidationError extends TokenValidationError {
4
4
  value: any;
@@ -30,7 +30,7 @@ export declare class AddressToken extends ComparableToken {
30
30
  };
31
31
  private isValid;
32
32
  Encode(args: any[]): any;
33
- EncodeObject(val: any): any;
33
+ EncodeObject(val: any, semantic?: SemanticEncoding): any;
34
34
  Execute(val: {
35
35
  bytes: string;
36
36
  string: string;
@@ -1,5 +1,5 @@
1
1
  import { BaseTokenSchema } from '../../schema/types';
2
- import { Token, TokenFactory, ComparableToken } from '../token';
2
+ import { Token, TokenFactory, ComparableToken, SemanticEncoding } from '../token';
3
3
  export declare class BoolToken extends ComparableToken {
4
4
  protected val: {
5
5
  prim: string;
@@ -16,9 +16,7 @@ export declare class BoolToken extends ComparableToken {
16
16
  }, idx: number, fac: TokenFactory);
17
17
  Execute(val: any): boolean;
18
18
  Encode(args: any[]): any;
19
- EncodeObject(val: any): {
20
- prim: string;
21
- };
19
+ EncodeObject(val: any, semantic?: SemanticEncoding): import("@taquito/rpc").MichelsonV1Expression;
22
20
  /**
23
21
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
24
22
  *
@@ -33,9 +31,7 @@ export declare class BoolToken extends ComparableToken {
33
31
  prim: string;
34
32
  };
35
33
  };
36
- ToKey(val: string): {
37
- prim: string;
38
- };
34
+ ToKey(val: string): import("@taquito/rpc").MichelsonV1Expression;
39
35
  compare(val1: any, val2: any): 0 | 1 | -1;
40
36
  findAndReturnTokens(tokenToFind: string, tokens: Token[]): Token[];
41
37
  }
@@ -1,5 +1,5 @@
1
1
  import { BaseTokenSchema } from '../../schema/types';
2
- import { TokenFactory, ComparableToken, TokenValidationError, Token } from '../token';
2
+ import { TokenFactory, ComparableToken, TokenValidationError, Token, SemanticEncoding } from '../token';
3
3
  export declare class BytesValidationError extends TokenValidationError {
4
4
  value: any;
5
5
  token: BytesToken;
@@ -31,9 +31,7 @@ export declare class BytesToken extends ComparableToken {
31
31
  private isValid;
32
32
  private convertUint8ArrayToHexString;
33
33
  Encode(args: any[]): any;
34
- EncodeObject(val: string | Uint8Array): {
35
- bytes: string;
36
- };
34
+ EncodeObject(val: string | Uint8Array, semantic?: SemanticEncoding): import("@taquito/rpc").MichelsonV1Expression;
37
35
  Execute(val: any): string;
38
36
  /**
39
37
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
@@ -1,4 +1,4 @@
1
- import { Token, TokenFactory, ComparableToken, TokenValidationError } from '../token';
1
+ import { Token, TokenFactory, ComparableToken, TokenValidationError, SemanticEncoding } from '../token';
2
2
  import { BaseTokenSchema } from '../../schema/types';
3
3
  export declare class IntValidationError extends TokenValidationError {
4
4
  value: any;
@@ -33,7 +33,7 @@ export declare class IntToken extends ComparableToken {
33
33
  generateSchema(): BaseTokenSchema;
34
34
  private isValid;
35
35
  Encode(args: any[]): any;
36
- EncodeObject(val: any): any;
36
+ EncodeObject(val: any, semantic?: SemanticEncoding): any;
37
37
  ToBigMapKey(val: string | number): {
38
38
  key: {
39
39
  int: string;
@@ -1,4 +1,4 @@
1
- import { Token, TokenFactory, ComparableToken, TokenValidationError } from '../token';
1
+ import { Token, TokenFactory, ComparableToken, TokenValidationError, SemanticEncoding } from '../token';
2
2
  import { BaseTokenSchema } from '../../schema/types';
3
3
  export declare class KeyHashValidationError extends TokenValidationError {
4
4
  value: any;
@@ -26,7 +26,7 @@ export declare class KeyHashToken extends ComparableToken {
26
26
  }): string | undefined;
27
27
  private isValid;
28
28
  Encode(args: any[]): any;
29
- EncodeObject(val: any): any;
29
+ EncodeObject(val: any, semantic?: SemanticEncoding): any;
30
30
  /**
31
31
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
32
32
  *
@@ -1,4 +1,4 @@
1
- import { Token, TokenFactory, ComparableToken, TokenValidationError } from '../token';
1
+ import { Token, TokenFactory, ComparableToken, TokenValidationError, SemanticEncoding } from '../token';
2
2
  import BigNumber from 'bignumber.js';
3
3
  import { BaseTokenSchema } from '../../schema/types';
4
4
  export declare class MutezValidationError extends TokenValidationError {
@@ -30,7 +30,7 @@ export declare class MutezToken extends ComparableToken {
30
30
  generateSchema(): BaseTokenSchema;
31
31
  private isValid;
32
32
  Encode(args: any[]): any;
33
- EncodeObject(val: any): any;
33
+ EncodeObject(val: any, semantic?: SemanticEncoding): any;
34
34
  ToBigMapKey(val: string | number): {
35
35
  key: {
36
36
  int: string;
@@ -1,4 +1,4 @@
1
- import { Token, TokenFactory, ComparableToken, TokenValidationError } from '../token';
1
+ import { Token, TokenFactory, ComparableToken, TokenValidationError, SemanticEncoding } from '../token';
2
2
  import BigNumber from 'bignumber.js';
3
3
  import { BaseTokenSchema } from '../../schema/types';
4
4
  export declare class NatValidationError extends TokenValidationError {
@@ -26,7 +26,7 @@ export declare class NatToken extends ComparableToken {
26
26
  };
27
27
  Encode(args: any[]): any;
28
28
  private isValid;
29
- EncodeObject(val: any): any;
29
+ EncodeObject(val: any, semantic?: SemanticEncoding): any;
30
30
  /**
31
31
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
32
32
  *
@@ -1,5 +1,5 @@
1
1
  import { BaseTokenSchema } from '../../schema/types';
2
- import { Token, TokenFactory, ComparableToken } from '../token';
2
+ import { Token, TokenFactory, ComparableToken, SemanticEncoding } from '../token';
3
3
  export declare class StringToken extends ComparableToken {
4
4
  protected val: {
5
5
  prim: string;
@@ -22,7 +22,7 @@ export declare class StringToken extends ComparableToken {
22
22
  ExtractSchema(): "string";
23
23
  generateSchema(): BaseTokenSchema;
24
24
  Encode(args: any[]): any;
25
- EncodeObject(val: any): any;
25
+ EncodeObject(val: any, semantic?: SemanticEncoding): any;
26
26
  ToKey({ string }: any): any;
27
27
  ToBigMapKey(val: string): {
28
28
  key: {
@@ -1,5 +1,5 @@
1
1
  import { BaseTokenSchema } from '../../schema/types';
2
- import { Token, TokenFactory, ComparableToken } from '../token';
2
+ import { Token, TokenFactory, ComparableToken, SemanticEncoding } from '../token';
3
3
  export declare class TimestampToken extends ComparableToken {
4
4
  protected val: {
5
5
  prim: string;
@@ -19,7 +19,7 @@ export declare class TimestampToken extends ComparableToken {
19
19
  int?: string;
20
20
  }): string | undefined;
21
21
  Encode(args: any[]): any;
22
- EncodeObject(val: any): any;
22
+ EncodeObject(val: any, semantic?: SemanticEncoding): any;
23
23
  /**
24
24
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
25
25
  *
@@ -0,0 +1,45 @@
1
+ import { BaseTokenSchema } from '../../schema/types';
2
+ import { ComparableToken, SemanticEncoding, Token, TokenFactory, TokenValidationError } from "../token";
3
+ export declare class TxRollupL2AddressValidationError extends TokenValidationError {
4
+ value: unknown;
5
+ token: TxRollupL2AddressToken;
6
+ name: string;
7
+ constructor(value: unknown, token: TxRollupL2AddressToken, message: string);
8
+ }
9
+ export declare class TxRollupL2AddressToken extends ComparableToken {
10
+ protected val: {
11
+ prim: string;
12
+ args: any[];
13
+ annots: any[];
14
+ };
15
+ protected idx: number;
16
+ protected fac: TokenFactory;
17
+ static prim: 'tx_rollup_l2_address';
18
+ constructor(val: {
19
+ prim: string;
20
+ args: any[];
21
+ annots: any[];
22
+ }, idx: number, fac: TokenFactory);
23
+ ToBigMapKey(val: any): {
24
+ key: {
25
+ bytes: string;
26
+ };
27
+ type: {
28
+ prim: string;
29
+ };
30
+ };
31
+ private isValid;
32
+ Encode(args: string[]): any;
33
+ EncodeObject(val: any, semantic?: SemanticEncoding): any;
34
+ Execute(val: {
35
+ bytes?: string;
36
+ string?: string;
37
+ }): string;
38
+ ExtractSchema(): "tx_rollup_l2_address";
39
+ generateSchema(): BaseTokenSchema;
40
+ ToKey({ bytes, string }: {
41
+ bytes?: string;
42
+ string?: string;
43
+ }): string;
44
+ findAndReturnTokens(tokenToFind: string, tokens: Token[]): Token[];
45
+ }
@@ -1,5 +1,5 @@
1
1
  import { ConstantTokenSchema } from '../schema/types';
2
- import { Semantic, Token, TokenFactory, TokenValidationError } from './token';
2
+ import { Semantic, SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
3
3
  export declare class GlobalConstantEncodingError extends TokenValidationError {
4
4
  value: any;
5
5
  token: GlobalConstantToken;
@@ -28,7 +28,7 @@ export declare class GlobalConstantToken extends Token {
28
28
  }, idx: number, fac: TokenFactory);
29
29
  Execute(val: any, semantic?: Semantic): any;
30
30
  Encode(args: any[]): any;
31
- EncodeObject(val: any): any;
31
+ EncodeObject(val: any, semantic?: SemanticEncoding): any;
32
32
  /**
33
33
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
34
34
  *
@@ -1,5 +1,5 @@
1
1
  import { ContractTokenSchema } from '../schema/types';
2
- import { Token, TokenFactory, TokenValidationError } from './token';
2
+ import { SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
3
3
  export declare class ContractValidationError extends TokenValidationError {
4
4
  value: any;
5
5
  token: ContractToken;
@@ -26,7 +26,7 @@ export declare class ContractToken extends Token {
26
26
  string: string;
27
27
  }): string;
28
28
  Encode(args: any[]): any;
29
- EncodeObject(val: any): any;
29
+ EncodeObject(val: any, semantic?: SemanticEncoding): any;
30
30
  /**
31
31
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
32
32
  *
@@ -1,4 +1,4 @@
1
- import { ComparableToken, Token, TokenFactory, TokenValidationError } from './token';
1
+ import { ComparableToken, SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
2
2
  import { BaseTokenSchema } from '../schema/types';
3
3
  export declare class KeyValidationError extends TokenValidationError {
4
4
  value: any;
@@ -26,7 +26,7 @@ export declare class KeyToken extends ComparableToken {
26
26
  }): string | undefined;
27
27
  private isValid;
28
28
  Encode(args: any[]): any;
29
- EncodeObject(val: any): any;
29
+ EncodeObject(val: any, semantic?: SemanticEncoding): any;
30
30
  /**
31
31
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
32
32
  *
@@ -1,5 +1,5 @@
1
1
  import { LambdaTokenSchema } from '../schema/types';
2
- import { Token, TokenFactory } from './token';
2
+ import { SemanticEncoding, Token, TokenFactory } from './token';
3
3
  export declare class LambdaToken extends Token {
4
4
  protected val: {
5
5
  prim: string;
@@ -18,7 +18,7 @@ export declare class LambdaToken extends Token {
18
18
  get returnSchema(): Token;
19
19
  Execute(val: any): any;
20
20
  Encode(args: any[]): any;
21
- EncodeObject(val: any): any;
21
+ EncodeObject(val: any, semantic?: SemanticEncoding): any;
22
22
  /**
23
23
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
24
24
  *
@@ -1,5 +1,5 @@
1
1
  import { ListTokenSchema } from '../schema/types';
2
- import { Token, TokenFactory, Semantic, TokenValidationError } from './token';
2
+ import { Token, TokenFactory, Semantic, TokenValidationError, SemanticEncoding } from './token';
3
3
  export declare class ListValidationError extends TokenValidationError {
4
4
  value: any;
5
5
  token: ListToken;
@@ -24,7 +24,7 @@ export declare class ListToken extends Token {
24
24
  private isValid;
25
25
  Encode(args: any[]): any;
26
26
  Execute(val: any, semantics?: Semantic): any;
27
- EncodeObject(args: any): any;
27
+ EncodeObject(args: any, semantic?: SemanticEncoding): any;
28
28
  /**
29
29
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
30
30
  *
@@ -1,5 +1,5 @@
1
1
  import { MapTokenSchema } from '../schema/types';
2
- import { ComparableToken, Semantic, Token, TokenFactory, TokenValidationError } from './token';
2
+ import { ComparableToken, Semantic, SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
3
3
  export declare class MapValidationError extends TokenValidationError {
4
4
  value: any;
5
5
  token: MapToken;
@@ -27,7 +27,7 @@ export declare class MapToken extends Token {
27
27
  [key: string]: any;
28
28
  };
29
29
  Encode(args: any[]): any;
30
- EncodeObject(args: any): any;
30
+ EncodeObject(args: any, semantic?: SemanticEncoding): any;
31
31
  /**
32
32
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
33
33
  *
@@ -1,5 +1,5 @@
1
1
  import { BaseTokenSchema } from '../schema/types';
2
- import { Token, TokenFactory, TokenValidationError } from './token';
2
+ import { SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
3
3
  export declare class NeverTokenError extends TokenValidationError {
4
4
  value: any;
5
5
  token: NeverToken;
@@ -21,7 +21,7 @@ export declare class NeverToken extends Token {
21
21
  annots: any[];
22
22
  }, idx: number, fac: TokenFactory);
23
23
  Encode(args: any[]): any;
24
- EncodeObject(val: any): any;
24
+ EncodeObject(val: any, semantic?: SemanticEncoding): any;
25
25
  Execute(val: any): void;
26
26
  /**
27
27
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
@@ -1,5 +1,5 @@
1
1
  import { BaseTokenSchema } from '../schema/types';
2
- import { Token, TokenFactory } from './token';
2
+ import { SemanticEncoding, Token, TokenFactory } from './token';
3
3
  export declare class OperationToken extends Token {
4
4
  protected val: {
5
5
  prim: string;
@@ -18,7 +18,7 @@ export declare class OperationToken extends Token {
18
18
  [key: string]: any;
19
19
  };
20
20
  Encode(...args: any[]): any;
21
- EncodeObject(val: any): any;
21
+ EncodeObject(val: any, semantic?: SemanticEncoding): any;
22
22
  /**
23
23
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
24
24
  *
@@ -1,5 +1,5 @@
1
1
  import { OptionTokenSchema } from '../schema/types';
2
- import { Token, TokenFactory, Semantic, ComparableToken } from './token';
2
+ import { Token, TokenFactory, Semantic, ComparableToken, SemanticEncoding } from './token';
3
3
  export declare class OptionToken extends ComparableToken {
4
4
  protected val: {
5
5
  prim: string;
@@ -18,7 +18,7 @@ export declare class OptionToken extends ComparableToken {
18
18
  schema(): Token;
19
19
  annot(): string;
20
20
  Encode(args: any): any;
21
- EncodeObject(args: any): any;
21
+ EncodeObject(args: any, semantic?: SemanticEncoding): any;
22
22
  Execute(val: any, semantics?: Semantic): any;
23
23
  /**
24
24
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
@@ -32,10 +32,7 @@ export declare class OptionToken extends ComparableToken {
32
32
  ToKey(val: any): any;
33
33
  ToBigMapKey(val: any): {
34
34
  key: any;
35
- type: {
36
- prim: string;
37
- args?: any[] | undefined;
38
- };
35
+ type: Pick<import("@taquito/rpc").MichelsonV1ExpressionExtended, "prim" | "args">;
39
36
  };
40
37
  findAndReturnTokens(tokenToFind: string, tokens: Token[]): Token[];
41
38
  }
@@ -1,5 +1,5 @@
1
1
  import { OrTokenSchema } from '../schema/types';
2
- import { Token, TokenFactory, Semantic, ComparableToken } from './token';
2
+ import { Token, TokenFactory, Semantic, ComparableToken, SemanticEncoding } from './token';
3
3
  /**
4
4
  * @category Error
5
5
  * @description Error that indicates a failure when decoding OR Token methods
@@ -25,7 +25,7 @@ export declare class OrToken extends ComparableToken {
25
25
  }, idx: number, fac: TokenFactory);
26
26
  Encode(args: any[]): any;
27
27
  ExtractSignature(): any;
28
- EncodeObject(args: any): any;
28
+ EncodeObject(args: any, semantic?: SemanticEncoding): any;
29
29
  Execute(val: any, semantics?: Semantic): any;
30
30
  private traversal;
31
31
  /**
@@ -39,10 +39,7 @@ export declare class OrToken extends ComparableToken {
39
39
  ToKey(val: any): any;
40
40
  ToBigMapKey(val: any): {
41
41
  key: any;
42
- type: {
43
- prim: string;
44
- args?: any[] | undefined;
45
- };
42
+ type: Pick<import("@taquito/rpc").MichelsonV1ExpressionExtended, "prim" | "args">;
46
43
  };
47
44
  findAndReturnTokens(tokenToFind: string, tokens: Token[]): Token[];
48
45
  }
@@ -1,5 +1,6 @@
1
- import { Token, TokenFactory, Semantic, ComparableToken } from './token';
1
+ import { Token, TokenFactory, Semantic, ComparableToken, SemanticEncoding } from './token';
2
2
  import { PairTokenSchema } from '../schema/types';
3
+ import { MichelsonV1Expression, MichelsonV1ExpressionExtended } from '@taquito/rpc';
3
4
  /**
4
5
  * @category Error
5
6
  * @description Error that indicates in invalid token argument being passed
@@ -21,26 +22,19 @@ export declare class TokenComparisonError extends Error {
21
22
  }
22
23
  export declare class PairToken extends ComparableToken {
23
24
  static prim: 'pair';
24
- constructor(val: {
25
- prim: string;
26
- args: any[];
27
- annots: any[];
28
- } | any[], idx: number, fac: TokenFactory);
25
+ constructor(val: MichelsonV1Expression, idx: number, fac: TokenFactory);
29
26
  private args;
30
27
  private tokens;
31
28
  Encode(args: any[]): any;
32
29
  ExtractSignature(): any;
33
30
  ToBigMapKey(val: any): {
34
31
  key: any;
35
- type: {
36
- prim: string;
37
- args?: any[] | undefined;
38
- };
32
+ type: Pick<MichelsonV1ExpressionExtended, "prim" | "args">;
39
33
  };
40
34
  ToKey(val: any): {
41
35
  [key: string]: any;
42
36
  };
43
- EncodeObject(args: any): any;
37
+ EncodeObject(args: any, semantic?: SemanticEncoding): any;
44
38
  private traversal;
45
39
  Execute(val: any, semantics?: Semantic): {
46
40
  [key: string]: any;
@@ -1,5 +1,5 @@
1
1
  import { SaplingStateTokenSchema } from '../schema/types';
2
- import { Semantic, Token, TokenFactory, TokenValidationError } from './token';
2
+ import { Semantic, SemanticEncoding, Token, TokenFactory, TokenValidationError } from './token';
3
3
  export declare class SaplingStateValidationError extends TokenValidationError {
4
4
  value: any;
5
5
  token: SaplingStateToken;
@@ -25,7 +25,7 @@ export declare class SaplingStateToken extends Token {
25
25
  int: string;
26
26
  }, semantic?: Semantic): any;
27
27
  Encode(args: any[]): any;
28
- EncodeObject(val: any): any;
28
+ EncodeObject(val: any, semantic?: SemanticEncoding): any;
29
29
  /**
30
30
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
31
31
  *