@tezos-x/octez.js 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +154 -0
- package/dist/lib/batch/constants.js +16 -0
- package/dist/lib/batch/rpc-batch-provider.js +319 -0
- package/dist/lib/constants.js +133 -0
- package/dist/lib/context.js +182 -0
- package/dist/lib/contract/big-map.js +70 -0
- package/dist/lib/contract/compose.js +6 -0
- package/dist/lib/contract/constants.js +4 -0
- package/dist/lib/contract/contract-methods/contract-method-factory.js +18 -0
- package/dist/lib/contract/contract-methods/contract-method-interface.js +2 -0
- package/dist/lib/contract/contract-methods/contract-method-object-param.js +72 -0
- package/dist/lib/contract/contract-methods/contract-on-chain-view.js +124 -0
- package/dist/lib/contract/contract.js +169 -0
- package/dist/lib/contract/errors.js +140 -0
- package/dist/lib/contract/index.js +30 -0
- package/dist/lib/contract/interface.js +2 -0
- package/dist/lib/contract/manager-lambda.js +71 -0
- package/dist/lib/contract/prepare.js +240 -0
- package/dist/lib/contract/rpc-contract-provider.js +724 -0
- package/dist/lib/contract/sapling-state-abstraction.js +35 -0
- package/dist/lib/contract/semantic.js +40 -0
- package/dist/lib/contract/view_lambda.js +27 -0
- package/dist/lib/errors.js +42 -0
- package/dist/lib/estimate/errors.js +16 -0
- package/dist/lib/estimate/estimate-provider-interface.js +2 -0
- package/dist/lib/estimate/estimate.js +130 -0
- package/dist/lib/estimate/index.js +20 -0
- package/dist/lib/estimate/rpc-estimate-provider.js +673 -0
- package/dist/lib/extension/extension.js +2 -0
- package/dist/lib/forger/composite-forger.js +43 -0
- package/dist/lib/forger/errors.js +30 -0
- package/dist/lib/forger/octez.js-local-forger.js +34 -0
- package/dist/lib/forger/rpc-forger.js +12 -0
- package/dist/lib/global-constants/default-global-constants-provider.js +46 -0
- package/dist/lib/global-constants/errors.js +30 -0
- package/dist/lib/global-constants/interface-global-constants-provider.js +2 -0
- package/dist/lib/global-constants/noop-global-constants-provider.js +21 -0
- package/dist/lib/import-key.js +51 -0
- package/dist/lib/injector/helper.js +18 -0
- package/dist/lib/injector/interface.js +2 -0
- package/dist/lib/injector/rpc-injector.js +38 -0
- package/dist/lib/octez.js +404 -0
- package/dist/lib/operations/ballot-operation.js +33 -0
- package/dist/lib/operations/batch-operation.js +66 -0
- package/dist/lib/operations/delegate-operation.js +57 -0
- package/dist/lib/operations/drain-delegate-operation.js +31 -0
- package/dist/lib/operations/errors.js +130 -0
- package/dist/lib/operations/failing-noop-operation.js +2 -0
- package/dist/lib/operations/increase-paid-storage-operation.js +52 -0
- package/dist/lib/operations/index.js +54 -0
- package/dist/lib/operations/operations.js +123 -0
- package/dist/lib/operations/origination-operation.js +89 -0
- package/dist/lib/operations/proposals-operation.js +30 -0
- package/dist/lib/operations/register-global-constant-operation.js +55 -0
- package/dist/lib/operations/reveal-operation.js +74 -0
- package/dist/lib/operations/smart-rollup-add-messages-operation.js +47 -0
- package/dist/lib/operations/smart-rollup-execute-outbox-message-operation.js +56 -0
- package/dist/lib/operations/smart-rollup-originate-operation.js +53 -0
- package/dist/lib/operations/transaction-operation.js +70 -0
- package/dist/lib/operations/transfer-ticket-operation.js +49 -0
- package/dist/lib/operations/types.js +90 -0
- package/dist/lib/operations/update-companion-key-operation.js +58 -0
- package/dist/lib/operations/update-consensus-key-operation.js +58 -0
- package/dist/lib/packer/interface.js +2 -0
- package/dist/lib/packer/michel-codec-packer.js +22 -0
- package/dist/lib/packer/rpc-packer.js +23 -0
- package/dist/lib/parser/interface.js +2 -0
- package/dist/lib/parser/michel-codec-parser.js +135 -0
- package/dist/lib/parser/noop-parser.js +20 -0
- package/dist/lib/prepare/index.js +18 -0
- package/dist/lib/prepare/interface.js +2 -0
- package/dist/lib/prepare/prepare-provider.js +1010 -0
- package/dist/lib/provider.js +169 -0
- package/dist/lib/read-provider/interface.js +2 -0
- package/dist/lib/read-provider/rpc-read-adapter.js +228 -0
- package/dist/lib/signer/errors.js +17 -0
- package/dist/lib/signer/noop.js +40 -0
- package/dist/lib/subscribe/create-observable-from-subscription.js +20 -0
- package/dist/lib/subscribe/errors.js +30 -0
- package/dist/lib/subscribe/filters.js +96 -0
- package/dist/lib/subscribe/interface.js +2 -0
- package/dist/lib/subscribe/observable-subscription.js +79 -0
- package/dist/lib/subscribe/polling-subcribe-provider.js +118 -0
- package/dist/lib/tz/interface.js +2 -0
- package/dist/lib/tz/rpc-tz-provider.js +63 -0
- package/dist/lib/version.js +8 -0
- package/dist/lib/wallet/batch-operation.js +84 -0
- package/dist/lib/wallet/delegation-operation.js +57 -0
- package/dist/lib/wallet/errors.js +28 -0
- package/dist/lib/wallet/increase-paid-storage-operation.js +57 -0
- package/dist/lib/wallet/index.js +25 -0
- package/dist/lib/wallet/interface.js +2 -0
- package/dist/lib/wallet/legacy.js +86 -0
- package/dist/lib/wallet/operation-factory.js +117 -0
- package/dist/lib/wallet/operation.js +157 -0
- package/dist/lib/wallet/origination-operation.js +65 -0
- package/dist/lib/wallet/receipt.js +43 -0
- package/dist/lib/wallet/register-global-constant-operation.js +62 -0
- package/dist/lib/wallet/transaction-operation.js +53 -0
- package/dist/lib/wallet/transfer-ticket-operation.js +53 -0
- package/dist/lib/wallet/wallet.js +442 -0
- package/dist/octez.es6.js +7673 -0
- package/dist/octez.es6.js.map +1 -0
- package/dist/octez.umd.js +7787 -0
- package/dist/octez.umd.js.map +1 -0
- package/dist/types/batch/constants.d.ts +3 -0
- package/dist/types/batch/rpc-batch-provider.d.ts +139 -0
- package/dist/types/constants.d.ts +81 -0
- package/dist/types/context.d.ts +100 -0
- package/dist/types/contract/big-map.d.ts +35 -0
- package/dist/types/contract/compose.d.ts +5 -0
- package/dist/types/contract/constants.d.ts +1 -0
- package/dist/types/contract/contract-methods/contract-method-factory.d.ts +14 -0
- package/dist/types/contract/contract-methods/contract-method-interface.d.ts +28 -0
- package/dist/types/contract/contract-methods/contract-method-object-param.d.ts +39 -0
- package/dist/types/contract/contract-methods/contract-on-chain-view.d.ts +43 -0
- package/dist/types/contract/contract.d.ts +75 -0
- package/dist/types/contract/errors.d.ts +83 -0
- package/dist/types/contract/index.d.ts +11 -0
- package/dist/types/contract/interface.d.ts +254 -0
- package/dist/types/contract/manager-lambda.d.ts +73 -0
- package/dist/types/contract/prepare.d.ts +18 -0
- package/dist/types/contract/rpc-contract-provider.d.ts +269 -0
- package/dist/types/contract/sapling-state-abstraction.d.ts +17 -0
- package/dist/types/contract/semantic.d.ts +7 -0
- package/dist/types/contract/view_lambda.d.ts +34 -0
- package/dist/types/errors.d.ts +26 -0
- package/dist/types/estimate/errors.d.ts +8 -0
- package/dist/types/estimate/estimate-provider-interface.d.ts +156 -0
- package/dist/types/estimate/estimate.d.ts +94 -0
- package/dist/types/estimate/index.d.ts +4 -0
- package/dist/types/estimate/rpc-estimate-provider.d.ts +170 -0
- package/dist/types/extension/extension.d.ts +4 -0
- package/dist/types/forger/composite-forger.d.ts +6 -0
- package/dist/types/forger/errors.d.ts +16 -0
- package/dist/types/forger/octez.js-local-forger.d.ts +8 -0
- package/dist/types/forger/rpc-forger.d.ts +7 -0
- package/dist/types/global-constants/default-global-constants-provider.d.ts +18 -0
- package/dist/types/global-constants/errors.d.ts +16 -0
- package/dist/types/global-constants/interface-global-constants-provider.d.ts +11 -0
- package/dist/types/global-constants/noop-global-constants-provider.d.ts +5 -0
- package/dist/types/import-key.d.ts +13 -0
- package/dist/types/injector/helper.d.ts +2 -0
- package/dist/types/injector/interface.d.ts +5 -0
- package/dist/types/injector/rpc-injector.d.ts +7 -0
- package/dist/types/octez.d.ts +248 -0
- package/dist/types/operations/ballot-operation.d.ts +18 -0
- package/dist/types/operations/batch-operation.d.ts +19 -0
- package/dist/types/operations/delegate-operation.d.ts +24 -0
- package/dist/types/operations/drain-delegate-operation.d.ts +17 -0
- package/dist/types/operations/errors.d.ts +50 -0
- package/dist/types/operations/failing-noop-operation.d.ts +17 -0
- package/dist/types/operations/increase-paid-storage-operation.d.ts +23 -0
- package/dist/types/operations/index.d.ts +18 -0
- package/dist/types/operations/operations.d.ts +35 -0
- package/dist/types/operations/origination-operation.d.ts +35 -0
- package/dist/types/operations/proposals-operation.d.ts +17 -0
- package/dist/types/operations/register-global-constant-operation.d.ts +25 -0
- package/dist/types/operations/reveal-operation.d.ts +25 -0
- package/dist/types/operations/smart-rollup-add-messages-operation.d.ts +20 -0
- package/dist/types/operations/smart-rollup-execute-outbox-message-operation.d.ts +24 -0
- package/dist/types/operations/smart-rollup-originate-operation.d.ts +23 -0
- package/dist/types/operations/transaction-operation.d.ts +28 -0
- package/dist/types/operations/transfer-ticket-operation.d.ts +22 -0
- package/dist/types/operations/types.d.ts +461 -0
- package/dist/types/operations/update-companion-key-operation.d.ts +23 -0
- package/dist/types/operations/update-consensus-key-operation.d.ts +23 -0
- package/dist/types/packer/interface.d.ts +4 -0
- package/dist/types/packer/michel-codec-packer.d.ts +5 -0
- package/dist/types/packer/rpc-packer.d.ts +8 -0
- package/dist/types/parser/interface.d.ts +4 -0
- package/dist/types/parser/michel-codec-parser.d.ts +16 -0
- package/dist/types/parser/noop-parser.d.ts +5 -0
- package/dist/types/prepare/index.d.ts +2 -0
- package/dist/types/prepare/interface.d.ts +153 -0
- package/dist/types/prepare/prepare-provider.d.ts +213 -0
- package/dist/types/provider.d.ts +44 -0
- package/dist/types/read-provider/interface.d.ts +132 -0
- package/dist/types/read-provider/rpc-read-adapter.d.ts +130 -0
- package/dist/types/signer/errors.d.ts +8 -0
- package/dist/types/signer/noop.d.ts +11 -0
- package/dist/types/subscribe/create-observable-from-subscription.d.ts +4 -0
- package/dist/types/subscribe/errors.d.ts +18 -0
- package/dist/types/subscribe/filters.d.ts +6 -0
- package/dist/types/subscribe/interface.d.ts +48 -0
- package/dist/types/subscribe/observable-subscription.d.ts +21 -0
- package/dist/types/subscribe/polling-subcribe-provider.d.ts +23 -0
- package/dist/types/tz/interface.d.ts +20 -0
- package/dist/types/tz/rpc-tz-provider.d.ts +13 -0
- package/dist/types/version.d.ts +4 -0
- package/dist/types/wallet/batch-operation.d.ts +13 -0
- package/dist/types/wallet/delegation-operation.d.ts +12 -0
- package/dist/types/wallet/errors.d.ts +16 -0
- package/dist/types/wallet/increase-paid-storage-operation.d.ts +12 -0
- package/dist/types/wallet/index.d.ts +9 -0
- package/dist/types/wallet/interface.d.ts +66 -0
- package/dist/types/wallet/legacy.d.ts +21 -0
- package/dist/types/wallet/operation-factory.d.ts +32 -0
- package/dist/types/wallet/operation.d.ts +54 -0
- package/dist/types/wallet/origination-operation.d.ts +14 -0
- package/dist/types/wallet/receipt.d.ts +16 -0
- package/dist/types/wallet/register-global-constant-operation.d.ts +13 -0
- package/dist/types/wallet/transaction-operation.d.ts +12 -0
- package/dist/types/wallet/transfer-ticket-operation.d.ts +12 -0
- package/dist/types/wallet/wallet.d.ts +195 -0
- package/package.json +131 -0
- package/patch.js +20 -0
- package/signature.json +866 -0
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
import { OperationObject, InternalOperationResultKindEnum, OpKind, TransactionOperationParameter, MichelsonV1Expression, BallotVote, PvmKind } from '@tezos-x/octez.js-rpc';
|
|
2
|
+
import { BlockIdentifier } from '../read-provider/interface';
|
|
3
|
+
export { OpKind } from '@tezos-x/octez.js-rpc';
|
|
4
|
+
export type withKind<T, K extends OpKind> = T & {
|
|
5
|
+
kind: K;
|
|
6
|
+
};
|
|
7
|
+
export type ParamsWithKind = withKind<OriginateParams, OpKind.ORIGINATION> | withKind<DelegateParams, OpKind.DELEGATION> | withKind<TransferParams, OpKind.TRANSACTION> | withKind<ActivationParams, OpKind.ACTIVATION> | withKind<RegisterGlobalConstantParams, OpKind.REGISTER_GLOBAL_CONSTANT> | withKind<IncreasePaidStorageParams, OpKind.INCREASE_PAID_STORAGE> | withKind<TransferTicketParams, OpKind.TRANSFER_TICKET> | withKind<UpdateConsensusKeyParams, OpKind.UPDATE_CONSENSUS_KEY> | withKind<UpdateCompanionKeyParams, OpKind.UPDATE_COMPANION_KEY> | withKind<SmartRollupAddMessagesParams, OpKind.SMART_ROLLUP_ADD_MESSAGES> | withKind<FailingNoopParams, OpKind.FAILING_NOOP> | withKind<SmartRollupOriginateParams, OpKind.SMART_ROLLUP_ORIGINATE> | withKind<SmartRollupExecuteOutboxMessageParams, OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE>;
|
|
8
|
+
export type ParamsWithKindExtended = ParamsWithKind | withKind<RevealParams, OpKind.REVEAL>;
|
|
9
|
+
export declare const attachKind: <T, K extends OpKind>(op: T, kind: K) => withKind<T, K>;
|
|
10
|
+
export declare const findWithKind: <T extends {
|
|
11
|
+
kind: OpKind;
|
|
12
|
+
}, K extends OpKind>(arr: T[], kind: K) => (T & {
|
|
13
|
+
kind: K;
|
|
14
|
+
}) | undefined;
|
|
15
|
+
export declare const isKind: <T extends {
|
|
16
|
+
kind: OpKind;
|
|
17
|
+
}, K extends OpKind>(op: T, kind: K) => op is withKind<T, K>;
|
|
18
|
+
export type RPCOpWithFee = RPCTransferOperation | RPCOriginationOperation | RPCDelegateOperation | RPCRevealOperation | RPCRegisterGlobalConstantOperation | RPCIncreasePaidStorageOperation | RPCTransferTicketOperation | RPCUpdateConsensusKeyOperation | RPCUpdateCompanionKeyOperation | RPCSmartRollupAddMessagesOperation | RPCSmartRollupOriginateOperation | RPCSmartRollupOutboxMessageOperation;
|
|
19
|
+
export type RPCOpWithSource = RPCTransferOperation | RPCOriginationOperation | RPCDelegateOperation | RPCRevealOperation | RPCRegisterGlobalConstantOperation | RPCIncreasePaidStorageOperation | RPCTransferTicketOperation | RPCUpdateConsensusKeyOperation | RPCUpdateCompanionKeyOperation | RPCSmartRollupAddMessagesOperation | RPCSmartRollupOriginateOperation | RPCSmartRollupOutboxMessageOperation | RPCBallotOperation | RPCProposalsOperation;
|
|
20
|
+
export declare const isOpWithGasBuffer: <T extends {
|
|
21
|
+
kind: OpKind;
|
|
22
|
+
destination?: string;
|
|
23
|
+
}>(op: T) => boolean;
|
|
24
|
+
export declare const isOpWithFee: <T extends {
|
|
25
|
+
kind: OpKind;
|
|
26
|
+
}>(op: T) => op is withKind<T, Exclude<Exclude<OpKind, OpKind.ACTIVATION>, OpKind.FAILING_NOOP>>;
|
|
27
|
+
export declare const isOpRequireReveal: <T extends {
|
|
28
|
+
kind: OpKind;
|
|
29
|
+
}>(op: T) => op is withKind<T, Exclude<InternalOperationResultKindEnum, OpKind.REVEAL>>;
|
|
30
|
+
export type SourceKinds = InternalOperationResultKindEnum;
|
|
31
|
+
export declare const isSourceOp: <T extends {
|
|
32
|
+
kind: OpKind;
|
|
33
|
+
}>(op: T) => op is withKind<T, SourceKinds>;
|
|
34
|
+
export declare const hasMetadata: <T extends {
|
|
35
|
+
kind: OpKind;
|
|
36
|
+
}, K>(op: T) => op is T & {
|
|
37
|
+
metadata: K;
|
|
38
|
+
};
|
|
39
|
+
export declare const hasMetadataWithResult: <T extends {
|
|
40
|
+
kind: OpKind;
|
|
41
|
+
}, K>(op: T) => op is T & {
|
|
42
|
+
metadata: {
|
|
43
|
+
operation_result: K;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export declare const hasMetadataWithInternalOperationResult: <T extends {
|
|
47
|
+
kind: OpKind;
|
|
48
|
+
}, K>(op: T) => op is T & {
|
|
49
|
+
metadata: {
|
|
50
|
+
internal_operation_results?: K;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export interface GasConsumingOperation {
|
|
54
|
+
consumedGas?: string;
|
|
55
|
+
gasLimit: number;
|
|
56
|
+
}
|
|
57
|
+
export interface StorageConsumingOperation {
|
|
58
|
+
storageDiff?: string;
|
|
59
|
+
storageSize?: string;
|
|
60
|
+
storageLimit: number;
|
|
61
|
+
}
|
|
62
|
+
export interface FeeConsumingOperation {
|
|
63
|
+
fee: number;
|
|
64
|
+
}
|
|
65
|
+
export type OriginateParamsBase = {
|
|
66
|
+
balance?: string | number;
|
|
67
|
+
code: string | object[];
|
|
68
|
+
delegate?: string;
|
|
69
|
+
fee?: number;
|
|
70
|
+
gasLimit?: number;
|
|
71
|
+
storageLimit?: number;
|
|
72
|
+
mutez?: boolean;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* @description Parameters for originate method
|
|
76
|
+
*/
|
|
77
|
+
export type OriginateParams<TStorage = any> = OriginateParamsBase & ({
|
|
78
|
+
init?: never;
|
|
79
|
+
/** JS representation of a storage object */
|
|
80
|
+
storage: TStorage;
|
|
81
|
+
} | {
|
|
82
|
+
/** Initial storage object value. Either Micheline or JSON encoded */
|
|
83
|
+
init: string | object;
|
|
84
|
+
storage?: never;
|
|
85
|
+
});
|
|
86
|
+
export interface ActivationParams {
|
|
87
|
+
pkh: string;
|
|
88
|
+
secret: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* @description RPC origination operation
|
|
92
|
+
*/
|
|
93
|
+
export interface RPCOriginationOperation {
|
|
94
|
+
kind: OpKind.ORIGINATION;
|
|
95
|
+
fee: number;
|
|
96
|
+
gas_limit: number;
|
|
97
|
+
storage_limit: number;
|
|
98
|
+
balance: string;
|
|
99
|
+
delegate?: string;
|
|
100
|
+
source?: string;
|
|
101
|
+
script: {
|
|
102
|
+
code: any;
|
|
103
|
+
storage: any;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* @description RPC reveal operation
|
|
108
|
+
*/
|
|
109
|
+
export interface RPCRevealOperation {
|
|
110
|
+
kind: OpKind.REVEAL;
|
|
111
|
+
fee: number;
|
|
112
|
+
public_key: string;
|
|
113
|
+
source?: string;
|
|
114
|
+
gas_limit: number;
|
|
115
|
+
storage_limit: number;
|
|
116
|
+
proof?: string;
|
|
117
|
+
}
|
|
118
|
+
export interface RevealParams {
|
|
119
|
+
fee?: number;
|
|
120
|
+
gasLimit?: number;
|
|
121
|
+
storageLimit?: number;
|
|
122
|
+
proof?: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* @description Result of a forge operation contains the operation plus its encoded version
|
|
126
|
+
*/
|
|
127
|
+
export interface ForgedBytes {
|
|
128
|
+
opbytes: string;
|
|
129
|
+
opOb: OperationObject;
|
|
130
|
+
counter: number;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* @description Parameters for setDelegate method
|
|
134
|
+
*/
|
|
135
|
+
export interface DelegateParams {
|
|
136
|
+
source?: string;
|
|
137
|
+
delegate?: string;
|
|
138
|
+
fee?: number;
|
|
139
|
+
gasLimit?: number;
|
|
140
|
+
storageLimit?: number;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* @description Parameters for registerDelegate method
|
|
144
|
+
*/
|
|
145
|
+
export interface RegisterDelegateParams {
|
|
146
|
+
fee?: number;
|
|
147
|
+
gasLimit?: number;
|
|
148
|
+
storageLimit?: number;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* @description RPC delegation operation
|
|
152
|
+
*/
|
|
153
|
+
export interface RPCDelegateOperation {
|
|
154
|
+
kind: OpKind.DELEGATION;
|
|
155
|
+
source?: string;
|
|
156
|
+
fee: number;
|
|
157
|
+
gas_limit: number;
|
|
158
|
+
storage_limit: number;
|
|
159
|
+
delegate?: string;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* @description Parameters for transfer method
|
|
163
|
+
*/
|
|
164
|
+
export interface TransferParams {
|
|
165
|
+
to: string;
|
|
166
|
+
source?: string;
|
|
167
|
+
amount: number;
|
|
168
|
+
fee?: number;
|
|
169
|
+
parameter?: TransactionOperationParameter;
|
|
170
|
+
gasLimit?: number;
|
|
171
|
+
storageLimit?: number;
|
|
172
|
+
mutez?: boolean;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* @description RPC Stake pseudo operation params
|
|
176
|
+
*/
|
|
177
|
+
export interface StakeParams {
|
|
178
|
+
to?: string;
|
|
179
|
+
source?: string;
|
|
180
|
+
amount: number;
|
|
181
|
+
fee?: number;
|
|
182
|
+
parameter?: TransactionOperationParameter;
|
|
183
|
+
gasLimit?: number;
|
|
184
|
+
storageLimit?: number;
|
|
185
|
+
mutez?: boolean;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* @description RPC unstake pseudo operation params
|
|
189
|
+
*/
|
|
190
|
+
export interface UnstakeParams {
|
|
191
|
+
to?: string;
|
|
192
|
+
source?: string;
|
|
193
|
+
amount: number;
|
|
194
|
+
fee?: number;
|
|
195
|
+
parameter?: TransactionOperationParameter;
|
|
196
|
+
gasLimit?: number;
|
|
197
|
+
storageLimit?: number;
|
|
198
|
+
mutez?: boolean;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* @description RPC finalize_unstake pseudo operation params
|
|
202
|
+
*/
|
|
203
|
+
export interface FinalizeUnstakeParams {
|
|
204
|
+
to?: string;
|
|
205
|
+
source?: string;
|
|
206
|
+
amount?: number;
|
|
207
|
+
fee?: number;
|
|
208
|
+
parameter?: TransactionOperationParameter;
|
|
209
|
+
gasLimit?: number;
|
|
210
|
+
storageLimit?: number;
|
|
211
|
+
mutez?: boolean;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* @description RPC register global constant operation
|
|
215
|
+
*/
|
|
216
|
+
export interface RPCRegisterGlobalConstantOperation {
|
|
217
|
+
kind: OpKind.REGISTER_GLOBAL_CONSTANT;
|
|
218
|
+
fee: number;
|
|
219
|
+
gas_limit: number;
|
|
220
|
+
storage_limit: number;
|
|
221
|
+
source: string;
|
|
222
|
+
value: MichelsonV1Expression;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* @description Parameters for the `registerGlobalConstant` method
|
|
226
|
+
*/
|
|
227
|
+
export interface RegisterGlobalConstantParams {
|
|
228
|
+
value: MichelsonV1Expression;
|
|
229
|
+
source?: string;
|
|
230
|
+
fee?: number;
|
|
231
|
+
gasLimit?: number;
|
|
232
|
+
storageLimit?: number;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* @description RPC transfer operation
|
|
236
|
+
*/
|
|
237
|
+
export interface RPCTransferOperation {
|
|
238
|
+
kind: OpKind.TRANSACTION;
|
|
239
|
+
fee: number;
|
|
240
|
+
gas_limit: number;
|
|
241
|
+
storage_limit: number;
|
|
242
|
+
amount: string;
|
|
243
|
+
source?: string;
|
|
244
|
+
destination: string;
|
|
245
|
+
parameters?: TransactionOperationParameter;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* @description RPC activate account operation
|
|
249
|
+
*/
|
|
250
|
+
export interface RPCActivateOperation {
|
|
251
|
+
kind: OpKind.ACTIVATION;
|
|
252
|
+
pkh: string;
|
|
253
|
+
secret: string;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* @description Parameters for the transferTicket contract provider
|
|
257
|
+
*/
|
|
258
|
+
export interface TransferTicketParams {
|
|
259
|
+
source?: string;
|
|
260
|
+
fee?: number;
|
|
261
|
+
gasLimit?: number;
|
|
262
|
+
storageLimit?: number;
|
|
263
|
+
ticketContents: MichelsonV1Expression;
|
|
264
|
+
ticketTy: MichelsonV1Expression;
|
|
265
|
+
ticketTicketer: string;
|
|
266
|
+
ticketAmount: number;
|
|
267
|
+
destination: string;
|
|
268
|
+
entrypoint: string;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* @description Rpc transfer-ticket operation
|
|
272
|
+
*/
|
|
273
|
+
export interface RPCTransferTicketOperation {
|
|
274
|
+
kind: OpKind.TRANSFER_TICKET;
|
|
275
|
+
source?: string;
|
|
276
|
+
fee: number;
|
|
277
|
+
gas_limit: number;
|
|
278
|
+
storage_limit: number;
|
|
279
|
+
ticket_contents: MichelsonV1Expression;
|
|
280
|
+
ticket_ty: MichelsonV1Expression;
|
|
281
|
+
ticket_ticketer: string;
|
|
282
|
+
ticket_amount: number;
|
|
283
|
+
destination: string;
|
|
284
|
+
entrypoint: string;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* @description Parameters for the increasePaidStorage method
|
|
288
|
+
*/
|
|
289
|
+
export interface IncreasePaidStorageParams {
|
|
290
|
+
source?: string;
|
|
291
|
+
fee?: number;
|
|
292
|
+
gasLimit?: number;
|
|
293
|
+
storageLimit?: number;
|
|
294
|
+
amount: number;
|
|
295
|
+
destination: string;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* @description RPC IncreasePaidStorage operation
|
|
299
|
+
*/
|
|
300
|
+
export interface RPCIncreasePaidStorageOperation {
|
|
301
|
+
kind: OpKind.INCREASE_PAID_STORAGE;
|
|
302
|
+
source: string;
|
|
303
|
+
fee: number;
|
|
304
|
+
gas_limit: number;
|
|
305
|
+
storage_limit: number;
|
|
306
|
+
amount: number;
|
|
307
|
+
destination: string;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* @description Parameters for the DrainDelegate method
|
|
311
|
+
*/
|
|
312
|
+
export interface DrainDelegateParams {
|
|
313
|
+
consensus_key: string;
|
|
314
|
+
delegate: string;
|
|
315
|
+
destination: string;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* @description RPC DrainDelegate operation
|
|
319
|
+
*/
|
|
320
|
+
export interface RPCDrainDelegateOperation {
|
|
321
|
+
kind: OpKind.DRAIN_DELEGATE;
|
|
322
|
+
consensus_key: string;
|
|
323
|
+
delegate: string;
|
|
324
|
+
destination: string;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* @description Ballot operation params
|
|
328
|
+
*/
|
|
329
|
+
export interface BallotParams {
|
|
330
|
+
source?: string;
|
|
331
|
+
proposal: string;
|
|
332
|
+
ballot: BallotVote;
|
|
333
|
+
}
|
|
334
|
+
export interface RPCBallotOperation {
|
|
335
|
+
kind: OpKind.BALLOT;
|
|
336
|
+
source: string;
|
|
337
|
+
period: number;
|
|
338
|
+
proposal: string;
|
|
339
|
+
ballot: BallotVote;
|
|
340
|
+
}
|
|
341
|
+
export interface ProposalsParams {
|
|
342
|
+
source?: string;
|
|
343
|
+
proposals: string[];
|
|
344
|
+
}
|
|
345
|
+
export interface RPCProposalsOperation {
|
|
346
|
+
kind: OpKind.PROPOSALS;
|
|
347
|
+
source: string;
|
|
348
|
+
period: number;
|
|
349
|
+
proposals: string[];
|
|
350
|
+
}
|
|
351
|
+
export interface UpdateConsensusKeyParams {
|
|
352
|
+
source?: string;
|
|
353
|
+
fee?: number;
|
|
354
|
+
gasLimit?: number;
|
|
355
|
+
storageLimit?: number;
|
|
356
|
+
pk: string;
|
|
357
|
+
proof?: string;
|
|
358
|
+
}
|
|
359
|
+
export interface RPCUpdateConsensusKeyOperation {
|
|
360
|
+
kind: OpKind.UPDATE_CONSENSUS_KEY;
|
|
361
|
+
source: string;
|
|
362
|
+
fee: number;
|
|
363
|
+
gas_limit: number;
|
|
364
|
+
storage_limit: number;
|
|
365
|
+
pk: string;
|
|
366
|
+
proof?: string;
|
|
367
|
+
}
|
|
368
|
+
export interface UpdateCompanionKeyParams {
|
|
369
|
+
source?: string;
|
|
370
|
+
fee?: number;
|
|
371
|
+
gasLimit?: number;
|
|
372
|
+
storageLimit?: number;
|
|
373
|
+
pk: string;
|
|
374
|
+
proof?: string;
|
|
375
|
+
}
|
|
376
|
+
export interface RPCUpdateCompanionKeyOperation {
|
|
377
|
+
kind: OpKind.UPDATE_COMPANION_KEY;
|
|
378
|
+
source: string;
|
|
379
|
+
fee: number;
|
|
380
|
+
gas_limit: number;
|
|
381
|
+
storage_limit: number;
|
|
382
|
+
pk: string;
|
|
383
|
+
proof?: string;
|
|
384
|
+
}
|
|
385
|
+
export interface SmartRollupAddMessagesParams {
|
|
386
|
+
source?: string;
|
|
387
|
+
fee?: number;
|
|
388
|
+
gasLimit?: number;
|
|
389
|
+
storageLimit?: number;
|
|
390
|
+
message: string[];
|
|
391
|
+
}
|
|
392
|
+
export interface RPCSmartRollupAddMessagesOperation {
|
|
393
|
+
kind: OpKind.SMART_ROLLUP_ADD_MESSAGES;
|
|
394
|
+
source: string;
|
|
395
|
+
fee: number;
|
|
396
|
+
gas_limit: number;
|
|
397
|
+
storage_limit: number;
|
|
398
|
+
message: string[];
|
|
399
|
+
}
|
|
400
|
+
export interface SmartRollupOriginateParams {
|
|
401
|
+
source?: string;
|
|
402
|
+
fee?: number;
|
|
403
|
+
gasLimit?: number;
|
|
404
|
+
storageLimit?: number;
|
|
405
|
+
pvmKind: PvmKind;
|
|
406
|
+
kernel: string;
|
|
407
|
+
parametersType: MichelsonV1Expression;
|
|
408
|
+
}
|
|
409
|
+
export interface RPCSmartRollupOriginateOperation {
|
|
410
|
+
kind: OpKind.SMART_ROLLUP_ORIGINATE;
|
|
411
|
+
source: string;
|
|
412
|
+
fee: number;
|
|
413
|
+
gas_limit: number;
|
|
414
|
+
storage_limit: number;
|
|
415
|
+
pvm_kind: PvmKind;
|
|
416
|
+
kernel: string;
|
|
417
|
+
parameters_ty: MichelsonV1Expression;
|
|
418
|
+
}
|
|
419
|
+
export interface SmartRollupExecuteOutboxMessageParams {
|
|
420
|
+
source?: string;
|
|
421
|
+
fee?: number;
|
|
422
|
+
gasLimit?: number;
|
|
423
|
+
storageLimit?: number;
|
|
424
|
+
rollup: string;
|
|
425
|
+
cementedCommitment: string;
|
|
426
|
+
outputProof: string;
|
|
427
|
+
}
|
|
428
|
+
export interface RPCSmartRollupOutboxMessageOperation {
|
|
429
|
+
kind: OpKind.SMART_ROLLUP_EXECUTE_OUTBOX_MESSAGE;
|
|
430
|
+
source: string;
|
|
431
|
+
fee: number;
|
|
432
|
+
gas_limit: number;
|
|
433
|
+
storage_limit: number;
|
|
434
|
+
rollup: string;
|
|
435
|
+
cemented_commitment: string;
|
|
436
|
+
output_proof: string;
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* @description RPC failing noop operation
|
|
440
|
+
*/
|
|
441
|
+
export interface RPCFailingNoopOperation {
|
|
442
|
+
kind: OpKind.FAILING_NOOP;
|
|
443
|
+
arbitrary: string;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* @description Parameters for the `failingNoop` method
|
|
447
|
+
*/
|
|
448
|
+
export interface FailingNoopParams {
|
|
449
|
+
arbitrary: string;
|
|
450
|
+
basedOnBlock: BlockIdentifier;
|
|
451
|
+
}
|
|
452
|
+
export type RPCOperation = RPCOriginationOperation | RPCTransferOperation | RPCDelegateOperation | RPCRevealOperation | RPCActivateOperation | RPCRegisterGlobalConstantOperation | RPCTransferTicketOperation | RPCIncreasePaidStorageOperation | RPCDrainDelegateOperation | RPCBallotOperation | RPCProposalsOperation | RPCUpdateConsensusKeyOperation | RPCUpdateCompanionKeyOperation | RPCSmartRollupAddMessagesOperation | RPCSmartRollupOriginateOperation | RPCSmartRollupOutboxMessageOperation | RPCFailingNoopOperation;
|
|
453
|
+
export type PrepareOperationParams = {
|
|
454
|
+
operation: RPCOperation | RPCOperation[];
|
|
455
|
+
source?: string;
|
|
456
|
+
};
|
|
457
|
+
export type ParamsWithOptionalFees = {
|
|
458
|
+
fee?: number | string;
|
|
459
|
+
storageLimit?: number | string;
|
|
460
|
+
gasLimit?: number | string;
|
|
461
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { OperationContentsAndResult, OperationContentsUpdateCompanionKey } from '@tezos-x/octez.js-rpc';
|
|
2
|
+
import { Context } from '../context';
|
|
3
|
+
import { Operation } from './operations';
|
|
4
|
+
import { FeeConsumingOperation, ForgedBytes, GasConsumingOperation, StorageConsumingOperation } from './types';
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @description UpdateCompanionKeyOperation provides utility to fetch properties for Operation of kind UpdateCompanionKey
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
export declare class UpdateCompanionKeyOperation extends Operation implements GasConsumingOperation, StorageConsumingOperation, FeeConsumingOperation {
|
|
11
|
+
private readonly params;
|
|
12
|
+
readonly source: string;
|
|
13
|
+
constructor(hash: string, params: OperationContentsUpdateCompanionKey, source: string, raw: ForgedBytes, results: OperationContentsAndResult[], context: Context);
|
|
14
|
+
get operationResults(): import("@tezos-x/octez.js-rpc").OperationResultUpdateConsensusKey | undefined;
|
|
15
|
+
get status(): import("@tezos-x/octez.js-rpc").OperationResultStatusEnum | "unknown";
|
|
16
|
+
get fee(): number;
|
|
17
|
+
get gasLimit(): number;
|
|
18
|
+
get storageLimit(): number;
|
|
19
|
+
get pk(): string;
|
|
20
|
+
get proof(): string;
|
|
21
|
+
get consumedMilliGas(): string | undefined;
|
|
22
|
+
get errors(): import("@tezos-x/octez.js-rpc").TezosGenericOperationError[] | undefined;
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { OperationContentsAndResult, OperationContentsUpdateConsensusKey } from '@tezos-x/octez.js-rpc';
|
|
2
|
+
import { Context } from '../context';
|
|
3
|
+
import { Operation } from './operations';
|
|
4
|
+
import { FeeConsumingOperation, ForgedBytes, GasConsumingOperation, StorageConsumingOperation } from './types';
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @description UpdateConsensusKeyOperation provides utility to fetch properties for Operation of kind UpdateConsensusKey
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
export declare class UpdateConsensusKeyOperation extends Operation implements GasConsumingOperation, StorageConsumingOperation, FeeConsumingOperation {
|
|
11
|
+
private readonly params;
|
|
12
|
+
readonly source: string;
|
|
13
|
+
constructor(hash: string, params: OperationContentsUpdateConsensusKey, source: string, raw: ForgedBytes, results: OperationContentsAndResult[], context: Context);
|
|
14
|
+
get operationResults(): import("@tezos-x/octez.js-rpc").OperationResultUpdateConsensusKey | undefined;
|
|
15
|
+
get status(): import("@tezos-x/octez.js-rpc").OperationResultStatusEnum | "unknown";
|
|
16
|
+
get fee(): number;
|
|
17
|
+
get gasLimit(): number;
|
|
18
|
+
get storageLimit(): number;
|
|
19
|
+
get pk(): string;
|
|
20
|
+
get proof(): string;
|
|
21
|
+
get consumedMilliGas(): string | undefined;
|
|
22
|
+
get errors(): import("@tezos-x/octez.js-rpc").TezosGenericOperationError[] | undefined;
|
|
23
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Packer } from './interface';
|
|
2
|
+
import { Context } from '../context';
|
|
3
|
+
import { PackDataParams, PackDataResponse } from '@tezos-x/octez.js-rpc';
|
|
4
|
+
export declare class RpcPacker implements Packer {
|
|
5
|
+
private context;
|
|
6
|
+
constructor(context: Context);
|
|
7
|
+
packData(data: PackDataParams): Promise<PackDataResponse>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Context } from '../context';
|
|
2
|
+
import { ParserProvider } from './interface';
|
|
3
|
+
import { Expr } from '@tezos-x/octez.js-michel-codec';
|
|
4
|
+
import { OriginateParams } from '../operations/types';
|
|
5
|
+
export declare class MichelCodecParser implements ParserProvider {
|
|
6
|
+
private context;
|
|
7
|
+
constructor(context: Context);
|
|
8
|
+
private getNextProto;
|
|
9
|
+
parseScript(src: string): Promise<Expr[] | null>;
|
|
10
|
+
parseMichelineExpression(src: string): Promise<Expr | null>;
|
|
11
|
+
parseJSON(src: object): Promise<Expr>;
|
|
12
|
+
prepareCodeOrigination(params: OriginateParams): Promise<OriginateParams>;
|
|
13
|
+
private formatCodeParam;
|
|
14
|
+
private formatInitParam;
|
|
15
|
+
private findGlobalConstantsHashAndValue;
|
|
16
|
+
}
|