koilib 8.0.0 → 9.0.0

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/src/Provider.ts CHANGED
@@ -15,6 +15,122 @@ import { koinos } from "./protoModules/protocol-proto.js";
15
15
  import { decodeBase64url, encodeBase64url } from "./utils";
16
16
  import { Serializer } from "./Serializer";
17
17
 
18
+ export interface ProviderInterface {
19
+ call: <T = unknown>(method: string, params: unknown) => Promise<T>;
20
+ getNonce: (
21
+ account: string,
22
+ deserialize?: boolean
23
+ ) => Promise<number | string>;
24
+ getNextNonce: (account: string) => Promise<string>;
25
+ getAccountRc: (account: string) => Promise<string>;
26
+ getTransactionsById: (transactionIds: string[]) => Promise<{
27
+ transactions: {
28
+ transaction: TransactionJson;
29
+ containing_blocks: string[];
30
+ }[];
31
+ }>;
32
+ getBlocksById: (
33
+ blockIds: string[],
34
+ opts?: GetBlockOptions
35
+ ) => Promise<{
36
+ block_items: {
37
+ block_id: string;
38
+ block_height: string;
39
+ block: BlockJson;
40
+ receipt: BlockReceipt;
41
+ }[];
42
+ }>;
43
+ getHeadInfo: () => Promise<{
44
+ head_block_time: string;
45
+ head_topology: BlockTopology;
46
+ head_state_merkle_root: string;
47
+ last_irreversible_block: string;
48
+ }>;
49
+ getChainId: () => Promise<string>;
50
+ getBlocks: (
51
+ height: number,
52
+ numBlocks?: number,
53
+ idRef?: string,
54
+ opts?: GetBlockOptions
55
+ ) => Promise<
56
+ {
57
+ block_id: string;
58
+ block_height: string;
59
+ block: BlockJson;
60
+ receipt: BlockReceipt;
61
+ }[]
62
+ >;
63
+ getBlock: (
64
+ height: number,
65
+ opts?: GetBlockOptions
66
+ ) => Promise<{
67
+ block_id: string;
68
+ block_height: string;
69
+ block: BlockJson;
70
+ receipt: BlockReceipt;
71
+ }>;
72
+ wait: (
73
+ txId: string,
74
+ type?: "byTransactionId" | "byBlock",
75
+ timeout?: number
76
+ ) => Promise<{
77
+ blockId: string;
78
+ blockNumber?: number;
79
+ }>;
80
+ sendTransaction: (
81
+ transaction: TransactionJson | TransactionJsonWait,
82
+ broadcast?: boolean
83
+ ) => Promise<{
84
+ receipt: TransactionReceipt;
85
+ transaction: TransactionJsonWait;
86
+ }>;
87
+ readContract: (operation: CallContractOperationJson) => Promise<{
88
+ result: string;
89
+ logs: string;
90
+ }>;
91
+ invokeSystemCall: <T = Record<string, unknown>>(
92
+ serializer: Serializer,
93
+ nameOrId: string | number,
94
+ args: Record<string, unknown>,
95
+ callerData?: { caller: string; caller_privilege: number }
96
+ ) => Promise<T | undefined>;
97
+
98
+ // optional functions
99
+ submitBlock?: (block: BlockJson) => Promise<Record<string, never>>;
100
+ getForkHeads?: () => Promise<{
101
+ last_irreversible_block: BlockTopology;
102
+ fork_heads: BlockTopology[];
103
+ }>;
104
+ getResourceLimits?: () => Promise<{
105
+ resource_limit_data: {
106
+ disk_storage_limit: string;
107
+ disk_storage_cost: string;
108
+ network_bandwidth_limit: string;
109
+ network_bandwidth_cost: string;
110
+ compute_bandwidth_limit: string;
111
+ compute_bandwidth_cost: string;
112
+ };
113
+ }>;
114
+ invokeGetContractMetadata?: (contractId: string) => Promise<
115
+ | {
116
+ value: {
117
+ hash: string;
118
+ system: boolean;
119
+ authorizes_call_contract: boolean;
120
+ authorizes_transaction_application: boolean;
121
+ authorizes_upload_contract: boolean;
122
+ };
123
+ }
124
+ | undefined
125
+ >;
126
+ invokeGetContractAddress?: (name: string) => Promise<
127
+ | {
128
+ value: { address: string };
129
+ }
130
+ | undefined
131
+ >;
132
+ }
133
+
18
134
  /* eslint-disable @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access */
19
135
 
20
136
  async function sleep(ms: number): Promise<void> {
@@ -24,7 +140,7 @@ async function sleep(ms: number): Promise<void> {
24
140
  /**
25
141
  * Class to connect with the RPC node
26
142
  */
27
- export class Provider {
143
+ export class Provider implements ProviderInterface {
28
144
  /**
29
145
  * Array of URLs of RPC nodes
30
146
  */
@@ -583,25 +699,49 @@ export class Provider {
583
699
  */
584
700
  async wait(
585
701
  txId: string,
586
- type: "byTransactionId" | "byBlock" = "byBlock",
702
+ type: "byTransactionId" | "byBlock" = "byTransactionId",
587
703
  timeout = 15000
588
704
  ): Promise<{
589
705
  blockId: string;
590
706
  blockNumber?: number;
591
707
  }> {
592
- const iniTime = Date.now();
708
+ const endTime = Date.now() + timeout;
593
709
  if (type === "byTransactionId") {
594
- while (Date.now() < iniTime + timeout) {
710
+ while (Date.now() < endTime) {
595
711
  await sleep(1000);
596
712
  const { transactions } = await this.getTransactionsById([txId]);
713
+ // If the API node knows about the transaction and
714
+ // the transaction has been included in a block
597
715
  if (
598
716
  transactions &&
599
717
  transactions[0] &&
600
718
  transactions[0].containing_blocks
601
- )
602
- return {
603
- blockId: transactions[0].containing_blocks[0],
604
- };
719
+ ) {
720
+ // For each of the blocks containing the transaction,
721
+ // check to see if that block is a parent of head
722
+
723
+ // Get the height of the containing block
724
+ const blockCandidates = transactions[0].containing_blocks;
725
+ const blocks = await this.getBlocksById(blockCandidates, {
726
+ returnBlock: false,
727
+ returnReceipt: false,
728
+ });
729
+
730
+ if (blocks && blocks.block_items && blocks.block_items.length > 0) {
731
+ for (let i = 0; i < blocks.block_items.length; i += 1) {
732
+ // If the ancestor block of head at the height of the containing
733
+ // block is the containing block, return that block
734
+ const blockNumber = Number(blocks.block_items[i].block_height);
735
+ const blocksHeight = await this.getBlocks(blockNumber);
736
+ if (blocksHeight) {
737
+ const blockId = blockCandidates.find(
738
+ (b) => b === blocksHeight[0].block_id
739
+ );
740
+ if (blockId) return { blockId, blockNumber };
741
+ }
742
+ }
743
+ }
744
+ }
605
745
  }
606
746
  throw new Error(`Transaction not mined after ${timeout} ms`);
607
747
  }
@@ -637,7 +777,7 @@ export class Provider {
637
777
  let iniBlock = 0;
638
778
  let previousId = "";
639
779
 
640
- while (Date.now() < iniTime + timeout) {
780
+ while (Date.now() < endTime) {
641
781
  await sleep(1000);
642
782
  const { head_topology: headTopology } = await this.getHeadInfo();
643
783
  if (blockNumber === 0) {
@@ -802,7 +942,7 @@ export class Provider {
802
942
  nameOrId: string | number,
803
943
  args: Record<string, unknown>,
804
944
  callerData?: { caller: string; caller_privilege: number }
805
- ): Promise<T> {
945
+ ): Promise<T | undefined> {
806
946
  if (!serializer.argumentsTypeName)
807
947
  throw new Error("argumentsTypeName not defined");
808
948
  if (!serializer.returnTypeName)
@@ -820,8 +960,7 @@ export class Provider {
820
960
  caller_data: callerData,
821
961
  }
822
962
  );
823
- if (!response || !response.value)
824
- throw new Error("no value in the response");
963
+ if (!response || !response.value) return undefined;
825
964
  const result = await serializer.deserialize(
826
965
  response.value,
827
966
  serializer.returnTypeName
@@ -908,10 +1047,74 @@ export class Provider {
908
1047
  returnTypeName: "get_contract_metadata_result",
909
1048
  }
910
1049
  );
911
- return this.invokeSystemCall(serializer, "get_contract_metadata", {
1050
+ return this.invokeSystemCall<{
1051
+ value: {
1052
+ hash: string;
1053
+ system: boolean;
1054
+ authorizes_call_contract: boolean;
1055
+ authorizes_transaction_application: boolean;
1056
+ authorizes_upload_contract: boolean;
1057
+ };
1058
+ }>(serializer, "get_contract_metadata", {
912
1059
  contract_id: contractId,
913
1060
  });
914
1061
  }
1062
+
1063
+ /**
1064
+ * Function to get the address of a system contract
1065
+ * @param name - contract name
1066
+ *
1067
+ * @example
1068
+ * ```ts
1069
+ * const provider = new Provider("https://api.koinos.io");
1070
+ * const result = await provider.invokeGetContractAddress("koin");
1071
+ * console.log(result);
1072
+ *
1073
+ * // { value: { address: '15DJN4a8SgrbGhhGksSBASiSYjGnMU8dGL' } }
1074
+ * ```
1075
+ */
1076
+ async invokeGetContractAddress(name: string) {
1077
+ const serializer = new Serializer(
1078
+ {
1079
+ nested: {
1080
+ get_address_arguments: {
1081
+ fields: {
1082
+ name: {
1083
+ type: "string",
1084
+ id: 1,
1085
+ },
1086
+ },
1087
+ },
1088
+ get_address_result: {
1089
+ fields: {
1090
+ value: {
1091
+ type: "address_record",
1092
+ id: 1,
1093
+ },
1094
+ },
1095
+ },
1096
+ address_record: {
1097
+ fields: {
1098
+ address: {
1099
+ type: "bytes",
1100
+ id: 1,
1101
+ options: {
1102
+ "(koinos.btype)": "ADDRESS",
1103
+ },
1104
+ },
1105
+ },
1106
+ },
1107
+ },
1108
+ },
1109
+ {
1110
+ argumentsTypeName: "get_address_arguments",
1111
+ returnTypeName: "get_address_result",
1112
+ }
1113
+ );
1114
+ return this.invokeSystemCall<{
1115
+ value: { address: string };
1116
+ }>(serializer, "get_contract_address", { name });
1117
+ }
915
1118
  }
916
1119
 
917
1120
  export default Provider;
package/src/Signer.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable no-param-reassign, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */
2
2
  import { sha256 } from "@noble/hashes/sha256";
3
3
  import * as secp from "@noble/secp256k1";
4
- import { Provider } from "./Provider";
4
+ import { ProviderInterface } from "./Provider";
5
5
  import {
6
6
  TransactionJson,
7
7
  TransactionJsonWait,
@@ -28,7 +28,7 @@ import {
28
28
  import { koinos } from "./protoModules/protocol-proto.js";
29
29
 
30
30
  export interface SignerInterface {
31
- provider?: Provider;
31
+ provider?: ProviderInterface;
32
32
  getAddress: (compressed?: boolean) => string;
33
33
  signHash: (hash: Uint8Array) => Promise<Uint8Array>;
34
34
  signMessage: (message: string | Uint8Array) => Promise<Uint8Array>;
@@ -142,7 +142,7 @@ export class Signer implements SignerInterface {
142
142
  /**
143
143
  * Provider to connect with the blockchain
144
144
  */
145
- provider?: Provider;
145
+ provider?: ProviderInterface;
146
146
 
147
147
  /**
148
148
  * Options to apply when sending a transaction.
@@ -171,7 +171,7 @@ export class Signer implements SignerInterface {
171
171
  constructor(c: {
172
172
  privateKey: string | number | bigint | Uint8Array;
173
173
  compressed?: boolean;
174
- provider?: Provider;
174
+ provider?: ProviderInterface;
175
175
  sendOptions?: SendTransactionOptions;
176
176
  }) {
177
177
  this.compressed = typeof c.compressed === "undefined" ? true : c.compressed;
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable no-param-reassign, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */
2
2
  import { sha256 } from "@noble/hashes/sha256";
3
3
  import { Contract } from "./Contract";
4
- import { Provider } from "./Provider";
4
+ import { ProviderInterface } from "./Provider";
5
5
  import { SignerInterface } from "./Signer";
6
6
  import {
7
7
  Abi,
@@ -90,7 +90,7 @@ export class Transaction {
90
90
  /**
91
91
  * Provider to connect with the blockchain
92
92
  */
93
- provider?: Provider;
93
+ provider?: ProviderInterface;
94
94
 
95
95
  /**
96
96
  * Transaction
@@ -109,7 +109,7 @@ export class Transaction {
109
109
 
110
110
  constructor(c?: {
111
111
  signer?: SignerInterface;
112
- provider?: Provider;
112
+ provider?: ProviderInterface;
113
113
  transaction?: TransactionJson;
114
114
  options?: TransactionOptions;
115
115
  }) {
@@ -148,14 +148,17 @@ export class Transaction {
148
148
  * signer.provider = provider;
149
149
  * const tx = new Transaction({ signer });
150
150
  *
151
- * // method 1
151
+ * // Method 1 (using 2 arguments)
152
+ * // note that with 2 arguments it is not necessary to
153
+ * // set "onlyOperation: true". For the rest of the
154
+ * // methods it's necessary to do that.
152
155
  * await tx.pushOperation(koin.transfer, {
153
156
  * from: "1NRYHBYr9qxYQAeVqfdSvyjJemRQ4qD3Mt",
154
157
  * to: "13UdKjYuzfBYbB6bGLQkUN9DJRFPCmG1mU",
155
158
  * value: "1000",
156
159
  * });
157
160
  *
158
- * // method 2
161
+ * // Method 2
159
162
  * await tx.pushOperation(
160
163
  * koin.transfer({
161
164
  * from: "1NRYHBYr9qxYQAeVqfdSvyjJemRQ4qD3Mt",
@@ -166,7 +169,7 @@ export class Transaction {
166
169
  * })
167
170
  * );
168
171
  *
169
- * // method 3
172
+ * // Method 3
170
173
  * await tx.pushOperation(
171
174
  * await koin.transfer({
172
175
  * from: "1NRYHBYr9qxYQAeVqfdSvyjJemRQ4qD3Mt",
@@ -177,7 +180,7 @@ export class Transaction {
177
180
  * })
178
181
  * );
179
182
  *
180
- * // method 4
183
+ * // Method 4
181
184
  * const { operation } = await koin.transfer({
182
185
  * from: "1NRYHBYr9qxYQAeVqfdSvyjJemRQ4qD3Mt",
183
186
  * to: "13UdKjYuzfBYbB6bGLQkUN9DJRFPCmG1mU",
@@ -242,7 +245,7 @@ export class Transaction {
242
245
  */
243
246
  static async prepareTransaction(
244
247
  tx: TransactionJson,
245
- provider?: Provider,
248
+ provider?: ProviderInterface,
246
249
  payer?: string
247
250
  ): Promise<TransactionJson> {
248
251
  if (!tx.header) {
package/src/interface.ts CHANGED
@@ -50,13 +50,13 @@ import { Serializer } from "./Serializer";
50
50
  * },
51
51
  * mint: {
52
52
  * entry_point: 0xc2f82bdc,
53
- * argument: "mint_argumnets",
53
+ * argument: "mint_arguments",
54
54
  * return: "mint_result",
55
55
  * },
56
56
  * },
57
57
  * events: {
58
58
  * 'koinos.contracts.token.mint_event': {
59
- * argument: "mint"
59
+ * type: "mint_arguments"
60
60
  * },
61
61
  * },
62
62
  * koilib_types: tokenJson,
@@ -151,7 +151,7 @@ import { Serializer } from "./Serializer";
151
151
  * },
152
152
  * events: {
153
153
  * 'transfer_event': {
154
- * argument: "transfer"
154
+ * type: "transfer"
155
155
  * },
156
156
  * },
157
157
  * koilib_types: tokenJson,
@@ -200,8 +200,10 @@ export interface Abi {
200
200
  */
201
201
  events?: {
202
202
  [x: string]: {
203
- /** Protobuffer type for argument */
203
+ /** Deprecated, use type instead */
204
204
  argument?: string;
205
+ /** Protobuffer type for event */
206
+ type?: string;
205
207
  /** Description of the event */
206
208
  description?: string;
207
209
  };
package/src/utils.ts CHANGED
@@ -578,6 +578,13 @@ export const tokenAbi: Abi = {
578
578
  read_only: false,
579
579
  entry_point: 0xdc6f17bb,
580
580
  },
581
+ burn: {
582
+ argument: "token.burn_args",
583
+ return: "",
584
+ description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lbnQSGgoFb3duZXIYASABKAxCBIC1GAZSBW93bmVyEh4KB3NwZW5kZXIYAiABKAxCBIC1GAZSB3NwZW5kZXISGAoFdmFsdWUYAyABKARCAjABUgV2YWx1ZWIGcHJvdG8z",
@@ -1158,6 +1165,20 @@ export const tokenAbi: Abi = {
1158
1165
  },
1159
1166
  },
1160
1167
  },
1168
+ events: {
1169
+ "token.mint_event": {
1170
+ argument: "token.mint_args",
1171
+ type: "token.mint_args",
1172
+ },
1173
+ "token.transfer_event": {
1174
+ argument: "token.transfer_args",
1175
+ type: "token.transfer_args",
1176
+ },
1177
+ "token.burn_event": {
1178
+ argument: "token.burn_args",
1179
+ type: "token.burn_args",
1180
+ },
1181
+ },
1161
1182
  };
1162
1183
 
1163
1184
  /**
@@ -1346,6 +1367,13 @@ export const nftAbi: Abi = {
1346
1367
  read_only: false,
1347
1368
  entry_point: 0xdc6f17bb,
1348
1369
  },
1370
+ burn: {
1371
+ argument: "nft.burn_args",
1372
+ return: "",
1373
+ description: "Burn NFT",
1374
+ read_only: false,
1375
+ entry_point: 0x859facc5,
1376
+ },
1349
1377
  },
1350
1378
  types:
1351
1379
  "CoQDCidrb2lub3Nib3gtcHJvdG8vbWFuYXNoYXJlci9jb21tb24ucHJvdG8SBmNvbW1vbhoUa29pbm9zL29wdGlvbnMucHJvdG8iGwoDc3RyEhQKBXZhbHVlGAEgASgJUgV2YWx1ZSIeCgZ1aW50MzISFAoFdmFsdWUYASABKA1SBXZhbHVlIiIKBnVpbnQ2NBIYCgV2YWx1ZRgBIAEoBEICMAFSBXZhbHVlIh0KBWJvb2xlEhQKBXZhbHVlGAEgASgIUgV2YWx1ZSIlCgdhZGRyZXNzEhoKBXZhbHVlGAEgASgMQgSAtRgGUgV2YWx1ZSJdCglsaXN0X2FyZ3MSGgoFc3RhcnQYASABKAxCBIC1GAZSBXN0YXJ0EhQKBWxpbWl0GAIgASgFUgVsaW1pdBIeCgpkZXNjZW5kaW5nGAMgASgIUgpkZXNjZW5ka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HRva2VuSWRzYgZwcm90bzM=",
@@ -1776,24 +1804,35 @@ export const nftAbi: Abi = {
1776
1804
  events: {
1777
1805
  "collections.owner_event": {
1778
1806
  argument: "common.address",
1807
+ type: "common.address",
1779
1808
  },
1780
1809
  "collections.royalties_event": {
1781
1810
  argument: "nft.royalties",
1811
+ type: "nft.royalties",
1782
1812
  },
1783
1813
  "collections.set_metadata_event": {
1784
1814
  argument: "nft.metadata_args",
1815
+ type: "nft.metadata_args",
1785
1816
  },
1786
1817
  "collections.token_approval_event": {
1787
1818
  argument: "nft.approve_args",
1819
+ type: "nft.approve_args",
1788
1820
  },
1789
1821
  "collections.operator_approval_event": {
1790
1822
  argument: "nft.set_approval_for_all_args",
1823
+ type: "nft.set_approval_for_all_args",
1791
1824
  },
1792
1825
  "collections.transfer_event": {
1793
1826
  argument: "nft.transfer_args",
1827
+ type: "nft.transfer_args",
1794
1828
  },
1795
1829
  "collections.mint_event": {
1796
1830
  argument: "nft.mint_args",
1831
+ type: "nft.mint_args",
1832
+ },
1833
+ "collections.burn_event": {
1834
+ argument: "nft.burn_args",
1835
+ type: "nft.burn_args",
1797
1836
  },
1798
1837
  },
1799
1838
  };