|
| 1 | +{ |
| 2 | + "limit": 96, |
| 3 | + "offset": 0, |
| 4 | + "total": 5, |
| 5 | + "results": [ |
| 6 | + { |
| 7 | + "tx_id": "0xb31df5a363dad31723324cb5e0eefa04d491519fd30827a521cbc830114aa50c", |
| 8 | + "tx_status": "pending", |
| 9 | + "tx_type": "token_transfer", |
| 10 | + "receipt_time": 1598288370, |
| 11 | + "receipt_time_iso": "2020-08-24T16:59:30.000Z", |
| 12 | + "fee_rate": "180", |
| 13 | + "sender_address": "STB44HYPYAT2BB2QE513NSP81HTMYWBJP02HPGK6", |
| 14 | + "sponsored": false, |
| 15 | + "post_condition_mode": "deny", |
| 16 | + "token_transfer": { |
| 17 | + "recipient_address": "ST1GY25DM8RZV4X15X07THRZ2C5NMWPGQWKFGV87F", |
| 18 | + "amount": "500000", |
| 19 | + "memo": "0x46617563657400000000000000000000000000000000000000000000000000000000" |
| 20 | + } |
| 21 | + }, |
| 22 | + { |
| 23 | + "tx_id": "0x5bed8e3f801cb4e2c74d2815a092f7c1c6a35f2fce4a80c80ca70848d34cb395", |
| 24 | + "tx_status": "pending", |
| 25 | + "tx_type": "token_transfer", |
| 26 | + "receipt_time": 1598282326, |
| 27 | + "receipt_time_iso": "2020-08-24T15:18:46.000Z", |
| 28 | + "fee_rate": "180", |
| 29 | + "sender_address": "ST1PS1KF93VBY5A1JV7TM66KN046KP3E3761DBSAG", |
| 30 | + "sponsored": false, |
| 31 | + "post_condition_mode": "deny", |
| 32 | + "token_transfer": { |
| 33 | + "recipient_address": "ST2H33S8SEY27QKEKQKR6S5PECYPKY45CQYGGQR8X", |
| 34 | + "amount": "1000", |
| 35 | + "memo": "0x00000000000000000000000000000000000000000000000000000000000000000000" |
| 36 | + } |
| 37 | + }, |
| 38 | + { |
| 39 | + "tx_id": "0x9916036fde08a207e581cdcabc18ff55469861cb81194ab0e3e7c9a02cd5a17c", |
| 40 | + "tx_status": "pending", |
| 41 | + "tx_type": "smart_contract", |
| 42 | + "receipt_time": 1598258958, |
| 43 | + "receipt_time_iso": "2020-08-24T08:49:18.000Z", |
| 44 | + "fee_rate": "2000", |
| 45 | + "sender_address": "ST2R1XSFXYHCSFE426HP45TTD8ZWV9XHX2SRP3XA8", |
| 46 | + "sponsored": false, |
| 47 | + "post_condition_mode": "deny", |
| 48 | + "post_conditions": [], |
| 49 | + "smart_contract": { |
| 50 | + "contract_id": "ST2R1XSFXYHCSFE426HP45TTD8ZWV9XHX2SRP3XA8.test-loans-1", |
| 51 | + "source_code": "(define-data-var stx-loaned int 0)\n(define-data-var lockup-period int 0)\n(define-data-var stx-return int 0)\n(define-public (get-stx-return (stx uint) (months uint))\n (ok\n (begin\n (var-set stx-loaned (to-int(stx))\n (var-set lockup-period (to-int(months))\n (calculate-stx-return)\n (print (var-get stx-return))\n (transfer-to-server)\n )\n )\n)\n(define-private (calculate-stx-return)\n (ok\n (begin\n (var-set stx-return (- (+ (* (/ (* (var-get stx-loaned) 5) 100) (var-get lockup-period)) (var-get stx-loaned)) 5))\n )\n )\n)\n(define-private (transfer-to-server)\n (begin\n (unwrap-panic (stx-transfer? (to-uint (var-get stx-loaned)) tx-sender 'ST2R1XSFXYHCSFE426HP45TTD8ZWV9XHX2SRP3XA8))\n (ok (to-uint (var-get stx-loaned)))\n )\n)" |
| 52 | + } |
| 53 | + }, |
| 54 | + { |
| 55 | + "tx_id": "0x871fb186c8d6ac6ede2822c71074d9884b593c0d7f2d0d6e8516e615484d7501", |
| 56 | + "tx_status": "pending", |
| 57 | + "tx_type": "smart_contract", |
| 58 | + "receipt_time": 1598230365, |
| 59 | + "receipt_time_iso": "2020-08-24T00:52:45.000Z", |
| 60 | + "fee_rate": "2000", |
| 61 | + "sender_address": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1", |
| 62 | + "sponsored": false, |
| 63 | + "post_condition_mode": "deny", |
| 64 | + "post_conditions": [], |
| 65 | + "smart_contract": { |
| 66 | + "contract_id": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1.contract-hook-1598230358601", |
| 67 | + "source_code": ";; ## CUSTOM FUNCTION TO EXTRACT A SUBSTRING\n\n(define-read-only (subs (source (buff 10)) \n (start int) \n (end int))\n (begin\n (unwrap-panic (if (and (<= 0 start) (<= start 10)) (ok 1) (err \"Out of bounds: start\")))\n (unwrap-panic (if (and (<= 0 end) (<= end 10)) (ok 1) (err \"Out of bounds: end\")))\n (let ((temp1 (fold subs1 source \n {start: start, end: end, cursor: 1, data: \"\"})))\n (let ((data (get data temp1))) \n data))))\n \n;; Call the function to extract the substring between the bounds:\n\n;; (subs \"123456789\" 2 5)\n\n(define-read-only (subs1 \n (ch (buff 1))\n (acc {data: (buff 10), \n start: int,\n end: int,\n cursor: int})) \n (let ((data (get data acc))\n (start (get start acc))\n (cursor (get cursor acc))\n (end (get end acc))) \n (let ((temp2 \n {cursor: (+ 1 cursor),\n data: (default-to \"\"\n (as-max-len?\n (concat data \n (if (let ((temp3 start)\n (temp4 cursor)\n (temp5 end))\n (and (<= temp3 temp4)\n (<= temp4 temp5)))\n ch \n \"\"))\n u10))}))\n {start: (get start acc),\n end: (get end acc),\n cursor: (get cursor temp2),\n data: (get data temp2)})))\n" |
| 68 | + } |
| 69 | + }, |
| 70 | + { |
| 71 | + "tx_id": "0x66df10d99d3a26018f521d60e9f744b083386c73e47ad39c394d570abee55f1f", |
| 72 | + "tx_status": "pending", |
| 73 | + "tx_type": "smart_contract", |
| 74 | + "receipt_time": 1598230066, |
| 75 | + "receipt_time_iso": "2020-08-24T00:47:46.000Z", |
| 76 | + "fee_rate": "2000", |
| 77 | + "sender_address": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1", |
| 78 | + "sponsored": false, |
| 79 | + "post_condition_mode": "deny", |
| 80 | + "post_conditions": [], |
| 81 | + "smart_contract": { |
| 82 | + "contract_id": "ST1FJGMWPGM1P7N0K3N9QEPZK5H1VDC5YWTVMEAZ1.contract-hook-1598230054238", |
| 83 | + "source_code": "(define-read-only (subs1 \n (ch (buff 1))\n (acc {data: (buff 10), \n start: int,\n end: int,\n cursor: int}))\n (begin\n (unwrap-panic (if (and (<= 1 (get start acc)) (<= (get start acc) 10)) (ok 1) (err \"Out of bounds: start\")))\n (unwrap-panic (if (and (<= 1 (get end acc)) (<= (get end acc) 10)) (ok 1) (err \"Out of bounds: end\")))\n (unwrap-panic (if (and (<= 1 (get cursor acc)) (<= (get cursor acc) 10)) (ok 1) (err \"Out of bounds: cursor\")))\n (let ((data (get data acc))\n (start (get start acc))\n (cursor (get cursor acc))\n (end (get end acc))) \n (let ((temp1 \n {cursor: (+ 1 cursor),\n data: (default-to \"\"\n (as-max-len?\n (concat data \n (if (let ((temp2 start)\n (temp3 cursor)\n (temp4 end))\n (and (<= temp2 temp3)\n (<= temp3 temp4)))\n ch \n \"\"))\n u10))}))\n {start: (get start acc),\n end: (get end acc),\n cursor: (get cursor temp1),\n data: (get data temp1)}))))\n" |
| 84 | + } |
| 85 | + } |
| 86 | + ] |
| 87 | +} |
0 commit comments