@safe-global/api-kit 4.0.0-alpha.0 → 4.0.1
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/cjs/index.cjs +21 -8
- package/dist/esm/index.mjs +21 -8
- package/dist/src/utils/config.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/cjs/index.cjs
CHANGED
|
@@ -114,28 +114,41 @@ var TRANSACTION_SERVICE_URL = "https://api.safe.global/tx-service";
|
|
|
114
114
|
var networks = [
|
|
115
115
|
{ chainId: 1n, shortName: "eth" },
|
|
116
116
|
{ chainId: 10n, shortName: "oeth" },
|
|
117
|
+
{ chainId: 50n, shortName: "xdc" },
|
|
117
118
|
{ chainId: 56n, shortName: "bnb" },
|
|
118
119
|
{ chainId: 100n, shortName: "gno" },
|
|
119
120
|
{ chainId: 130n, shortName: "unichain" },
|
|
120
121
|
{ chainId: 137n, shortName: "pol" },
|
|
122
|
+
{ chainId: 143n, shortName: "monad" },
|
|
121
123
|
{ chainId: 146n, shortName: "sonic" },
|
|
122
124
|
{ chainId: 196n, shortName: "okb" },
|
|
125
|
+
{ chainId: 204n, shortName: "opbnb" },
|
|
123
126
|
{ chainId: 232n, shortName: "lens" },
|
|
124
127
|
{ chainId: 324n, shortName: "zksync" },
|
|
125
128
|
{ chainId: 480n, shortName: "wc" },
|
|
129
|
+
{ chainId: 988n, shortName: "stable" },
|
|
130
|
+
{ chainId: 999n, shortName: "hyper" },
|
|
126
131
|
{ chainId: 1101n, shortName: "zkevm" },
|
|
132
|
+
{ chainId: 3338n, shortName: "peaq" },
|
|
133
|
+
{ chainId: 3637n, shortName: "btc" },
|
|
127
134
|
{ chainId: 5000n, shortName: "mantle" },
|
|
128
135
|
{ chainId: 8453n, shortName: "base" },
|
|
136
|
+
{ chainId: 9745n, shortName: "plasma" },
|
|
137
|
+
{ chainId: 10143n, shortName: "monad-testnet" },
|
|
129
138
|
{ chainId: 10200n, shortName: "chi" },
|
|
139
|
+
{ chainId: 16661n, shortName: "0g" },
|
|
130
140
|
{ chainId: 42161n, shortName: "arb1" },
|
|
141
|
+
{ chainId: 42220n, shortName: "celo" },
|
|
131
142
|
{ chainId: 43111n, shortName: "hemi" },
|
|
143
|
+
{ chainId: 43114n, shortName: "avax" },
|
|
132
144
|
{ chainId: 57073n, shortName: "ink" },
|
|
133
|
-
{ chainId: 80094n, shortName: "berachain" },
|
|
134
145
|
{ chainId: 59144n, shortName: "linea" },
|
|
135
|
-
{ chainId:
|
|
136
|
-
{ chainId:
|
|
146
|
+
{ chainId: 80069n, shortName: "bep" },
|
|
147
|
+
{ chainId: 80094n, shortName: "berachain" },
|
|
148
|
+
{ chainId: 81224n, shortName: "codex" },
|
|
137
149
|
{ chainId: 84532n, shortName: "basesep" },
|
|
138
150
|
{ chainId: 534352n, shortName: "scr" },
|
|
151
|
+
{ chainId: 747474n, shortName: "katana" },
|
|
139
152
|
{ chainId: 11155111n, shortName: "sep" },
|
|
140
153
|
{ chainId: 1313161554n, shortName: "aurora" }
|
|
141
154
|
];
|
|
@@ -522,7 +535,7 @@ var SafeApiKit = class {
|
|
|
522
535
|
throw new Error("Invalid safeTxHash");
|
|
523
536
|
}
|
|
524
537
|
return this.#api({
|
|
525
|
-
url: `${this.#txServiceBaseUrl}/
|
|
538
|
+
url: `${this.#txServiceBaseUrl}/v2/multisig-transactions/${safeTxHash}/`,
|
|
526
539
|
method: "get" /* Get */
|
|
527
540
|
});
|
|
528
541
|
}
|
|
@@ -667,7 +680,7 @@ var SafeApiKit = class {
|
|
|
667
680
|
throw new Error("Invalid safeTxHash");
|
|
668
681
|
}
|
|
669
682
|
return this.#api({
|
|
670
|
-
url: `${this.#txServiceBaseUrl}/
|
|
683
|
+
url: `${this.#txServiceBaseUrl}/v2/safes/${safe}/multisig-transactions/`,
|
|
671
684
|
method: "post" /* Post */,
|
|
672
685
|
body: {
|
|
673
686
|
...safeTransactionData,
|
|
@@ -735,7 +748,7 @@ var SafeApiKit = class {
|
|
|
735
748
|
throw new Error("Invalid Safe address");
|
|
736
749
|
}
|
|
737
750
|
const { address } = this.#getEip3770Address(safeAddress);
|
|
738
|
-
const url = new URL(`${this.#txServiceBaseUrl}/
|
|
751
|
+
const url = new URL(`${this.#txServiceBaseUrl}/v2/safes/${address}/multisig-transactions/`);
|
|
739
752
|
this.#addUrlQueryParams(url, options);
|
|
740
753
|
return this.#api({
|
|
741
754
|
url: url.toString(),
|
|
@@ -760,7 +773,7 @@ var SafeApiKit = class {
|
|
|
760
773
|
const { address } = this.#getEip3770Address(safeAddress);
|
|
761
774
|
const nonce = currentNonce ? currentNonce : (await this.getSafeInfo(address)).nonce;
|
|
762
775
|
const url = new URL(
|
|
763
|
-
`${this.#txServiceBaseUrl}/
|
|
776
|
+
`${this.#txServiceBaseUrl}/v2/safes/${address}/multisig-transactions/?executed=false&nonce__gte=${nonce}`
|
|
764
777
|
);
|
|
765
778
|
if (hasConfirmations) {
|
|
766
779
|
url.searchParams.set("has_confirmations", hasConfirmations.toString());
|
|
@@ -794,7 +807,7 @@ var SafeApiKit = class {
|
|
|
794
807
|
throw new Error("Invalid Safe address");
|
|
795
808
|
}
|
|
796
809
|
const { address } = this.#getEip3770Address(safeAddress);
|
|
797
|
-
const url = new URL(`${this.#txServiceBaseUrl}/
|
|
810
|
+
const url = new URL(`${this.#txServiceBaseUrl}/v2/safes/${address}/all-transactions/`);
|
|
798
811
|
this.#addUrlQueryParams(url, options);
|
|
799
812
|
return this.#api({
|
|
800
813
|
url: url.toString(),
|
package/dist/esm/index.mjs
CHANGED
|
@@ -78,28 +78,41 @@ var TRANSACTION_SERVICE_URL = "https://api.safe.global/tx-service";
|
|
|
78
78
|
var networks = [
|
|
79
79
|
{ chainId: 1n, shortName: "eth" },
|
|
80
80
|
{ chainId: 10n, shortName: "oeth" },
|
|
81
|
+
{ chainId: 50n, shortName: "xdc" },
|
|
81
82
|
{ chainId: 56n, shortName: "bnb" },
|
|
82
83
|
{ chainId: 100n, shortName: "gno" },
|
|
83
84
|
{ chainId: 130n, shortName: "unichain" },
|
|
84
85
|
{ chainId: 137n, shortName: "pol" },
|
|
86
|
+
{ chainId: 143n, shortName: "monad" },
|
|
85
87
|
{ chainId: 146n, shortName: "sonic" },
|
|
86
88
|
{ chainId: 196n, shortName: "okb" },
|
|
89
|
+
{ chainId: 204n, shortName: "opbnb" },
|
|
87
90
|
{ chainId: 232n, shortName: "lens" },
|
|
88
91
|
{ chainId: 324n, shortName: "zksync" },
|
|
89
92
|
{ chainId: 480n, shortName: "wc" },
|
|
93
|
+
{ chainId: 988n, shortName: "stable" },
|
|
94
|
+
{ chainId: 999n, shortName: "hyper" },
|
|
90
95
|
{ chainId: 1101n, shortName: "zkevm" },
|
|
96
|
+
{ chainId: 3338n, shortName: "peaq" },
|
|
97
|
+
{ chainId: 3637n, shortName: "btc" },
|
|
91
98
|
{ chainId: 5000n, shortName: "mantle" },
|
|
92
99
|
{ chainId: 8453n, shortName: "base" },
|
|
100
|
+
{ chainId: 9745n, shortName: "plasma" },
|
|
101
|
+
{ chainId: 10143n, shortName: "monad-testnet" },
|
|
93
102
|
{ chainId: 10200n, shortName: "chi" },
|
|
103
|
+
{ chainId: 16661n, shortName: "0g" },
|
|
94
104
|
{ chainId: 42161n, shortName: "arb1" },
|
|
105
|
+
{ chainId: 42220n, shortName: "celo" },
|
|
95
106
|
{ chainId: 43111n, shortName: "hemi" },
|
|
107
|
+
{ chainId: 43114n, shortName: "avax" },
|
|
96
108
|
{ chainId: 57073n, shortName: "ink" },
|
|
97
|
-
{ chainId: 80094n, shortName: "berachain" },
|
|
98
109
|
{ chainId: 59144n, shortName: "linea" },
|
|
99
|
-
{ chainId:
|
|
100
|
-
{ chainId:
|
|
110
|
+
{ chainId: 80069n, shortName: "bep" },
|
|
111
|
+
{ chainId: 80094n, shortName: "berachain" },
|
|
112
|
+
{ chainId: 81224n, shortName: "codex" },
|
|
101
113
|
{ chainId: 84532n, shortName: "basesep" },
|
|
102
114
|
{ chainId: 534352n, shortName: "scr" },
|
|
115
|
+
{ chainId: 747474n, shortName: "katana" },
|
|
103
116
|
{ chainId: 11155111n, shortName: "sep" },
|
|
104
117
|
{ chainId: 1313161554n, shortName: "aurora" }
|
|
105
118
|
];
|
|
@@ -486,7 +499,7 @@ var SafeApiKit = class {
|
|
|
486
499
|
throw new Error("Invalid safeTxHash");
|
|
487
500
|
}
|
|
488
501
|
return this.#api({
|
|
489
|
-
url: `${this.#txServiceBaseUrl}/
|
|
502
|
+
url: `${this.#txServiceBaseUrl}/v2/multisig-transactions/${safeTxHash}/`,
|
|
490
503
|
method: "get" /* Get */
|
|
491
504
|
});
|
|
492
505
|
}
|
|
@@ -631,7 +644,7 @@ var SafeApiKit = class {
|
|
|
631
644
|
throw new Error("Invalid safeTxHash");
|
|
632
645
|
}
|
|
633
646
|
return this.#api({
|
|
634
|
-
url: `${this.#txServiceBaseUrl}/
|
|
647
|
+
url: `${this.#txServiceBaseUrl}/v2/safes/${safe}/multisig-transactions/`,
|
|
635
648
|
method: "post" /* Post */,
|
|
636
649
|
body: {
|
|
637
650
|
...safeTransactionData,
|
|
@@ -699,7 +712,7 @@ var SafeApiKit = class {
|
|
|
699
712
|
throw new Error("Invalid Safe address");
|
|
700
713
|
}
|
|
701
714
|
const { address } = this.#getEip3770Address(safeAddress);
|
|
702
|
-
const url = new URL(`${this.#txServiceBaseUrl}/
|
|
715
|
+
const url = new URL(`${this.#txServiceBaseUrl}/v2/safes/${address}/multisig-transactions/`);
|
|
703
716
|
this.#addUrlQueryParams(url, options);
|
|
704
717
|
return this.#api({
|
|
705
718
|
url: url.toString(),
|
|
@@ -724,7 +737,7 @@ var SafeApiKit = class {
|
|
|
724
737
|
const { address } = this.#getEip3770Address(safeAddress);
|
|
725
738
|
const nonce = currentNonce ? currentNonce : (await this.getSafeInfo(address)).nonce;
|
|
726
739
|
const url = new URL(
|
|
727
|
-
`${this.#txServiceBaseUrl}/
|
|
740
|
+
`${this.#txServiceBaseUrl}/v2/safes/${address}/multisig-transactions/?executed=false&nonce__gte=${nonce}`
|
|
728
741
|
);
|
|
729
742
|
if (hasConfirmations) {
|
|
730
743
|
url.searchParams.set("has_confirmations", hasConfirmations.toString());
|
|
@@ -758,7 +771,7 @@ var SafeApiKit = class {
|
|
|
758
771
|
throw new Error("Invalid Safe address");
|
|
759
772
|
}
|
|
760
773
|
const { address } = this.#getEip3770Address(safeAddress);
|
|
761
|
-
const url = new URL(`${this.#txServiceBaseUrl}/
|
|
774
|
+
const url = new URL(`${this.#txServiceBaseUrl}/v2/safes/${address}/all-transactions/`);
|
|
762
775
|
this.#addUrlQueryParams(url, options);
|
|
763
776
|
return this.#api({
|
|
764
777
|
url: url.toString(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/utils/config.ts"],"names":[],"mappings":"AAEA,KAAK,gBAAgB,GAAG;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/utils/config.ts"],"names":[],"mappings":"AAEA,KAAK,gBAAgB,GAAG;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,gBAAgB,EAwCtC,CAAA;AAED,eAAO,MAAM,mBAAmB,YAAa,MAAM,KAAG,MAMrD,CAAA;AAED,eAAO,MAAM,wBAAwB,YAAa,MAAM,WAEvD,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@safe-global/api-kit",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "SDK that facilitates the interaction with the Safe Transaction Service API",
|
|
5
5
|
"types": "dist/src/index.d.ts",
|
|
6
6
|
"main": "dist/cjs/index.cjs",
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
],
|
|
47
47
|
"homepage": "https://github.com/safe-global/safe-core-sdk#readme",
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@safe-global/relay-kit": "^4.
|
|
50
|
-
"@safe-global/testing-kit": "^0.2.
|
|
49
|
+
"@safe-global/relay-kit": "^4.1.1",
|
|
50
|
+
"@safe-global/testing-kit": "^0.2.2",
|
|
51
51
|
"@types/chai": "^4.3.20",
|
|
52
52
|
"@types/chai-as-promised": "^7.1.8",
|
|
53
53
|
"@types/mocha": "^10.0.10",
|
|
54
54
|
"@types/node-fetch": "^2.6.12",
|
|
55
|
-
"@types/semver": "^7.
|
|
55
|
+
"@types/semver": "^7.7.0",
|
|
56
56
|
"@types/sinon": "^17.0.4",
|
|
57
57
|
"chai": "^4.5.0",
|
|
58
58
|
"chai-as-promised": "^7.1.2",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"tsconfig-paths": "^4.2.0"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@safe-global/protocol-kit": "^6.
|
|
69
|
-
"@safe-global/types-kit": "^
|
|
68
|
+
"@safe-global/protocol-kit": "^6.1.2",
|
|
69
|
+
"@safe-global/types-kit": "^3.0.0",
|
|
70
70
|
"node-fetch": "^2.7.0",
|
|
71
71
|
"viem": "^2.21.8"
|
|
72
72
|
}
|