@rabby-wallet/rabby-api 0.9.58-beta.3 → 0.9.58
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.d.ts +55 -0
- package/dist/index.js +46 -0
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,44 @@ declare type VersionPrefix = 'v1' | 'v2';
|
|
|
23
23
|
declare type ApiOptions<V extends VersionPrefix | void = VersionPrefix> = {
|
|
24
24
|
restfulPrefix?: V;
|
|
25
25
|
};
|
|
26
|
+
declare type GnosisRequestOptions = {
|
|
27
|
+
txServiceUrl: string;
|
|
28
|
+
};
|
|
29
|
+
declare type GnosisSafeRequestOptions = GnosisRequestOptions & {
|
|
30
|
+
safeAddress: string;
|
|
31
|
+
};
|
|
32
|
+
declare type GnosisPostTransactionOptions = GnosisSafeRequestOptions & {
|
|
33
|
+
data: Record<string, any>;
|
|
34
|
+
};
|
|
35
|
+
declare type GnosisConfirmTransactionOptions = GnosisRequestOptions & {
|
|
36
|
+
safeTransactionHash: string;
|
|
37
|
+
data: Record<string, any>;
|
|
38
|
+
};
|
|
39
|
+
declare type GnosisSafeTxGasOptions = GnosisSafeRequestOptions & {
|
|
40
|
+
safeTxData: {
|
|
41
|
+
to: string;
|
|
42
|
+
value?: string;
|
|
43
|
+
data?: string | null;
|
|
44
|
+
operation?: number;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
declare type GnosisGetSafeMessagesOptions = GnosisSafeRequestOptions & {
|
|
48
|
+
options?: Record<string, any>;
|
|
49
|
+
};
|
|
50
|
+
declare type GnosisAddSafeMessageOptions = GnosisSafeRequestOptions & {
|
|
51
|
+
data: {
|
|
52
|
+
message: string | Record<string, any>;
|
|
53
|
+
signature: string;
|
|
54
|
+
safeAppId?: number;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
declare type GnosisGetSafeMessageOptions = GnosisRequestOptions & {
|
|
58
|
+
messageHash: string;
|
|
59
|
+
};
|
|
60
|
+
declare type GnosisAddSafeMessageSignatureOptions = GnosisRequestOptions & {
|
|
61
|
+
messageHash: string;
|
|
62
|
+
signature: string;
|
|
63
|
+
};
|
|
26
64
|
export declare class OpenApiService {
|
|
27
65
|
#private;
|
|
28
66
|
store: OpenApiStore;
|
|
@@ -43,6 +81,23 @@ export declare class OpenApiService {
|
|
|
43
81
|
}) => Promise<any>) | (() => Promise<never>);
|
|
44
82
|
init: (options?: string | InitOptions) => Promise<void>;
|
|
45
83
|
initSync(options?: InitOptions): void;
|
|
84
|
+
getSafePendingTransactions: ({ txServiceUrl, safeAddress, nonce, }: GnosisRequestOptions & {
|
|
85
|
+
safeAddress: string;
|
|
86
|
+
} & {
|
|
87
|
+
nonce: number;
|
|
88
|
+
}) => Promise<{
|
|
89
|
+
results: any[];
|
|
90
|
+
}>;
|
|
91
|
+
postSafeTransactions: ({ txServiceUrl, safeAddress, data, }: GnosisPostTransactionOptions) => Promise<void>;
|
|
92
|
+
getSafeInfo: ({ txServiceUrl, safeAddress, }: GnosisSafeRequestOptions) => Promise<any>;
|
|
93
|
+
confirmSafeTransaction: ({ txServiceUrl, safeTransactionHash, data, }: GnosisConfirmTransactionOptions) => Promise<void>;
|
|
94
|
+
getSafeTxGas: ({ txServiceUrl, safeAddress, safeTxData, }: GnosisSafeTxGasOptions) => Promise<string | undefined>;
|
|
95
|
+
getSafeMessages: ({ txServiceUrl, safeAddress, options, }: GnosisGetSafeMessagesOptions) => Promise<{
|
|
96
|
+
results: any[];
|
|
97
|
+
}>;
|
|
98
|
+
addSafeMessage: ({ txServiceUrl, safeAddress, data, }: GnosisAddSafeMessageOptions) => Promise<void>;
|
|
99
|
+
getSafeMessage: ({ txServiceUrl, messageHash, }: GnosisGetSafeMessageOptions) => Promise<any>;
|
|
100
|
+
addSafeMessageSignature: ({ txServiceUrl, messageHash, signature, }: GnosisAddSafeMessageSignatureOptions) => Promise<void>;
|
|
46
101
|
asyncJob: <T = any>(url: string, options?: AxiosRequestConfig & {
|
|
47
102
|
retryDelay?: number;
|
|
48
103
|
}) => Promise<T>;
|
package/dist/index.js
CHANGED
|
@@ -89,6 +89,52 @@ export class OpenApiService {
|
|
|
89
89
|
yield ((_d = (_c = __classPrivateFieldGet(this, _OpenApiService_plugin, "f")).onInitiateAsync) === null || _d === void 0 ? void 0 : _d.call(_c, Object.assign({}, options)));
|
|
90
90
|
this.initSync(Object.assign({}, options));
|
|
91
91
|
});
|
|
92
|
+
this.getSafePendingTransactions = ({ txServiceUrl, safeAddress, nonce, }) => __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
const { data } = yield this.request.get(`${txServiceUrl}/v1/safes/${safeAddress}/multisig-transactions/`, {
|
|
94
|
+
params: {
|
|
95
|
+
executed: false,
|
|
96
|
+
nonce__gte: nonce,
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
return data;
|
|
100
|
+
});
|
|
101
|
+
this.postSafeTransactions = ({ txServiceUrl, safeAddress, data, }) => __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
yield this.request.post(`${txServiceUrl}/v1/safes/${safeAddress}/multisig-transactions/`, data);
|
|
103
|
+
});
|
|
104
|
+
this.getSafeInfo = ({ txServiceUrl, safeAddress, }) => __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
const { data } = yield this.request.get(`${txServiceUrl}/v1/safes/${safeAddress}/`);
|
|
106
|
+
return data;
|
|
107
|
+
});
|
|
108
|
+
this.confirmSafeTransaction = ({ txServiceUrl, safeTransactionHash, data, }) => __awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
yield this.request.post(`${txServiceUrl}/v1/multisig-transactions/${safeTransactionHash}/confirmations/`, data);
|
|
110
|
+
});
|
|
111
|
+
this.getSafeTxGas = ({ txServiceUrl, safeAddress, safeTxData, }) => __awaiter(this, void 0, void 0, function* () {
|
|
112
|
+
const { data } = yield this.request.post(`${txServiceUrl}/v1/safes/${safeAddress}/multisig-transactions/estimations/`, {
|
|
113
|
+
to: safeTxData.to,
|
|
114
|
+
value: safeTxData.value || '0',
|
|
115
|
+
data: safeTxData.data,
|
|
116
|
+
operation: safeTxData.operation,
|
|
117
|
+
});
|
|
118
|
+
return data === null || data === void 0 ? void 0 : data.safeTxGas;
|
|
119
|
+
});
|
|
120
|
+
this.getSafeMessages = ({ txServiceUrl, safeAddress, options, }) => __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
const { data } = yield this.request.get(`${txServiceUrl}/v1/safes/${safeAddress}/messages/`, {
|
|
122
|
+
params: options,
|
|
123
|
+
});
|
|
124
|
+
return data;
|
|
125
|
+
});
|
|
126
|
+
this.addSafeMessage = ({ txServiceUrl, safeAddress, data, }) => __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
yield this.request.post(`${txServiceUrl}/v1/safes/${safeAddress}/messages/`, data);
|
|
128
|
+
});
|
|
129
|
+
this.getSafeMessage = ({ txServiceUrl, messageHash, }) => __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
const { data } = yield this.request.get(`${txServiceUrl}/v1/messages/${messageHash}/`);
|
|
131
|
+
return data;
|
|
132
|
+
});
|
|
133
|
+
this.addSafeMessageSignature = ({ txServiceUrl, messageHash, signature, }) => __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
yield this.request.post(`${txServiceUrl}/v1/messages/${messageHash}/signatures/`, {
|
|
135
|
+
signature,
|
|
136
|
+
});
|
|
137
|
+
});
|
|
92
138
|
this.asyncJob = (url, options) => {
|
|
93
139
|
const _option = Object.assign({ timeout: ASYNC_JOB_TIMEOUT, retryDelay: ASYNC_JOB_RETRY_DELAY }, options);
|
|
94
140
|
const startTime = +new Date();
|
package/dist/types.d.ts
CHANGED
|
@@ -2681,6 +2681,7 @@ export interface TokenMarketTokenItem {
|
|
|
2681
2681
|
price_24h_change: number;
|
|
2682
2682
|
volume_24h: number;
|
|
2683
2683
|
fdv: number;
|
|
2684
|
+
identity?: TokenEntityDetail;
|
|
2684
2685
|
launchpad: TokenMarketTokenRelatedItem | null;
|
|
2685
2686
|
asset: TokenMarketTokenRelatedItem | null;
|
|
2686
2687
|
}
|