@pooflabs/core 0.0.44 → 0.0.46

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.
@@ -1015,7 +1015,7 @@ export type Tarobase = {
1015
1015
  "type": {
1016
1016
  "vec": {
1017
1017
  "defined": {
1018
- "name": "txData";
1018
+ "name": "txDataV1";
1019
1019
  };
1020
1020
  };
1021
1021
  };
@@ -1049,6 +1049,118 @@ export type Tarobase = {
1049
1049
  "address": "11111111111111111111111111111111";
1050
1050
  }
1051
1051
  ];
1052
+ "args": [
1053
+ {
1054
+ "name": "appId";
1055
+ "type": "string";
1056
+ },
1057
+ {
1058
+ "name": "documents";
1059
+ "type": {
1060
+ "vec": {
1061
+ "defined": {
1062
+ "name": "setDocumentData";
1063
+ };
1064
+ };
1065
+ };
1066
+ },
1067
+ {
1068
+ "name": "deletePaths";
1069
+ "type": {
1070
+ "vec": "string";
1071
+ };
1072
+ },
1073
+ {
1074
+ "name": "txData";
1075
+ "type": {
1076
+ "vec": {
1077
+ "defined": {
1078
+ "name": "txDataV1";
1079
+ };
1080
+ };
1081
+ };
1082
+ }
1083
+ ];
1084
+ },
1085
+ {
1086
+ "name": "setDocumentsNoUserV2";
1087
+ "discriminator": [
1088
+ 204,
1089
+ 116,
1090
+ 232,
1091
+ 56,
1092
+ 12,
1093
+ 252,
1094
+ 33,
1095
+ 108
1096
+ ];
1097
+ "accounts": [
1098
+ {
1099
+ "name": "payer";
1100
+ "writable": true;
1101
+ "signer": true;
1102
+ },
1103
+ {
1104
+ "name": "systemProgram";
1105
+ "address": "11111111111111111111111111111111";
1106
+ }
1107
+ ];
1108
+ "args": [
1109
+ {
1110
+ "name": "appId";
1111
+ "type": "string";
1112
+ },
1113
+ {
1114
+ "name": "documents";
1115
+ "type": {
1116
+ "vec": {
1117
+ "defined": {
1118
+ "name": "setDocumentData";
1119
+ };
1120
+ };
1121
+ };
1122
+ },
1123
+ {
1124
+ "name": "deletePaths";
1125
+ "type": {
1126
+ "vec": "string";
1127
+ };
1128
+ },
1129
+ {
1130
+ "name": "txData";
1131
+ "type": {
1132
+ "vec": {
1133
+ "defined": {
1134
+ "name": "txData";
1135
+ };
1136
+ };
1137
+ };
1138
+ }
1139
+ ];
1140
+ },
1141
+ {
1142
+ "name": "setDocumentsV2";
1143
+ "discriminator": [
1144
+ 22,
1145
+ 236,
1146
+ 242,
1147
+ 185,
1148
+ 145,
1149
+ 61,
1150
+ 26,
1151
+ 39
1152
+ ];
1153
+ "accounts": [
1154
+ {
1155
+ "name": "payer";
1156
+ "writable": true;
1157
+ "signer": true;
1158
+ },
1159
+ {
1160
+ "name": "systemProgram";
1161
+ "address": "11111111111111111111111111111111";
1162
+ }
1163
+ ];
1052
1164
  "args": [
1053
1165
  {
1054
1166
  "name": "appId";
@@ -1079,6 +1191,10 @@ export type Tarobase = {
1079
1191
  };
1080
1192
  };
1081
1193
  };
1194
+ },
1195
+ {
1196
+ "name": "simulate";
1197
+ "type": "bool";
1082
1198
  }
1083
1199
  ];
1084
1200
  },
@@ -1851,6 +1967,26 @@ export type Tarobase = {
1851
1967
  },
1852
1968
  {
1853
1969
  "name": "txData";
1970
+ "type": {
1971
+ "kind": "struct";
1972
+ "fields": [
1973
+ {
1974
+ "name": "pluginFunctionKey";
1975
+ "type": "string";
1976
+ },
1977
+ {
1978
+ "name": "txData";
1979
+ "type": "bytes";
1980
+ },
1981
+ {
1982
+ "name": "raIndices";
1983
+ "type": "bytes";
1984
+ }
1985
+ ];
1986
+ };
1987
+ },
1988
+ {
1989
+ "name": "txDataV1";
1854
1990
  "type": {
1855
1991
  "kind": "struct";
1856
1992
  "fields": [
@@ -1015,7 +1015,7 @@ export type Tarobase = {
1015
1015
  "type": {
1016
1016
  "vec": {
1017
1017
  "defined": {
1018
- "name": "txData";
1018
+ "name": "txDataV1";
1019
1019
  };
1020
1020
  };
1021
1021
  };
@@ -1049,6 +1049,118 @@ export type Tarobase = {
1049
1049
  "address": "11111111111111111111111111111111";
1050
1050
  }
1051
1051
  ];
1052
+ "args": [
1053
+ {
1054
+ "name": "appId";
1055
+ "type": "string";
1056
+ },
1057
+ {
1058
+ "name": "documents";
1059
+ "type": {
1060
+ "vec": {
1061
+ "defined": {
1062
+ "name": "setDocumentData";
1063
+ };
1064
+ };
1065
+ };
1066
+ },
1067
+ {
1068
+ "name": "deletePaths";
1069
+ "type": {
1070
+ "vec": "string";
1071
+ };
1072
+ },
1073
+ {
1074
+ "name": "txData";
1075
+ "type": {
1076
+ "vec": {
1077
+ "defined": {
1078
+ "name": "txDataV1";
1079
+ };
1080
+ };
1081
+ };
1082
+ }
1083
+ ];
1084
+ },
1085
+ {
1086
+ "name": "setDocumentsNoUserV2";
1087
+ "discriminator": [
1088
+ 204,
1089
+ 116,
1090
+ 232,
1091
+ 56,
1092
+ 12,
1093
+ 252,
1094
+ 33,
1095
+ 108
1096
+ ];
1097
+ "accounts": [
1098
+ {
1099
+ "name": "payer";
1100
+ "writable": true;
1101
+ "signer": true;
1102
+ },
1103
+ {
1104
+ "name": "systemProgram";
1105
+ "address": "11111111111111111111111111111111";
1106
+ }
1107
+ ];
1108
+ "args": [
1109
+ {
1110
+ "name": "appId";
1111
+ "type": "string";
1112
+ },
1113
+ {
1114
+ "name": "documents";
1115
+ "type": {
1116
+ "vec": {
1117
+ "defined": {
1118
+ "name": "setDocumentData";
1119
+ };
1120
+ };
1121
+ };
1122
+ },
1123
+ {
1124
+ "name": "deletePaths";
1125
+ "type": {
1126
+ "vec": "string";
1127
+ };
1128
+ },
1129
+ {
1130
+ "name": "txData";
1131
+ "type": {
1132
+ "vec": {
1133
+ "defined": {
1134
+ "name": "txData";
1135
+ };
1136
+ };
1137
+ };
1138
+ }
1139
+ ];
1140
+ },
1141
+ {
1142
+ "name": "setDocumentsV2";
1143
+ "discriminator": [
1144
+ 22,
1145
+ 236,
1146
+ 242,
1147
+ 185,
1148
+ 145,
1149
+ 61,
1150
+ 26,
1151
+ 39
1152
+ ];
1153
+ "accounts": [
1154
+ {
1155
+ "name": "payer";
1156
+ "writable": true;
1157
+ "signer": true;
1158
+ },
1159
+ {
1160
+ "name": "systemProgram";
1161
+ "address": "11111111111111111111111111111111";
1162
+ }
1163
+ ];
1052
1164
  "args": [
1053
1165
  {
1054
1166
  "name": "appId";
@@ -1079,6 +1191,10 @@ export type Tarobase = {
1079
1191
  };
1080
1192
  };
1081
1193
  };
1194
+ },
1195
+ {
1196
+ "name": "simulate";
1197
+ "type": "bool";
1082
1198
  }
1083
1199
  ];
1084
1200
  },
@@ -1362,78 +1478,138 @@ export type Tarobase = {
1362
1478
  "errors": [
1363
1479
  {
1364
1480
  "code": 6000;
1365
- "name": "unauthorized";
1366
- "msg": "Unauthorized: Only the owner can perform this action.";
1481
+ "name": "invalidAccountLength";
1482
+ "msg": "The number of provided new accounts does not match the number of documents.";
1367
1483
  },
1368
1484
  {
1369
1485
  "code": 6001;
1370
- "name": "unauthorizedUpdate";
1371
- "msg": "Unauthorized: Failed policy check to update this document.";
1486
+ "name": "invalidPda";
1487
+ "msg": "The provided account does not match the expected PDA.";
1372
1488
  },
1373
1489
  {
1374
1490
  "code": 6002;
1375
- "name": "unauthorizedDelete";
1376
- "msg": "Unauthorized: Failed policy check to delete this document.";
1491
+ "name": "simulate2";
1492
+ "msg": "Simulate mode.";
1377
1493
  },
1378
1494
  {
1379
1495
  "code": 6003;
1380
- "name": "unauthorizedCreate";
1381
- "msg": "Unauthorized: Failed policy check to create document at this path.";
1496
+ "name": "accountTooLarge";
1497
+ "msg": "The account size would exceed the maximum allowed size of 10240 bytes.";
1382
1498
  },
1383
1499
  {
1384
1500
  "code": 6004;
1385
- "name": "constraintMismatch";
1386
- "msg": "Constraint mismatch: provided values do not match stored document values.";
1501
+ "name": "pathInBothDeleteAndUpdate";
1502
+ "msg": "The same path cannot appear in both delete_paths and documents";
1387
1503
  },
1388
1504
  {
1389
1505
  "code": 6005;
1390
- "name": "cannotDeleteFieldsFromNonexistentAccount";
1391
- "msg": "Cannot delete fields from a nonexistent account.";
1506
+ "name": "invalidOperation";
1507
+ "msg": "Invalid operation.";
1392
1508
  },
1393
1509
  {
1394
1510
  "code": 6006;
1395
- "name": "fieldNotFound";
1396
- "msg": "Field not found: Cannot delete a field that doesn't exist.";
1511
+ "name": "missingRequiredFields";
1512
+ "msg": "Missing required fields.";
1397
1513
  },
1398
1514
  {
1399
1515
  "code": 6007;
1400
- "name": "createHookFailed";
1401
- "msg": "Create hook failed: Document creation was rejected by hook.";
1516
+ "name": "fieldAlreadyExists";
1517
+ "msg": "The same field cannot appear in more than one operation.";
1402
1518
  },
1403
1519
  {
1404
1520
  "code": 6008;
1405
- "name": "updateHookFailed";
1406
- "msg": "Update hook failed: Document update was rejected by hook.";
1521
+ "name": "fieldReadOnly";
1522
+ "msg": "The field is read only.";
1407
1523
  },
1408
1524
  {
1409
1525
  "code": 6009;
1410
- "name": "deleteHookFailed";
1411
- "msg": "Delete hook failed: Document deletion was rejected by hook.";
1526
+ "name": "invalidFieldType";
1527
+ "msg": "The provided field is not of the expected type.";
1412
1528
  },
1413
1529
  {
1414
1530
  "code": 6010;
1415
- "name": "executionDataUpdating";
1416
- "msg": "GenericPathExecutionData is currently being updated.";
1531
+ "name": "unsupportedOperation";
1532
+ "msg": "The provided option is not supported.";
1417
1533
  },
1418
1534
  {
1419
1535
  "code": 6011;
1420
- "name": "appIsNotInitialized";
1421
- "msg": "App is not initialized";
1536
+ "name": "invalidIncrementType";
1537
+ "msg": "The increment type is invalid.";
1422
1538
  },
1423
1539
  {
1424
1540
  "code": 6012;
1425
- "name": "invalidAuthorityPermit";
1426
- "msg": "Invalid authority permit.";
1541
+ "name": "invalidType";
1542
+ "msg": "The type is invalid.";
1427
1543
  },
1428
1544
  {
1429
1545
  "code": 6013;
1430
- "name": "accountMissing";
1431
- "msg": "Account is missing.";
1546
+ "name": "missingValue";
1547
+ "msg": "The value is missing.";
1432
1548
  },
1433
1549
  {
1434
1550
  "code": 6014;
1435
- "name": "numericalOverflow";
1436
- "msg": "numericalOverflow";
1551
+ "name": "invalidTypeForTimestamp";
1552
+ "msg": "The type is invalid for timestamp.";
1553
+ },
1554
+ {
1555
+ "code": 6015;
1556
+ "name": "fieldNotFound";
1557
+ "msg": "The field was not found.";
1558
+ },
1559
+ {
1560
+ "code": 6016;
1561
+ "name": "documentDataMissingFromMap";
1562
+ "msg": "The document data was missing from the map.";
1563
+ },
1564
+ {
1565
+ "code": 6017;
1566
+ "name": "streamAlreadyActive";
1567
+ "msg": "A bytecode stream is already active for this account.";
1568
+ },
1569
+ {
1570
+ "code": 6018;
1571
+ "name": "noActiveStream";
1572
+ "msg": "No bytecode stream is currently active.";
1573
+ },
1574
+ {
1575
+ "code": 6019;
1576
+ "name": "wrongFinalSize";
1577
+ "msg": "Chunk upload finished but size does not match expected_len.";
1578
+ },
1579
+ {
1580
+ "code": 6020;
1581
+ "name": "invalidBytecodeIndex";
1582
+ "msg": "Bytecode index must be 0-5";
1583
+ },
1584
+ {
1585
+ "code": 6021;
1586
+ "name": "missingEd25519VerifyIx";
1587
+ "msg": "Missing or invalid Ed25519 verify instruction.";
1588
+ },
1589
+ {
1590
+ "code": 6022;
1591
+ "name": "permitExpired";
1592
+ "msg": "Permit has expired.";
1593
+ },
1594
+ {
1595
+ "code": 6023;
1596
+ "name": "invalidSignature";
1597
+ "msg": "Invalid signature.";
1598
+ },
1599
+ {
1600
+ "code": 6024;
1601
+ "name": "invalidSigner";
1602
+ "msg": "Invalid signer.";
1603
+ },
1604
+ {
1605
+ "code": 6025;
1606
+ "name": "invalidMessage";
1607
+ "msg": "Invalid message.";
1608
+ },
1609
+ {
1610
+ "code": 6026;
1611
+ "name": "failedToParse";
1612
+ "msg": "Failed to parse.";
1437
1613
  }
1438
1614
  ];
1439
1615
  "types": [
@@ -1791,6 +1967,26 @@ export type Tarobase = {
1791
1967
  },
1792
1968
  {
1793
1969
  "name": "txData";
1970
+ "type": {
1971
+ "kind": "struct";
1972
+ "fields": [
1973
+ {
1974
+ "name": "pluginFunctionKey";
1975
+ "type": "string";
1976
+ },
1977
+ {
1978
+ "name": "txData";
1979
+ "type": "bytes";
1980
+ },
1981
+ {
1982
+ "name": "raIndices";
1983
+ "type": "bytes";
1984
+ }
1985
+ ];
1986
+ };
1987
+ },
1988
+ {
1989
+ "name": "txDataV1";
1794
1990
  "type": {
1795
1991
  "kind": "struct";
1796
1992
  "fields": [
@@ -1,6 +1,5 @@
1
1
  import { Connection, PublicKey, Transaction, TransactionInstruction, VersionedTransaction } from "@solana/web3.js";
2
2
  import * as anchor from "@coral-xyz/anchor";
3
- import BN from "bn.js";
4
3
  export type RemainingAccount = {
5
4
  pubkey: PublicKey;
6
5
  isWritable: boolean;
@@ -9,10 +8,10 @@ export type RemainingAccount = {
9
8
  export type TxData = {
10
9
  pluginFunctionKey: string;
11
10
  txData: Buffer;
12
- raIndices: BN[];
11
+ raIndices: Buffer;
13
12
  };
14
13
  export declare function genSolanaMessage(address: string, nonce: string): Promise<string>;
15
- export declare function isHexString(value: string): boolean;
14
+ export declare function isHexString(value: unknown): boolean;
16
15
  export declare function convertRemainingAccounts(remainingAccounts: any[]): {
17
16
  pubkey: PublicKey;
18
17
  isWritable: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pooflabs/core",
3
- "version": "0.0.44",
3
+ "version": "0.0.46",
4
4
  "description": "Core functionality for Poof SDK",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -13,7 +13,7 @@
13
13
  }
14
14
  },
15
15
  "scripts": {
16
- "build": "rm -rf ./dist && rollup -c && tsc -p tsconfig.build.json --emitDeclarationOnly --declarationDir dist",
16
+ "build": "rm -rf ./dist ./.rollup-tmp && tsc -p tsconfig.build.json --outDir .rollup-tmp --declarationDir .rollup-tmp --emitDeclarationOnly false && rollup -c && tsc -p tsconfig.build.json --emitDeclarationOnly --declarationDir dist && rm -rf ./.rollup-tmp",
17
17
  "watch": "rollup -c -w",
18
18
  "prepare": "npm run build"
19
19
  },