@inco/shield-js 0.0.0-bootstrap.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 +201 -0
- package/README.md +359 -0
- package/dist/binary.d.ts +3 -0
- package/dist/binary.js +16 -0
- package/dist/contracts/abi.d.ts +6800 -0
- package/dist/contracts/abi.js +8836 -0
- package/dist/contracts/index.d.ts +2 -0
- package/dist/contracts/index.js +2 -0
- package/dist/contracts/utils.d.ts +25 -0
- package/dist/contracts/utils.js +28 -0
- package/dist/errors.d.ts +125 -0
- package/dist/errors.js +91 -0
- package/dist/generated/inco/shield/v2/conductor_connect.d.ts +137 -0
- package/dist/generated/inco/shield/v2/conductor_connect.js +141 -0
- package/dist/generated/inco/shield/v2/deposit_pb.d.ts +103 -0
- package/dist/generated/inco/shield/v2/deposit_pb.js +141 -0
- package/dist/generated/inco/shield/v2/drafting_pb.d.ts +279 -0
- package/dist/generated/inco/shield/v2/drafting_pb.js +372 -0
- package/dist/generated/inco/shield/v2/permission_pb.d.ts +443 -0
- package/dist/generated/inco/shield/v2/permission_pb.js +639 -0
- package/dist/generated/inco/shield/v2/query_pb.d.ts +103 -0
- package/dist/generated/inco/shield/v2/query_pb.js +141 -0
- package/dist/generated/inco/shield/v2/types_pb.d.ts +166 -0
- package/dist/generated/inco/shield/v2/types_pb.js +261 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +19 -0
- package/dist/shield/client.d.ts +72 -0
- package/dist/shield/client.js +136 -0
- package/dist/shield/convert.d.ts +18 -0
- package/dist/shield/convert.js +152 -0
- package/dist/shield/encryption.d.ts +86 -0
- package/dist/shield/encryption.js +180 -0
- package/dist/shield/envelope.d.ts +14 -0
- package/dist/shield/envelope.js +29 -0
- package/dist/shield/index.d.ts +13 -0
- package/dist/shield/index.js +11 -0
- package/dist/shield/intent.d.ts +977 -0
- package/dist/shield/intent.js +188 -0
- package/dist/shield/rpc.d.ts +72 -0
- package/dist/shield/rpc.js +423 -0
- package/dist/shield/shield.eip712.gen.d.ts +396 -0
- package/dist/shield/shield.eip712.gen.js +318 -0
- package/dist/shield/types.d.ts +119 -0
- package/dist/shield/types.js +4 -0
- package/dist/shield/userop/gas-estimation.d.ts +36 -0
- package/dist/shield/userop/gas-estimation.js +284 -0
- package/dist/shield/userop/index.d.ts +1 -0
- package/dist/shield/userop/index.js +1 -0
- package/dist/shield/userop/token-exchange.d.ts +54 -0
- package/dist/shield/userop/token-exchange.js +165 -0
- package/dist/shield/userop/types.d.ts +91 -0
- package/dist/shield/userop/types.js +4 -0
- package/dist/shield/userop/userOp.d.ts +26 -0
- package/dist/shield/userop/userOp.js +98 -0
- package/dist/shield/utils/chain.d.ts +2 -0
- package/dist/shield/utils/chain.js +8 -0
- package/dist/uniswap-adapter/config.d.ts +34 -0
- package/dist/uniswap-adapter/config.js +45 -0
- package/dist/uniswap-adapter/find-pools.d.ts +91 -0
- package/dist/uniswap-adapter/find-pools.js +108 -0
- package/dist/uniswap-adapter/index.d.ts +10 -0
- package/dist/uniswap-adapter/index.js +13 -0
- package/dist/uniswap-adapter/swap.d.ts +344 -0
- package/dist/uniswap-adapter/swap.js +309 -0
- package/package.json +72 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
|
|
2
|
+
import { Message, proto3 } from "@bufbuild/protobuf";
|
|
3
|
+
import { Address, AssetId, Bytes32, Handle, Uint256 } from "./types_pb.js";
|
|
4
|
+
/**
|
|
5
|
+
* GetBalanceRequest is the envelope payload for GetBalance.
|
|
6
|
+
* Account ownership is proven by eip712_signature.
|
|
7
|
+
* Response is AEAD-encrypted with response_key.
|
|
8
|
+
*
|
|
9
|
+
* @generated from message inco.shield.v2.GetBalanceRequest
|
|
10
|
+
*/
|
|
11
|
+
export declare class GetBalanceRequest extends Message<GetBalanceRequest> {
|
|
12
|
+
/**
|
|
13
|
+
* The account to query.
|
|
14
|
+
*
|
|
15
|
+
* @generated from field: inco.shield.v2.Address address = 1;
|
|
16
|
+
*/
|
|
17
|
+
address?: Address;
|
|
18
|
+
/**
|
|
19
|
+
* The asset to query.
|
|
20
|
+
*
|
|
21
|
+
* @generated from field: inco.shield.v2.AssetId asset_id = 2;
|
|
22
|
+
*/
|
|
23
|
+
assetId?: AssetId;
|
|
24
|
+
/**
|
|
25
|
+
* Optional: query balance at a specific block (0 = latest).
|
|
26
|
+
*
|
|
27
|
+
* @generated from field: uint64 at_block = 3;
|
|
28
|
+
*/
|
|
29
|
+
atBlock: bigint;
|
|
30
|
+
/**
|
|
31
|
+
* Symmetric key for AEAD-encrypting the response.
|
|
32
|
+
*
|
|
33
|
+
* @generated from field: bytes response_key = 4;
|
|
34
|
+
*/
|
|
35
|
+
responseKey: Uint8Array<ArrayBuffer>;
|
|
36
|
+
/**
|
|
37
|
+
* EIP-712 signature proving ownership of the queried address.
|
|
38
|
+
*
|
|
39
|
+
* @generated from field: bytes eip712_signature = 5;
|
|
40
|
+
*/
|
|
41
|
+
eip712Signature: Uint8Array<ArrayBuffer>;
|
|
42
|
+
/**
|
|
43
|
+
* Unix timestamp (seconds) the client signed into the BalanceQuery digest;
|
|
44
|
+
* the enclave verifies against this exact value.
|
|
45
|
+
*
|
|
46
|
+
* @generated from field: uint64 query_timestamp = 6;
|
|
47
|
+
*/
|
|
48
|
+
queryTimestamp: bigint;
|
|
49
|
+
constructor(data?: PartialMessage<GetBalanceRequest>);
|
|
50
|
+
static readonly runtime: typeof proto3;
|
|
51
|
+
static readonly typeName = "inco.shield.v2.GetBalanceRequest";
|
|
52
|
+
static readonly fields: FieldList;
|
|
53
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GetBalanceRequest;
|
|
54
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GetBalanceRequest;
|
|
55
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GetBalanceRequest;
|
|
56
|
+
static equals(a: GetBalanceRequest | PlainMessage<GetBalanceRequest> | undefined, b: GetBalanceRequest | PlainMessage<GetBalanceRequest> | undefined): boolean;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* GetBalanceResponse returns the account's balance breakdown.
|
|
60
|
+
* Serialized and AEAD-encrypted into an EncryptedResponse.
|
|
61
|
+
*
|
|
62
|
+
* @generated from message inco.shield.v2.GetBalanceResponse
|
|
63
|
+
*/
|
|
64
|
+
export declare class GetBalanceResponse extends Message<GetBalanceResponse> {
|
|
65
|
+
/**
|
|
66
|
+
* Balance from settled transfers.
|
|
67
|
+
*
|
|
68
|
+
* @generated from field: inco.shield.v2.Uint256 confirmed_balance = 1;
|
|
69
|
+
*/
|
|
70
|
+
confirmedBalance?: Uint256;
|
|
71
|
+
/**
|
|
72
|
+
* Balance from in-flight transfers not yet settled.
|
|
73
|
+
*
|
|
74
|
+
* @generated from field: inco.shield.v2.Uint256 pending_balance = 2;
|
|
75
|
+
*/
|
|
76
|
+
pendingBalance?: Uint256;
|
|
77
|
+
/**
|
|
78
|
+
* Total available balance (confirmed + pending).
|
|
79
|
+
*
|
|
80
|
+
* @generated from field: inco.shield.v2.Uint256 available_balance = 3;
|
|
81
|
+
*/
|
|
82
|
+
availableBalance?: Uint256;
|
|
83
|
+
/**
|
|
84
|
+
* The handle at which this balance was computed.
|
|
85
|
+
*
|
|
86
|
+
* @generated from field: inco.shield.v2.Handle handle = 4;
|
|
87
|
+
*/
|
|
88
|
+
handle?: Handle;
|
|
89
|
+
/**
|
|
90
|
+
* The block hash at which this balance was computed.
|
|
91
|
+
*
|
|
92
|
+
* @generated from field: inco.shield.v2.Bytes32 block_hash = 5;
|
|
93
|
+
*/
|
|
94
|
+
blockHash?: Bytes32;
|
|
95
|
+
constructor(data?: PartialMessage<GetBalanceResponse>);
|
|
96
|
+
static readonly runtime: typeof proto3;
|
|
97
|
+
static readonly typeName = "inco.shield.v2.GetBalanceResponse";
|
|
98
|
+
static readonly fields: FieldList;
|
|
99
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GetBalanceResponse;
|
|
100
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GetBalanceResponse;
|
|
101
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GetBalanceResponse;
|
|
102
|
+
static equals(a: GetBalanceResponse | PlainMessage<GetBalanceResponse> | undefined, b: GetBalanceResponse | PlainMessage<GetBalanceResponse> | undefined): boolean;
|
|
103
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v1.10.1 with parameter "target=ts,import_extension=.js"
|
|
2
|
+
// @generated from file inco/shield/v2/query.proto (package inco.shield.v2, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// @ts-nocheck
|
|
5
|
+
import { Message, proto3, protoInt64 } from "@bufbuild/protobuf";
|
|
6
|
+
import { Address, AssetId, Bytes32, Handle, Uint256 } from "./types_pb.js";
|
|
7
|
+
/**
|
|
8
|
+
* GetBalanceRequest is the envelope payload for GetBalance.
|
|
9
|
+
* Account ownership is proven by eip712_signature.
|
|
10
|
+
* Response is AEAD-encrypted with response_key.
|
|
11
|
+
*
|
|
12
|
+
* @generated from message inco.shield.v2.GetBalanceRequest
|
|
13
|
+
*/
|
|
14
|
+
export class GetBalanceRequest extends Message {
|
|
15
|
+
/**
|
|
16
|
+
* The account to query.
|
|
17
|
+
*
|
|
18
|
+
* @generated from field: inco.shield.v2.Address address = 1;
|
|
19
|
+
*/
|
|
20
|
+
address;
|
|
21
|
+
/**
|
|
22
|
+
* The asset to query.
|
|
23
|
+
*
|
|
24
|
+
* @generated from field: inco.shield.v2.AssetId asset_id = 2;
|
|
25
|
+
*/
|
|
26
|
+
assetId;
|
|
27
|
+
/**
|
|
28
|
+
* Optional: query balance at a specific block (0 = latest).
|
|
29
|
+
*
|
|
30
|
+
* @generated from field: uint64 at_block = 3;
|
|
31
|
+
*/
|
|
32
|
+
atBlock = protoInt64.zero;
|
|
33
|
+
/**
|
|
34
|
+
* Symmetric key for AEAD-encrypting the response.
|
|
35
|
+
*
|
|
36
|
+
* @generated from field: bytes response_key = 4;
|
|
37
|
+
*/
|
|
38
|
+
responseKey = new Uint8Array(0);
|
|
39
|
+
/**
|
|
40
|
+
* EIP-712 signature proving ownership of the queried address.
|
|
41
|
+
*
|
|
42
|
+
* @generated from field: bytes eip712_signature = 5;
|
|
43
|
+
*/
|
|
44
|
+
eip712Signature = new Uint8Array(0);
|
|
45
|
+
/**
|
|
46
|
+
* Unix timestamp (seconds) the client signed into the BalanceQuery digest;
|
|
47
|
+
* the enclave verifies against this exact value.
|
|
48
|
+
*
|
|
49
|
+
* @generated from field: uint64 query_timestamp = 6;
|
|
50
|
+
*/
|
|
51
|
+
queryTimestamp = protoInt64.zero;
|
|
52
|
+
constructor(data) {
|
|
53
|
+
super();
|
|
54
|
+
proto3.util.initPartial(data, this);
|
|
55
|
+
}
|
|
56
|
+
static runtime = proto3;
|
|
57
|
+
static typeName = "inco.shield.v2.GetBalanceRequest";
|
|
58
|
+
static fields = proto3.util.newFieldList(() => [
|
|
59
|
+
{ no: 1, name: "address", kind: "message", T: Address },
|
|
60
|
+
{ no: 2, name: "asset_id", kind: "message", T: AssetId },
|
|
61
|
+
{ no: 3, name: "at_block", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
|
|
62
|
+
{ no: 4, name: "response_key", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
|
|
63
|
+
{ no: 5, name: "eip712_signature", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
|
|
64
|
+
{ no: 6, name: "query_timestamp", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
|
|
65
|
+
]);
|
|
66
|
+
static fromBinary(bytes, options) {
|
|
67
|
+
return new GetBalanceRequest().fromBinary(bytes, options);
|
|
68
|
+
}
|
|
69
|
+
static fromJson(jsonValue, options) {
|
|
70
|
+
return new GetBalanceRequest().fromJson(jsonValue, options);
|
|
71
|
+
}
|
|
72
|
+
static fromJsonString(jsonString, options) {
|
|
73
|
+
return new GetBalanceRequest().fromJsonString(jsonString, options);
|
|
74
|
+
}
|
|
75
|
+
static equals(a, b) {
|
|
76
|
+
return proto3.util.equals(GetBalanceRequest, a, b);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* GetBalanceResponse returns the account's balance breakdown.
|
|
81
|
+
* Serialized and AEAD-encrypted into an EncryptedResponse.
|
|
82
|
+
*
|
|
83
|
+
* @generated from message inco.shield.v2.GetBalanceResponse
|
|
84
|
+
*/
|
|
85
|
+
export class GetBalanceResponse extends Message {
|
|
86
|
+
/**
|
|
87
|
+
* Balance from settled transfers.
|
|
88
|
+
*
|
|
89
|
+
* @generated from field: inco.shield.v2.Uint256 confirmed_balance = 1;
|
|
90
|
+
*/
|
|
91
|
+
confirmedBalance;
|
|
92
|
+
/**
|
|
93
|
+
* Balance from in-flight transfers not yet settled.
|
|
94
|
+
*
|
|
95
|
+
* @generated from field: inco.shield.v2.Uint256 pending_balance = 2;
|
|
96
|
+
*/
|
|
97
|
+
pendingBalance;
|
|
98
|
+
/**
|
|
99
|
+
* Total available balance (confirmed + pending).
|
|
100
|
+
*
|
|
101
|
+
* @generated from field: inco.shield.v2.Uint256 available_balance = 3;
|
|
102
|
+
*/
|
|
103
|
+
availableBalance;
|
|
104
|
+
/**
|
|
105
|
+
* The handle at which this balance was computed.
|
|
106
|
+
*
|
|
107
|
+
* @generated from field: inco.shield.v2.Handle handle = 4;
|
|
108
|
+
*/
|
|
109
|
+
handle;
|
|
110
|
+
/**
|
|
111
|
+
* The block hash at which this balance was computed.
|
|
112
|
+
*
|
|
113
|
+
* @generated from field: inco.shield.v2.Bytes32 block_hash = 5;
|
|
114
|
+
*/
|
|
115
|
+
blockHash;
|
|
116
|
+
constructor(data) {
|
|
117
|
+
super();
|
|
118
|
+
proto3.util.initPartial(data, this);
|
|
119
|
+
}
|
|
120
|
+
static runtime = proto3;
|
|
121
|
+
static typeName = "inco.shield.v2.GetBalanceResponse";
|
|
122
|
+
static fields = proto3.util.newFieldList(() => [
|
|
123
|
+
{ no: 1, name: "confirmed_balance", kind: "message", T: Uint256 },
|
|
124
|
+
{ no: 2, name: "pending_balance", kind: "message", T: Uint256 },
|
|
125
|
+
{ no: 3, name: "available_balance", kind: "message", T: Uint256 },
|
|
126
|
+
{ no: 4, name: "handle", kind: "message", T: Handle },
|
|
127
|
+
{ no: 5, name: "block_hash", kind: "message", T: Bytes32 },
|
|
128
|
+
]);
|
|
129
|
+
static fromBinary(bytes, options) {
|
|
130
|
+
return new GetBalanceResponse().fromBinary(bytes, options);
|
|
131
|
+
}
|
|
132
|
+
static fromJson(jsonValue, options) {
|
|
133
|
+
return new GetBalanceResponse().fromJson(jsonValue, options);
|
|
134
|
+
}
|
|
135
|
+
static fromJsonString(jsonString, options) {
|
|
136
|
+
return new GetBalanceResponse().fromJsonString(jsonString, options);
|
|
137
|
+
}
|
|
138
|
+
static equals(a, b) {
|
|
139
|
+
return proto3.util.equals(GetBalanceResponse, a, b);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
|
|
2
|
+
import { Message, proto3 } from "@bufbuild/protobuf";
|
|
3
|
+
/**
|
|
4
|
+
* Address represents a 20-byte Ethereum address.
|
|
5
|
+
* Stored as raw bytes to avoid encoding ambiguity (0x prefix, capitalization).
|
|
6
|
+
*
|
|
7
|
+
* @generated from message inco.shield.v2.Address
|
|
8
|
+
*/
|
|
9
|
+
export declare class Address extends Message<Address> {
|
|
10
|
+
/**
|
|
11
|
+
* The raw 20-byte address value.
|
|
12
|
+
*
|
|
13
|
+
* @generated from field: bytes value = 1;
|
|
14
|
+
*/
|
|
15
|
+
value: Uint8Array<ArrayBuffer>;
|
|
16
|
+
constructor(data?: PartialMessage<Address>);
|
|
17
|
+
static readonly runtime: typeof proto3;
|
|
18
|
+
static readonly typeName = "inco.shield.v2.Address";
|
|
19
|
+
static readonly fields: FieldList;
|
|
20
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Address;
|
|
21
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Address;
|
|
22
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Address;
|
|
23
|
+
static equals(a: Address | PlainMessage<Address> | undefined, b: Address | PlainMessage<Address> | undefined): boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Bytes32 represents a 32-byte value, used for hashes and other fixed-size data.
|
|
27
|
+
*
|
|
28
|
+
* @generated from message inco.shield.v2.Bytes32
|
|
29
|
+
*/
|
|
30
|
+
export declare class Bytes32 extends Message<Bytes32> {
|
|
31
|
+
/**
|
|
32
|
+
* The raw 32-byte value.
|
|
33
|
+
*
|
|
34
|
+
* @generated from field: bytes value = 1;
|
|
35
|
+
*/
|
|
36
|
+
value: Uint8Array<ArrayBuffer>;
|
|
37
|
+
constructor(data?: PartialMessage<Bytes32>);
|
|
38
|
+
static readonly runtime: typeof proto3;
|
|
39
|
+
static readonly typeName = "inco.shield.v2.Bytes32";
|
|
40
|
+
static readonly fields: FieldList;
|
|
41
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Bytes32;
|
|
42
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Bytes32;
|
|
43
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Bytes32;
|
|
44
|
+
static equals(a: Bytes32 | PlainMessage<Bytes32> | undefined, b: Bytes32 | PlainMessage<Bytes32> | undefined): boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Handle is a unique identifier for a position in the shield state.
|
|
48
|
+
* Used to track the covalidator's view of the on-chain state.
|
|
49
|
+
*
|
|
50
|
+
* @generated from message inco.shield.v2.Handle
|
|
51
|
+
*/
|
|
52
|
+
export declare class Handle extends Message<Handle> {
|
|
53
|
+
/**
|
|
54
|
+
* The 32-byte handle value.
|
|
55
|
+
*
|
|
56
|
+
* @generated from field: bytes value = 1;
|
|
57
|
+
*/
|
|
58
|
+
value: Uint8Array<ArrayBuffer>;
|
|
59
|
+
constructor(data?: PartialMessage<Handle>);
|
|
60
|
+
static readonly runtime: typeof proto3;
|
|
61
|
+
static readonly typeName = "inco.shield.v2.Handle";
|
|
62
|
+
static readonly fields: FieldList;
|
|
63
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Handle;
|
|
64
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Handle;
|
|
65
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Handle;
|
|
66
|
+
static equals(a: Handle | PlainMessage<Handle> | undefined, b: Handle | PlainMessage<Handle> | undefined): boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* AssetId identifies a specific asset type within the shield system.
|
|
70
|
+
* Typically derived from the token contract address.
|
|
71
|
+
*
|
|
72
|
+
* @generated from message inco.shield.v2.AssetId
|
|
73
|
+
*/
|
|
74
|
+
export declare class AssetId extends Message<AssetId> {
|
|
75
|
+
/**
|
|
76
|
+
* The 32-byte asset identifier.
|
|
77
|
+
*
|
|
78
|
+
* @generated from field: bytes value = 1;
|
|
79
|
+
*/
|
|
80
|
+
value: Uint8Array<ArrayBuffer>;
|
|
81
|
+
constructor(data?: PartialMessage<AssetId>);
|
|
82
|
+
static readonly runtime: typeof proto3;
|
|
83
|
+
static readonly typeName = "inco.shield.v2.AssetId";
|
|
84
|
+
static readonly fields: FieldList;
|
|
85
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AssetId;
|
|
86
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AssetId;
|
|
87
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AssetId;
|
|
88
|
+
static equals(a: AssetId | PlainMessage<AssetId> | undefined, b: AssetId | PlainMessage<AssetId> | undefined): boolean;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Uint256 is an unsigned 256-bit integer.
|
|
92
|
+
*
|
|
93
|
+
* Wire encoding: `value` is exactly 32 bytes, big-endian, unsigned. Same
|
|
94
|
+
* byte layout as Solidity's `uint256` ABI encoding. Producers write the
|
|
95
|
+
* integer to a 32-byte buffer big-endian (left-zero-padded); consumers
|
|
96
|
+
* read the 32 bytes as a big-endian unsigned integer. The zero value is
|
|
97
|
+
* 32 zero bytes (not an empty `value`). Length other than 32 is invalid.
|
|
98
|
+
*
|
|
99
|
+
* @generated from message inco.shield.v2.Uint256
|
|
100
|
+
*/
|
|
101
|
+
export declare class Uint256 extends Message<Uint256> {
|
|
102
|
+
/**
|
|
103
|
+
* @generated from field: bytes value = 1;
|
|
104
|
+
*/
|
|
105
|
+
value: Uint8Array<ArrayBuffer>;
|
|
106
|
+
constructor(data?: PartialMessage<Uint256>);
|
|
107
|
+
static readonly runtime: typeof proto3;
|
|
108
|
+
static readonly typeName = "inco.shield.v2.Uint256";
|
|
109
|
+
static readonly fields: FieldList;
|
|
110
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Uint256;
|
|
111
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Uint256;
|
|
112
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Uint256;
|
|
113
|
+
static equals(a: Uint256 | PlainMessage<Uint256> | undefined, b: Uint256 | PlainMessage<Uint256> | undefined): boolean;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* EncryptedEnvelope wraps an authenticated payload for the covalidator.
|
|
117
|
+
* The covalidator determines the inner plaintext type from the RPC method being called.
|
|
118
|
+
* The payload is serialized into a protobuf message and encrypted using the TEE's public key.
|
|
119
|
+
*
|
|
120
|
+
* @generated from message inco.shield.v2.EncryptedEnvelope
|
|
121
|
+
*/
|
|
122
|
+
export declare class EncryptedEnvelope extends Message<EncryptedEnvelope> {
|
|
123
|
+
/**
|
|
124
|
+
* The payload bytes, encrypted using the TEE's public key.
|
|
125
|
+
*
|
|
126
|
+
* @generated from field: bytes payload = 1;
|
|
127
|
+
*/
|
|
128
|
+
payload: Uint8Array<ArrayBuffer>;
|
|
129
|
+
constructor(data?: PartialMessage<EncryptedEnvelope>);
|
|
130
|
+
static readonly runtime: typeof proto3;
|
|
131
|
+
static readonly typeName = "inco.shield.v2.EncryptedEnvelope";
|
|
132
|
+
static readonly fields: FieldList;
|
|
133
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): EncryptedEnvelope;
|
|
134
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): EncryptedEnvelope;
|
|
135
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): EncryptedEnvelope;
|
|
136
|
+
static equals(a: EncryptedEnvelope | PlainMessage<EncryptedEnvelope> | undefined, b: EncryptedEnvelope | PlainMessage<EncryptedEnvelope> | undefined): boolean;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* EncryptedResponse wraps a response payload from the covalidator.
|
|
140
|
+
* The response is serialized into a protobuf message and AEAD-encrypted using the caller's response_key.
|
|
141
|
+
* The nonce and ciphertext are always populated.
|
|
142
|
+
*
|
|
143
|
+
* @generated from message inco.shield.v2.EncryptedResponse
|
|
144
|
+
*/
|
|
145
|
+
export declare class EncryptedResponse extends Message<EncryptedResponse> {
|
|
146
|
+
/**
|
|
147
|
+
* The AEAD nonce used to encrypt the response payload.
|
|
148
|
+
*
|
|
149
|
+
* @generated from field: bytes nonce = 1;
|
|
150
|
+
*/
|
|
151
|
+
nonce: Uint8Array<ArrayBuffer>;
|
|
152
|
+
/**
|
|
153
|
+
* The AEAD-encrypted serialized response payload.
|
|
154
|
+
*
|
|
155
|
+
* @generated from field: bytes ciphertext = 2;
|
|
156
|
+
*/
|
|
157
|
+
ciphertext: Uint8Array<ArrayBuffer>;
|
|
158
|
+
constructor(data?: PartialMessage<EncryptedResponse>);
|
|
159
|
+
static readonly runtime: typeof proto3;
|
|
160
|
+
static readonly typeName = "inco.shield.v2.EncryptedResponse";
|
|
161
|
+
static readonly fields: FieldList;
|
|
162
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): EncryptedResponse;
|
|
163
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): EncryptedResponse;
|
|
164
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): EncryptedResponse;
|
|
165
|
+
static equals(a: EncryptedResponse | PlainMessage<EncryptedResponse> | undefined, b: EncryptedResponse | PlainMessage<EncryptedResponse> | undefined): boolean;
|
|
166
|
+
}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v1.10.1 with parameter "target=ts,import_extension=.js"
|
|
2
|
+
// @generated from file inco/shield/v2/types.proto (package inco.shield.v2, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// @ts-nocheck
|
|
5
|
+
import { Message, proto3 } from "@bufbuild/protobuf";
|
|
6
|
+
/**
|
|
7
|
+
* Address represents a 20-byte Ethereum address.
|
|
8
|
+
* Stored as raw bytes to avoid encoding ambiguity (0x prefix, capitalization).
|
|
9
|
+
*
|
|
10
|
+
* @generated from message inco.shield.v2.Address
|
|
11
|
+
*/
|
|
12
|
+
export class Address extends Message {
|
|
13
|
+
/**
|
|
14
|
+
* The raw 20-byte address value.
|
|
15
|
+
*
|
|
16
|
+
* @generated from field: bytes value = 1;
|
|
17
|
+
*/
|
|
18
|
+
value = new Uint8Array(0);
|
|
19
|
+
constructor(data) {
|
|
20
|
+
super();
|
|
21
|
+
proto3.util.initPartial(data, this);
|
|
22
|
+
}
|
|
23
|
+
static runtime = proto3;
|
|
24
|
+
static typeName = "inco.shield.v2.Address";
|
|
25
|
+
static fields = proto3.util.newFieldList(() => [
|
|
26
|
+
{ no: 1, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
|
|
27
|
+
]);
|
|
28
|
+
static fromBinary(bytes, options) {
|
|
29
|
+
return new Address().fromBinary(bytes, options);
|
|
30
|
+
}
|
|
31
|
+
static fromJson(jsonValue, options) {
|
|
32
|
+
return new Address().fromJson(jsonValue, options);
|
|
33
|
+
}
|
|
34
|
+
static fromJsonString(jsonString, options) {
|
|
35
|
+
return new Address().fromJsonString(jsonString, options);
|
|
36
|
+
}
|
|
37
|
+
static equals(a, b) {
|
|
38
|
+
return proto3.util.equals(Address, a, b);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Bytes32 represents a 32-byte value, used for hashes and other fixed-size data.
|
|
43
|
+
*
|
|
44
|
+
* @generated from message inco.shield.v2.Bytes32
|
|
45
|
+
*/
|
|
46
|
+
export class Bytes32 extends Message {
|
|
47
|
+
/**
|
|
48
|
+
* The raw 32-byte value.
|
|
49
|
+
*
|
|
50
|
+
* @generated from field: bytes value = 1;
|
|
51
|
+
*/
|
|
52
|
+
value = new Uint8Array(0);
|
|
53
|
+
constructor(data) {
|
|
54
|
+
super();
|
|
55
|
+
proto3.util.initPartial(data, this);
|
|
56
|
+
}
|
|
57
|
+
static runtime = proto3;
|
|
58
|
+
static typeName = "inco.shield.v2.Bytes32";
|
|
59
|
+
static fields = proto3.util.newFieldList(() => [
|
|
60
|
+
{ no: 1, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
|
|
61
|
+
]);
|
|
62
|
+
static fromBinary(bytes, options) {
|
|
63
|
+
return new Bytes32().fromBinary(bytes, options);
|
|
64
|
+
}
|
|
65
|
+
static fromJson(jsonValue, options) {
|
|
66
|
+
return new Bytes32().fromJson(jsonValue, options);
|
|
67
|
+
}
|
|
68
|
+
static fromJsonString(jsonString, options) {
|
|
69
|
+
return new Bytes32().fromJsonString(jsonString, options);
|
|
70
|
+
}
|
|
71
|
+
static equals(a, b) {
|
|
72
|
+
return proto3.util.equals(Bytes32, a, b);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Handle is a unique identifier for a position in the shield state.
|
|
77
|
+
* Used to track the covalidator's view of the on-chain state.
|
|
78
|
+
*
|
|
79
|
+
* @generated from message inco.shield.v2.Handle
|
|
80
|
+
*/
|
|
81
|
+
export class Handle extends Message {
|
|
82
|
+
/**
|
|
83
|
+
* The 32-byte handle value.
|
|
84
|
+
*
|
|
85
|
+
* @generated from field: bytes value = 1;
|
|
86
|
+
*/
|
|
87
|
+
value = new Uint8Array(0);
|
|
88
|
+
constructor(data) {
|
|
89
|
+
super();
|
|
90
|
+
proto3.util.initPartial(data, this);
|
|
91
|
+
}
|
|
92
|
+
static runtime = proto3;
|
|
93
|
+
static typeName = "inco.shield.v2.Handle";
|
|
94
|
+
static fields = proto3.util.newFieldList(() => [
|
|
95
|
+
{ no: 1, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
|
|
96
|
+
]);
|
|
97
|
+
static fromBinary(bytes, options) {
|
|
98
|
+
return new Handle().fromBinary(bytes, options);
|
|
99
|
+
}
|
|
100
|
+
static fromJson(jsonValue, options) {
|
|
101
|
+
return new Handle().fromJson(jsonValue, options);
|
|
102
|
+
}
|
|
103
|
+
static fromJsonString(jsonString, options) {
|
|
104
|
+
return new Handle().fromJsonString(jsonString, options);
|
|
105
|
+
}
|
|
106
|
+
static equals(a, b) {
|
|
107
|
+
return proto3.util.equals(Handle, a, b);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* AssetId identifies a specific asset type within the shield system.
|
|
112
|
+
* Typically derived from the token contract address.
|
|
113
|
+
*
|
|
114
|
+
* @generated from message inco.shield.v2.AssetId
|
|
115
|
+
*/
|
|
116
|
+
export class AssetId extends Message {
|
|
117
|
+
/**
|
|
118
|
+
* The 32-byte asset identifier.
|
|
119
|
+
*
|
|
120
|
+
* @generated from field: bytes value = 1;
|
|
121
|
+
*/
|
|
122
|
+
value = new Uint8Array(0);
|
|
123
|
+
constructor(data) {
|
|
124
|
+
super();
|
|
125
|
+
proto3.util.initPartial(data, this);
|
|
126
|
+
}
|
|
127
|
+
static runtime = proto3;
|
|
128
|
+
static typeName = "inco.shield.v2.AssetId";
|
|
129
|
+
static fields = proto3.util.newFieldList(() => [
|
|
130
|
+
{ no: 1, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
|
|
131
|
+
]);
|
|
132
|
+
static fromBinary(bytes, options) {
|
|
133
|
+
return new AssetId().fromBinary(bytes, options);
|
|
134
|
+
}
|
|
135
|
+
static fromJson(jsonValue, options) {
|
|
136
|
+
return new AssetId().fromJson(jsonValue, options);
|
|
137
|
+
}
|
|
138
|
+
static fromJsonString(jsonString, options) {
|
|
139
|
+
return new AssetId().fromJsonString(jsonString, options);
|
|
140
|
+
}
|
|
141
|
+
static equals(a, b) {
|
|
142
|
+
return proto3.util.equals(AssetId, a, b);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Uint256 is an unsigned 256-bit integer.
|
|
147
|
+
*
|
|
148
|
+
* Wire encoding: `value` is exactly 32 bytes, big-endian, unsigned. Same
|
|
149
|
+
* byte layout as Solidity's `uint256` ABI encoding. Producers write the
|
|
150
|
+
* integer to a 32-byte buffer big-endian (left-zero-padded); consumers
|
|
151
|
+
* read the 32 bytes as a big-endian unsigned integer. The zero value is
|
|
152
|
+
* 32 zero bytes (not an empty `value`). Length other than 32 is invalid.
|
|
153
|
+
*
|
|
154
|
+
* @generated from message inco.shield.v2.Uint256
|
|
155
|
+
*/
|
|
156
|
+
export class Uint256 extends Message {
|
|
157
|
+
/**
|
|
158
|
+
* @generated from field: bytes value = 1;
|
|
159
|
+
*/
|
|
160
|
+
value = new Uint8Array(0);
|
|
161
|
+
constructor(data) {
|
|
162
|
+
super();
|
|
163
|
+
proto3.util.initPartial(data, this);
|
|
164
|
+
}
|
|
165
|
+
static runtime = proto3;
|
|
166
|
+
static typeName = "inco.shield.v2.Uint256";
|
|
167
|
+
static fields = proto3.util.newFieldList(() => [
|
|
168
|
+
{ no: 1, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
|
|
169
|
+
]);
|
|
170
|
+
static fromBinary(bytes, options) {
|
|
171
|
+
return new Uint256().fromBinary(bytes, options);
|
|
172
|
+
}
|
|
173
|
+
static fromJson(jsonValue, options) {
|
|
174
|
+
return new Uint256().fromJson(jsonValue, options);
|
|
175
|
+
}
|
|
176
|
+
static fromJsonString(jsonString, options) {
|
|
177
|
+
return new Uint256().fromJsonString(jsonString, options);
|
|
178
|
+
}
|
|
179
|
+
static equals(a, b) {
|
|
180
|
+
return proto3.util.equals(Uint256, a, b);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* EncryptedEnvelope wraps an authenticated payload for the covalidator.
|
|
185
|
+
* The covalidator determines the inner plaintext type from the RPC method being called.
|
|
186
|
+
* The payload is serialized into a protobuf message and encrypted using the TEE's public key.
|
|
187
|
+
*
|
|
188
|
+
* @generated from message inco.shield.v2.EncryptedEnvelope
|
|
189
|
+
*/
|
|
190
|
+
export class EncryptedEnvelope extends Message {
|
|
191
|
+
/**
|
|
192
|
+
* The payload bytes, encrypted using the TEE's public key.
|
|
193
|
+
*
|
|
194
|
+
* @generated from field: bytes payload = 1;
|
|
195
|
+
*/
|
|
196
|
+
payload = new Uint8Array(0);
|
|
197
|
+
constructor(data) {
|
|
198
|
+
super();
|
|
199
|
+
proto3.util.initPartial(data, this);
|
|
200
|
+
}
|
|
201
|
+
static runtime = proto3;
|
|
202
|
+
static typeName = "inco.shield.v2.EncryptedEnvelope";
|
|
203
|
+
static fields = proto3.util.newFieldList(() => [
|
|
204
|
+
{ no: 1, name: "payload", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
|
|
205
|
+
]);
|
|
206
|
+
static fromBinary(bytes, options) {
|
|
207
|
+
return new EncryptedEnvelope().fromBinary(bytes, options);
|
|
208
|
+
}
|
|
209
|
+
static fromJson(jsonValue, options) {
|
|
210
|
+
return new EncryptedEnvelope().fromJson(jsonValue, options);
|
|
211
|
+
}
|
|
212
|
+
static fromJsonString(jsonString, options) {
|
|
213
|
+
return new EncryptedEnvelope().fromJsonString(jsonString, options);
|
|
214
|
+
}
|
|
215
|
+
static equals(a, b) {
|
|
216
|
+
return proto3.util.equals(EncryptedEnvelope, a, b);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* EncryptedResponse wraps a response payload from the covalidator.
|
|
221
|
+
* The response is serialized into a protobuf message and AEAD-encrypted using the caller's response_key.
|
|
222
|
+
* The nonce and ciphertext are always populated.
|
|
223
|
+
*
|
|
224
|
+
* @generated from message inco.shield.v2.EncryptedResponse
|
|
225
|
+
*/
|
|
226
|
+
export class EncryptedResponse extends Message {
|
|
227
|
+
/**
|
|
228
|
+
* The AEAD nonce used to encrypt the response payload.
|
|
229
|
+
*
|
|
230
|
+
* @generated from field: bytes nonce = 1;
|
|
231
|
+
*/
|
|
232
|
+
nonce = new Uint8Array(0);
|
|
233
|
+
/**
|
|
234
|
+
* The AEAD-encrypted serialized response payload.
|
|
235
|
+
*
|
|
236
|
+
* @generated from field: bytes ciphertext = 2;
|
|
237
|
+
*/
|
|
238
|
+
ciphertext = new Uint8Array(0);
|
|
239
|
+
constructor(data) {
|
|
240
|
+
super();
|
|
241
|
+
proto3.util.initPartial(data, this);
|
|
242
|
+
}
|
|
243
|
+
static runtime = proto3;
|
|
244
|
+
static typeName = "inco.shield.v2.EncryptedResponse";
|
|
245
|
+
static fields = proto3.util.newFieldList(() => [
|
|
246
|
+
{ no: 1, name: "nonce", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
|
|
247
|
+
{ no: 2, name: "ciphertext", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
|
|
248
|
+
]);
|
|
249
|
+
static fromBinary(bytes, options) {
|
|
250
|
+
return new EncryptedResponse().fromBinary(bytes, options);
|
|
251
|
+
}
|
|
252
|
+
static fromJson(jsonValue, options) {
|
|
253
|
+
return new EncryptedResponse().fromJson(jsonValue, options);
|
|
254
|
+
}
|
|
255
|
+
static fromJsonString(jsonString, options) {
|
|
256
|
+
return new EncryptedResponse().fromJsonString(jsonString, options);
|
|
257
|
+
}
|
|
258
|
+
static equals(a, b) {
|
|
259
|
+
return proto3.util.equals(EncryptedResponse, a, b);
|
|
260
|
+
}
|
|
261
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IncoShield SDK
|
|
3
|
+
*
|
|
4
|
+
* TypeScript SDK for interacting with IncoShield contracts.
|
|
5
|
+
* Works in both browser and Node.js environments.
|
|
6
|
+
*/
|
|
7
|
+
export { bytesToHex, hexToBytes } from './binary.js';
|
|
8
|
+
export * as contracts from './contracts/index.js';
|
|
9
|
+
export { computeErc20AssetId } from './contracts/utils.js';
|
|
10
|
+
export * from './errors.js';
|
|
11
|
+
export * from './shield/index.js';
|
|
12
|
+
export * as abi from './shield/shield.eip712.gen.js';
|