@credenza3/contracts-lib-sui 0.2.4 → 0.2.6
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/client/CredenzaSuiClient.d.ts +7 -4
- package/dist/cjs/client/index.cjs +28 -21
- package/dist/cjs/client/index.cjs.map +3 -3
- package/dist/esm/client/CredenzaSuiClient.d.ts +7 -4
- package/dist/esm/client/index.mjs +28 -21
- package/dist/esm/client/index.mjs.map +3 -3
- package/dist/umd/client/index.js +22 -22
- package/dist/umd/client/index.js.map +3 -3
- package/package.json +1 -1
|
@@ -5,10 +5,10 @@ import { SuiGrpcClient } from '@mysten/sui/grpc';
|
|
|
5
5
|
import type { CredenzaSuiSigner } from '../signer/CredenzaSuiSigner';
|
|
6
6
|
import { SuiGraphqlClient } from './SuiGraphqlClient';
|
|
7
7
|
import { SuiClientTypes } from '@mysten/sui/client';
|
|
8
|
-
export type
|
|
9
|
-
|
|
8
|
+
export type SuiTransactionResult = SuiClientTypes.Transaction<{
|
|
9
|
+
effects: true;
|
|
10
|
+
events: true;
|
|
10
11
|
}>;
|
|
11
|
-
export type SuiTransactionResult = SuiClientTypes.Transaction;
|
|
12
12
|
export declare const ENVIRONMENT_RPC: {
|
|
13
13
|
DEVNET: string;
|
|
14
14
|
TESTNET: string;
|
|
@@ -57,7 +57,10 @@ export declare class CredenzaSuiClient {
|
|
|
57
57
|
getSignerAddress(): string;
|
|
58
58
|
getPackageId(): string;
|
|
59
59
|
signTransaction(tx: Transaction): Promise<SignatureWithBytes>;
|
|
60
|
-
executeTransaction(signatureWithBytes:
|
|
60
|
+
executeTransaction(signatureWithBytes: {
|
|
61
|
+
bytes: string;
|
|
62
|
+
signature: string | string[];
|
|
63
|
+
}): Promise<SuiClientTypes.Transaction<{
|
|
61
64
|
effects: true;
|
|
62
65
|
events: true;
|
|
63
66
|
}>>;
|
|
@@ -35,8 +35,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
35
35
|
// node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isArray.js
|
|
36
36
|
var require_isArray = __commonJS({
|
|
37
37
|
"node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/isArray.js"(exports, module2) {
|
|
38
|
-
var
|
|
39
|
-
module2.exports =
|
|
38
|
+
var isArray2 = Array.isArray;
|
|
39
|
+
module2.exports = isArray2;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
|
|
@@ -153,12 +153,12 @@ var require_isSymbol = __commonJS({
|
|
|
153
153
|
// node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_isKey.js
|
|
154
154
|
var require_isKey = __commonJS({
|
|
155
155
|
"node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_isKey.js"(exports, module2) {
|
|
156
|
-
var
|
|
156
|
+
var isArray2 = require_isArray();
|
|
157
157
|
var isSymbol = require_isSymbol();
|
|
158
158
|
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
|
|
159
159
|
var reIsPlainProp = /^\w*$/;
|
|
160
160
|
function isKey(value, object) {
|
|
161
|
-
if (
|
|
161
|
+
if (isArray2(value)) {
|
|
162
162
|
return false;
|
|
163
163
|
}
|
|
164
164
|
var type = typeof value;
|
|
@@ -741,7 +741,7 @@ var require_baseToString = __commonJS({
|
|
|
741
741
|
"node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_baseToString.js"(exports, module2) {
|
|
742
742
|
var Symbol2 = require_Symbol();
|
|
743
743
|
var arrayMap = require_arrayMap();
|
|
744
|
-
var
|
|
744
|
+
var isArray2 = require_isArray();
|
|
745
745
|
var isSymbol = require_isSymbol();
|
|
746
746
|
var INFINITY = 1 / 0;
|
|
747
747
|
var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
|
|
@@ -750,7 +750,7 @@ var require_baseToString = __commonJS({
|
|
|
750
750
|
if (typeof value == "string") {
|
|
751
751
|
return value;
|
|
752
752
|
}
|
|
753
|
-
if (
|
|
753
|
+
if (isArray2(value)) {
|
|
754
754
|
return arrayMap(value, baseToString) + "";
|
|
755
755
|
}
|
|
756
756
|
if (isSymbol(value)) {
|
|
@@ -777,12 +777,12 @@ var require_toString = __commonJS({
|
|
|
777
777
|
// node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_castPath.js
|
|
778
778
|
var require_castPath = __commonJS({
|
|
779
779
|
"node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_castPath.js"(exports, module2) {
|
|
780
|
-
var
|
|
780
|
+
var isArray2 = require_isArray();
|
|
781
781
|
var isKey = require_isKey();
|
|
782
782
|
var stringToPath = require_stringToPath();
|
|
783
783
|
var toString = require_toString();
|
|
784
784
|
function castPath(value, object) {
|
|
785
|
-
if (
|
|
785
|
+
if (isArray2(value)) {
|
|
786
786
|
return value;
|
|
787
787
|
}
|
|
788
788
|
return isKey(value, object) ? [value] : stringToPath(toString(value));
|
|
@@ -2852,14 +2852,14 @@ var require_arrayLikeKeys = __commonJS({
|
|
|
2852
2852
|
"node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_arrayLikeKeys.js"(exports, module2) {
|
|
2853
2853
|
var baseTimes = require_baseTimes();
|
|
2854
2854
|
var isArguments = require_isArguments();
|
|
2855
|
-
var
|
|
2855
|
+
var isArray2 = require_isArray();
|
|
2856
2856
|
var isBuffer = require_isBuffer();
|
|
2857
2857
|
var isIndex = require_isIndex();
|
|
2858
2858
|
var isTypedArray = require_isTypedArray();
|
|
2859
2859
|
var objectProto = Object.prototype;
|
|
2860
2860
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2861
2861
|
function arrayLikeKeys(value, inherited) {
|
|
2862
|
-
var isArr =
|
|
2862
|
+
var isArr = isArray2(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
|
|
2863
2863
|
for (var key in value) {
|
|
2864
2864
|
if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
2865
2865
|
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
@@ -3363,10 +3363,10 @@ var require_arrayPush = __commonJS({
|
|
|
3363
3363
|
var require_baseGetAllKeys = __commonJS({
|
|
3364
3364
|
"node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_baseGetAllKeys.js"(exports, module2) {
|
|
3365
3365
|
var arrayPush = require_arrayPush();
|
|
3366
|
-
var
|
|
3366
|
+
var isArray2 = require_isArray();
|
|
3367
3367
|
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
3368
3368
|
var result = keysFunc(object);
|
|
3369
|
-
return
|
|
3369
|
+
return isArray2(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
3370
3370
|
}
|
|
3371
3371
|
module2.exports = baseGetAllKeys;
|
|
3372
3372
|
}
|
|
@@ -3564,7 +3564,7 @@ var require_baseIsEqualDeep = __commonJS({
|
|
|
3564
3564
|
var equalByTag = require_equalByTag();
|
|
3565
3565
|
var equalObjects = require_equalObjects();
|
|
3566
3566
|
var getTag = require_getTag();
|
|
3567
|
-
var
|
|
3567
|
+
var isArray2 = require_isArray();
|
|
3568
3568
|
var isBuffer = require_isBuffer();
|
|
3569
3569
|
var isTypedArray = require_isTypedArray();
|
|
3570
3570
|
var COMPARE_PARTIAL_FLAG = 1;
|
|
@@ -3574,7 +3574,7 @@ var require_baseIsEqualDeep = __commonJS({
|
|
|
3574
3574
|
var objectProto = Object.prototype;
|
|
3575
3575
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
3576
3576
|
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
3577
|
-
var objIsArr =
|
|
3577
|
+
var objIsArr = isArray2(object), othIsArr = isArray2(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
|
|
3578
3578
|
objTag = objTag == argsTag ? objectTag : objTag;
|
|
3579
3579
|
othTag = othTag == argsTag ? objectTag : othTag;
|
|
3580
3580
|
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
|
|
@@ -3744,7 +3744,7 @@ var require_hasPath = __commonJS({
|
|
|
3744
3744
|
"node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/_hasPath.js"(exports, module2) {
|
|
3745
3745
|
var castPath = require_castPath();
|
|
3746
3746
|
var isArguments = require_isArguments();
|
|
3747
|
-
var
|
|
3747
|
+
var isArray2 = require_isArray();
|
|
3748
3748
|
var isIndex = require_isIndex();
|
|
3749
3749
|
var isLength = require_isLength();
|
|
3750
3750
|
var toKey = require_toKey();
|
|
@@ -3762,7 +3762,7 @@ var require_hasPath = __commonJS({
|
|
|
3762
3762
|
return result;
|
|
3763
3763
|
}
|
|
3764
3764
|
length = object == null ? 0 : object.length;
|
|
3765
|
-
return !!length && isLength(length) && isIndex(key, length) && (
|
|
3765
|
+
return !!length && isLength(length) && isIndex(key, length) && (isArray2(object) || isArguments(object));
|
|
3766
3766
|
}
|
|
3767
3767
|
module2.exports = hasPath;
|
|
3768
3768
|
}
|
|
@@ -3860,7 +3860,7 @@ var require_baseIteratee = __commonJS({
|
|
|
3860
3860
|
var baseMatches = require_baseMatches();
|
|
3861
3861
|
var baseMatchesProperty = require_baseMatchesProperty();
|
|
3862
3862
|
var identity = require_identity();
|
|
3863
|
-
var
|
|
3863
|
+
var isArray2 = require_isArray();
|
|
3864
3864
|
var property = require_property();
|
|
3865
3865
|
function baseIteratee(value) {
|
|
3866
3866
|
if (typeof value == "function") {
|
|
@@ -3870,7 +3870,7 @@ var require_baseIteratee = __commonJS({
|
|
|
3870
3870
|
return identity;
|
|
3871
3871
|
}
|
|
3872
3872
|
if (typeof value == "object") {
|
|
3873
|
-
return
|
|
3873
|
+
return isArray2(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
|
|
3874
3874
|
}
|
|
3875
3875
|
return property(value);
|
|
3876
3876
|
}
|
|
@@ -3884,9 +3884,9 @@ var require_filter = __commonJS({
|
|
|
3884
3884
|
var arrayFilter = require_arrayFilter();
|
|
3885
3885
|
var baseFilter = require_baseFilter();
|
|
3886
3886
|
var baseIteratee = require_baseIteratee();
|
|
3887
|
-
var
|
|
3887
|
+
var isArray2 = require_isArray();
|
|
3888
3888
|
function filter3(collection, predicate) {
|
|
3889
|
-
var func =
|
|
3889
|
+
var func = isArray2(collection) ? arrayFilter : baseFilter;
|
|
3890
3890
|
return func(collection, baseIteratee(predicate, 3));
|
|
3891
3891
|
}
|
|
3892
3892
|
module2.exports = filter3;
|
|
@@ -9133,6 +9133,7 @@ var SuiGraphqlClient = class {
|
|
|
9133
9133
|
|
|
9134
9134
|
// src/client/CredenzaSuiClient.ts
|
|
9135
9135
|
var import_filter2 = __toESM(require_filter());
|
|
9136
|
+
var import_isArray = __toESM(require_isArray());
|
|
9136
9137
|
var ENVIRONMENT_RPC = {
|
|
9137
9138
|
DEVNET: "https://fullnode.devnet.sui.io:443",
|
|
9138
9139
|
TESTNET: "https://fullnode.testnet.sui.io:443",
|
|
@@ -9193,9 +9194,15 @@ var CredenzaSuiClient = class {
|
|
|
9193
9194
|
return await this.options.signer.signTransaction(txBytes);
|
|
9194
9195
|
}
|
|
9195
9196
|
async executeTransaction(signatureWithBytes) {
|
|
9197
|
+
let signatures;
|
|
9198
|
+
if (!(0, import_isArray.default)(signatureWithBytes.signature)) {
|
|
9199
|
+
signatures = [signatureWithBytes.signature];
|
|
9200
|
+
} else {
|
|
9201
|
+
signatures = signatureWithBytes.signature;
|
|
9202
|
+
}
|
|
9196
9203
|
const res = await this.suiGrpcClient.executeTransaction({
|
|
9197
9204
|
transaction: import_buffer2.Buffer.from(signatureWithBytes.bytes, "base64"),
|
|
9198
|
-
signatures
|
|
9205
|
+
signatures,
|
|
9199
9206
|
include: {
|
|
9200
9207
|
effects: true,
|
|
9201
9208
|
events: true
|