@rabby-wallet/rabby-api 0.9.57 → 0.9.58-alpha-2

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 CHANGED
@@ -23,6 +23,37 @@ 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
+ };
26
57
  export declare class OpenApiService {
27
58
  #private;
28
59
  store: OpenApiStore;
@@ -43,6 +74,21 @@ export declare class OpenApiService {
43
74
  }) => Promise<any>) | (() => Promise<never>);
44
75
  init: (options?: string | InitOptions) => Promise<void>;
45
76
  initSync(options?: InitOptions): void;
77
+ getSafePendingTransactions: ({ txServiceUrl, safeAddress, nonce, }: GnosisRequestOptions & {
78
+ safeAddress: string;
79
+ } & {
80
+ nonce: number;
81
+ }) => Promise<{
82
+ results: any[];
83
+ }>;
84
+ postSafeTransactions: ({ txServiceUrl, safeAddress, data, }: GnosisPostTransactionOptions) => Promise<void>;
85
+ getSafeInfo: ({ txServiceUrl, safeAddress, }: GnosisSafeRequestOptions) => Promise<any>;
86
+ confirmSafeTransaction: ({ txServiceUrl, safeTransactionHash, data, }: GnosisConfirmTransactionOptions) => Promise<void>;
87
+ getSafeTxGas: ({ txServiceUrl, safeAddress, safeTxData, }: GnosisSafeTxGasOptions) => Promise<string | undefined>;
88
+ getSafeMessages: ({ txServiceUrl, safeAddress, options, }: GnosisGetSafeMessagesOptions) => Promise<{
89
+ results: any[];
90
+ }>;
91
+ addSafeMessage: ({ txServiceUrl, safeAddress, data, }: GnosisAddSafeMessageOptions) => Promise<void>;
46
92
  asyncJob: <T = any>(url: string, options?: AxiosRequestConfig & {
47
93
  retryDelay?: number;
48
94
  }) => Promise<T>;
package/dist/index.js CHANGED
@@ -89,6 +89,43 @@ 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
+ });
92
129
  this.asyncJob = (url, options) => {
93
130
  const _option = Object.assign({ timeout: ASYNC_JOB_TIMEOUT, retryDelay: ASYNC_JOB_RETRY_DELAY }, options);
94
131
  const startTime = +new Date();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/rabby-api",
3
- "version": "0.9.57",
3
+ "version": "0.9.58-alpha-2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [