@avaprotocol/sdk-js 0.6.8 → 0.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -20
- package/dist/index.d.cts +29 -34
- package/dist/index.d.mts +1499 -0
- package/dist/index.d.ts +29 -34
- package/dist/index.js +30 -35
- package/dist/index.mjs +4495 -0
- package/package.json +8 -6
package/dist/index.cjs
CHANGED
|
@@ -4115,23 +4115,6 @@ __export(src_exports, {
|
|
|
4115
4115
|
module.exports = __toCommonJS(src_exports);
|
|
4116
4116
|
var grpc2 = __toESM(require("@grpc/grpc-js"), 1);
|
|
4117
4117
|
|
|
4118
|
-
// src/config.ts
|
|
4119
|
-
var DEFAULT_JWT_EXPIRATION = 24 * 60 * 60;
|
|
4120
|
-
var configs = {
|
|
4121
|
-
development: {
|
|
4122
|
-
AVS_RPC_URL: process.env.AVS_RPC_URL || "localhost:2206"
|
|
4123
|
-
},
|
|
4124
|
-
staging: {
|
|
4125
|
-
AVS_RPC_URL: "aggregator-holesky.avaprotocol.org:2206"
|
|
4126
|
-
},
|
|
4127
|
-
production: {
|
|
4128
|
-
AVS_RPC_URL: "aggregator.avaprotocol.org:2206"
|
|
4129
|
-
}
|
|
4130
|
-
};
|
|
4131
|
-
function getRpcEndpoint(env) {
|
|
4132
|
-
return configs[env].AVS_RPC_URL;
|
|
4133
|
-
}
|
|
4134
|
-
|
|
4135
4118
|
// src/auth.ts
|
|
4136
4119
|
var getKeyRequestMessage = (address, expiredAt) => {
|
|
4137
4120
|
return `key request for ${address} expired at ${expiredAt}`;
|
|
@@ -4446,12 +4429,13 @@ var AggregatorClient = grpc.makeGenericClientConstructor(AggregatorService);
|
|
|
4446
4429
|
init_avs_pb();
|
|
4447
4430
|
var metadata = new grpc2.Metadata();
|
|
4448
4431
|
var BaseClient = class {
|
|
4432
|
+
// protected wallet?: any;
|
|
4449
4433
|
constructor(opts) {
|
|
4450
|
-
this.
|
|
4434
|
+
this.endpoint = opts.endpoint;
|
|
4451
4435
|
this.rpcClient = new AggregatorClient(
|
|
4452
|
-
|
|
4436
|
+
this.endpoint,
|
|
4453
4437
|
// TODO: switch to the TLS after we're able to update all the operator
|
|
4454
|
-
grpc2.
|
|
4438
|
+
grpc2.ChannelCredentials.createInsecure()
|
|
4455
4439
|
);
|
|
4456
4440
|
console.log("this.rpcClient:", this.rpcClient);
|
|
4457
4441
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -3,38 +3,6 @@ import * as jspb from 'google-protobuf';
|
|
|
3
3
|
import * as google_protobuf_timestamp_pb from 'google-protobuf/google/protobuf/timestamp_pb';
|
|
4
4
|
import * as google_protobuf_wrappers_pb from 'google-protobuf/google/protobuf/wrappers_pb';
|
|
5
5
|
|
|
6
|
-
type Environment = "production" | "development" | "staging";
|
|
7
|
-
interface KeyExchangeResp {
|
|
8
|
-
key: string;
|
|
9
|
-
}
|
|
10
|
-
interface ClientOption {
|
|
11
|
-
privateKey?: string;
|
|
12
|
-
jwtApiKey?: string;
|
|
13
|
-
presignSignature?: string;
|
|
14
|
-
signatureExpiredAt?: number;
|
|
15
|
-
env?: Environment;
|
|
16
|
-
owner?: string;
|
|
17
|
-
}
|
|
18
|
-
interface TaskResp {
|
|
19
|
-
id: string;
|
|
20
|
-
status: string;
|
|
21
|
-
result?: any;
|
|
22
|
-
error?: string;
|
|
23
|
-
}
|
|
24
|
-
interface TaskListResp {
|
|
25
|
-
tasks: TaskResp[];
|
|
26
|
-
}
|
|
27
|
-
interface SmartWalletResp {
|
|
28
|
-
address: string;
|
|
29
|
-
smart_account_address: string;
|
|
30
|
-
}
|
|
31
|
-
interface TransactionResp {
|
|
32
|
-
hash: string;
|
|
33
|
-
}
|
|
34
|
-
interface BalanceResp {
|
|
35
|
-
balance: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
6
|
declare const getKeyRequestMessage: (address: string, expiredAt: number) => string;
|
|
39
7
|
|
|
40
8
|
// package: aggregator
|
|
@@ -1487,11 +1455,38 @@ declare class AggregatorClient extends grpc.Client implements IAggregatorClient
|
|
|
1487
1455
|
): grpc.ClientUnaryCall;
|
|
1488
1456
|
}
|
|
1489
1457
|
|
|
1458
|
+
type Environment = "production" | "development" | "staging";
|
|
1459
|
+
interface KeyExchangeResp {
|
|
1460
|
+
key: string;
|
|
1461
|
+
}
|
|
1462
|
+
interface ClientOption {
|
|
1463
|
+
endpoint: string;
|
|
1464
|
+
jwtApiKey?: string;
|
|
1465
|
+
}
|
|
1466
|
+
interface TaskResp {
|
|
1467
|
+
id: string;
|
|
1468
|
+
status: string;
|
|
1469
|
+
result?: any;
|
|
1470
|
+
error?: string;
|
|
1471
|
+
}
|
|
1472
|
+
interface TaskListResp {
|
|
1473
|
+
tasks: TaskResp[];
|
|
1474
|
+
}
|
|
1475
|
+
interface SmartWalletResp {
|
|
1476
|
+
address: string;
|
|
1477
|
+
smart_account_address: string;
|
|
1478
|
+
}
|
|
1479
|
+
interface TransactionResp {
|
|
1480
|
+
hash: string;
|
|
1481
|
+
}
|
|
1482
|
+
interface BalanceResp {
|
|
1483
|
+
balance: string;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1490
1486
|
declare class BaseClient {
|
|
1491
|
-
readonly
|
|
1487
|
+
readonly endpoint: string;
|
|
1492
1488
|
readonly rpcClient: AggregatorClient;
|
|
1493
1489
|
protected authkey?: string;
|
|
1494
|
-
protected wallet?: any;
|
|
1495
1490
|
constructor(opts: ClientOption);
|
|
1496
1491
|
authWithSignature(address: string, signature: string, expiredAtEpoch: number): Promise<KeyExchangeResp>;
|
|
1497
1492
|
isAuthenticated(): boolean;
|