@ardrive/turbo-sdk 1.40.2 → 1.41.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.
@@ -29,10 +29,10 @@ const ArweaveClass =
29
29
  // @ts-ignore -- Access the correct class constructor for Arweave
30
30
  arweave_1.default.default?.default || arweave_1.default.default || arweave_1.default;
31
31
  class ArweaveToken {
32
- constructor({ gatewayUrl = 'https://arweave.net', arweave, logger = logger_js_1.Logger.default, mintU = true, pollingOptions = {
32
+ constructor({ gatewayUrl = 'https://turbo-gateway.com', arweave, logger = logger_js_1.Logger.default, mintU = true, pollingOptions = {
33
33
  maxAttempts: 10,
34
- pollingIntervalMs: 3_000,
35
- initialBackoffMs: 7_000,
34
+ pollingIntervalMs: 5_000,
35
+ initialBackoffMs: 15_000,
36
36
  }, } = {}) {
37
37
  const url = new URL(gatewayUrl);
38
38
  this.arweave =
@@ -83,7 +83,12 @@ class ArweaveToken {
83
83
  }
84
84
  async pollTxAvailability({ txId }) {
85
85
  const { maxAttempts, pollingIntervalMs, initialBackoffMs } = this.pollingOptions;
86
- this.logger.debug('Polling for transaction...', { txId });
86
+ this.logger.debug('Polling for transaction...', {
87
+ txId,
88
+ maxAttempts,
89
+ pollingIntervalMs,
90
+ gatewayUrl: this.arweave.api.getConfig().host,
91
+ });
87
92
  await (0, common_js_1.sleep)(initialBackoffMs);
88
93
  let attempts = 0;
89
94
  while (attempts < maxAttempts) {
@@ -48,8 +48,8 @@ const baseTestnetRpc = 'https://sepolia.base.org';
48
48
  const polygonTestnetRpc = 'https://rpc-amoy.polygon.technology';
49
49
  const baseMainnetRpc = 'https://mainnet.base.org';
50
50
  exports.tokenToDevGatewayMap = {
51
- arweave: 'https://arweave.net', // No arweave test net
52
- ario: 'https://arweave.net', // No arweave test net
51
+ arweave: 'https://turbo-gateway.com', // No arweave test net
52
+ ario: 'https://turbo-gateway.com', // No arweave test net
53
53
  'base-ario': baseMainnetRpc, // No base-ario test net contract deployed
54
54
  solana: 'https://api.devnet.solana.com',
55
55
  ethereum: ethTestnetRpc,
@@ -68,8 +68,8 @@ exports.tokenToDevAoConfigMap = {
68
68
  },
69
69
  };
70
70
  exports.defaultProdGatewayUrls = {
71
- arweave: 'https://arweave.net',
72
- ario: 'https://arweave.net',
71
+ arweave: 'https://turbo-gateway.com',
72
+ ario: 'https://turbo-gateway.com',
73
73
  'base-ario': baseMainnetRpc,
74
74
  solana: 'https://api.mainnet-beta.solana.com',
75
75
  ethereum: 'https://cloudflare-eth.com/',
@@ -23,10 +23,10 @@ const ArweaveClass =
23
23
  // @ts-ignore -- Access the correct class constructor for Arweave
24
24
  ArweaveModule.default?.default || ArweaveModule.default || ArweaveModule;
25
25
  export class ArweaveToken {
26
- constructor({ gatewayUrl = 'https://arweave.net', arweave, logger = Logger.default, mintU = true, pollingOptions = {
26
+ constructor({ gatewayUrl = 'https://turbo-gateway.com', arweave, logger = Logger.default, mintU = true, pollingOptions = {
27
27
  maxAttempts: 10,
28
- pollingIntervalMs: 3_000,
29
- initialBackoffMs: 7_000,
28
+ pollingIntervalMs: 5_000,
29
+ initialBackoffMs: 15_000,
30
30
  }, } = {}) {
31
31
  const url = new URL(gatewayUrl);
32
32
  this.arweave =
@@ -77,7 +77,12 @@ export class ArweaveToken {
77
77
  }
78
78
  async pollTxAvailability({ txId }) {
79
79
  const { maxAttempts, pollingIntervalMs, initialBackoffMs } = this.pollingOptions;
80
- this.logger.debug('Polling for transaction...', { txId });
80
+ this.logger.debug('Polling for transaction...', {
81
+ txId,
82
+ maxAttempts,
83
+ pollingIntervalMs,
84
+ gatewayUrl: this.arweave.api.getConfig().host,
85
+ });
81
86
  await sleep(initialBackoffMs);
82
87
  let attempts = 0;
83
88
  while (attempts < maxAttempts) {
@@ -33,8 +33,8 @@ const baseTestnetRpc = 'https://sepolia.base.org';
33
33
  const polygonTestnetRpc = 'https://rpc-amoy.polygon.technology';
34
34
  const baseMainnetRpc = 'https://mainnet.base.org';
35
35
  export const tokenToDevGatewayMap = {
36
- arweave: 'https://arweave.net', // No arweave test net
37
- ario: 'https://arweave.net', // No arweave test net
36
+ arweave: 'https://turbo-gateway.com', // No arweave test net
37
+ ario: 'https://turbo-gateway.com', // No arweave test net
38
38
  'base-ario': baseMainnetRpc, // No base-ario test net contract deployed
39
39
  solana: 'https://api.devnet.solana.com',
40
40
  ethereum: ethTestnetRpc,
@@ -53,8 +53,8 @@ export const tokenToDevAoConfigMap = {
53
53
  },
54
54
  };
55
55
  export const defaultProdGatewayUrls = {
56
- arweave: 'https://arweave.net',
57
- ario: 'https://arweave.net',
56
+ arweave: 'https://turbo-gateway.com',
57
+ ario: 'https://turbo-gateway.com',
58
58
  'base-ario': baseMainnetRpc,
59
59
  solana: 'https://api.mainnet-beta.solana.com',
60
60
  ethereum: 'https://cloudflare-eth.com/',
@@ -1 +1 @@
1
- {"version":3,"file":"arweave.d.ts","sourceRoot":"","sources":["../../../../src/common/token/arweave.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,aAAa,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAUxB,qBAAa,YAAa,YAAW,UAAU;IAC7C,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;IAC9B,SAAS,CAAC,OAAO,EAAE,aAAa,CAAC;IACjC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,cAAc,EAAE,mBAAmB,CAAC;gBAElC,EACV,UAAkC,EAClC,OAAO,EACP,MAAuB,EACvB,KAAY,EACZ,cAIC,GACF,GAAE;QACD,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE,aAAa,CAAC;QACxB,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,KAAK,CAAC,EAAE,OAAO,CAA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AC,EAAE,WAAW,CAAC;QACrB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,cAAc,CAAC,EAAE,mBAAmB,CAAC;KACjC;IAeO,iBAAiB,CAAC,EAC7B,aAAa,EACb,MAAM,EACN,WAAW,EACX,MAAM,EACN,6BAA6B,GAC9B,EAAE,mBAAmB,GAAG,OAAO,CAAC;QAC/B,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IAmDW,kBAAkB,CAAC,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAgE7D,QAAQ,CAAC,EAAE,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAqB9C;AAED,eAAO,MAAM,oBAAoB,YAAa,SAAS,CAAC,KAAK,oBAAY,CAAC;AAC1E,eAAO,MAAM,eAAe,OAAQ,SAAS,CAAC,KAAK,WACV,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ardrive/turbo-sdk",
3
- "version": "1.40.2",
3
+ "version": "1.41.0",
4
4
  "main": "./lib/cjs/node/index.js",
5
5
  "types": "./lib/types/node/index.d.ts",
6
6
  "module": "./lib/esm/node/index.js",